# HG changeset patch # User cvs # Date 1186988164 -7200 # Node ID 56c54cf7c5b6f987b6660732880a62681c9dc7e0 # Parent 11c6df210d7f231e7df5af4becf335f19b263431 Import from CVS: tag r19-16b90 diff -r 11c6df210d7f -r 56c54cf7c5b6 CHANGES-beta --- a/CHANGES-beta Mon Aug 13 08:55:32 2007 +0200 +++ b/CHANGES-beta Mon Aug 13 08:56:04 2007 +0200 @@ -1,336 +1,4 @@ -*- indented-text -*- -to 19.15 --- W3-3.0.75 --- hm--html-menus --- NEWS update --- miscellaneous bug fixes - -to 19.15 prefinal --- W3-3.0.74 --- Documentation updates --- miscellaneous bug fixes --- cc-mode-4.388 --- Custom-1.67 --- Gnus-5.4.37 - -to 19.15 beta104 --- EFS fixes courtesy of Michael Sperber --- time.el-1.6 --- Miscellaneous bug fixes --- hm--html-mode-5.4 --- VM-6.22 --- Gnus-5.4.36 - -to 19.15 beta103 --- VM-6.21 --- tm-7.106 --- Garbage Collection patches courtesy of David Moore --- time.el update --- cc-mode.el-4.387 --- EFS integration/bug fix patches courtesy of Michael Sperber --- safe char-before added --- minor build tweaks --- miscellaneous bug fixes - -to 19.15 beta102 --- preceding-char, following-char are obsolete and broken, do not use them --- miscellaneous bug fixes --- W3-3.0.71 --- Gnus-5.4.33 --- corrections to lib-src script setup in --srcdir configuration --- corrections to stripping subwindows code - -to 19.15 beta101 --- itimer.el-1.05 --- hyperbole-4.023 --- cc-mode.el-4.381 --- floating-toolbar.el-1.02 --- balloon-help.el-1.05 --- W3-3.0.69 --- VM-6.20 --- Custom-1.65 --- Gnus-5.4.30 --- strip unimplemented subwindows subr code --- GIF correction courtesy Darrell Kindred - -to 19.15 beta100 --- GIF crash fix courtesy of David Moore --- Fix for problem dumping comint with sparcworks --- Fixes for problems during build with dynamic puresize --- xpm background color patch courtesy of Darrell Kindred --- Custom-1.64 --- Gnus-5.4.28 --- Miscellaneous bug fixes - -to 19.15 beta99 --- Update to time.el. --- htmlpro DTD, IE3 DTDs added to etc/sgml. --- Invisibility to visibility extent patch courtesy of David Moore - (fixes long-standing Gnus annoyance when unhiding .signature). --- cperl-mode-1.31+ --- w3-3.0.68 --- Custom-1.63 --- Define BROKEN_SIGIO for SunOS 4.1 --- itimer.el-1.04 --- tm-7.105.2 --- cc-mode-4.379 courtesy of Barry Warsaw --- more about.el hacking. --- Gnus-5.4.26 --- Logo adjusted to be more colormap friendly --- efs/dired updates courtesy of Michael Sperber [on hold] --- miscellaneous bug fixes --- hyperbole fix --- sit-for, etc. The Final Solution courtesy of David Moore - -to 19.15 beta98 --- filladapt.el-2.09 courtesy of Kyle Jones --- itimer.el-1.03 --- more work on sit-for, etc. courtesy of David Moore --- describe-beta command added, etc/BETA, C-h B --- updates to hyper-apropos.el courtesy of Christoph Wedler --- texinfo manual updated to 2.23 --- texinfo.tex update to 3.9 --- Gnus-5.4.24 --- tm-7.105.1 --- W3-3.0.65 --- Custom-1.59 --- AUCTeX-9.7l --- VM-6.19 --- Build fixes --- More work on Linux libc-5/libc-6 portability, it works out of the box now? --- more frame visibility patches courtesy of Jan Vroonhof --- graphical updates to time.el --- gnuattach fixes courtesy of Hunter Kelly --- dynamic PURESIZE fixes --- miscellaneous bug fixes - -to 19.15 beta97 --- Gnus-5.4.17 --- Freeze frame fixes Courtesy of Jan Vroonhof and Darrell Kindred [Mistakenly - left out of beta96] --- mine.el (almost) fully ported to XEmacs --- Miscellaneous bug fixes. - -to 19.15 beta96 --- New XEmacs logo Courtesy of Jens Lautenbacher --- New default color coordination Courtesy of Hrvoje Niksic --- time.el updated for XEmacs Courtesy of Jens Lautenbacher --- Gnus-5.4.16 --- some historical files removed from etc for space --- id-select.el-1.4.5 --- M-: (eval-expression) is now enabled by default --- PURESIZE is now a dynamic computation --- hyperbole-4.022 --- Customized edit-faces Courtesy of Jens Lautenbacher --- W3-3.0.62 --- AUCTeX-9.7k --- mic-paren.el-1.3.1 Courtesy of Mikael Sjödin --- hm--html-menus-5.3 --- custom-1.46 --- site-load.el preconfigured to work with DOC string generation --- python-mode.el-2.90 --- balloon-help-1.04 --- xrdb-mode.el-1.21 --- Dynamic computation of PURESIZE during build --- itimer.el-1.01 Courtesy of Kyle Jones --- miscellaneous fixes. - -to 19.15 beta'95 --- hm--html-menus-5.2 --- redo.el-1.01 --- VM-6.15 --- miscellaneous efs/dired fixes --- OO-Browser-2.10 Courtesy of Bob Weiner --- Yet another man.el Courtesy of jwz --- Addition to sample.emacs Courtesy of jwz --- additions/corrections to about.el --- hyperbole-4.021 Courtesy of Bob Weiner --- Restoration of reportmail.el Courtesy of jwz --- Restoration of passwd.el Courtesy of jwz --- AUC TeX-9.7i Courtesy of Per Abrahamsen --- viper-2.93 --- ediff-2.64 --- edmacro.el-3.05 --- detached-minibuf.el Courtesy of Alvin Shelton --- whitespace-mode.el Courtesy of Heiko Muenkel --- winmgr-mode.el Courtesy of David Konerding, Stefan Strobel & Barry Warsaw --- Gnus-5.4.15 --- custom-1.44 --- error-message-string ported from Emacs 19.34. --- fast-lock.el-3.11.01 Courtesy of Simon Marshall --- lazy-lock.el-1.16 Courtesy of Simon Marshall --- speedbar.el Courtesy of Eric Ludlam and Jens Lautenbacher --- W3-3.0.60 --- Miscellaneous bug fixes --- igrep.el-2.56 Courtesy of Kevin Rodgers --- frame-icon.el Courtesy of Michael Lamoureux and Bob Weiner --- xrdb-mode.el-1.17 Courtesy of Barry Warsaw - -to 19.15 beta94 --- New symbol `signal-error-on-buffer-boundary'. Set to nil to avoid - lossage of zmacs region when moving against buffer boundaries. --- python-mode.el-2.89 Courtesy of Barry Warsaw --- added mouse-[123] and down-mouse-[123] Emacs-compatible keysyms --- W3-3.0.59 --- Clicking on `**' buffer modified status in mode-line now works the same - way as C-x C-q. --- Miscellanous bug fixes from a number of people --- mine.el-1.17 Courtesy of Jacques Duthen [New] --- fast-lock.el-3.10.2 Courtesy of Simon Marshall --- browse-cltl2.el-1.1 Courtesy of Holger Schauer --- eldoc.el-1.8 Courtesy of Noah Friedman [New] --- webjump.el-1.4 Courtesy of Neil W. Van Dyke [New] --- Canna coredump fixed --- verilog-mode.el Courtesy of Michael McNamara & Adrian Aichner [New] --- overlay.el Courtesy of Joseph Nuspl [New] --- hm--html-menus-5.1 Courtesy of Heiko Muenkel --- tm-7.105 --- Initial port of edmacro.el courtesy of Hrvoje Niksic [New] --- custom-1.40 --- Native sound support for FreeBSD Courtesy Dick van den Burg --- Correct detection of GIF89, and implement detection of PNG --- efs-1.15 courtesy of Andy Norman and Michael Sperber [New] --- Easy customization of toolbar support courtesy of Hrvoje Niksic --- Gnus-5.4.12 --- balloon-help-1.03 courtesy of Kyle Jones [New] --- 'compatible byte compiler warning type added and turned off by default --- redo.el-1.00 courtesy of Kyle Jones [New] --- floating-toolbar.el courtesy of Kyle Jones [New] - -to 19.15 beta93 --- W3-3.0.56 --- VM-6.13 Courtesy of Kyle Jones --- Custom-1.30 --- Replicating extents are history --- tm-7.103.5 --- Miscellaneous bug fixes --- Synch to 20.0 patches - -to 19.15 beta92 --- gnus-5.4.11 --- tm-7.103.1 --- custom-1.24 --- widget-1.24 --- Corrections for dumping custom.elc with XEmacs --- Miscellaneous bug fixes - -to 19.15 beta91 --- Gnus-5.4.9 Courtesy of Lars Magne Ingebrigtsen --- Custom-1.20 Courtesy of Per Abrahamsen --- Widget-1.20 Courtesy of Per Abrahamsen --- iso-acc.el updated courtesy of Alexandre Oliva --- tm-7.103 --- w3-3.0.52 --- html 3.2 final dtd added --- Miscellaneous bug fixes --- ps-print.el-3.05 Courtesy of Jacques Duthen Prestataire - -to 19.15 beta90 --- ediff-2.64 --- viper-2.92 --- bench.el-1.2 --- Degenerate extent insertion speedup courtesy of David Moore --- decipher.el (from Emacs 19.34) --- w3-3.0.43 --- Miscellaneous bug fixes - -to 19.15 beta7 --- backup-dir 2.0 courtesy of Greg Klanderman --- lazy-lock-1.15 --- tm-7.100.3 --- viper-2.91 --- ediff-2.63 --- psgml-1.01 --- Miscellaneous bug fixes - -to 19.15 beta6 --- tm-7.100.2 --- 20k of new zippy quotes from mly --- By popular demand, `font-menu-this-frame-only-p' now defaults to nil. --- Neal Becker's Rosetta Man patch reinstalled --- VM 5.97 --- Minimize displayed help windows to avoid wasted screen space --- Miscellaneous bug fixes --- Java fontlocking update from Bob Weiner --- pcl-cvs update from Neal Becker - -to 19.15 beta5 --- tm-7.97 --- InfoDock man.el --- Fix long-standing race condition in timeout handling (courtesy of David - Moore). --- next-line-add-newlines now defaults to nil --- Miscellaneous bug fixes. --- kp_ X11 keysyms now recognized as kp-. - -to 19.15 beta4 --- Default JPEG image loading is now old tempfile code, but should work again. --- Miscellaneous bug fixes courtesy of Christoph Wedler --- mic-paren.el courtesy of Mikael Sjdin --- lpr.el/ps-print.el - Allow dynamic expansion of - lpr-switches/ps-lpr-switches. --- Lisp Bug fixes --- Install info files compressed (courtesy of Joseph J Nuspl) --- Default locking for Linux is now .lock locking - -to 19.15 beta3 - --- EDT/TPU modes synched from GNU Emacs, should actually work for the first - first time. --- Lots of files synched with GNU Emacs 19.34. --- Apropos mode enhancements. --- locate-library is now silent when called non-interactively. --- Non aggressive keyboard focus throwing is supported. --- Various enhancements from Lars Magne Ingebrigtsen. --- smtpmail.el added from GNU Emacs 19.34. --- man.el & man-xref.el added from GNU Emacs 19.35. --- crisp/brief emulation courtesy of Gary D. Foster. --- id-select.el courtesy of Bob Weiner. --- m4-mode 1.8 --- etags.c 11.78 --- ilisp 5.8 --- cperl-mode 1.28 --- cc-mode 4.322 --- elp 2.37 --- python-mode 2.83 --- load-warn-when-source-newer now defaults to t --- tm 7.95 - -to 19.15 beta2 - --- fast-lock.el 3.10.01 --- ksh-mode.el 2.9 --- mode-motion+.el 3.16 --- psgml-1a12 --- executable.el, imenu.el, sh-script.el and uniquify.el now included --- rfc1521 patches to VM from Jamie --- OffiX support added --- lots of 19.34 syncing, most by Steven Baur --- NetBSD on sparc platform fixes --- additional featurep checks on 'scrollbar and 'menubar --- configure changes to allow sunos4shr args to be picked up correctly - -to 19.15 beta1 - --- gnus 5.2.40 --- etc 0.22 --- w3 3.0.12 --- url 1.0.41 --- reporter 3.3 --- psgml 1a11 --- cc-mode 4.315 --- hm--html-menus 5.0 --- stringp nil error when starting sparcworks --- call7 and call8 had incorrect array sizes --- makefile mode Error in `pre-idle-hook' (setting hook to nil): - (void-function makefile-space-face) --- Crashes when built on X11R5 and run on X11R6 fixed --- Lisp backtrace is now printed on all crashes, not just debug build --- LOTS of typos fixed. --- sunpro-init no longer opens /net/bin with possible hang at startup. --- switch-to-buffer-other-window reverted to old-style behaviour --- python-mode 2.67 --- auto-mode-alist regexps reorganized for efficiency --- interpreter-mode-alist regexps now look at entire first line. --- new (interactive) spec `i' can be used to skip arguments. --- other assorted fixes and changes +to 19.16 beta90 +-- Miscellaneous 20.1 fixes merged +-- Synch with 19.15p8 Courtesy of Alvin Shelton diff -r 11c6df210d7f -r 56c54cf7c5b6 configure --- a/configure Mon Aug 13 08:55:32 2007 +0200 +++ b/configure Mon Aug 13 08:56:04 2007 +0200 @@ -2394,6 +2394,7 @@ decosf1-3 ) opsys=decosf1-3-static ;; decosf3-1 ) opsys=decosf3-1-static ;; decosf3-2 ) opsys=decosf3-2-static ;; + decosf4-0 ) opsys=decosf4-0-static ;; linux ) opsys=linux-static ;; esac fi @@ -8263,15 +8264,15 @@ # This directory was configured as follows, # on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # -# $0 $configure_args +# $0 $quoted_arguments ac_cs_usage="Usage: config.status [--recheck] [--version] [--help]" for ac_option do case "\$ac_option" in -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args --no-create - exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args --no-create ;; + echo running \${CONFIG_SHELL-/bin/sh} $0 $quoted_arguments --no-create + exec \${CONFIG_SHELL-/bin/sh} $0 $quoted_arguments --no-create ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) echo "config.status generated by autoconf version 1.11" exit 0 ;; diff -r 11c6df210d7f -r 56c54cf7c5b6 configure.in --- a/configure.in Mon Aug 13 08:55:32 2007 +0200 +++ b/configure.in Mon Aug 13 08:56:04 2007 +0200 @@ -2400,6 +2400,7 @@ decosf1-3 ) opsys=decosf1-3-static ;; decosf3-1 ) opsys=decosf3-1-static ;; decosf3-2 ) opsys=decosf3-2-static ;; + decosf4-0 ) opsys=decosf4-0-static ;; linux ) opsys=linux-static ;; esac fi diff -r 11c6df210d7f -r 56c54cf7c5b6 etc/BETA --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/etc/BETA Mon Aug 13 08:56:04 2007 +0200 @@ -0,0 +1,212 @@ + -*- mode:outline; minor-mode:outl-mouse -*- + +* Introduction +============== + +You are running an experimental version of XEmacs. Please do not +report problems with Beta XEmacs to comp.emacs.xemacs. Report them to +xemacs-beta@xemacs.org. + +** XEmacs Beta Mailing List +=========================== + +*** Subscribing +--------------- + +If you are not subscribed to the XEmacs beta list you should be. Send +an email message with a subject of `subscribe' (without the quotes) to +xemacs-beta-request@xemacs.org and follow the directions. You do not +have to fill out the survey if you don't want to. + +*** Unsubscribing +----------------- + +To unsubscribe from the list send an email message with a subject of +`unsubscribe' (without the quotes) to xemacs-beta-request@xemacs.org. + +*** Administrivia +----------------- + +The XEmacs beta list is managed by the SmartList mailing list package, +and the usual SmartList commands work. Do not send mailing list +requests to the main address (xemacs-beta@xemacs.org), always send +them to xemacs-beta-request@xemacs.org. If you have problems with the +list itself, they should be brought to the attention of the Mailing +List manager Chuck Thompson . + + +** Beta Release Schedule +======================== + +The URL ftp://ftp.xemacs.org/pub/beta/README always contains the best +estimate of when the next beta XEmacs will be released. For weekend +betas the release time is generally in the vicinity of 2PM to 5PM US +Pacific Time (Universal Time minus 8 hours). For weekday betas, the +release time is generally in the vicinity of 8PM to Midnight US +Pacific Time on the listed day. + +While 19.15 and 20.x are in parallel development, a simultaneous +release day implies a release of 20.x first, followed a few hours +later by 19.15. + +Betas are nominally a week apart, scheduled on every Saturday. +Midweek releases are made when a serious enough problem warrants it. + + +** Reporting Problems +===================== + +The best way to get problems fixed in XEmacs is to submit good problem +reports. Since this is beta software problems are certain to exist. +Please read through all of part II of the XEmacs FAQ for an overview +of problem reporting. Other items which are most important are: + +1. Do not submit C stack backtraces without line numbers. Since it + is possible to compile optimized with debug information with GCC + it is never a good idea to compile XEmacs without the -g flag. + XEmacs runs on a variety of platforms, and often it is not + possible to recreate problems which afflict a specific platform. + The line numbers in the C stack backtrace help isolate where the + problem is actually occurring. + +2. Attempt to recreate the problem starting with an invocation of + XEmacs with `xemacs -q -no-site-file'. Quite often problems are + due to package interdependencies, and the like. An actual bug in + XEmacs should be reproducible in a default configuration without + loading any special packages (or the one or two specific packages + that cause the bug to appear). + +3. A picture can be worth a thousand words. When reporting an + unusual display, it is generally best to capture the problem in a + screen dump and include that with the problem report. The easiest + way to get a screen dump is to use the xv program and its grab + function. Save the image as a GIF to keep bandwidth requirements + down without loss of information. MIME is the preferred method + for making the image attachments. + +* Compiling Beta XEmacs +======================= + +** Building an XEmacs from patches +================================== + +All beta releases of XEmacs are included with patches from the +previous version in an attempt to keep bandwidth requirements down. +Patches should be applied with the GNU patch program in something like +the following. Let's say you're upgrading XEmacs 20.4-beta10 to +XEmacs 20.4-beta11 and you have a full unmodified XEmacs 20.4-beta10 +source tree to work with. Cd to the top level directory and issue the +shell command: + +$ gunzip -c /tmp/xemacs-20.4-b10-20.4-b11.patch.gz | patch -p1 + +After patching check to see that no patches were missed by doing +$ find . -name \*.rej -print + +Any rejections should be treated as serious problems to be resolved +before starting compilation. + +After seeing that there were no rejections, issue the commands + +$ ./config.status --recheck +$ make beta + +and go play minesweep for awhile on an older XEmacs while the binary +is rebuilt. + +** Building an XEmacs from a full distribution +============================================== + +Locate a convenient place where you have at least 100MB of free space +and issue the command + +$ gunzip -c /tmp/xemacs-20.4-b11.tar.gz | tar xvf - + +(or the simpler `tar zxvf /tmp/xemacs-20.4-b11.tar.gz' if you use GNU +tar). + +cd to the top level directory and issue an appropriate configure +command. The maintainer uses the following at the time of this +writing: + +./configure --with-offix --with-mule=yes --with-dialogs=athena3d \ + --cflags="-m486 -g -O4 -fno-strength-reduce -malign-loops=2 \ + -malign-jumps=2 -malign-functions=2" --with-sound=no \ + --with-xface=yes --error-checking=all --debug=yes \ + --with-scrollbars=athena3d \ + --with-canna=yes --with-wnn=yes --wnn-includes=/usr/X11R6/include/wnn + +Save the output from configure that looks something like: +Configured for `i586-unknown-linux2.0.28'. + + Where should the build process find the source code? /usr/src/xemacs-20.0 + What installation prefix should install use? /usr/local + What operating system and machine description files should XEmacs use? + `s/linux.h' and `m/intel386.h' + What compiler should XEmacs be built with? gcc -m486 -g -O4 -fno-strength-reduce -malign-loops=2 -malign-jumps=2 -malign-functions=2 + Should XEmacs use the GNU version of malloc? yes + Should XEmacs use the relocating allocator for buffers? yes + What window system should XEmacs use? x11 + Where do we find X Windows header files? /usr/X11R6/include + Where do we find X Windows libraries? /usr/X11R6/lib + Compiling in support for XAUTH. + Compiling in support for XPM. + Compiling in support for X-Face headers. + Compiling in support for GIF image conversion. + Compiling in support for JPEG image conversion. + Compiling in support for PNG image conversion. + Compiling in support for Berkeley DB. + Compiling in support for GNU DBM. + Compiling in Mule (multi-lingual) support. + Compiling in support for OffiX. + Using the Lucid menubar. + Using the Athena-3d scrollbar. + Using the Athena-3d dialog boxes. + +Then type make and you should have a working XEmacs. + +After you have verified that you have a functional editor, fire up +your favorite mail program and send a build report to +xemacs-beta@xemacs.org. The build report should include + +1. Your hardware configuration (OS version, etc.) + +2. Version numbers of software in use (X11 version, system library + versions if appropriate, graphics library versions if appropriate). + If you're on a system like Linux, include all the version numbers + you can because chances are it makes a difference. + +3. The options given to configure + +4. The configuration report illustrated above + +5. Any other unusual items you feel should be brought to the attention + of the developers. + +** Creating patches for submission +================================== + +When making patches you should use the `-c', or preferably if your +diff supports it, `-u'. Using ordinary diffs like this are +notoriously prone to error (and this one won't in fact work, since +I've already applied a patch to this file so the line numbers probably +don't match up any more). + +$ diff -u old-file.c new-file.c + +-or- + +$ diff -c old-file.c new-file.c + +Also, it is helpful for me if you create the patch in the top level of +the XEmacs source directory: + +$ diff -u lwlib/xlwmenu.c~ lwlib/xlwmenu.c + +I prefer patches to be accompanied by an update (either a raw entry or +a patch) to the appropriate ChangeLog file, but it is not required. + +Also note that if you cut & paste from an xterm to an XEmacs mail buffer +you will probably lose due to tab expansion. The best thing to do is to +M-x cd to the appropriate directory, and issue the command `C-u M-!' from +within XEmacs. diff -r 11c6df210d7f -r 56c54cf7c5b6 etc/NEWS --- a/etc/NEWS Mon Aug 13 08:55:32 2007 +0200 +++ b/etc/NEWS Mon Aug 13 08:56:04 2007 +0200 @@ -168,7 +168,7 @@ *** overlay.el (Joseph Nuspl support for Emacs overlay API) *** browse-cltl2.el 1.1 (Holger Schauer) *** mine.el 1.17 (Jacques Duthen) -*** igrep.el 2.56 (Kevin Rodger) +*** igrep.el 2.56 (Kevin Rodgers) *** speedbar.el (Eric Ludlam) *** frame-icon.el (Michael Lamoureux) *** winmgr-mode.el (David Konerding, Stefan Strobel & Barry Warsaw) diff -r 11c6df210d7f -r 56c54cf7c5b6 etc/frame-icon/tree.xbm --- a/etc/frame-icon/tree.xbm Mon Aug 13 08:55:32 2007 +0200 +++ b/etc/frame-icon/tree.xbm Mon Aug 13 08:56:04 2007 +0200 @@ -1,6 +1,6 @@ #define tree_width 64 #define tree_height 64 -static char tree.bits[] = { +static char tree_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, diff -r 11c6df210d7f -r 56c54cf7c5b6 etc/steve.xpm.Z Binary file etc/steve.xpm.Z has changed diff -r 11c6df210d7f -r 56c54cf7c5b6 etc/stevem.xpm.Z Binary file etc/stevem.xpm.Z has changed diff -r 11c6df210d7f -r 56c54cf7c5b6 etc/vin.xpm.Z Binary file etc/vin.xpm.Z has changed diff -r 11c6df210d7f -r 56c54cf7c5b6 etc/vinm.xpm.Z Binary file etc/vinm.xpm.Z has changed diff -r 11c6df210d7f -r 56c54cf7c5b6 lib-autoconf-1/README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib-autoconf-1/README Mon Aug 13 08:56:04 2007 +0200 @@ -0,0 +1,2 @@ +Generic Autoconf 1 will not create a correct configure for XEmacs 19. +Please install these files in place of the originals. diff -r 11c6df210d7f -r 56c54cf7c5b6 lib-autoconf-1/acconfig.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib-autoconf-1/acconfig.h Mon Aug 13 08:56:04 2007 +0200 @@ -0,0 +1,255 @@ +/* acconfig.h + This file is in the public domain. + + Descriptive text for the C preprocessor macros that + the distributed Autoconf macros can define. + No software package will use all of them; autoheader copies the ones + your configure.in uses into your configuration header file templates. + + The entries are in sort -df order: alphabetical, case insensitive, + ignoring punctuation (such as underscores). Although this order + can split up related entries, it makes it easier to check whether + a given entry is in the file. + + Leave the following blank line there!! Autoheader needs it. */ + + +/* Define if on AIX 3. + System headers sometimes define this. + We just want to avoid a redefinition error message. */ +#ifndef _ALL_SOURCE +#undef _ALL_SOURCE +#endif + +/* Define if using alloca.c. */ +#undef C_ALLOCA + +/* Define if type char is unsigned and you are not using gcc. */ +#undef __CHAR_UNSIGNED__ + +/* Define to empty if the keyword does not work. */ +#undef const + +/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. + This function is required for alloca.c support on those systems. */ +#undef CRAY_STACKSEG_END + +/* Define for DGUX with . */ +#undef DGUX + +/* Define if you have dirent.h. */ +#undef DIRENT + +/* Define to the type of elements in the array set by `getgroups'. + Usually this is either `int' or `gid_t'. */ +#undef GETGROUPS_T + +/* Define if the `getloadavg' function needs to be run setuid or setgid. */ +#undef GETLOADAVG_PRIVILEGED + +/* Define to `int' if doesn't define. */ +#undef gid_t + +/* Define if you have alloca.h and it should be used (not Ultrix). */ +#undef HAVE_ALLOCA_H + +/* Define if you don't have vprintf but do have _doprnt. */ +#undef HAVE_DOPRNT + +/* Define if your system has its own `getloadavg' function. */ +#undef HAVE_GETLOADAVG + +/* Define if the `long double' type works. */ +#undef HAVE_LONG_DOUBLE + +/* Define if you support file names longer than 14 characters. */ +#undef HAVE_LONG_FILE_NAMES + +/* Define if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Define if you have netdb.h (and thus the rexec function). */ +#undef HAVE_NETDB_H + +/* Define if system calls automatically restart after interruption + by a signal. */ +#undef HAVE_RESTARTABLE_SYSCALLS + +/* Define if your struct stat has st_blksize. */ +#undef HAVE_ST_BLKSIZE + +/* Define if your struct stat has st_blocks. */ +#undef HAVE_ST_BLOCKS + +/* Define if you have the strcoll function and it is properly defined. */ +#undef HAVE_STRCOLL + +/* Define if your struct stat has st_rdev. */ +#undef HAVE_ST_RDEV + +/* Define if you have sys/mtio.h. */ +#undef HAVE_SYS_MTIO_H + +/* Define if you have a with `union wait'. */ +#undef HAVE_SYS_WAIT + +/* Define if your struct tm has tm_zone. */ +#undef HAVE_TM_ZONE + +/* Define if you don't have tm_zone but do have the external array + tzname. */ +#undef HAVE_TZNAME + +/* Define if `union wait' is the type of the first arg to wait functions. */ +#undef HAVE_UNION_WAIT + +/* Define if you have unistd.h. */ +#undef HAVE_UNISTD_H + +/* Define if utime(file, NULL) sets file's timestamp to the present. */ +#undef HAVE_UTIME_NULL + +/* Define if you have vfork.h. */ +#undef HAVE_VFORK_H + +/* Define if you have the vprintf function. */ +#undef HAVE_VPRINTF + +/* Define if you have the wait3 system call. */ +#undef HAVE_WAIT3 + +/* Define if you have the POSIX.1 `waitpid' function. */ +#undef HAVE_WAITPID + +/* Define as __inline if that's what the C compiler calls it. */ +#undef inline + +/* Define if int is 16 bits instead of 32. */ +#undef INT_16_BITS + +/* Define if long int is 64 bits. */ +#undef LONG_64_BITS + +/* Define if major, minor, and makedev are declared in mkdev.h. */ +#undef MAJOR_IN_MKDEV + +/* Define if major, minor, and makedev are declared in sysmacros.h. */ +#undef MAJOR_IN_SYSMACROS + +/* Define if on MINIX. */ +#undef _MINIX + +/* Define to `int' if doesn't define. */ +#undef mode_t + +/* Define if you don't have dirent.h, but have ndir.h. */ +#undef NDIR + +/* Define if you have memory.h, and string.h doesn't declare the + mem* functions. */ +#undef NEED_MEMORY_H + +/* Define if your struct nlist has an n_un member. */ +#undef NLIST_NAME_UNION + +/* Define if you have nlist.h. */ +#undef NLIST_STRUCT + +/* Define if you can't use the address of an argument to a function + as the start of an array. */ +#undef NO_ARG_ARRAY + +/* Define if your C compiler doesn't accept -c and -o together. */ +#undef NO_MINUS_C_MINUS_O + +/* Define if you have neither a remote shell nor the rexec function. */ +#undef NO_REMOTE + +/* Define to `long' if doesn't define. */ +#undef off_t + +/* Define to `int' if doesn't define. */ +#undef pid_t + +/* Define if the system does not provide POSIX.1 features except + with this defined. */ +#undef _POSIX_1_SOURCE + +/* Define if you need to in order for stat and other things to work. */ +#undef _POSIX_SOURCE + +/* Define as the return type of signal handlers (int or void). */ +#undef RETSIGTYPE + +/* Define if the setvbuf function takes the buffering type as its second + argument and the buffer pointer as the third, as on System V + before release 3. */ +#undef SETVBUF_REVERSED + +/* Define to `unsigned' if doesn't define. */ +#undef size_t + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at run-time. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown + */ +#undef STACK_DIRECTION + +/* Define if the `S_IS*' macros in do not work properly. */ +#undef STAT_MACROS_BROKEN + +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define on System V Release 4. */ +#undef SVR4 + +/* Define if you don't have dirent.h, but have sys/dir.h. */ +#undef SYSDIR + +/* Define if you don't have dirent.h, but have sys/ndir.h. */ +#undef SYSNDIR + +/* Define if `sys_siglist' is declared by . */ +#undef SYS_SIGLIST_DECLARED + +/* Define if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Define if your declares struct tm. */ +#undef TM_IN_SYS_TIME + +/* Define to `int' if doesn't define. */ +#undef uid_t + +/* Define for Encore UMAX. */ +#undef UMAX + +/* Define for Encore UMAX 4.3 that has + instead of . */ +#undef UMAX4_3 + +/* Define if you do not have strings.h, index, bzero, etc.. */ +#undef USG + +/* Define vfork as fork if vfork does not work. */ +#undef vfork + +/* Define if the closedir function returns void instead of int. */ +#undef VOID_CLOSEDIR + +/* Define if your processor stores words with the most significant + byte first (like Motorola and SPARC, unlike Intel and VAX). */ +#undef WORDS_BIGENDIAN + +/* Define if lex declares yytext as a char * by default, not a char[]. */ +#undef YYTEXT_POINTER + + +/* Leave that blank line there!! Autoheader needs it. + If you're adding to this file, keep in mind: + The entries are in sort -df order: alphabetical, case insensitive, + ignoring punctuation (such as underscores). */ diff -r 11c6df210d7f -r 56c54cf7c5b6 lib-autoconf-1/acgeneral.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib-autoconf-1/acgeneral.m4 Mon Aug 13 08:56:04 2007 +0200 @@ -0,0 +1,1174 @@ +dnl Parameterized macros that do not check for something specific. +dnl This file is part of Autoconf. +dnl Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2, or (at your option) +dnl any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +dnl +dnl Written by David MacKenzie, with help from +dnl Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, +dnl Roland McGrath, Noah Friedman, and david d zuhn. +dnl +changequote([,])dnl +undefine([eval])dnl +undefine([include])dnl +undefine([shift])dnl +undefine([format])dnl +dnl +ifdef([__gnu__], , [errprint(Autoconf requires GNU m4 +)m4exit(2)])dnl +dnl +dnl +dnl Utility functions for stamping the configure script. +dnl +dnl +define(AC_ACVERSION, 1.11)dnl +dnl This is defined by the --version option of the autoconf script. +ifdef([AC_PRINT_VERSION], [errprint(Autoconf version AC_ACVERSION +)])dnl +dnl +dnl These are currently not used, for the sake of people who diff +dnl configure scripts and don't want spurious differences. +dnl But they are too clever to just delete. +dnl +define(AC_USER, [esyscmd( +changequote({,})dnl +# Extract the user name from the first pair of parentheses. +({ac_sedcmd='s/[^(]*(\([^)]*\)).*/\1/';} +changequote([,])dnl +whoami || id|sed "$ac_sedcmd") 2>/dev/null|tr -d '\012')])dnl +dnl +define(AC_HOST, [esyscmd((hostname || uname -n) 2>/dev/null|tr -d '\012')])dnl +dnl +define(AC_DATE, [esyscmd(date|tr -d '\012')])dnl +dnl +dnl +dnl Controlling Autoconf operation +dnl +dnl +dnl This is separate from AC_INIT to prevent GNU m4 1.0 from coredumping +dnl when AC_CONFIG_HEADER is used. +define(AC_NOTICE, +[# Guess values for system-dependent variables and create Makefiles. +dnl [#] Generated automatically using autoconf. +# Generated automatically using autoconf version] AC_ACVERSION [ +dnl [#] by AC_USER@AC_HOST on AC_DATE +# Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc. + +# This configure script 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 script 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. +])dnl +dnl +define(AC_PARSEARGS, +[# Save the original args to write them into config.status later. +configure_args="[$]*" + +# Only options that might do something get documented. +changequote(,)dnl +ac_usage="Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +--build=BUILD configure for building on BUILD [BUILD=HOST] +--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) +--enable-FEATURE[=ARG] include FEATURE [ARG=yes] +--exec-prefix=PREFIX install host dependent files in PREFIX [/usr/local] +--help print this message +--host=HOST configure for HOST [guessed] +--prefix=PREFIX install host independent files in PREFIX [/usr/local] +--quiet, --silent do not print \`checking for...' messages +--srcdir=DIR find the sources in DIR [configure dir or ..] +--target=TARGET configure for TARGET [TARGET=HOST] +--verbose print results of checks +--version print the version of autoconf that created configure +--with-PACKAGE[=ARG] use PACKAGE [ARG=yes] +--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) +--x-includes=DIR X include files are in DIR +--x-libraries=DIR X library files are in DIR" +changequote([,])dnl + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +exec_prefix= +host=NONE +no_create= +nonopt=NONE +norecursion= +prefix= +program_prefix= +program_suffix= +program_transform_name= +silent= +srcdir= +target=NONE +verbose= +x_includes= +x_libraries= + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + # Accept (but ignore some of) the important Cygnus configure + # options, so we can diagnose typos. + + case "$ac_option" in +changequote(,)dnl + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; +changequote([,])dnl + *) ac_optarg= ;; + esac + + case "$ac_option" in + + -build | --build | --buil | --bui | --bu | --b) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*) + build="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that aren't valid shell variable names. +changequote(,)dnl + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then +changequote([,])dnl + AC_ERROR($ac_feature: invalid feature name) + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that aren't valid shell variable names. +changequote(,)dnl + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then +changequote([,])dnl + AC_ERROR($ac_feature: invalid feature name) + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + # For backward compatibility, recognize -exec-prefix and --exec_prefix. + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + with_gas=yes ;; # Obsolete; use --with-gas. + + -help | --help | --hel | --he) + cat << EOF +$ac_usage +EOF + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -nfp | --nfp | --nf) + with_fp=no ;; # Obsolete; use --without-fp. + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -norecursion | --norecursion | --norecursio | --norecursi \ + | --norecurs | --norecur | --norecu | --norec | --nore | --nor) + norecursion=yes ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version AC_ACVERSION" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that aren't valid shell variable names. +changequote(,)dnl + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then +changequote([,])dnl + AC_ERROR($ac_package: invalid package name) + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that aren't valid shell variable names. +changequote(,)dnl + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then +changequote([,])dnl + AC_ERROR($ac_package: invalid package name) + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) with_x=yes ;; # Obsolete; use --with-x. + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) AC_ERROR([$ac_option: invalid option; use --help to show usage]) + ;; + + *) +changequote(,)dnl + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then +changequote([,])dnl + AC_WARN($ac_option: invalid host type) + fi + if test "x$nonopt" != xNONE; then + AC_ERROR(can only configure for one host and one target at a time) + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + AC_ERROR(missing argument to --`echo $ac_prev | sed 's/_/-/g'`) +fi +])dnl +dnl +define(AC_INIT, +[#!/bin/sh +AC_NOTICE +AC_PARSEARGS +AC_PREPARE($1)])dnl +dnl +define(AC_PREPARE, +[trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15 +trap 'rm -fr confdefs* $ac_clean_files' 0 + +# Save the original args if we used an alternate arg parser. +ac_configure_temp="${configure_args-[$]*}" +# Strip out --no-create and --norecursion so they don't pile up. +configure_args= +for ac_arg in $ac_configure_temp; do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -norecursion | --norecursion | --norecursio | --norecursi \ + | --norecurs | --norecur | --norecu | --norec | --nore | --nor) ;; + *) configure_args="$configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# These must not be set unconditionally because not all systems understand +# e.g. LANG=C (notably SCO). +if test "${LC_ALL+set}" = 'set'; then LC_ALL=C; export LC_ALL; fi +if test "${LANG+set}" = 'set'; then LANG=C; export LANG; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=$1 + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then `..'. + ac_prog=[$]0 +changequote(,)dnl + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` +changequote([,])dnl + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +fi +if test ! -r $srcdir/$ac_unique_file; then + if test x$ac_srcdir_defaulted = xyes; then + AC_ERROR(can not find sources in ${ac_confdir} or ..) + else + AC_ERROR(can not find sources in ${srcdir}) + fi +fi +AC_LANG_C +])dnl +dnl +define(AC_ENABLE, +[[#] check whether --enable-$1 was given +enableval="[$enable_]patsubst($1,-,_)" +if test -n "$enableval"; then + ifelse([$2], , :, [$2]) +ifelse([$3], , , [else + $3 +])dnl +fi +])dnl +dnl +dnl Giving --with an argument is deprecated. +define(AC_WITH, +[[#] check whether --with-$1 or --without-$1 was given. +withval="[$with_]patsubst($1,-,_)" +if test -n "$withval"; then + ifelse([$2], , :, [$2]) +ifelse([$3], , , [else + $3 +])dnl +fi +])dnl +dnl +dnl Guess the value for the `prefix' variable by looking for +dnl the argument program along PATH and taking its parent. +dnl Example: if the argument is `gcc' and we find /usr/local/gnu/bin/gcc, +dnl set `prefix' to /usr/local/gnu. +define(AC_PREFIX, +[if test -z "$prefix" +then + AC_CHECKING([for $1 to derive installation directory prefix]) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="$IFS:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test $ac_dir != . && test -f $ac_dir/$1; then +changequote(,)dnl + # Not all systems have dirname. + prefix=`echo $ac_dir|sed 's%/[^/][^/]*$%%'` +changequote([,])dnl + break + fi + done + IFS="$ac_save_ifs" + AC_VERBOSE(chose installation directory prefix ${prefix}) +fi +])dnl +dnl +define(AC_CONFIG_HEADER, [define(AC_CONFIG_NAMES, $1)])dnl +dnl +define(AC_DOREV, [#!/bin/sh +# From configure.in $1 +])dnl +define(AC_REVISION, [AC_DOREV(translit($1,$"))])dnl +dnl +dnl Subroutines of AC_PREREQ. +dnl +dnl Change the dots in version number $1 into commas. +define(AC_PREREQ_SPLIT, [translit($1,.,[,])])dnl +dnl +dnl Default the ternary version number to 0 (e.g., 1,7 -> 1,7,0). +define(AC_PREREQ_CANON, [$1,$2,ifelse([$3],,0,[$3])])dnl +dnl +dnl Complain and exit if the version number in $1 through $3 is less than +dnl the version number in $4 through $6. +dnl $7 is the printable version of the second version number. +define(AC_PREREQ_COMPARE, +[ifelse(builtin([eval], +[$3 + $2 * 100 + $1 * 10000 < $6 + $5 * 100 + $4 * 10000]),1, +[errprint(Autoconf version $7 or higher is required +)m4exit(3)])])dnl +dnl +dnl Complain and exit if the Autoconf version is less than $1. +define(AC_PREREQ, +[AC_PREREQ_COMPARE(AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)), +AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])),[$1])])dnl +dnl +dnl +dnl Setting variables +dnl +dnl +dnl Several simple subroutines to do various flavors of quoting. +dnl +dnl Quote $1 against shell "s. +define(AC_QUOTE_DQUOTE, [dnl We use \1 instead of \& to avoid an m4 1.0.3 bug. +patsubst($1, changequote(,)\([$"`\\]\)changequote([,]), \\\1)])dnl +dnl +dnl Quote $1 against shell 's. +define(AC_QUOTE_SQUOTE, [patsubst($1, ', '\\'')])dnl +dnl +dnl Quote $1 against shell here documents (<> confdefs.h +dnl Define DEFS even if AC_CONFIG_NAMES for use in user case statements. +DEFS="$DEFS -D$1=AC_QUOTE_SQUOTE(AC_VAL)" +ifdef([AC_CONFIG_NAMES], +ac_sed_defs="dnl +${ac_sed_defs}\${ac_dA}$1\${ac_dB}$1\${ac_dC}AC_DEFINE_SEDQUOTE(AC_VAL)\${ac_dD} +\${ac_uA}$1\${ac_uB}$1\${ac_uC}AC_DEFINE_SEDQUOTE(AC_VAL)\${ac_uD} +\${ac_eA}$1\${ac_eB}$1\${ac_eC}AC_DEFINE_SEDQUOTE(AC_VAL)\${ac_eD} +" +)dnl +} +])dnl +dnl +dnl Unsafe version of AC_DEFINE. +dnl Users are responsible for the quoting nightmare. +dnl Well, not all of it. We need to pull the identify function out to +dnl the top level, because m4 doesn't really support nested functions; +dnl it doesn't distinguish between the arguments to the outer +dnl function, which should be expanded, and the arguments to the inner +dnl function, which shouldn't yet. +define(AC_IDENTITY,$1)dnl +define(AC_DEFINE_UNQUOTED,[dnl +pushdef([AC_QUOTE_SQUOTE],defn([AC_IDENTITY]))dnl +pushdef([AC_DEFINE_SEDQUOTE],defn([AC_IDENTITY]))dnl +AC_DEFINE($1,$2)dnl +popdef([AC_DEFINE_SEDQUOTE])dnl +popdef([AC_QUOTE_SQUOTE])dnl +])dnl +dnl +dnl Protects the argument from being diverted twice +dnl if this macro is called twice for it. +dnl Diversion 0 is the normal output. +dnl Diversion 1 is sed substitutions for output files. +dnl Diversion 2 is variable assignments for config.status. +define(AC_SUBST, +[ifdef([AC_SUBST_$1], , +[define([AC_SUBST_$1], )dnl +divert(1)dnl +s%@$1@%[$]$1%g +divert(2)dnl +$1='[$]$1' +divert(0)dnl +])])dnl +dnl +dnl +dnl Printing messages +dnl +dnl +define(AC_CHECKING, +[test -n "$silent" || echo "checking $1"])dnl +dnl +define(AC_VERBOSE, +[test -n "$verbose" && echo " $1"])dnl +dnl +define(AC_WARN, +[echo "configure: warning: $1" >&2])dnl +dnl +define(AC_ERROR, +[echo "configure: $1" >&2; exit 1])dnl +dnl +dnl +dnl Selecting which language to use for testing +dnl +dnl +define(AC_LANG_C, +[define([AC_LANG],[C])AC_PROVIDE([$0])ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='${CPP}' +ac_compile='${CC-cc} $CFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS >/dev/null 2>&1' +])dnl +dnl +define(AC_LANG_CPLUSPLUS, +[define([AC_LANG],[CPLUSPLUS])AC_PROVIDE([$0])ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='${CXXCPP}' +ac_compile='${CXX-gcc} $CXXFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS >/dev/null 2>&1' +])dnl +dnl +dnl Push the current language on a stack. +define(AC_LANG_SAVE, [pushdef([AC_LANG_STACK], AC_LANG)])dnl +dnl +dnl Restore the current language from the stack. +define(AC_LANG_RESTORE, +[ifelse(AC_LANG_STACK,C,[ifelse(AC_LANG,C,,[AC_LANG_C])],[ifelse(AC_LANG,CPLUSPLUS,,[AC_LANG_CPLUSPLUS])])[]popdef([AC_LANG_STACK])])dnl +dnl +dnl +dnl Enforcing ordering constraints +dnl +dnl +define(AC_BEFORE, +[ifdef([AC_PROVIDE_$2], [errprint(__file__:__line__: [$2 was called before $1 +])])])dnl +dnl +define(AC_REQUIRE, +[ifdef([AC_PROVIDE_$1],,[indir([$1]) +])])dnl +dnl +define(AC_PROVIDE, +[define([AC_PROVIDE_$1],)])dnl +dnl +define(AC_OBSOLETE, +[errprint(__file__:__line__: warning: [$1] is obsolete[$2] +)])dnl +dnl +dnl +dnl Checking for kinds of features +dnl +dnl +define(AC_PROGRAM_CHECK, +[if test -z "[$]$1"; then + # Extract the first word of `$2', so it can be a program name with args. + set ac_dummy $2; ac_word=[$]2 + AC_CHECKING([for $ac_word]) + 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 + $1="$3" + break + fi + done + IFS="$ac_save_ifs" +fi +ifelse([$4],,, [test -z "[$]$1" && $1="$4"]) +test -n "[$]$1" && AC_VERBOSE(setting $1 to [$]$1) +AC_SUBST($1)dnl +])dnl +dnl +define(AC_PROGRAMS_CHECK, +[for ac_prog in $2 +do +AC_PROGRAM_CHECK($1, [$]ac_prog, [$]ac_prog, ) +test -n "[$]$1" && break +done +ifelse([$3],,, [test -n "[$]$1" || $1="$3" +])])dnl +dnl +define(AC_PROGRAM_PATH, +[if test -z "[$]$1"; then + # Extract the first word of `$2', so it can be a program name with args. + set ac_dummy $2; ac_word=[$]2 + AC_CHECKING([for $ac_word]) + 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 + $1="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" +fi +ifelse([$3],,, [test -z "[$]$1" && $1="$3"]) +test -n "[$]$1" && AC_VERBOSE(setting $1 to [$]$1) +AC_SUBST($1)dnl +])dnl +define(AC_PROGRAMS_PATH, +[for ac_prog in $2 +do +AC_PROGRAM_PATH($1, [$]ac_prog) +test -n "[$]$1" && break +done +ifelse([$3],,, [test -n "[$]$1" || $1="$3" +])])dnl +define(AC_HEADER_EGREP, +[AC_REQUIRE_CPP()AC_PROVIDE([$0])echo '#include "confdefs.h" +#include <$2>' > conftest.${ac_ext} +eval "$ac_cpp conftest.${ac_ext} > conftest.out 2>&1" +if egrep "$1" conftest.out >/dev/null 2>&1; then + ifelse([$3], , :, [rm -rf conftest* + $3 +]) +ifelse([$4], , , [else + rm -rf conftest* + $4 +])dnl +fi +rm -f conftest* +])dnl +dnl +dnl Because this macro is used by AC_GCC_TRADITIONAL, which must come early, +dnl it is not included in AC_BEFORE checks. +define(AC_PROGRAM_EGREP, +[AC_REQUIRE_CPP()AC_PROVIDE([$0])cat > conftest.${ac_ext} < conftest.out 2>&1" +if egrep "$1" conftest.out >/dev/null 2>&1; then + ifelse([$3], , :, [rm -rf conftest* + $3 +]) +ifelse([$4], , , [else + rm -rf conftest* + $4 +])dnl +fi +rm -f conftest* +])dnl +dnl +define(AC_HEADER_CHECK, +[AC_CHECKING([for $1]) +ifelse([$3], , [AC_TEST_CPP([#include <$1>], [$2])], +[AC_TEST_CPP([#include <$1>], [$2], [$3])]) +])dnl +dnl +define(AC_COMPILE_CHECK, +[AC_PROVIDE([$0])dnl +ifelse([$1], , , [AC_CHECKING([for $1])] +)dnl +dnl We use return because because C++ requires a prototype for exit. +cat > conftest.${ac_ext} < conftest.${ac_ext} </dev/null; then + ifelse([$2], , :, [$2 +]) +ifelse([$3], , , [else + $3 +])dnl +fi +ifelse([$4], , , fi +)dnl +rm -fr conftest*])dnl +dnl +define(AC_TEST_CPP, +[AC_REQUIRE_CPP()dnl +cat > conftest.${ac_ext} </dev/null) 2>&1"` +if test -z "$ac_err"; then + ifelse([$2], , :, [rm -rf conftest* + $2 +]) +ifelse([$3], , , [else + rm -rf conftest* + $3 +])dnl +fi +rm -f conftest*])dnl +dnl +define(AC_REPLACE_FUNCS, +[for ac_func in $1 +do +AC_COMPILE_CHECK([${ac_func}], [#include ], [ +/* 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 +/* Override any gcc2 internal prototype to avoid an error. */ +extern char ${ac_func}(); ${ac_func}(); +#endif +], , [LIBOBJS="$LIBOBJS ${ac_func}.o" +AC_VERBOSE(using ${ac_func}.o instead)]) +done +AC_SUBST(LIBOBJS)dnl +])dnl +dnl +define(AC_FUNC_CHECK, +[ifelse([$3], , [AC_COMPILE_CHECK($1, [#include ], [ +/* 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_$1) || defined (__stub___$1) +choke me +#else +/* Override any gcc2 internal prototype to avoid an error. */ +extern char $1(); $1(); +#endif +], +$2)], [AC_COMPILE_CHECK($1, [#include ], [ +/* 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_$1) || defined (__stub___$1) +choke me +#else +/* Override any gcc2 internal prototype to avoid an error. */ +extern char $1(); $1(); +#endif +], +$2, $3)])dnl +])dnl +dnl +define(AC_HAVE_FUNCS, +[for ac_func in $1 +do +changequote(,)dnl +ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'` +changequote([,])dnl +AC_FUNC_CHECK(${ac_func}, +AC_DEFINE(${ac_tr_func}))dnl +done +])dnl +dnl +define(AC_HAVE_HEADERS, +[AC_REQUIRE_CPP()dnl Make sure the cpp check happens outside the loop. +for ac_hdr in $1 +do +changequote(,)dnl +ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./' '[A-Z]__'` +changequote([,])dnl +AC_HEADER_CHECK(${ac_hdr}, +AC_DEFINE(${ac_tr_hdr}))dnl +done +])dnl +dnl +define(AC_HAVE_LIBRARY, [dnl +changequote(/,/)dnl +define(/AC_LIB_NAME/, dnl +patsubst(patsubst($1, /lib\([^\.]*\)\.a/, /\1/), /-l/, //))dnl +changequote([,])dnl +ac_save_LIBS="${LIBS}" +LIBS="${LIBS} -l[]AC_LIB_NAME[]" +ac_have_lib="" +AC_COMPILE_CHECK([-l[]AC_LIB_NAME[]], , [main();], [ac_have_lib="1"])dnl +LIBS="${ac_save_LIBS}" +ifelse($#, 1, [dnl +if test -n "${ac_have_lib}"; then + AC_DEFINE([HAVE_LIB]translit(AC_LIB_NAME, [a-z], [A-Z])) + LIBS="${LIBS} -l[]AC_LIB_NAME[]" +fi +undefine(AC_LIB_NAME)dnl +], [dnl +if test -n "${ac_have_lib}"; then + :; $2 +else + :; $3 +fi +])])dnl +dnl +define(AC_SIZEOF_TYPE, +[AC_CHECKING(size of $1) +AC_TEST_PROGRAM([#include +main() +{ + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + fprintf(f, "%d\n", sizeof($1)); + exit(0); +}], ac_size=`cat conftestval`, AC_ERROR(can not determine size of $1)) +AC_DEFINE_UNQUOTED(changequote(<<,>>) translit(sizeof_$1, [a-z *], [A-Z_P])<<>>changequote([,]), $ac_size)])dnl +dnl +dnl +dnl The big finish +dnl +dnl +define(AC_OUTPUT, +[changequote(,)dnl + +# The preferred way to propogate these variables is regular @ substitutions. +if test -n "$prefix"; then + ac_prsub="s%^prefix\\([ ]*\\)=\\([ ]*\\).*$%prefix\\1=\\2$prefix%" +else + prefix=/usr/local +fi +if test -n "$exec_prefix"; then + ac_prsub="$ac_prsub +s%^exec_prefix\\([ ]*\\)=\\([ ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%" +else + exec_prefix='${prefix}' # Let make expand it. +fi + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +# Quote sed substitution magic chars in DEFS. +cat >conftest.def < config.status </dev/null | sed 1q`: +# +[#] [$]0 [$]quoted_arguments + +changequote(,)dnl +ac_cs_usage="Usage: config.status [--recheck] [--version] [--help]" +changequote([,])dnl +for ac_option +do + case "[\$]ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo running [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]quoted_arguments --no-create + exec [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]quoted_arguments --no-create ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "config.status generated by autoconf version AC_ACVERSION" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "[\$]ac_cs_usage"; exit 0 ;; + *) echo "[\$]ac_cs_usage"; exit 1 ;; + esac +done + +ifdef([AC_CONFIG_NAMES], +[trap 'rm -fr $1 AC_CONFIG_NAMES conftest*; exit 1' 1 2 15], +[trap 'rm -f $1; exit 1' 1 2 15]) +dnl Insert the variable assignments. +undivert(2)dnl +EOF +cat >> config.status <<\EOF + +ac_given_srcdir=$srcdir + +CONFIG_FILES=${CONFIG_FILES-"$1"} +for ac_file in .. ${CONFIG_FILES}; do if test "x$ac_file" != x..; then + # Remove last slash and all that follows it. Not all systems have dirname. +changequote(,)dnl + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` +changequote([,])dnl + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/$ac_dir" + else + ac_dir_suffix= + fi + +changequote(,)dnl + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` +changequote([,])dnl + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dir_suffix"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + comment_str="Generated automatically from `echo $ac_file|sed 's|.*/||'`.in by configure." + case "$ac_file" in + *.c | *.h | *.C | *.cc | *.m ) echo "/* $comment_str */" > "$ac_file" ;; + * ) echo "# $comment_str" > "$ac_file" ;; + esac + sed -e " +$ac_prsub +$ac_vpsub +dnl Shell code in configure.in might set extrasub. +$extrasub +dnl Insert the sed substitutions. +undivert(1)dnl +" $ac_given_srcdir/${ac_file}.in >> $ac_file +fi; done +AC_OUTPUT_HEADER +$2 +exit 0 +EOF +chmod +x config.status +# Some shells look in PATH for config.status without the "./". +test -n "$no_create" || ${CONFIG_SHELL-/bin/sh} ./config.status +])dnl +dnl This is a subroutine of AC_OUTPUT, broken out primarily to avoid bugs +dnl with long definitions in GNU m4 1.0. This is called inside a quoted +dnl here document whose contents are going into config.status. +define(AC_OUTPUT_HEADER,[dnl +ifdef([AC_CONFIG_NAMES],[dnl +changequote(<<,>>)dnl + +# These sed commands are put into ac_sed_defs when defining a macro. +# They are broken into pieces to make the sed script easier to manage. +# They are passed to sed as "A NAME B NAME C VALUE D", where NAME +# is the cpp macro being defined and VALUE is the value it is being given. +# Each defining turns into a single global substitution command. +# Hopefully no one uses "!" as a variable value. +# Other candidates for the sed separators, like , and @, do get used. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s!^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='\([ ][ ]*\)[^ ]*!\1#\2' +ac_dC='\3' +ac_dD='!g' +# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". +ac_uA='s!^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='\([ ]\)!\1#\2define\3' +ac_uC=' ' +ac_uD='\4!g' +# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_eA='s!^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_eB='<<$>>!\1#\2define\3' +ac_eC=' ' +ac_eD='!g' +changequote([,])dnl +rm -f conftest.sed +EOF +# Turn off quoting long enough to insert the sed commands. +rm -f conftest.sh +cat > conftest.sh < conftest.s1 # Like head -9. + sed 1,${ac_max_sh_lines}d conftest.sh > conftest.s2 # Like tail +10. + # Write a limited-size here document to append to conftest.sed. + echo 'cat >> conftest.sed <> config.status + cat conftest.s1 >> config.status + echo 'CONFEOF' >> config.status + rm -f conftest.s1 conftest.sh + mv conftest.s2 conftest.sh +done +rm -f conftest.sh + +# Now back to your regularly scheduled config.status. +cat >> config.status <<\EOF +# This sed command replaces #undef's with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it in +[#] AC_CONFIG_NAMES. +cat >> conftest.sed <<\CONFEOF +changequote(,)dnl +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +changequote([,])dnl +CONFEOF +rm -f conftest.h +# Break up the sed commands because old seds have small limits. +ac_max_sed_lines=20 + +CONFIG_HEADERS=${CONFIG_HEADERS-"AC_CONFIG_NAMES"} +for ac_file in .. ${CONFIG_HEADERS}; do if test "x$ac_file" != x..; then + echo creating $ac_file + + cp $ac_given_srcdir/$ac_file.in conftest.h1 + cp conftest.sed conftest.stm + while : + do + ac_lines=`grep -c . conftest.stm` + if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi + rm -f conftest.s1 conftest.s2 conftest.h2 + sed ${ac_max_sed_lines}q conftest.stm > conftest.s1 # Like head -20. + sed 1,${ac_max_sed_lines}d conftest.stm > conftest.s2 # Like tail +21. + sed -f conftest.s1 < conftest.h1 > conftest.h2 + rm -f conftest.s1 conftest.h1 conftest.stm + mv conftest.h2 conftest.h1 + mv conftest.s2 conftest.stm + done + rm -f conftest.stm conftest.h + echo "/* $ac_file. Generated automatically by configure. */" > conftest.h + cat conftest.h1 >> conftest.h + rm -f conftest.h1 + if cmp -s $ac_file conftest.h 2>/dev/null; then + # The file exists and we would not be changing it. + echo "$ac_file is unchanged" + rm -f conftest.h + else + rm -f $ac_file + mv conftest.h $ac_file + fi +fi; done +rm -f conftest.sed + +])])dnl diff -r 11c6df210d7f -r 56c54cf7c5b6 lib-autoconf-1/acspecific.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib-autoconf-1/acspecific.m4 Mon Aug 13 08:56:04 2007 +0200 @@ -0,0 +1,1402 @@ +dnl Macros that test for specific features. +dnl This file is part of Autoconf. +dnl Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2, or (at your option) +dnl any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +dnl +dnl Written by David MacKenzie, with help from +dnl Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, +dnl Roland McGrath, and Noah Friedman. +dnl +dnl +dnl checks for programs +dnl +dnl +define(AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])AC_PROVIDE([$0])AC_PROGRAM_CHECK(CC, gcc, gcc, cc) +# Find out if we are using GNU C, under whatever name. +cat > conftest.c < conftest.out 2>&1 +if egrep yes conftest.out >/dev/null 2>&1; then + GCC=1 # For later tests. +fi +rm -f conftest* +])dnl +dnl +define(AC_PROG_CXX, +[AC_BEFORE([$0], [AC_PROG_CXXCPP])AC_PROVIDE([$0]) +AC_PROGRAMS_CHECK(CXX, $CCC c++ g++ gcc CC cxx, gcc) +# Find out if we are using GNU C++, under whatever name. +cat > conftest.C < conftest.out 2>&1 +if egrep yes conftest.out >/dev/null 2>&1; then + GXX=1 # For later tests. +fi +rm -f conftest* +])dnl +dnl +define(AC_GCC_TRADITIONAL, +[AC_REQUIRE([AC_PROG_CC])AC_REQUIRE([AC_PROG_CPP])if test -n "$GCC"; then + AC_CHECKING(whether -traditional is needed) +changequote(,)dnl + ac_pattern="Autoconf.*'x'" +changequote([,])dnl + ac_prog='#include +Autoconf TIOCGETP' + AC_PROGRAM_EGREP($ac_pattern, $ac_prog, ac_need_trad=1) + + if test -z "$ac_need_trad"; then + ac_prog='#include +Autoconf TCGETA' + AC_PROGRAM_EGREP($ac_pattern, $ac_prog, ac_need_trad=1) + fi + test -n "$ac_need_trad" && CC="$CC -traditional" +fi +])dnl +dnl +define(AC_MINUS_C_MINUS_O, +[AC_CHECKING(whether $CC and cc understand -c and -o together) +echo 'foo(){}' > conftest.c +# Make sure it works both with $CC and with simple cc. +# We do the test twice because some compilers refuse to overwrite an +# existing .o file with -o, though they will create one. +if ${CC-cc} -c conftest.c -o conftest.o >/dev/null 2>&1 \ + && test -f conftest.o && ${CC-cc} -c conftest.c -o conftest.o >/dev/null 2>&1 +then + # Test first that cc exists at all. + if cc -c conftest.c >/dev/null 2>&1 + then + if cc -c conftest.c -o conftest2.o >/dev/null 2>&1 && \ + test -f conftest2.o && cc -c conftest.c -o conftest2.o >/dev/null 2>&1 + then + : + else + AC_DEFINE(NO_MINUS_C_MINUS_O) + fi + fi +else + AC_DEFINE(NO_MINUS_C_MINUS_O) +fi +rm -f conftest* +])dnl +dnl +dnl Define SET_MAKE to set ${MAKE} if make doesn't. +define(AC_SET_MAKE, +[cat > conftestmake <<'EOF' +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +changequote(,)dnl +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +changequote([,])dnl +if test -n "$ac_maketemp"; then SET_MAKE= +else SET_MAKE="MAKE=${MAKE-make}"; fi +rm -f conftestmake +AC_SUBST([SET_MAKE])dnl +])dnl +dnl +define(AC_PROG_RANLIB, [AC_PROGRAM_CHECK(RANLIB, ranlib, ranlib, :)])dnl +dnl +define(AC_PROG_AWK, [AC_PROGRAMS_CHECK(AWK, mawk gawk nawk awk,)])dnl +dnl +define(AC_PROG_YACC,[AC_PROGRAMS_CHECK(YACC, 'bison -y' byacc, yacc)])dnl +dnl +define(AC_PROG_CPP, +[AC_PROVIDE([$0])AC_CHECKING(how to run the C preprocessor) +if test -z "$CPP"; then + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and ``${CC-cc}'' will simply confuse + # make. It must be expanded now. + CPP="${CC-cc} -E" +dnl On the NeXT, cc -E runs the code through the compiler's parser, +dnl not just through cpp. + AC_TEST_CPP([#include +Syntax Error], , + CPP="${CC-cc} -E -traditional-cpp" + AC_TEST_CPP([#include +Syntax Error], ,CPP=/lib/cpp)) +fi +AC_VERBOSE(setting CPP to $CPP) +AC_SUBST(CPP)dnl +])dnl +dnl +define(AC_PROG_CXXCPP, +[AC_PROVIDE([$0])AC_CHECKING(how to run the C++ preprocessor) +AC_LANG_SAVE[]dnl +AC_LANG_CPLUSPLUS[]dnl +if test -z "$CXXCPP"; then + CXXCPP="${CXX-c++} -E" + AC_TEST_CPP([#include ], , CXXCPP=/lib/cpp) +fi +AC_VERBOSE(setting CXXCPP to $CXXCPP) +AC_LANG_RESTORE[]dnl +AC_SUBST(CXXCPP)dnl +])dnl +dnl +dnl Require finding the C or C++ preprocessor, whichever is the +dnl current language. +define(AC_REQUIRE_CPP, +[ifelse(AC_LANG,C,[AC_REQUIRE([AC_PROG_CPP])],[AC_REQUIRE([AC_PROG_CXXCPP])])])dnl +dnl +define(AC_PROG_LEX, +[AC_PROVIDE([$0])AC_PROGRAM_CHECK(LEX, flex, flex, lex) +if test -z "$LEXLIB" +then + case "$LEX" in + flex*) AC_HAVE_LIBRARY(fl, LEXLIB="-lfl") ;; + *) LEXLIB="-ll" ;; + esac +fi +AC_VERBOSE(setting LEXLIB to $LEXLIB) +AC_SUBST(LEXLIB)])dnl +dnl +define(AC_YYTEXT_POINTER,[dnl +AC_REQUIRE_CPP()AC_REQUIRE([AC_PROG_LEX])dnl +AC_CHECKING(for yytext declaration) +# POSIX says lex can declare yytext either as a pointer or an array; the +# default is implementation-dependent. Figure out which it is, since +# not all implementations provide the %pointer and %array declarations. +# +# The minimal lex program is just a single line: %%. But some broken lexes +# (Solaris, I think it was) want two %% lines, so accommodate them. + echo '%% +%%' | ${LEX} +if test -f lex.yy.c; then + LEX_OUTPUT_ROOT=lex.yy +elif test -f lexyy.c; then + LEX_OUTPUT_ROOT=lexyy +else + # Don't know what to do here. + AC_ERROR(cannot find output from $LEX, giving up on yytext declaration) + LEX_OUTPUT_ROOT= +fi +if test -n "$LEX_OUTPUT_ROOT"; then + echo 'extern char *yytext; main () { exit (0); }' >>$LEX_OUTPUT_ROOT.c + ac_save_LIBS="$LIBS" + LIBS="$LIBS $LEXLIB" + AC_TEST_PROGRAM(`cat $LEX_OUTPUT_ROOT.c`, AC_DEFINE(YYTEXT_POINTER)) + LIBS="$ac_save_LIBS" + rm -f "${LEX_OUTPUT_ROOT}.c" +fi +AC_SUBST(LEX_OUTPUT_ROOT)dnl +])dnl +dnl +define(AC_PROG_INSTALL, +[# Make sure to not get the incompatible SysV /etc/install and +# /usr/sbin/install, which might be in PATH before a BSD-like install, +# or the SunOS /usr/etc/install directory, or the AIX /bin/install, +# or the AFS install, which mishandles nonexistent args, or +# /usr/ucb/install on SVR4, which tries to use the nonexistent group +# `staff', or /sbin/install on IRIX which has incompatible command-line +# syntax. Sigh. +# +# On most BSDish systems install is in /usr/bin, not /usr/ucb +# anyway. +# This turns out not to be true, so the mere pathname isn't an indication +# of whether the program works. What we really need is a set of tests for +# the install program to see if it actually works in all the required ways. +# +# Avoid using ./install, which might have been erroneously created +# by make from ./install.sh. +if test -z "${INSTALL}"; then + AC_CHECKING(for a BSD compatible install) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + case "$ac_dir" in + ''|.|/etc|/sbin|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + for ac_prog in 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 + INSTALL="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_ifs" +fi + +if test -z "$INSTALL"; then + # As a last resort, use the slow shell script. + for ac_dir in ${srcdir} ${srcdir}/.. ${srcdir}/../..; do + if test -f $ac_dir/install.sh; then + INSTALL="$ac_dir/install.sh -c"; break + fi + done +fi +if test -z "$INSTALL"; then + AC_ERROR([can not find install.sh in ${srcdir} or ${srcdir}/.. or ${srcdir}/../..]) +fi +AC_SUBST(INSTALL)dnl +AC_VERBOSE(setting INSTALL to $INSTALL) + +# Use test -z because SunOS4 sh mishandles ${INSTALL_PROGRAM-'${INSTALL}'}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' +AC_SUBST(INSTALL_PROGRAM)dnl +AC_VERBOSE(setting INSTALL_PROGRAM to $INSTALL_PROGRAM) + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' +AC_SUBST(INSTALL_DATA)dnl +AC_VERBOSE(setting INSTALL_DATA to $INSTALL_DATA) +])dnl +dnl +define(AC_LN_S, +[AC_CHECKING(for ln -s) +rm -f conftestdata +if ln -s X conftestdata 2>/dev/null +then + rm -f conftestdata + LN_S="ln -s" +else + LN_S=ln +fi +AC_SUBST(LN_S) +])dnl +dnl +define(AC_RSH, +[AC_CHECKING(for remote shell) +if test -f /usr/ucb/rsh || test -f /usr/bin/remsh || test -f /usr/bin/rsh || + test -f /usr/bsd/rsh || test -f /usr/bin/nsh; then + RTAPELIB=rtapelib.o +else + AC_HEADER_CHECK(netdb.h, AC_DEFINE(HAVE_NETDB_H) RTAPELIB=rtapelib.o, + AC_DEFINE(NO_REMOTE)) +fi +AC_SUBST(RTAPELIB)dnl +])dnl +dnl +dnl +dnl checks for header files +dnl +dnl +define(AC_STDC_HEADERS, +[AC_REQUIRE_CPP()dnl +AC_CHECKING(for ANSI C header files) +AC_TEST_CPP([#include +#include +#include +#include ], +[# SunOS 4.x string.h does not declare mem*, contrary to ANSI. +AC_HEADER_EGREP(memchr, string.h, +# SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. +AC_TEST_PROGRAM([#include +#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#define XOR(e,f) (((e) && !(f)) || (!(e) && (f))) +int main () { int i; for (i = 0; i < 256; i++) +if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); +exit (0); } +], +[# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. +AC_HEADER_EGREP(free, stdlib.h, AC_DEFINE(STDC_HEADERS))]))]) +])dnl +dnl +define(AC_UNISTD_H, [AC_OBSOLETE([$0], [; instead use AC_HAVE_HEADERS(unistd.h)])AC_HEADER_CHECK(unistd.h, + AC_DEFINE(HAVE_UNISTD_H))])dnl +dnl +define(AC_USG, +[AC_OBSOLETE([$0], [; instead use AC_HAVE_HEADERS(string.h) and HAVE_STRING_H])AC_COMPILE_CHECK([BSD string and memory functions], +[#include ], [rindex(0, 0); bzero(0, 0);], , AC_DEFINE(USG))])dnl +dnl +dnl +dnl If memchr and the like aren't declared in , include . +dnl To avoid problems, don't check for gcc2 built-ins. +define(AC_MEMORY_H, +[AC_OBSOLETE([$0], [; instead use AC_HAVE_HEADERS(memory.h) and HAVE_MEMORY_H])AC_CHECKING(whether string.h declares mem functions) +AC_HEADER_EGREP(memchr, string.h, , + AC_HEADER_CHECK(memory.h, AC_DEFINE(NEED_MEMORY_H)))] +)dnl +dnl +define(AC_MAJOR_HEADER, +[AC_COMPILE_CHECK([major, minor and makedev header], +[#include ], +[return makedev(0, 0);], ac_makedev=1) +if test -z "$ac_makedev"; then +AC_HEADER_CHECK(sys/mkdev.h, AC_DEFINE(MAJOR_IN_MKDEV) ac_makedev=1) +fi +if test -z "$ac_makedev"; then +AC_HEADER_CHECK(sys/sysmacros.h, AC_DEFINE(MAJOR_IN_SYSMACROS)) +fi] +)dnl +dnl +define(AC_DIR_HEADER, +[AC_PROVIDE([$0])AC_CHECKING(for directory library header) +ac_dir_header= +AC_DIR_HEADER_CHECK(dirent.h, DIRENT) +AC_DIR_HEADER_CHECK(sys/ndir.h, SYSNDIR) +AC_DIR_HEADER_CHECK(sys/dir.h, SYSDIR) +AC_DIR_HEADER_CHECK(ndir.h, NDIR) + +AC_CHECKING(for closedir return value) +AC_TEST_PROGRAM([#include +#include <$ac_dir_header> +int closedir(); main() { exit(closedir(opendir(".")) != 0); }], , +AC_DEFINE(VOID_CLOSEDIR)) +])dnl +dnl Subroutine of AC_DIR_HEADER. +dnl ??? I tried to put this define inside AC_DIR_HEADER, but when I did +dnl that, $1 and $2 did not get expanded. --roland +dnl Check if $1 is the winning directory library header file. +dnl It must not only exist, but also correctly define the `DIR' type. +dnl If it is really winning, define $2 and set shell var `ac_dir_header' to $1. +define(AC_DIR_HEADER_CHECK, [dnl +if test -z "$ac_dir_header"; then + AC_COMPILE_CHECK($1, [#include +#include <]$1[>], + [DIR *dirp = 0;], + AC_DEFINE($2) ac_dir_header=$1)dnl +fi])dnl +dnl +dnl +dnl checks for typedefs +dnl +dnl +define(AC_GETGROUPS_T, +[AC_REQUIRE([AC_UID_T])dnl +AC_CHECKING(for type of array argument to getgroups) +changequote(,)dnl +dnl Do not put single quotes in the C program text!! +ac_prog='/* Thanks to Mike Rendell for this test. */ +#include +#define NGID 256 +#undef MAX +#define MAX(x,y) ((x) > (y) ? (x) : (y)) +main() +{ + gid_t gidset[NGID]; + int i, n; + union { gid_t gval; long lval; } val; + + val.lval = -1; + for (i = 0; i < NGID; i++) + gidset[i] = val.gval; + n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1, + gidset); + /* Exit non-zero if getgroups seems to require an array of ints. This + happens when gid_t is short but getgroups modifies an array of ints. */ + exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0); +}' +changequote([,])dnl +AC_TEST_PROGRAM([$ac_prog], + AC_DEFINE(GETGROUPS_T, gid_t), + AC_DEFINE(GETGROUPS_T, int)) +])dnl +dnl +define(AC_UID_T, +[AC_PROVIDE([$0])AC_CHECKING(for uid_t in sys/types.h) +AC_HEADER_EGREP(uid_t, sys/types.h, , + AC_DEFINE(uid_t, int) AC_DEFINE(gid_t, int))])dnl +dnl +define(AC_SIZE_T, +[AC_CHECKING(for size_t in sys/types.h) +AC_HEADER_EGREP(size_t, sys/types.h, , AC_DEFINE(size_t, unsigned))])dnl +dnl +define(AC_PID_T, +[AC_PROVIDE([$0])AC_CHECKING(for pid_t in sys/types.h) +AC_HEADER_EGREP(pid_t, sys/types.h, , AC_DEFINE(pid_t, int))])dnl +dnl +define(AC_OFF_T, +[AC_PROVIDE([$0])AC_CHECKING(for off_t in sys/types.h) +AC_HEADER_EGREP(off_t, sys/types.h, , AC_DEFINE(off_t, long))])dnl +dnl +define(AC_MODE_T, +[AC_CHECKING(for mode_t in sys/types.h) +AC_HEADER_EGREP(mode_t, sys/types.h, , AC_DEFINE(mode_t, int))])dnl +dnl +define(AC_RETSIGTYPE, +[AC_PROVIDE([$0])AC_COMPILE_CHECK([return type of signal handlers], +[#include +#include +#ifdef signal +#undef signal +#endif +extern void (*signal ()) ();], +[int i;], +[AC_DEFINE(RETSIGTYPE, void)], +[AC_DEFINE(RETSIGTYPE, int)])] +)dnl +dnl +dnl +dnl checks for functions +dnl +dnl +define(AC_MMAP, [ +AC_CHECKING(for working mmap) +AC_TEST_PROGRAM([/* Thanks to Mike Haertel and Jim Avera for this test. */ +#include +#include +#include + +#ifdef BSD +#ifndef BSD4_1 +#define HAVE_GETPAGESIZE +#endif +#endif +#ifndef HAVE_GETPAGESIZE +#include +#ifdef EXEC_PAGESIZE +#define getpagesize() EXEC_PAGESIZE +#else +#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 */ +#define getpagesize() PAGESIZE /* SVR4 */ +#endif /* no NBPC */ +#endif /* no NBPG */ +#endif /* no EXEC_PAGESIZE */ +#endif /* not HAVE_GETPAGESIZE */ + +#ifdef __osf__ +#define valloc malloc +#endif + +extern char *valloc(); +extern char *malloc(); + +int +main() +{ + char *buf1, *buf2, *buf3; + int i = getpagesize(), j; + int i2 = getpagesize()*2; + int fd; + + buf1 = valloc(i2); + buf2 = valloc(i); + buf3 = malloc(i2); + for (j = 0; j < i2; ++j) + *(buf1 + j) = rand(); + fd = open("conftestmmap", O_CREAT | O_RDWR, 0666); + write(fd, buf1, i2); + mmap(buf2, i, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_PRIVATE, fd, 0); + for (j = 0; j < i; ++j) + if (*(buf1 + j) != *(buf2 + j)) + exit(1); + lseek(fd, (long)i, 0); + read(fd, buf2, i); /* read into mapped memory -- file should not change */ + /* (it does in i386 SVR4.0 - Jim Avera) */ + lseek(fd, (long)0, 0); + read(fd, buf3, i2); + for (j = 0; j < i2; ++j) + if (*(buf1 + j) != *(buf3 + j)) + exit(1); + exit(0); +} +], AC_DEFINE(HAVE_MMAP)) +])dnl +dnl +define(AC_VPRINTF, +[AC_COMPILE_CHECK([vprintf], , [vprintf();], AC_DEFINE(HAVE_VPRINTF), +ac_vprintf_missing=1) +if test -n "$ac_vprintf_missing"; then +AC_COMPILE_CHECK([_doprnt], , [_doprnt();], AC_DEFINE(HAVE_DOPRNT)) +fi +])dnl +dnl +define(AC_VFORK, +[AC_REQUIRE([AC_PID_T])AC_HEADER_CHECK(vfork.h, AC_DEFINE(HAVE_VFORK_H)) +AC_CHECKING(for working vfork) +AC_REQUIRE([AC_RETSIGTYPE]) +AC_TEST_PROGRAM([/* Thanks to Paul Eggert for this test. */ +#include +#include +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_VFORK_H +#include +#endif +static int signalled; +static RETSIGTYPE catch (s) int s; { signalled = 1; } +main() { + pid_t parent = getpid (); + pid_t child; + + signal (SIGINT, catch); + + child = vfork (); + + if (child == 0) { + /* On sparc systems, changes by the child to local and incoming + argument registers are propagated back to the parent. + The compiler is told about this with #include , + but some compilers (e.g. gcc -O) don't grok . + Test for this by using lots of local variables, at least + as many local variables as main has allocated so far + including compiler temporaries. 4 locals are enough for + gcc 1.40.3 on a sparc, but we use 8 to be safe. + A buggy compiler should reuse the register of parent + for one of the local variables, since it will think that + parent can't possibly be used any more in this routine. + Assigning to the local variable will thus munge parent + in the parent process. */ + pid_t + p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), + p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); + /* Convince the compiler that p..p7 are live; otherwise, it might + use the same hardware register for all 8 local variables. */ + if (p != p1 || p != p2 || p != p3 || p != p4 + || p != p5 || p != p6 || p != p7) + _exit(1); + + /* On some systems (e.g. SunOS 5.2), if the parent is catching + a signal, the child ignores the signal before execing, + and the parent later receives that signal, the parent dumps core. + Test for this by ignoring SIGINT in the child. */ + signal (SIGINT, SIG_IGN); + + /* On some systems (e.g. IRIX 3.3), + vfork doesn't separate parent from child file descriptors. + If the child closes a descriptor before it execs or exits, + this munges the parent's descriptor as well. + Test for this by closing stdout in the child. */ + _exit(close(fileno(stdout)) != 0); + } else { + int status; + struct stat st; + + while (wait(&status) != child) + ; + exit( + /* Was there some problem with vforking? */ + child < 0 + + /* Did the child fail? (This shouldn't happen.) */ + || status + + /* Did the vfork/compiler bug occur? */ + || parent != getpid() + + /* Did the signal handling bug occur? */ + || kill(parent, SIGINT) != 0 + || signalled != 1 + + /* Did the file descriptor bug occur? */ + || fstat(fileno(stdout), &st) != 0 + ); + } +}], , AC_DEFINE(vfork, fork)) +])dnl +dnl +define(AC_WAIT3, +[AC_CHECKING(for wait3 that fills in rusage) +AC_TEST_PROGRAM([#include +#include +#include +#include +/* HP-UX has wait3 but does not fill in rusage at all. */ +main() { + struct rusage r; + int i; + /* Use a field that we can force nonzero -- + voluntary context switches. + For systems like NeXT and OSF/1 that don't set it, + also use the system CPU time. */ + r.ru_nvcsw = 0; + r.ru_stime.tv_sec = 0; + r.ru_stime.tv_usec = 0; + switch (fork()) { + case 0: /* Child. */ + sleep(1); /* Give up the CPU. */ + _exit(0); + case -1: _exit(0); /* What can we do? */ + default: /* Parent. */ + wait3(&i, 0, &r); + sleep(1); /* Avoid "text file busy" from rm on fast HP-UX machines. */ + exit(r.ru_nvcsw == 0 + && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0); + } +}], AC_DEFINE(HAVE_WAIT3)) +])dnl +dnl +define(AC_ALLOCA, +[# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +AC_COMPILE_CHECK(working alloca.h, [#include ], + [char *p = alloca(2 * sizeof(int));], AC_DEFINE(HAVE_ALLOCA_H)) +ac_decl="#ifdef __GNUC__ +#define alloca __builtin_alloca +#else +#if HAVE_ALLOCA_H +#include +#else +#ifdef _AIX + #pragma alloca +#else +char *alloca (); +#endif +#endif +#endif +" +AC_COMPILE_CHECK([alloca], $ac_decl, +[char *p = (char *) alloca(1);], [AC_DEFINE([HAVE_ALLOCA])], [dnl +ac_alloca_missing=1 +AC_PROGRAM_EGREP(winnitude, [ +#if defined(CRAY) && ! defined(CRAY2) +winnitude +#else +lossage +#endif +], +AC_FUNC_CHECK([_getb67],AC_DEFINE([CRAY_STACKSEG_END],[_getb67]), +AC_FUNC_CHECK([GETB67],AC_DEFINE([CRAY_STACKSEG_END],[GETB67]), +AC_FUNC_CHECK([getb67],AC_DEFINE([CRAY_STACKSEG_END],[getb67]))))) +]) +if test -n "$ac_alloca_missing"; then + # The SVR3 libPW and SVR4 libucb both contain incompatible functions + # 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.o + AC_DEFINE(C_ALLOCA) + + AC_CHECKING(stack direction for C alloca) + AC_TEST_PROGRAM([find_stack_direction () +{ + static char *addr = 0; + auto char dummy; + if (addr == 0) + { + addr = &dummy; + return find_stack_direction (); + } + else + return (&dummy > addr) ? 1 : -1; +} +main () +{ + exit (find_stack_direction() < 0); +}], dnl +AC_DEFINE(STACK_DIRECTION,1), AC_DEFINE(STACK_DIRECTION,-1), dnl +AC_DEFINE(STACK_DIRECTION,0)) +fi +AC_SUBST(ALLOCA)dnl +])dnl +dnl +define(AC_GETLOADAVG, +[# Some definitions of getloadavg require that the program be installed setgid. +AC_SUBST(NEED_SETGID)NEED_SETGID=false +ac_need_func=true + +# Check for the 4.4BSD definition of getloadavg. +AC_HAVE_LIBRARY(util, LIBS="$LIBS -lutil" ac_need_func=false) +# Some systems with -lutil have (and need) -lkvm as well, some do not. +AC_HAVE_LIBRARY(kvm, LIBS="$LIBS -lkvm") + +if $ac_need_func; then +# There is a commonly available library for RS/6000 AIX. +# Since it is not a standard part of AIX, it might be installed locally. +LIBS_old="$LIBS" +LIBS="-L/usr/local/lib $LIBS" +AC_HAVE_LIBRARY(getloadavg, LIBS="$LIBS -lgetloadavg" ac_need_func=false, + LIBS="$LIBS_old") +fi + +# Make sure it is really in the library, if we think we found it at all. +AC_REPLACE_FUNCS(getloadavg) + +case "$LIBOBJS" in +*getloadavg*) +ac_need_func=true +AC_HEADER_CHECK(sys/dg_sys_info.h, [dnl +AC_DEFINE(DGUX) ac_need_func=false +# Some versions of DGUX need -ldgc for dg_sys_info. +AC_HAVE_LIBRARY(dgc)]) +if $ac_need_func; then +# We cannot check for , because Solaris 2 does not use dwarf (it +# uses stabs), but it's still SVR4. We cannot check for because +# Irix 4.0.5F has the header but not the library. +AC_HAVE_LIBRARY(elf, AC_DEFINE(SVR4) LIBS="$LIBS -lelf" ac_need_func=false + AC_HAVE_LIBRARY(kvm, LIBS="$LIBS -lkvm")) +fi +if $ac_need_func; then +AC_HEADER_CHECK(inq_stats/cpustats.h, AC_DEFINE(UMAX4_3) AC_DEFINE(UMAX) + ac_need_func=false) +fi +if $ac_need_func; then +AC_HEADER_CHECK(sys/cpustats.h, AC_DEFINE(UMAX) ac_need_func=false) +fi +if $ac_need_func; then +AC_HAVE_HEADERS(mach/mach.h) +fi + +AC_HEADER_CHECK(nlist.h, +[AC_DEFINE(NLIST_STRUCT) +AC_COMPILE_CHECK(n_un in struct nlist, [#include ], +[struct nlist n; n.n_un.n_name = 0;], +AC_DEFINE(NLIST_NAME_UNION))])dnl + +# Figure out whether we will need to install setgid. +AC_PROGRAM_EGREP([Yowza Am I SETGID yet], [dnl +#include "${srcdir}/getloadavg.c" +#ifdef LDAV_PRIVILEGED +Yowza Am I SETGID yet +#endif], [AC_DEFINE(GETLOADAVG_PRIVILEGED) NEED_SETGID=true])dnl +;; + +*) AC_DEFINE(HAVE_GETLOADAVG) ;; +esac + +if $NEED_SETGID; then +AC_SUBST(KMEM_GROUP)dnl + # Figure out what group owns /dev/kmem. + # The installed program will need to be setgid and owned by that group. +changequote(,)dnl + # On Solaris, /dev/kmem is a symlink. Get info on the real file. + ac_ls_output=`ls -lgL /dev/kmem 2>/dev/null` + # If we got an error (system does not support symlinks), try without -L. + test -z "$ac_ls_output" && ac_ls_output=`ls -lg /dev/kmem` + KMEM_GROUP=`echo $ac_ls_output \ + | sed -ne 's/[ ][ ]*/ /g; + s/^.[sSrwx-]* *[0-9]* *\([^0-9]*\) *.*/\1/; + / /s/.* //;p;'` +changequote([,])dnl +fi +])dnl +dnl +define(AC_UTIME_NULL, +[AC_CHECKING(utime with null argument) +rm -f conftestdata; > conftestdata +# Sequent interprets utime(file, 0) to mean use start of epoch. Wrong. +AC_TEST_PROGRAM([#include +#include +main() { +struct stat s, t; +exit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0 +&& stat("conftestdata", &t) == 0 && t.st_mtime >= s.st_mtime +&& t.st_mtime - s.st_mtime < 120)); +}], AC_DEFINE(HAVE_UTIME_NULL)) +rm -f core +])dnl +dnl +define(AC_STRCOLL, [AC_CHECKING(for strcoll) +AC_TEST_PROGRAM([#include +main () +{ + exit (strcoll ("abc", "def") >= 0 || + strcoll ("ABC", "DEF") >= 0 || + strcoll ("123", "456") >= 0); +}], AC_DEFINE(HAVE_STRCOLL))])dnl +dnl +define(AC_SETVBUF_REVERSED, +[AC_TEST_PROGRAM([#include +/* If setvbuf has the reversed format, exit 0. */ +main () { + /* This call has the arguments reversed. + A reversed system may check and see that the address of main + is not _IOLBF, _IONBF, or _IOFBF, and return nonzero. */ + if (setvbuf(stdout, _IOLBF, (char *) main, BUFSIZ) != 0) + exit(1); + putc('\r', stdout); + exit(0); /* Non-reversed systems segv here. */ +}], AC_DEFINE(SETVBUF_REVERSED)) +rm -f core +])dnl +dnl +dnl +dnl checks for structure members +dnl +dnl +define(AC_STRUCT_TM, +[AC_PROVIDE([$0])AC_COMPILE_CHECK([struct tm in time.h], +[#include +#include ], +[struct tm *tp; tp->tm_sec;], , AC_DEFINE(TM_IN_SYS_TIME))])dnl +dnl +define(AC_TIME_WITH_SYS_TIME, +[AC_COMPILE_CHECK([whether time.h and sys/time.h may both be included], +[#include +#include +#include ], +[struct tm *tp;], AC_DEFINE(TIME_WITH_SYS_TIME))])dnl +dnl +define(AC_TIMEZONE, +[AC_REQUIRE([AC_STRUCT_TM])ac_decl='#include +' +case "$DEFS" in + *TM_IN_SYS_TIME*) ac_decl="$ac_decl +#include +" ;; + *) ac_decl="$ac_decl +#include +" ;; +esac +AC_COMPILE_CHECK([tm_zone in struct tm], $ac_decl, +[struct tm tm; tm.tm_zone;], AC_DEFINE(HAVE_TM_ZONE), ac_no_tm_zone=1) +if test -n "$ac_no_tm_zone"; then +AC_COMPILE_CHECK(tzname, changequote(<<,>>)dnl +<<#include +#ifndef tzname /* For SGI. */ +extern char *tzname[]; /* RS6000 and others want it this way. */ +#endif>>, changequote([,])dnl +[atoi(*tzname);], AC_DEFINE(HAVE_TZNAME)) +fi +])dnl +dnl +define(AC_ST_BLOCKS, +[AC_COMPILE_CHECK([st_blocks in struct stat], +[#include +#include ], [struct stat s; s.st_blocks;], +AC_DEFINE(HAVE_ST_BLOCKS), LIBOBJS="$LIBOBJS fileblocks.o")dnl +AC_SUBST(LIBOBJS)dnl +])dnl +dnl +define(AC_ST_BLKSIZE, +[AC_COMPILE_CHECK([st_blksize in struct stat], +[#include +#include ], [struct stat s; s.st_blksize;], +AC_DEFINE(HAVE_ST_BLKSIZE))])dnl +dnl +define(AC_ST_RDEV, +[AC_COMPILE_CHECK([st_rdev in struct stat], +[#include +#include ], [struct stat s; s.st_rdev;], +AC_DEFINE(HAVE_ST_RDEV))])dnl +dnl +dnl +dnl checks for compiler characteristics +dnl +dnl +define(AC_CROSS_CHECK, +[AC_PROVIDE([$0])AC_CHECKING(whether cross-compiling) +# If we cannot run a trivial program, we must be cross compiling. +AC_TEST_PROGRAM([main(){exit(0);}], , cross_compiling=1) +])dnl +dnl +define(AC_CHAR_UNSIGNED, +[AC_CHECKING(for unsigned characters) +AC_TEST_PROGRAM( +[/* volatile prevents gcc2 from optimizing the test away on sparcs. */ +#if !__STDC__ +#define volatile +#endif +main() { +#ifdef __CHAR_UNSIGNED__ + exit(1); /* No need to redefine it. */ +#else + volatile char c = 255; exit(c < 0); +#endif +}], AC_DEFINE(__CHAR_UNSIGNED__))] +)dnl +dnl +define(AC_LONG_DOUBLE, +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CHECKING(for long double) +if test -n "$GCC"; then +AC_DEFINE(HAVE_LONG_DOUBLE) +else +AC_TEST_PROGRAM([int main() { +/* The Stardent Vistra knows sizeof(long double), but does not support it. */ +long double foo = 0.0; +/* On Ultrix 4.3 cc, long double is 4 and double is 8. */ +exit(sizeof(long double) < sizeof(double)); }], +AC_DEFINE(HAVE_LONG_DOUBLE)) +fi +])dnl +dnl +define(AC_INT_16_BITS, +[AC_OBSOLETE([$0], [; instead use AC_SIZEOF_TYPE(int)]) +AC_CHECKING(integer size) +AC_TEST_PROGRAM([main() { exit(sizeof(int) != 2); }], + AC_DEFINE(INT_16_BITS)) +])dnl +dnl +define(AC_LONG_64_BITS, +[AC_OBSOLETE([$0], [; instead use AC_SIZEOF_TYPE(long)]) +AC_CHECKING(for 64-bit long ints) +AC_TEST_PROGRAM([main() { exit(sizeof(long int) != 8); }], + AC_DEFINE(LONG_64_BITS)) +])dnl +dnl +define(AC_WORDS_BIGENDIAN, +[AC_CHECKING(byte ordering) +AC_TEST_PROGRAM([main () { + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long l; + char c[sizeof (long)]; + } u; + u.l = 1; + exit (u.c[sizeof (long) - 1] == 1); +}], , AC_DEFINE(WORDS_BIGENDIAN)) +])dnl +dnl +define(AC_ARG_ARRAY, +[AC_CHECKING(whether the address of an argument can be used as an array) +AC_TEST_PROGRAM([main() { +/* Return 0 iff arg arrays are ok. */ +exit(!x(1, 2, 3, 4)); +} +x(a, b, c, d) { + return y(a, &b); +} +/* Return 1 iff arg arrays are ok. */ +y(a, b) int *b; { + return a == 1 && b[0] == 2 && b[1] == 3 && b[2] == 4; +}], , AC_DEFINE(NO_ARG_ARRAY)) +rm -f core +])dnl +dnl +define(AC_INLINE, +[AC_REQUIRE([AC_PROG_CC])if test -n "$GCC"; then +AC_COMPILE_CHECK([inline], , [} inline foo() {], , AC_DEFINE(inline, __inline)) +fi +])dnl +define(AC_CONST, +[changequote(,)dnl +dnl Do not put single quotes in the C program text!! +ac_prog='/* Ultrix mips cc rejects this. */ +typedef int charset[2]; const charset x; +/* SunOS 4.1.1 cc rejects this. */ +char const *const *ccp; +char **p; +/* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in an arm + of an if-expression whose if-part is not a constant expression */ +const char *g = "string"; +ccp = &g + (g ? g-g : 0); +/* HPUX 7.0 cc rejects these. */ +++ccp; +p = (char**) ccp; +ccp = (char const *const *) p; +{ /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; +} +{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25,17}; + const int *foo = &x[0]; + ++foo; +} +{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; +} +{ /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; +} +{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; +}' +changequote([,])dnl +AC_COMPILE_CHECK([dnl Do not "break" this again. +lack of working const], , [$ac_prog], , AC_DEFINE(const,))])dnl +dnl +dnl +dnl checks for operating system services +dnl +dnl +define(AC_HAVE_POUNDBANG, [dnl +AC_CHECKING(whether \`[#]!' works in shell scripts) +echo '#!/bin/cat +exit 69 +' > conftest +chmod u+x conftest +(SHELL=/bin/sh; export SHELL; ./conftest > /dev/null) +if test $? -ne 69; then + :; $1 +else + :; $2 +fi +rm -f conftest +])dnl +define(AC_REMOTE_TAPE, +[AC_CHECKING(for remote tape and socket header files) +AC_HEADER_CHECK(sys/mtio.h, AC_DEFINE(HAVE_SYS_MTIO_H) ac_have_mtio_h=1) +if test -n "$ac_have_mtio_h"; then +AC_TEST_CPP([#include +#include ], PROGS="$PROGS rmt") +fi +])dnl +dnl +define(AC_LONG_FILE_NAMES, +[AC_CHECKING(for long file names) +ac_some_dir_failed=false +# Test for long file names in all the places we know might matter: +# . the current directory, where building will happen +# /tmp where it might want to write temporary files +# /var/tmp likewise +# /usr/tmp likewise +# $prefix/lib where we will be installing things +# $exec_prefix/lib likewise +# eval it to expand exec_prefix. +for ac_dir in `eval echo . /tmp /var/tmp /usr/tmp $prefix/lib $exec_prefix/lib` ; do + test -d $ac_dir || continue + test -w $ac_dir || continue # It's less confusing to not echo anything here. + (echo 1 > $ac_dir/conftest9012345) 2>/dev/null + (echo 2 > $ac_dir/conftest9012346) 2>/dev/null + val=`cat $ac_dir/conftest9012345 2>/dev/null` + test -f $ac_dir/conftest9012345 && test "$val" = 1 || ac_some_dir_failed=true + rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2> /dev/null +done +$ac_some_dir_failed || AC_DEFINE(HAVE_LONG_FILE_NAMES) +])dnl +dnl +define(AC_RESTARTABLE_SYSCALLS, +[AC_CHECKING(for restartable system calls) +AC_TEST_PROGRAM( +[/* Exit 0 (true) if wait returns something other than -1, + i.e. the pid of the child, which means that wait was restarted + after getting the signal. */ +#include +#include +ucatch (isig) { } +main () { + int i = fork (), status; + if (i == 0) { sleep (3); kill (getppid (), SIGINT); sleep (3); exit (0); } + signal (SIGINT, ucatch); + status = wait(&i); + if (status == -1) wait(&i); + exit (status == -1); +} +], AC_DEFINE(HAVE_RESTARTABLE_SYSCALLS)) +])dnl +dnl +define(AC_FIND_X, +[AC_REQUIRE_CPP()dnl Set CPP; we run AC_FIND_X_DIRECT conditionally. +AC_PROVIDE([$0])# If we find X, set shell vars x_includes and x_libraries to the paths. +no_x=true +if test "x$with_x" != xno; then +AC_FIND_X_XMKMF +if test -z "$ac_im_usrlibdir"; then +AC_FIND_X_DIRECT +fi +test -n "$x_includes" && AC_VERBOSE(X11 headers are in $x_includes) +test -n "$x_libraries" && AC_VERBOSE(X11 libraries are in $x_libraries) +fi +])dnl +dnl +dnl Internal subroutine of AC_FIND_X. +define(AC_FIND_X_XMKMF, +[AC_CHECKING(for X include and library files with xmkmf) +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 + no_x= + # GNU make sometimes prints "make[1]: Entering...", which would confuse us. + eval `make acfindx 2>/dev/null | grep -v make` + # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. + if test ! -f $ac_im_usrlibdir/libX11.a && test -f $ac_im_libdir/libX11.a + then + ac_im_usrlibdir=$ac_im_libdir + fi + case "$ac_im_incroot" in + /usr/include) ;; + *) test -z "$x_includes" && x_includes="$ac_im_incroot" ;; + esac + case "$ac_im_usrlibdir" in + /usr/lib | /lib) ;; + *) test -z "$x_libraries" && x_libraries="$ac_im_usrlibdir" ;; + esac + fi + cd .. + rm -fr conftestdir +fi +])dnl +dnl +dnl Internal subroutine of AC_FIND_X. +define(AC_FIND_X_DIRECT, +[AC_CHECKING(for X include and library files directly) +if test ".$x_direct_test_library" = . ; then + x_direct_test_library='Xt' +fi +if test ".$x_direct_test_include" = . ; then + x_direct_test_include='X11/Intrinsic.h' +fi +AC_TEST_CPP([#include <$x_direct_test_include>], no_x=, + for ac_dir in \ + /usr/X11R6/include \ + /usr/X11R5/include \ + /usr/X11R4/include \ + \ + /usr/include/X11R6 \ + /usr/include/X11R5 \ + /usr/include/X11R4 \ + \ + /usr/local/X11R6/include \ + /usr/local/X11R5/include \ + /usr/local/X11R4/include \ + \ + /usr/local/include/X11R6 \ + /usr/local/include/X11R5 \ + /usr/local/include/X11R4 \ + \ + /usr/X11/include \ + /usr/include/X11 \ + /usr/local/X11/include \ + /usr/local/include/X11 \ + \ + /usr/X386/include \ + /usr/x386/include \ + /usr/XFree86/include/X11 \ + \ + /usr/include \ + /usr/local/include \ + /usr/unsupported/include \ + /usr/athena/include \ + /usr/local/x11r5/include \ + /usr/lpp/Xamples/include \ + \ + /usr/openwin/include \ + /usr/openwin/share/include \ + ; \ + do + if test -r "$ac_dir/$x_direct_test_include"; then + test -z "$x_includes" && x_includes=$ac_dir + no_x= + break + fi + done) + +# Check for the libraries. First see if replacing the `include' by +# `lib' works. +AC_HAVE_LIBRARY("$x_direct_test_library", no_x=, +for ac_dir in `echo "$x_includes" | sed s/include/lib/` \ + /usr/X11R6/lib \ + /usr/X11R5/lib \ + /usr/X11R4/lib \ + \ + /usr/lib/X11R6 \ + /usr/lib/X11R5 \ + /usr/lib/X11R4 \ + \ + /usr/local/X11R6/lib \ + /usr/local/X11R5/lib \ + /usr/local/X11R4/lib \ + \ + /usr/local/lib/X11R6 \ + /usr/local/lib/X11R5 \ + /usr/local/lib/X11R4 \ + \ + /usr/X11/lib \ + /usr/lib/X11 \ + /usr/local/X11/lib \ + /usr/local/lib/X11 \ + \ + /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 \ + \ + /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 + test -z "$x_libraries" && x_libraries=$ac_dir + no_x= + break 2 + fi + done +done)])dnl +dnl +dnl Find additional X libraries, magic flags, etc. +define(AC_FIND_XTRA, [AC_REQUIRE([AC_ISC_POSIX])AC_REQUIRE([AC_FIND_X]) +AC_CHECKING(for additional X libraries and flags) +if test -n "$x_includes"; then + X_CFLAGS="$X_CFLAGS -I$x_includes" +elif test -n "$no_x"; then + # Not all programs may use this symbol, but it won't hurt to define it. + X_CFLAGS="$X_CFLAGS -DX_DISPLAY_MISSING" +fi + +# It would be nice to have a more robust check for the -R ld option than +# just checking for Solaris. +# 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" + if test "`(uname) 2>/dev/null`" = SunOS \ + && uname -r | grep '^5' >/dev/null; then + X_LIBS="$X_LIBS -R$x_libraries" + fi +fi + +# Check for additional X libraries. + +if test -n "$ISC"; 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's Alpha + # needs dnet_stub (dnet doesn't exist). + AC_HAVE_LIBRARY(dnet, + [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" + ac_have_dnet=t]) + if test -z "$ac_have_dnet"; then + AC_HAVE_LIBRARY(dnet_stub, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"]) + 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, according to simon@lia.di.epfl.ch. + if test "`(uname) 2>/dev/null`" != IRIX; then + AC_HAVE_LIBRARY(socket, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lsocket"]) + fi +fi +# +AC_VERBOSE(X compiler flags: $X_CFLAGS) +AC_VERBOSE(X library flags: $X_LIBS) +AC_VERBOSE(extra X libraries: $X_EXTRA_LIBS) +AC_SUBST(X_CFLAGS)dnl +AC_SUBST(X_LIBS)dnl +AC_SUBST(X_EXTRA_LIBS)dnl +])dnl +dnl +dnl +dnl checks for UNIX variants +dnl +dnl +define(AC_AIX, +[AC_CHECKING(for AIX) +AC_BEFORE([$0], [AC_COMPILE_CHECK])AC_BEFORE([$0], [AC_TEST_PROGRAM])AC_BEFORE([$0], [AC_HEADER_EGREP])AC_BEFORE([$0], [AC_TEST_CPP])AC_PROGRAM_EGREP(yes, +[#ifdef _AIX + yes +#endif +], AC_DEFINE(_ALL_SOURCE)) +])dnl +dnl +define(AC_MINIX, +[AC_BEFORE([$0], [AC_COMPILE_CHECK])AC_BEFORE([$0], [AC_TEST_PROGRAM])AC_BEFORE([$0], [AC_HEADER_EGREP])AC_BEFORE([$0], [AC_TEST_CPP])AC_HEADER_CHECK(minix/config.h, MINIX=1) +# The Minix shell can't assign to the same variable on the same line! +if test -n "$MINIX"; then + AC_DEFINE(_POSIX_SOURCE) + AC_DEFINE(_POSIX_1_SOURCE, 2) + AC_DEFINE(_MINIX) +fi +])dnl +dnl +define(AC_ISC_POSIX, +[AC_PROVIDE([$0])AC_BEFORE([$0], [AC_COMPILE_CHECK])AC_BEFORE([$0], [AC_TEST_PROGRAM])AC_BEFORE([$0], [AC_HEADER_EGREP])AC_BEFORE([$0], [AC_TEST_CPP])AC_CHECKING(for POSIXized ISC) +if test -d /etc/conf/kconfig.d && + grep _POSIX_VERSION [/usr/include/sys/unistd.h] >/dev/null 2>&1 +then + ISC=1 # If later tests want to check for ISC. + AC_DEFINE(_POSIX_SOURCE) + if test -n "$GCC"; then + CC="$CC -posix" + else + CC="$CC -Xp" + fi +fi +])dnl +dnl +define(AC_XENIX_DIR, +[AC_REQUIRE([AC_DIR_HEADER])AC_CHECKING(for Xenix) +AC_PROGRAM_EGREP(yes, +[#if defined(M_XENIX) && !defined(M_UNIX) + yes +#endif +], XENIX=1) +if test -n "$XENIX"; then + LIBS="$LIBS -lx" + case "$DEFS" in + *SYSNDIR*) ;; + *) LIBS="-ldir $LIBS" ;; # Make sure -ldir precedes any -lx. + esac +fi +])dnl +dnl +define(AC_SCO_INTL, +[AC_HAVE_LIBRARY(intl, LIBS="$LIBS -lintl") +])dnl +dnl +define(AC_IRIX_SUN, +[AC_HAVE_LIBRARY(sun, LIBS="$LIBS -lsun") +])dnl +dnl +define(AC_DYNIX_SEQ, +[AC_HAVE_LIBRARY(seq, LIBS="$LIBS -lseq") +])dnl +dnl +define(AC_STAT_MACROS_BROKEN,[AC_CHECKING(for broken stat file mode macros) +AC_PROGRAM_EGREP([You lose], [#include +#include +#ifdef S_ISBLK +#if S_ISBLK (S_IFDIR) +You lose. +#endif +#ifdef S_IFCHR +#if S_ISBLK (S_IFCHR) +You lose. +#endif +#endif /* S_IFCHR */ +#endif /* S_ISBLK */ +#ifdef S_ISLNK +#if S_ISLNK (S_IFREG) +You lose. +#endif +#endif /* S_ISLNK */ +#ifdef S_ISSOCK +#if S_ISSOCK (S_IFREG) +You lose. +#endif +#endif /* S_ISSOCK */ +], AC_DEFINE(STAT_MACROS_BROKEN))])dnl +dnl +dnl +define(AC_SYS_SIGLIST_DECLARED,[dnl +AC_COMPILE_CHECK(sys_siglist declaration in signal.h or unistd.h, + [#include +/* NetBSD declares sys_siglist in . */ +#ifdef HAVE_UNISTD_H +#include +#endif], [char *msg = *(sys_siglist + 1);], + AC_DEFINE(SYS_SIGLIST_DECLARED))])dnl +dnl diff -r 11c6df210d7f -r 56c54cf7c5b6 lib-src/movemail.c --- a/lib-src/movemail.c Mon Aug 13 08:55:32 2007 +0200 +++ b/lib-src/movemail.c Mon Aug 13 08:56:04 2007 +0200 @@ -1,6 +1,6 @@ /* movemail foo bar -- move file foo to file bar, locking file foo the way /bin/mail respects. - Copyright (C) 1986, 1992, 1993, 1994 Free Software Foundation, Inc. + Copyright (C) 1986, 1992, 1993, 1994, 1996 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -16,11 +16,9 @@ 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 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Synched up with: FSF 19.28. */ - /* Important notice: defining MAIL_USE_FLOCK or MAIL_USE_LOCKF *will cause loss of mail* if you do it on a system that does not normally use flock as its way of interlocking access to inbox files. The @@ -36,7 +34,7 @@ /* * Modified January, 1986 by Michael R. Gretzinger (Project Athena) * - * Added POP (Post Office Protocol) service. When compiled -DPOP + * Added POP (Post Office Protocol) service. When compiled -DMAIL_USE_POP * movemail will accept input filename arguments of the form * "po:username". This will cause movemail to open a connection to * a pop server running on $MAILHOST (environment variable). Movemail @@ -49,32 +47,54 @@ * New routines in movemail.c: * get_errmsg - return pointer to system error message * + * Modified August, 1993 by Jonathan Kamens (OpenVision Technologies) + * + * Move all of the POP code into a separate file, "pop.c". + * Use strerror instead of get_errmsg. + * */ #define NO_SHORTNAMES /* Tell config not to load remap.h */ #include <../src/config.h> -#include -#include -#include /* for time() */ -#include /* for printf() */ -#include /* strcpy() */ - #include #include #include +#include #include #include <../src/syswait.h> +#include +#include +#ifdef MAIL_USE_POP +#include "pop.h" +#endif #ifdef MSDOS #undef access #endif /* MSDOS */ +#ifndef DIRECTORY_SEP +#define DIRECTORY_SEP '/' +#endif +#ifndef IS_DIRECTORY_SEP +#define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP) +#endif + +#ifdef WINDOWSNT +#undef access +#undef unlink +#define fork() 0 +#define sys_wait(var) (*(var) = 0) +/* Unfortunately, Samba doesn't seem to properly lock Unix files even + though the locking call succeeds (and indeed blocks local access from + other NT programs). If you have direct file access using an NFS + client or something other than Samba, the locking call might work + properly - make sure it does before you enable this! */ +#define DISABLE_DIRECT_ACCESS +#endif /* WINDOWSNT */ + #ifdef USG #include #include -#if defined (sun) -#include -#endif /* sun */ #ifndef F_OK #define F_OK 0 #define X_OK 1 @@ -87,7 +107,7 @@ #include #endif -#ifdef XENIX +#if defined (XENIX) || defined (WINDOWSNT) #include #endif @@ -109,25 +129,27 @@ #undef write #undef close -static char *concat (CONST char *s1, CONST char *s2, CONST char *s3); -static void *xmalloc (unsigned int size); #ifndef errno extern int errno; #endif +char *strerror (); -static void error (CONST char *s1, CONST char *s2, CONST char *s3); -static void fatal (CONST char *s1, CONST char *s2); -static void pfatal_with_name (CONST char *name); -static void pfatal_and_delete (CONST char *name); - -#ifndef HAVE_STRERROR -char *strerror (int); -#endif +void fatal (char *, char*); +void error (); +void pfatal_with_name (); +void pfatal_and_delete (); +char *concat (); +long *xmalloc (); +int popmail (); +int pop_retr (); +int mbx_write (); +int mbx_delimit_begin (); +int mbx_delimit_end (); /* Nonzero means this is name of a lock file to delete on fatal error. */ char *delete_lockname; -void +int main (argc, argv) int argc; char **argv; @@ -149,7 +171,10 @@ delete_lockname = 0; if (argc < 3) - fatal ("two arguments required", ""); + { + fprintf (stderr, "Usage: movemail inbox destfile [POP-password]\n"); + exit(1); + } inname = argv[1]; outname = argv[2]; @@ -158,17 +183,20 @@ mmdf_init (argv[0]); #endif + if (*outname == 0) + fatal ("Destination file name is empty", 0); + /* Check access to output file. */ if (access (outname, F_OK) == 0 && access (outname, W_OK) != 0) pfatal_with_name (outname); - /* Also check that outname's directory is writeable to the real uid. */ + /* Also check that outname's directory is writable to the real uid. */ { char *buf = (char *) xmalloc (strlen (outname) + 1); char *p; strcpy (buf, outname); p = buf + strlen (buf); - while (p > buf && p[-1] != '/') + while (p > buf && !IS_DIRECTORY_SEP (p[-1])) *--p = 0; if (p == buf) *p++ = '.'; @@ -178,28 +206,26 @@ } #ifdef MAIL_USE_POP - if (!memcmp (inname, "po:", 3)) + if (!strncmp (inname, "po:", 3)) { - int status; char *user; + int status; - for (user = &inname[strlen (inname) - 1]; user >= inname; user--) - if (*user == ':') - break; - - status = popmail (user, outname); + status = popmail (inname + 3, outname, argc > 3 ? argv[3] : NULL); exit (status); } setuid (getuid ()); #endif /* MAIL_USE_POP */ +#ifndef DISABLE_DIRECT_ACCESS + /* Check access to input file. */ if (access (inname, R_OK | W_OK) != 0) pfatal_with_name (inname); #ifndef MAIL_USE_MMDF #ifndef MAIL_USE_SYSTEM_LOCK - /* Use a lock file named /usr/spool/mail/$USER.lock: + /* Use a lock file named after our first argument with .lock appended: If it exists, the mail file is locked. */ /* Note: this locking mechanism is *required* by the mailer (on systems which use it) to prevent loss of mail. @@ -208,7 +234,7 @@ WILL occasionally cause loss of mail due to timing errors! So, if creation of the lock file fails - due to access permission on /usr/spool/mail, + due to access permission on the mail spool directory, you simply MUST change the permission and/or make movemail a setgid program so it can create lock files properly. @@ -226,7 +252,7 @@ tempname = (char *) xmalloc (strlen (inname) + strlen ("EXXXXXX") + 1); strcpy (tempname, inname); p = tempname + strlen (tempname); - while (p != tempname && p[-1] != '/') + while (p != tempname && !IS_DIRECTORY_SEP (p[-1])) p--; *p = 0; strcpy (p, "EXXXXXX"); @@ -239,7 +265,12 @@ /* Give up if cannot do that. */ desc = open (tempname, O_WRONLY | O_CREAT | O_EXCL, 0666); if (desc < 0) - pfatal_with_name ("lock file--see source file lib-src/movemail.c"); + { + char *message = (char *) xmalloc (strlen (tempname) + 50); + sprintf (message, "%s--see source file lib-src/movemail.c", + tempname); + pfatal_with_name (message); + } close (desc); tem = link (tempname, lockname); @@ -248,12 +279,15 @@ break; sleep (1); - /* If lock file is a minute old, unlock it. */ + /* If lock file is five minutes old, unlock it. + Five minutes should be good enough to cope with crashes + and wedgitude, and long enough to avoid being fooled + by time differences between machines. */ if (stat (lockname, &st) >= 0) { now = time (0); - if (st.st_ctime < now - 60) - unlink (lockname); + if (st.st_ctime < now - 300) + unlink (lockname); } } @@ -295,8 +329,12 @@ #ifdef XENIX if (locking (indesc, LK_RLCK, 0L) < 0) pfatal_with_name (inname); #else +#ifdef WINDOWSNT + if (locking (indesc, LK_RLCK, -1L) < 0) pfatal_with_name (inname); +#else if (flock (indesc, LOCK_EX) < 0) pfatal_with_name (inname); #endif +#endif #endif /* not MAIL_USE_LOCKF */ #endif /* MAIL_USE_SYSTEM_LOCK */ @@ -328,7 +366,7 @@ pfatal_and_delete (outname); #ifdef MAIL_USE_SYSTEM_LOCK -#if defined (STRIDE) || defined (XENIX) +#if defined (STRIDE) || defined (XENIX) || defined (WINDOWSNT) /* Stride, xenix have file locking, but no ftruncate. This mess will do. */ close (open (inname, O_CREAT | O_TRUNC | O_RDWR, 0666)); #else @@ -365,58 +403,57 @@ #if !defined (MAIL_USE_MMDF) && !defined (MAIL_USE_SYSTEM_LOCK) unlink (lockname); #endif /* not MAIL_USE_MMDF and not MAIL_USE_SYSTEM_LOCK */ - exit (0); + +#endif /* ! DISABLE_DIRECT_ACCESS */ + + return 0; } /* Print error message and exit. */ -static void +void fatal (s1, s2) - CONST char *s1, *s2; + char *s1, *s2; { if (delete_lockname) - error (s1, s2, ""); unlink (delete_lockname); + error (s1, s2); exit (1); } /* Print error message. `s1' is printf control string, `s2' is arg for it. */ -static void +void error (s1, s2, s3) - CONST char *s1, *s2, *s3; + char *s1, *s2, *s3; { - printf ("movemail: "); - printf (s1, s2, s3); - printf ("\n"); + fprintf (stderr, "movemail: "); + fprintf (stderr, s1, s2, s3); + fprintf (stderr, "\n"); } -static void +void pfatal_with_name (name) - CONST char *name; + char *name; { - char *s; - - s = concat ("", strerror (errno), " for %s"); + char *s = concat ("", strerror (errno), " for %s"); fatal (s, name); } -static void +void pfatal_and_delete (name) - CONST char *name; + char *name; { - char *s; - - s = concat ("", strerror (errno), " for %s"); + char *s = concat ("", strerror (errno), " for %s"); unlink (name); fatal (s, name); } /* Return a newly-allocated string whose contents concatenate those of s1, s2, s3. */ -static char * +char * concat (s1, s2, s3) - CONST char *s1, *s2, *s3; + char *s1, *s2, *s3; { int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3); char *result = (char *) xmalloc (len1 + len2 + len3 + 1); @@ -431,13 +468,13 @@ /* Like malloc but get fatal error if memory is exhausted. */ -static void * +long * xmalloc (size) - unsigned int size; + unsigned size; { - void *result = (void *) malloc (size); + long *result = (long *) malloc (size); if (!result) - fatal ("virtual memory exhausted", (char *) 0); + fatal ("virtual memory exhausted", 0); return result; } @@ -445,9 +482,14 @@ #ifdef MAIL_USE_POP +#ifndef WINDOWSNT #include #include #include +#else +#undef _WINSOCKAPI_ +#include +#endif #include #include @@ -467,344 +509,197 @@ char *progname; FILE *sfi; FILE *sfo; +char ibuffer[BUFSIZ]; +char obuffer[BUFSIZ]; char Errmsg[80]; -static int debug = 0; - -char *get_errmsg (); -char *getenv (); -int mbx_write (); - -int -popmail (user, outfile) +popmail (user, outfile, password) char *user; char *outfile; + char *password; { - char *host; int nmsgs, nbytes; - char response[128]; register int i; int mbfi; FILE *mbf; - struct passwd *pw = (struct passwd *) getpwuid (getuid ()); - if (pw == NULL) - fatal ("cannot determine user name"); + char *getenv (); + int mbx_write (); + popserver server; + extern char *strerror (); - host = getenv ("MAILHOST"); - if (host == NULL) + server = pop_open (0, user, password, POP_NO_GETPASS); + if (! server) { - fatal ("no MAILHOST defined"); - } - - if (pop_init (host) == NOTOK) - { - fatal (Errmsg); + error (pop_error); + return (1); } - if (getline (response, sizeof response, sfi) != OK) - { - fatal (response); - } - - if (pop_command ("USER %s", user) == NOTOK - || pop_command ("RPOP %s", pw->pw_name) == NOTOK) + if (pop_stat (server, &nmsgs, &nbytes)) { - pop_command ("QUIT"); - fatal (Errmsg); - } - - if (pop_stat (&nmsgs, &nbytes) == NOTOK) - { - pop_command ("QUIT"); - fatal (Errmsg); + error (pop_error); + return (1); } if (!nmsgs) - { - pop_command ("QUIT"); - return 0; - } + { + pop_close (server); + return (0); + } mbfi = open (outfile, O_WRONLY | O_CREAT | O_EXCL, 0666); if (mbfi < 0) - { - pop_command ("QUIT"); - pfatal_and_delete (outfile); - } + { + pop_close (server); + error ("Error in open: %s, %s", strerror (errno), outfile); + return (1); + } fchown (mbfi, getuid (), -1); - if ((mbf = fdopen (mbfi, "w")) == NULL) + if ((mbf = fdopen (mbfi, "wb")) == NULL) { - pop_command ("QUIT"); - pfatal_and_delete (outfile); + pop_close (server); + error ("Error in fdopen: %s", strerror (errno)); + close (mbfi); + unlink (outfile); + return (1); } - for (i = 1; i <= nmsgs; i++) + for (i = 1; i <= nmsgs; i++) { mbx_delimit_begin (mbf); - if (pop_retr (i, mbx_write, mbf) != OK) - { - pop_command ("QUIT"); - close (mbfi); - unlink (outfile); - fatal (Errmsg); - } + if (pop_retr (server, i, mbx_write, mbf) != OK) + { + error (Errmsg); + close (mbfi); + return (1); + } mbx_delimit_end (mbf); fflush (mbf); + if (ferror (mbf)) + { + error ("Error in fflush: %s", strerror (errno)); + pop_close (server); + close (mbfi); + return (1); + } } + /* On AFS, a call to write only modifies the file in the local + * workstation's AFS cache. The changes are not written to the server + * until a call to fsync or close is made. Users with AFS home + * directories have lost mail when over quota because these checks were + * not made in previous versions of movemail. */ + +#ifdef BSD if (fsync (mbfi) < 0) { - pop_command ("QUIT"); - pfatal_and_delete (outfile); + error ("Error in fsync: %s", strerror (errno)); + return (1); } +#endif if (close (mbfi) == -1) { - pop_command ("QUIT"); - pfatal_and_delete (outfile); + error ("Error in close: %s", strerror (errno)); + return (1); } - for (i = 1; i <= nmsgs; i++) + for (i = 1; i <= nmsgs; i++) { - if (pop_command ("DELE %d", i) == NOTOK) - { - /* Better to ignore this failure. */ - } + if (pop_delete (server, i)) + { + error (pop_error); + pop_close (server); + return (1); + } } - pop_command ("QUIT"); + if (pop_quit (server)) + { + error (pop_error); + return (1); + } + return (0); } -int -pop_init (host) - char *host; +pop_retr (server, msgno, action, arg) + popserver server; + int (*action)(); { - register struct hostent *hp; - register struct servent *sp; - int lport = IPPORT_RESERVED - 1; - struct sockaddr_in sin; - register int s; - - hp = gethostbyname (host); - if (hp == NULL) - { - sprintf (Errmsg, "MAILHOST unknown: %s", host); - return NOTOK; - } + extern char *strerror (); + char *line; + int ret; - sp = getservbyname ("pop", "tcp"); - if (sp == 0) - { - strcpy (Errmsg, "tcp/pop: unknown service"); - return NOTOK; - } - - sin.sin_family = hp->h_addrtype; - memcpy ((char *)&sin.sin_addr, hp->h_addr, hp->h_length); - sin.sin_port = sp->s_port; - s = rresvport (&lport); - if (s < 0) - { - sprintf (Errmsg, "error creating socket: %s", get_errmsg ()); - return NOTOK; - } - - if (connect (s, (char *)&sin, sizeof sin) < 0) - { - sprintf (Errmsg, "error during connect: %s", get_errmsg ()); - close (s); - return NOTOK; - } - - sfi = fdopen (s, "r"); - sfo = fdopen (s, "w"); - if (sfi == NULL || sfo == NULL) + if (pop_retrieve_first (server, msgno, &line)) { - sprintf (Errmsg, "error in fdopen: %s", get_errmsg ()); - close (s); - return NOTOK; - } - - return OK; -} - -int -pop_command (fmt, a, b, c, d) - char *fmt; -{ - char buf[128]; - char errmsg[64]; - - sprintf (buf, fmt, a, b, c, d); - - if (debug) fprintf (stderr, "---> %s\n", buf); - if (putline (buf, Errmsg, sfo) == NOTOK) return NOTOK; - - if (getline (buf, sizeof buf, sfi) != OK) - { - strcpy (Errmsg, buf); - return NOTOK; - } - - if (debug) fprintf (stderr, "<--- %s\n", buf); - if (*buf != '+') - { - strcpy (Errmsg, buf); - return NOTOK; - } - else - { - return OK; - } -} - - -pop_stat (nmsgs, nbytes) - int *nmsgs, *nbytes; -{ - char buf[128]; - - if (debug) fprintf (stderr, "---> STAT\n"); - if (putline ("STAT", Errmsg, sfo) == NOTOK) - return NOTOK; - - if (getline (buf, sizeof buf, sfi) != OK) - { - strcpy (Errmsg, buf); - return NOTOK; + strncpy (Errmsg, pop_error, sizeof (Errmsg)); + Errmsg[sizeof (Errmsg)-1] = '\0'; + return (NOTOK); } - if (debug) fprintf (stderr, "<--- %s\n", buf); - if (*buf != '+') + while (! (ret = pop_retrieve_next (server, &line))) { - strcpy (Errmsg, buf); - return NOTOK; - } - else - { - sscanf (buf, "+OK %d %d", nmsgs, nbytes); - return OK; - } -} + if (! line) + break; -pop_retr (msgno, action, arg) - int (*action)(); -{ - char buf[128]; - - sprintf (buf, "RETR %d", msgno); - if (debug) fprintf (stderr, "%s\n", buf); - if (putline (buf, Errmsg, sfo) == NOTOK) return NOTOK; - - if (getline (buf, sizeof buf, sfi) != OK) - { - strcpy (Errmsg, buf); - return NOTOK; + if ((*action)(line, arg) != OK) + { + strcpy (Errmsg, strerror (errno)); + pop_close (server); + return (NOTOK); + } } - while (1) + if (ret) { - switch (multiline (buf, sizeof buf, sfi)) - { - case OK: - (*action)(buf, arg); - break; - case DONE: - return OK; - case NOTOK: - strcpy (Errmsg, buf); - return NOTOK; - } + strncpy (Errmsg, pop_error, sizeof (Errmsg)); + Errmsg[sizeof (Errmsg)-1] = '\0'; + return (NOTOK); } + + return (OK); } -getline (buf, n, f) - char *buf; - register int n; - FILE *f; -{ - register char *p; - int c; - - p = buf; - while (--n > 0 && (c = fgetc (f)) != EOF) - if ((*p++ = c) == '\n') break; - - if (ferror (f)) - { - strcpy (buf, "error on connection"); - return NOTOK; - } - - if (c == EOF && p == buf) - { - strcpy (buf, "connection closed by foreign host"); - return DONE; - } - - *p = NULL; - if (*--p == '\n') *p = NULL; - if (*--p == '\r') *p = NULL; - return OK; -} +/* Do this as a macro instead of using strcmp to save on execution time. */ +#define IS_FROM_LINE(a) ((a[0] == 'F') \ + && (a[1] == 'r') \ + && (a[2] == 'o') \ + && (a[3] == 'm') \ + && (a[4] == ' ')) -multiline (buf, n, f) - char *buf; - register int n; - FILE *f; -{ - if (getline (buf, n, f) != OK) return NOTOK; - if (*buf == '.') - { - if (*(buf+1) == NULL) - return DONE; - else - strcpy (buf, buf+1); - } - return OK; -} - -char * -get_errmsg () -{ - return strerror (errno); -} - -putline (buf, err, f) - char *buf; - char *err; - FILE *f; -{ - fprintf (f, "%s\r\n", buf); - fflush (f); - if (ferror (f)) - { - strcpy (err, "lost connection"); - return NOTOK; - } - return OK; -} - +int mbx_write (line, mbf) char *line; FILE *mbf; { - fputs (line, mbf); - fputc (0x0a, mbf); + if (IS_FROM_LINE (line)) + { + if (fputc ('>', mbf) == EOF) + return (NOTOK); + } + if (fputs (line, mbf) == EOF) + return (NOTOK); + if (fputc (0x0a, mbf) == EOF) + return (NOTOK); + return (OK); } +int mbx_delimit_begin (mbf) FILE *mbf; { - fputs ("\f\n0, unseen,,\n", mbf); + if (fputs ("\f\n0, unseen,,\n", mbf) == EOF) + return (NOTOK); + return (OK); } mbx_delimit_end (mbf) FILE *mbf; { - putc ('\037', mbf); + if (putc ('\037', mbf) == EOF) + return (NOTOK); + return (OK); } #endif /* MAIL_USE_POP */ diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/bytecomp/byte-optimize.el --- a/lisp/bytecomp/byte-optimize.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/bytecomp/byte-optimize.el Mon Aug 13 08:56:04 2007 +0200 @@ -649,8 +649,10 @@ ;; (byte-optimize-two-args-right form) ;; form)) +;; jwz: (byte-optimize-approx-equal 0.0 0.0) was returning nil +;; in xemacs 19.15 because it used < instead of <=. (defun byte-optimize-approx-equal (x y) - (< (* (abs (- x y)) 100) (abs (+ x y)))) + (<= (* (abs (- x y)) 100) (abs (+ x y)))) ;; Collect all the constants from FORM, after the STARTth arg, ;; and apply FUN to them to make one argument at the end. @@ -697,6 +699,22 @@ (condition-case () (eval form) (error form))) + + ;; `add1' and `sub1' are a marginally fewer instructions + ;; than `plus' and `minus', so use them when possible. + ((and (null (nthcdr 3 form)) + (eq (nth 2 form) 1)) + (list '1+ (nth 1 form))) ; (+ x 1) --> (1+ x) + ((and (null (nthcdr 3 form)) + (eq (nth 1 form) 1)) + (list '1+ (nth 2 form))) ; (+ 1 x) --> (1+ x) + ((and (null (nthcdr 3 form)) + (eq (nth 2 form) -1)) + (list '1- (nth 1 form))) ; (+ x -1) --> (1- x) + ((and (null (nthcdr 3 form)) + (eq (nth 1 form) -1)) + (list '1- (nth 2 form))) ; (+ -1 x) --> (1- x) + ;;; It is not safe to delete the function entirely ;;; (actually, it would be safe if we know the sole arg ;;; is not a marker). @@ -717,6 +735,7 @@ (numberp last)) (setq form (nconc (list '- (- (nth 1 form) last) (nth 2 form)) (delq last (copy-sequence (nthcdr 3 form)))))))) + (setq form ;;; It is not safe to delete the function entirely ;;; (actually, it would be safe if we know the sole arg ;;; is not a marker). @@ -728,6 +747,18 @@ (cons (car form) (cdr (cdr form))) form)) ;;; ) + ) + + ;; `add1' and `sub1' are a marginally fewer instructions than `plus' + ;; and `minus', so use them when possible. + (cond ((and (null (nthcdr 3 form)) + (eq (nth 2 form) 1)) + (list '1- (nth 1 form))) ; (- x 1) --> (1- x) + ((and (null (nthcdr 3 form)) + (eq (nth 2 form) -1)) + (list '1+ (nth 1 form))) ; (- x -1) --> (1+ x) + (t + form)) ) (defun byte-optimize-multiply (form) diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/calendar/appt.el --- a/lisp/calendar/appt.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/calendar/appt.el Mon Aug 13 08:56:04 2007 +0200 @@ -685,40 +685,41 @@ ;;; Patching in to existing time code to install our hook. -(defvar display-time-hook nil - "*List of functions to be called when the time is updated on the mode line.") - -(setq display-time-hook 'appt-check) (defvar display-time-hook-installed nil) (defun install-display-time-hook () - (if display-time-hook-installed ;; only do this stuff once! - nil - (let ((old-fn (if (or (featurep 'reportmail) - ;; old reportmail without a provide statement - (and (fboundp 'display-time-filter-18-55) - (fboundp 'display-time-filter-18-57))) - (if (and (featurep 'itimer) ; XEmacs reportmail.el - (fboundp 'display-time-timer-function)) - 'display-time-timer-function - ;; older reportmail, or no timer.el. - (if (string-match "18\\.5[0-5]" (emacs-version)) - 'display-time-filter-18-55 - 'display-time-filter-18-57)) - ;; othewise, time.el - (if (and (featurep 'itimer) - (fboundp 'display-time-function)) ; XEmacs - 'display-time-function - 'display-time-filter)))) + (unless display-time-hook-installed ; only do this stuff once! + (unless (boundp 'display-time-hook) ; Need to wrapper it. + (defvar display-time-hook nil + "*List of functions to be called when the time is updated on the mode line.") + (let ((old-fn (if (or (featurep 'reportmail) + ;; old reportmail without a provide statement + (and (fboundp 'display-time-filter-18-55) + (fboundp 'display-time-filter-18-57))) + (if (and (featurep 'itimer) ; XEmacs reportmail.el + (fboundp 'display-time-timer-function)) + 'display-time-timer-function + ;; older reportmail, or no timer.el. + (if (string-match "18\\.5[0-5]" (emacs-version)) + 'display-time-filter-18-55 + 'display-time-filter-18-57)) + ;; othewise, time.el + (if (and (featurep 'itimer) + (fboundp 'display-time-function)) ; XEmacs + 'display-time-function + 'display-time-filter)))) ;; we're about to redefine it... - (fset 'old-display-time-filter (symbol-function old-fn)) - (fset old-fn - (function (lambda (&rest args) ;; ...here's the revised definition - "Revised version of the original function: this version calls a hook." - (apply 'old-display-time-filter args) - (run-hooks 'display-time-hook))))) - (setq display-time-hook-installed t) - )) + (fset 'old-display-time-filter (symbol-function old-fn)) + (fset old-fn + '(lambda (&rest args) ;; ...here's the revised definition + "Revised version of the original function: this version calls a hook." + (apply 'old-display-time-filter args) + (run-hooks 'display-time-hook))))) + (setq display-time-hook-installed t) + (if (fboundp 'add-hook) + (add-hook 'display-time-hook 'appt-check) + (setq display-time-hook (cons appt-check display-time-hook))) + )) (provide 'appt) diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/comint/comint.el --- a/lisp/comint/comint.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/comint/comint.el Mon Aug 13 08:56:04 2007 +0200 @@ -1034,7 +1034,7 @@ Returns t if successful." (interactive) (if (and comint-input-autoexpand - (string-match "[!^]" (funcall comint-get-old-input)) + (string-match "!\\|^\\^" (funcall comint-get-old-input)) (save-excursion (beginning-of-line) (looking-at comint-prompt-regexp))) ;; Looks like there might be history references in the command. diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/comint/telnet.el --- a/lisp/comint/telnet.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/comint/telnet.el Mon Aug 13 08:56:04 2007 +0200 @@ -53,6 +53,10 @@ (require 'comint) +(defgroup telnet nil + "Telnet/rsh stuff" + :group 'comint) + (defvar telnet-new-line "\r") (defvar telnet-mode-map nil) (defvar telnet-default-prompt-pattern "^[^#$%>\n]*[#$%>] *") @@ -70,8 +74,14 @@ while looking for the initial password.") ;; (make-variable-buffer-local 'telnet-count) -(defvar telnet-program "telnet" - "Program to run to open a telnet connection.") +(defcustom telnet-program "telnet" + "*Program to run to open a telnet connection." + :group 'telnet) + +(defcustom rsh-eat-password-string nil + "Non-nil means rsh will look for a string matching a password prompt." + :type 'boolean + :group 'telnet) (defvar telnet-initial-count -75 "Initial value of `telnet-count'. Should be set to the negative of the @@ -119,7 +129,7 @@ "Tries to put correct initializations in. Needs work." (let ((case-fold-search t)) (cond ((string-match "unix" string) - (setq telnet-prompt-pattern comint-prompt-regexp) + (setq telnet-prompt-pattern shell-prompt-pattern) (setq telnet-new-line "\n")) ((string-match "tops-20" string) ;;maybe add telnet-replace-c-g (setq telnet-prompt-pattern "[@>] *")) @@ -304,7 +314,9 @@ ;; ;; I disagree with the above. -sb ;; - (set-process-filter (get-process name) 'telnet-initial-filter) + (set-process-filter (get-process name) (if rsh-eat-password-string + 'telnet-initial-filter + 'telnet-filter)) ;; (set-process-filter (get-process name) 'telnet-filter) ;; run last so that hooks can change things. (telnet-mode))) diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/edebug/edebug.el --- a/lisp/edebug/edebug.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/edebug/edebug.el Mon Aug 13 08:56:04 2007 +0200 @@ -29,7 +29,7 @@ ;; LCD Archive Entry: ;; edebug|Daniel LaLiberte|liberte@cs.uiuc.edu ;; |A source level debugger for Emacs Lisp. -;; |$Date: 1997/03/02 03:42:50 $|$Revision: 1.2 $|~/modes/edebug.el| +;; |$Date: 1997/08/21 06:23:41 $|$Revision: 1.3 $|~/modes/edebug.el| ;; This minor mode allows programmers to step through Emacs Lisp ;; source code while executing functions. You can also set @@ -87,7 +87,7 @@ ;;; Code: (defconst edebug-version - (let ((raw-version "$Revision: 1.2 $")) + (let ((raw-version "$Revision: 1.3 $")) (substring raw-version (string-match "[0-9.]*" raw-version) (match-end 0)))) @@ -3715,11 +3715,8 @@ (defun edebug-compute-previous-result (edebug-previous-value) (setq edebug-previous-result - (if (and (numberp edebug-previous-value) - (< edebug-previous-value 256) - (>= edebug-previous-value 0)) - (format "Result: %s = %s" edebug-previous-value - (single-key-description edebug-previous-value)) + (if (numberp edebug-previous-value) + (format "Result: %s" edebug-previous-value) (if edebug-unwrap-results (setq edebug-previous-value (edebug-unwrap* edebug-previous-value))) diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/efs/Makefile --- a/lisp/efs/Makefile Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/efs/Makefile Mon Aug 13 08:56:04 2007 +0200 @@ -2,7 +2,7 @@ # # File: Makefile # Release: $efs release: 1.15 $ -# Version: $Revision: 1.5 $ +# Version: $Revision: 1.6 $ # RCS: # Description: Makefile for byte-compiling efs and dired. # Author: Andy Norman, HPLabs, Bristol, UK. @@ -145,7 +145,7 @@ .el.elc: BDIR=$(BDIR) CWD=$(CWD) VMDIR=$(VMDIR) \ - $(EMACS) -batch -l $(CWD)/fixup -f batch-byte-compile $(CWD)/$< + $(EMACS) -batch -no-site-file -l $(CWD)/fixup -f batch-byte-compile $(CWD)/$< .texi.info: $(EMACS) -batch -f batch-texinfo-format $(CWD)/$< diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/efs/default-dir.el --- a/lisp/efs/default-dir.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/efs/default-dir.el Mon Aug 13 08:56:04 2007 +0200 @@ -340,22 +340,23 @@ 'default-dir-view-file-other-frame))) -(defun default-dir-shell-command (command &optional insert) +(defun default-dir-shell-command (command &optional output-buffer) "Documented as original" (interactive (list (let ((prompt (format "Shell command in %s: " (default-directory)))) (cond - ((memq default-dir-emacs-variant '(fsf-19 xemacs)) - (read-from-minibuffer prompt nil nil nil - 'shell-command-history)) + ((eq default-dir-emacs-variant 'xemacs) + (read-shell-command "Shell command: ")) + ((eq default-dir-emacs-variant 'fsf-19) + (read-from-minibuffer prompt nil nil nil 'shell-command-history)) ((featurep 'gmhist) (let ((minibuffer-history-symbol 'shell-command-history)) (read-string prompt))) (t (read-string prompt)))) current-prefix-arg)) (let ((default-directory (expand-file-name (default-directory)))) - (default-dir-real-shell-command command insert))) + (default-dir-real-shell-command command output-buffer))) (efs-overwrite-fn "default-dir" 'shell-command 'default-dir-shell-command) diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/efs/dired-faces.el --- a/lisp/efs/dired-faces.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/efs/dired-faces.el Mon Aug 13 08:56:04 2007 +0200 @@ -16,7 +16,7 @@ (defgroup dired nil "Directory editing." - :group 'emacs) + :group 'environment) (defcustom dired-do-highlighting t "Set if we should use highlighting according to filetype." @@ -57,14 +57,14 @@ :group 'dired) (defface dired-face-boring '((((class color)) - (:foreground "Grey")) + (:foreground "Gray65")) (((class grayscale)) - (:foreground "Grey"))) + (:foreground "Gray65"))) "Face used for unimportant files." :group 'dired) -(defface dired-face-permissions '((t (:background "grey75") - (:foreground "black"))) +(defface dired-face-permissions '((t (:background "grey75" + :foreground "black"))) "Face used for interactive permissions." :group 'dired) diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/efs/dired-shell.el --- a/lisp/efs/dired-shell.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/efs/dired-shell.el Mon Aug 13 08:56:04 2007 +0200 @@ -666,7 +666,7 @@ (list (dired-read-shell-command (concat (if dir - (format "! in %s" (dired-abbreviate-file-name dir)) + (format "! in %s " (dired-abbreviate-file-name dir)) "cd ; ! ") "on " (if on-each "each ") diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/efs/dired-vir.el --- a/lisp/efs/dired-vir.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/efs/dired-vir.el Mon Aug 13 08:56:04 2007 +0200 @@ -75,6 +75,7 @@ (set (make-local-variable 'dired-subdir-alist) nil) (dired-build-subdir-alist) (goto-char (point-min)) + (dired-insert-set-properties (point-min) (point-max)) (dired-initial-position dirname)) (defun dired-virtual-guess-dir () diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/efs/dired.el --- a/lisp/efs/dired.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/efs/dired.el Mon Aug 13 08:56:04 2007 +0200 @@ -221,7 +221,7 @@ ;;;###autoload (defvar dired-chown-program - (if (memq system-type '(hpux dgux usg-unix-v)) "chown" "/etc/chown") + (if (memq system-type '(hpux dgux usg-unix-v linux)) "chown" "/etc/chown") "*Name of chown command (usually `chown' or `/etc/chown').") ;;;###autoload @@ -377,6 +377,10 @@ "*If non-nil dired will revert dired buffers for modified subdirectories. See also dired-no-confirm .") +;;;###autoload +(defvar dired-refresh-automatically t + "*If non-nil, refresh dired buffers automatically after file operations.") + ;;; File name regular expressions and extensions. (defvar dired-trivial-filenames "^\\.\\.?$\\|^#" @@ -418,9 +422,9 @@ "*File names matching these regexp may be omitted (buffer-local). This only has effect when the subdirectory is in omission mode. To make omission mode the default, set `dired-omit-files' to t. -This only has effect when `dired-omit-files-p' is t. +This only has effect when `dired-omit-files' is t. See also `dired-omit-extensions'.") -(make-variable-buffer-local 'dired-omit-files-regexp) +(make-variable-buffer-local 'dired-omit-regexps) (defvar dired-filename-re-ext "\\..+$" ; start from the first dot. last dot? "*Defines what is the extension of a file name. @@ -1559,7 +1563,7 @@ (run-hooks 'dired-after-readin-hook) ;; I put omit-expunge after the dired-after-readin-hook ;; in case that hook marks files. Does this make sense? Also, users - ;; might want to set dired-omit-files-p in some incredibly clever + ;; might want to set dired-omit-files in some incredibly clever ;; way depending on the contents of the directory... I don't know... (if dired-omit-files (dired-omit-expunge nil t)) @@ -1641,7 +1645,7 @@ (widen) (erase-buffer) (dired-readin-insert dir-or-list wildcard) - (dired-indent-listing (point-min) (point-max)) + (dired-indent-listing (point-min) (point-max-marker)) ;; We need this to make the root dir have a header line as all ;; other subdirs have: (goto-char (point-min)) @@ -3812,24 +3816,26 @@ "Unmark the current (or next ARG) files. If looking at a subdir, unmark all its files except `.' and `..'." (interactive "p") - (let (buffer-read-only) - (dired-repeat-over-lines - arg - (function - (lambda () - (let ((char (following-char))) - (or (memq char '(?\ ?\n ?\r)) - (progn - (cond - ((char-equal char dired-marker-char) - (setq dired-marks-number (max (1- dired-marks-number) 0))) - ((char-equal char dired-del-marker) - (setq dired-del-flags-number - (max (1- dired-del-flags-number) 0))) - ((setq dired-other-marks-number - (max (1- dired-other-marks-number) 0)))) - (dired-substitute-marker (point) char ?\ ))))))) - (dired-update-mode-line-modified))) + (if (dired-get-subdir) + (dired-mark-subdir-files ?\ ) + (let (buffer-read-only) + (dired-repeat-over-lines + arg + (function + (lambda () + (let ((char (following-char))) + (or (memq char '(?\ ?\n ?\r)) + (progn + (cond + ((char-equal char dired-marker-char) + (setq dired-marks-number (max (1- dired-marks-number) 0))) + ((char-equal char dired-del-marker) + (setq dired-del-flags-number + (max (1- dired-del-flags-number) 0))) + ((setq dired-other-marks-number + (max (1- dired-other-marks-number) 0)))) + (dired-substitute-marker (point) char ?\ ))))))) + (dired-update-mode-line-modified)))) (defun dired-mark-prefix (&optional arg) "Mark the next ARG files with the next character typed. @@ -5106,10 +5112,8 @@ ;; Assumes that it is on a valid file line. It's the caller's responsibility ;; to ensure this. Assumes that match 0 for dired-re-month-and-time is ;; at the end of the file size. - (dired-move-to-filename t) - ;; dired-move-to-filename must leave match-beginning 0 at the start of - ;; the date. - (goto-char (match-beginning 0)) + (end-of-line) + (search-backward-regexp dired-re-month-and-time) (skip-chars-backward " ") (string-to-int (buffer-substring (point) (progn (skip-chars-backward "0-9") @@ -5269,7 +5273,7 @@ (defun dired-omit-toggle (&optional arg) "Toggle between displaying and omitting files matching -`dired-omit-files-regexp' in the current subdirectory. +`dired-omit-regexps' in the current subdirectory. With a positive prefix, omits files in the entire tree dired buffer. With a negative prefix, forces all files in the tree dired buffer to be displayed." @@ -5313,7 +5317,7 @@ (defun dired-omit-expunge (&optional regexp full-buffer) ;; Hides all unmarked files matching REGEXP. - ;; If REGEXP is nil or not specified, uses `dired-omit-files-regexp', + ;; If REGEXP is nil or not specified, uses `dired-omit-regexps', ;; and also omits filenames ending in `dired-omit-extensions'. ;; If REGEXP is the empty string, this function is a no-op. (let ((omit-re (or regexp (dired-omit-regexp))) @@ -5719,7 +5723,10 @@ (function (lambda (x) (and (not (eq (current-buffer) (cdr x))) x))) - dired-buffers)))) + dired-buffers))) + ;; If there are no more dired buffers, we are no longer needed in the + ;; file-name-handler-alist. + (or dired-buffers (dired-remove-from-file-name-handler-alist))) (defun dired-fun-in-all-buffers (directory fun &rest args) ;; In all buffers dired'ing DIRECTORY, run FUN with ARGS. @@ -6185,11 +6192,12 @@ (defun dired-check-file-name-handler-alist () ;; Verify that dired is installed as the first item in the alist - (or (eq (cdr (car file-name-handler-alist)) 'dired-handler-fn) - (setq file-name-handler-alist - (cons - '("." . dired-handler-fn) - (dired-remove-from-file-name-handler-alist))))) + (and dired-refresh-automatically + (or (eq (cdr (car file-name-handler-alist)) 'dired-handler-fn) + (setq file-name-handler-alist + (cons + '("." . dired-handler-fn) + (dired-remove-from-file-name-handler-alist)))))) (defun dired-handler-fn (op &rest args) ;; Function to update dired buffers after I/O. diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/efs/efs-auto.el --- a/lisp/efs/efs-auto.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/efs/efs-auto.el Mon Aug 13 08:56:04 2007 +0200 @@ -3,12 +3,11 @@ ;; ;; File: efs-auto.el ;; Release: $efs release: 1.15 $ -;; Version: #Revision: 1.7 $ +;; Version: #Revision: 1.8 $ ;; RCS: ;; Description: Simple way of autoloading efs ;; Author: Andy Norman, Dawn ;; Created: Thu Sep 24 09:50:08 1992 -;; Modified: Sun Nov 27 11:45:28 1994 by sandy on gandalf ;; Language: Emacs-Lisp ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -37,7 +36,7 @@ (defconst efs-auto-version (concat (substring "$efs release: 1.15 $" 14 -2) "/" - (substring "#Revision: 1.7 $" 11 -2))) + (substring "#Revision: 1.8 $" 11 -2))) ;;; Interactive functions that should be accessible from here. @@ -47,5 +46,12 @@ "For a given HOST and USER, set or change the associated PASSWORD." t) (autoload 'efs-nslookup-host "efs" "Attempt to resolve a hostname using nslookup if possible." t) +(autoload 'efs-display-ftp-activity "efs" + "Displays the number of active background ftp sessions in the modeline. +Uses the variable `efs-mode-line-format' to determine how this will be +displayed." t) +(autoload 'efs-ftp-path "efs-cu" + "Parse PATH according to efs-path-regexp. +Returns a list (HOST USER PATH), or nil if PATH does not match the format.") ;;; end of efs-auto.el diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/efs/efs-dired.el --- a/lisp/efs/efs-dired.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/efs/efs-dired.el Mon Aug 13 08:56:04 2007 +0200 @@ -3,14 +3,13 @@ ;; ;; File: efs-dired.el ;; Release: $efs release: 1.15 $ -;; Version: #Revision: 1.31 $ +;; Version: #Revision: 1.32 $ ;; RCS: ;; Description: Extends much of Dired to work under efs. ;; Authors: Sebastian Kremer , ;; Andy Norman , ;; Sandy Rutherford ;; Created: Throughout the ages. -;; Modified: Sun Nov 27 12:19:46 1994 by sandy on gandalf ;; Language: Emacs-Lisp ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -25,7 +24,7 @@ (defconst efs-dired-version (concat (substring "$efs release: 1.15 $" 14 -2) "/" - (substring "#Revision: 1.31 $" 11 -2))) + (substring "#Revision: 1.32 $" 11 -2))) ;;;; ---------------------------------------------------------------- ;;;; User Configuration Variables @@ -37,18 +36,6 @@ (defvar efs-dired-verify-anonymous-modtime nil "If non-nil, dired modtimes are checked for anonymous logins.") -(defvar efs-remote-shell-file-name - (if (memq system-type '(hpux usg-unix-v)) ; hope that's right - "remsh" - "rsh") - "Remote shell used by efs.") - -(defvar efs-remote-shell-takes-user - (null (null (memq system-type '(aix-v3 hpux silicon-graphics-unix - berkeley-unix)))) - ;; Complete? Doubt it. - "Set to non-nil if your remote shell command takes \"-l USER\".") - ;;; Internal Variables (make-variable-buffer-local 'dired-ls-F-marks-symlinks) @@ -1530,14 +1517,17 @@ (efs-host-type host user) (nth 2 parsed))) (abbr (efs-relativize-filename file)) (result (efs-send-cmd host user - (list 'quote 'site 'chmod - mode path) - (format "doing chmod %s" - abbr)))) - (efs-del-from-ls-cache file t) + (list 'quote 'site 'chmod + mode path) + (format "doing chmod %s" + abbr)))) + (if (car result) - (efs-error host user (format "chmod: %s: \"%s\"" file - (nth 1 result))))) + (efs-dired-shell-call-process + (concat "chmod " mode " " (file-name-nondirectory file)) + (file-name-directory file))) + + (efs-del-from-ls-cache file t)) (error (setq bombed t))))))) (cdr args)) (if bombed 1 0))) ; return code diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/efs/efs-dump.el --- a/lisp/efs/efs-dump.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/efs/efs-dump.el Mon Aug 13 08:56:04 2007 +0200 @@ -19,11 +19,6 @@ (substring "#Revision: 1.1 $" 11 -2))) ;;;###autoload -(defvar allow-remote-paths t - "*Set this to nil if you don't want remote paths to access -remote files.") - -;;;###autoload (or (assoc efs-path-root-regexp file-name-handler-alist) (setq file-name-handler-alist (cons @@ -41,3 +36,5 @@ inhibit-file-name-handlers))) (inhibit-file-name-operation operation)) (apply operation args)))) + +;;; end of efs-dump.el diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/efs/efs-fnh.el --- a/lisp/efs/efs-fnh.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/efs/efs-fnh.el Mon Aug 13 08:56:04 2007 +0200 @@ -22,6 +22,11 @@ "/" (substring "#Revision: 1.3 $" 11 -2))) +;;;###autoload +(defvar allow-remote-paths t + "*Set this to nil if you don't want remote paths to access +remote files.") + ;;;; ---------------------------------------------------------------- ;;;; Loading emacs version files ;;;; ---------------------------------------------------------------- diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/efs/efs.el --- a/lisp/efs/efs.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/efs/efs.el Mon Aug 13 08:56:04 2007 +0200 @@ -6,7 +6,7 @@ ;; Version: #Revision: 1.56 $ ;; RCS: ;; Description: Transparent FTP support for the original GNU Emacs -;; from FSF and Lucid Emacs +;; from FSF and XEmacs ;; Authors: Andy Norman , ;; Sandy Rutherford ;; Created: Thu Oct 12 14:00:05 1989 (as ange-ftp) @@ -1388,6 +1388,18 @@ If you set this to nil, efs will wait an arbitrary amount of time to get output.") +(defvar efs-remote-shell-file-name + (if (memq system-type '(hpux usg-unix-v)) ; hope that's right + "remsh" + "rsh") + "Remote shell used by efs.") + +(defvar efs-remote-shell-takes-user + (null (null (memq system-type '(aix aix-v3 hpux silicon-graphics-unix + berkeley-unix)))) + ;; Complete? Doubt it. + "Set to non-nil if your remote shell command takes \"-l USER\".") + (defvar efs-make-backup-files efs-unix-host-types "*A list of operating systems for which efs will make Emacs backup files. The backup files are made on the remote host. @@ -1585,6 +1597,9 @@ getting out of synch with the FTP client, so using this feature routinely isn't recommended.") +(defvar efs-use-passive-mode nil + "*If non-nil, the ftp client will specify passive mode for all transfers.") + ;;; Hooks and crooks. (defvar efs-ftp-startup-hook nil @@ -1645,7 +1660,7 @@ (defvar efs-cmd-ok-cmds (concat "^quote port \\|^type \\|^quote site \\|^chmod \\|^quote noop\\|" - "^quote pasv")) + "^quote pasv\\|^passive")) ;; Regexp to match commands for which efs-cmd-ok-msgs is a valid server ;; response for success. @@ -1678,6 +1693,8 @@ ; (Sometimes get this with a timeout, ; so treat as fatal.) "^3[0-5][0-7] \\|" ; 3yz = positive intermediate reply + ;; passive + "^[Pp]assive \\|" ;; client codes "^[Hh]ash mark ")) ;; Response to indicate that the requested action was successfully completed. @@ -3644,6 +3661,9 @@ ;; Tell client to send back hash-marks as progress. It isn't ;; usually fatal if this command fails. (efs-guess-hash-mark-size proc) + + (if efs-use-passive-mode + (efs-passive-mode host user)) ;; Run any user startup functions (let ((alist efs-ftp-startup-function-alist) @@ -3685,6 +3705,10 @@ 'efs-hash-mark-size) (string-to-int size)))))))))) +(defun efs-passive-mode (host user) + ;; put ftp into passive mode + (efs-send-cmd host user '(passive))) + ;;;; ------------------------------------------------------------ ;;;; Simple FTP process shell support. ;;;; ------------------------------------------------------------ @@ -4066,6 +4090,10 @@ (efs-fix-path host-type cmd2)) cmd-string (concat "rename " cmd1 " " cmd2)))) + ;; passive command + ((eq cmd0 'passive) + (setq cmd-string "passive")) + (t (error "efs: Don't know how to send %s %s %s %s" cmd0 cmd1 cmd2 cmd3)))) @@ -4199,7 +4227,7 @@ (progn (setq proc (efs-kerberos-login host user proc)) (efs-login-send-user host user proc gate)) - (let ((to (if (memq gate '(proxy local raptor)) + (let ((to (if (memq gate '(proxy raptor)) efs-gateway-host host)) port cmd result) @@ -4233,7 +4261,7 @@ Optional argument GATE specifies which type of gateway is being used. RETRY argument specifies to try twice if we get a 421 response." (let ((cmd (cond - ((memq gate '(local proxy interlock)) + ((memq gate '(proxy interlock)) (format "quote USER \"%s\"@%s" user (if (and efs-nslookup-on-connect (string-match "[^0-9.]" host)) @@ -4261,7 +4289,7 @@ (t (format "quote user \"%s\"" user)))) (msg (format "Logging in as user %s%s..." user - (if (memq gate '(proxy local raptor kerberos)) + (if (memq gate '(proxy raptor kerberos)) (concat "@" host) ""))) result code) @@ -8089,6 +8117,37 @@ (efs-build-mode-string-element group-int sgid nil) (efs-build-mode-string-element other-int nil sticky)))) +(defun efs-shell-call-process (command dir &optional in-background) + ;; Runs shell process on remote hosts. + (let* ((parsed (efs-ftp-path dir)) + (host (car parsed)) + (user (nth 1 parsed)) + (rdir (nth 2 parsed)) + (file-name-handler-alist nil)) + (or (string-equal (efs-internal-directory-file-name dir) + (efs-expand-tilde "~" (efs-host-type host) host user)) + (string-match "^cd " command) + (setq command (concat "cd " rdir "; " command))) + (setq command + (format "%s %s%s \"%s\"" ; remsh -l USER does not work well + ; on a hp-ux machine I tried + efs-remote-shell-file-name host + (if efs-remote-shell-takes-user + (concat " -l " user) + "") + command)) + (message "Doing shell command on %s..." host) + ;; do it + (let ((process-connection-type ; don't waste pty's + (null (null in-background)))) + (setq default-directory (file-name-directory efs-tmp-name-template)) + (if in-background + (progn + (setq mode-line-process '(": %s")) + (start-process "Shell" (current-buffer) + shell-file-name "-c" command)) + (call-process shell-file-name nil t nil "-c" command))))) + (defun efs-set-file-modes (file mode) ;; set-file-modes for remote files. ;; For remote files, if mode is nil, does nothing. @@ -8111,11 +8170,16 @@ nil nil (efs-cont (result line cont-lines) (host file r-file omode) (if result - (progn - (efs-set-host-property host 'chmod-failed t) - (message "CHMOD %s failed for %s on %s." omode r-file host) - (if efs-ding-on-chmod-failure - (progn (ding) (sit-for 1)))) + (let ((exit-code + (efs-shell-call-process + (concat "chmod " mode " " (file-name-nondirectory file)) + (file-name-directory file)))) + (if (not (equal 0 exit-code)) + (progn + (efs-set-host-property host 'chmod-failed t) + (message "CHMOD %s failed for %s on %s." omode r-file host) + (if efs-ding-on-chmod-failure + (progn (ding) (sit-for 1)))))) (let ((ent (efs-get-file-entry file))) (if ent (let* ((type @@ -8861,7 +8925,7 @@ (format efs-path-format-without-user host path) (format efs-path-format-string user host path)))) -(efs-define-fun efs-abbreviate-file-name (filename) +(efs-define-fun efs-abbreviate-file-name (filename &optional ignored-for-now) ;; Version of abbreviate-file-name for remote files. (efs-save-match-data (let ((tail directory-abbrev-alist)) @@ -10761,10 +10825,14 @@ ;; Yes, this is what it looks like. I'm defining the handler to run our ;; version whenever there is an environment variable. -(nconc file-name-handler-alist - (list - (cons "\\(^\\|[^$]\\)\\(\\$\\$\\)*\\$[{a-zA-Z0-9]" - 'efs-sifn-handler-function))) +(defvar efs-path-sifn-regexp "\\(^\\|[^$]\\)\\(\\$\\$\\)*\\$[{a-zA-Z0-9]" + "Regexp to match environment variables in file names.") + +(or (assoc efs-path-sifn-regexp file-name-handler-alist) + (nconc file-name-handler-alist + (list + (cons efs-path-sifn-regexp + 'efs-sifn-handler-function)))) ;;;; ------------------------------------------------------------ ;;;; Necessary overloads. diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/emulators/crisp.el --- a/lisp/emulators/crisp.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/emulators/crisp.el Mon Aug 13 08:56:04 2007 +0200 @@ -1,7 +1,7 @@ -;; @(#) crisp.el -- Crisp/Brief Emacs emulator +;; @(#) crisp.el -- CRiSP/Brief Emacs emulator ;; Author: Gary D. Foster -;; $Revision: 1.1.1.1 $ +;; $Revision: 1.2 $ ;; Keywords: emulations brief crisp ;; This file is part of GNU Emacs. @@ -21,6 +21,8 @@ ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. +;; CRiSP is a registered trademark of Foxtrot Systems Ltd. + ;;; Commentary: ;; Keybindings and minor functions to duplicate the functionality and @@ -53,42 +55,45 @@ ;; local variables (defvar crisp-mode-map (copy-keymap (current-global-map)) - "Local keymap for Crisp mode. + "Local keymap for CRiSP emulation mode. All the bindings are done here instead of globally to try and be nice to the world.") -(defvar crisp-mode-modeline-string " *Crisp*" - "String to display in the modeline when Crisp mode is enabled.") +(defvar crisp-mode-modeline-string " *CRiSP*" + "String to display in the modeline when CRiSP emulation mode is enabled.") (defvar crisp-mode-original-keymap (copy-keymap (current-global-map)) - "The original keymap before Crisp mode remaps anything. -This keymap is restored when Crisp mode is disabled.") + "The original keymap before CRiSP emulation mode remaps anything. +This keymap is restored when CRiSP emulation mode is disabled.") (defvar crisp-mode-enabled 'nil - "Track status of Crisp mode. -A value of nil means Crisp mode is not enabled. A value of t -indicates Crisp mode is enabled.") + "Track status of CRiSP emulation mode. +A value of nil means CRiSP mode is not enabled. A value of t +indicates CRiSP mode is enabled.") (defvar crisp-override-meta-x 't - "Controls overriding the normal Emacs M-x key binding. -The normal binding for M-x is `execute-extended-command', however -the normal Crisp keybinding for M-x is to exit the editor, while -the F10 key is used to execute extended commands. If you don't -want M-x to dump you out of emacs, set this to nil before loading -the package.") + "Controls overriding the normal Emacs M-x key binding in the CRiSP emulator. +Normally the CRiSP emulator rebinds M-x to save-buffers-exit-emacs +and provides the usual M-x functionality on the F10 key. + +If this variable is nil when you start the CRiSP emulator, it +does not alter the binding of M-x.") (defvar crisp-load-scroll-lock 't - "Controls loading of the Scroll Lock minor mode package. -Default behavior is to load the scroll lock minor mode -package when Crisp mode is enabled. Set to nil prior -to loading this package to prevent it.") + "Controls loading of the Scroll Lock in the CRiSP emulator. +Its Default behavior is to load and enable the Scroll Lock minor mode +package when enabling the CRiSP emulator. + +If this variable is nil when you start the CRiSP emulator, it +does not load Scroll Lock.") (defvar crisp-load-hook nil - "Hooks to run after Crisp mode is enabled.") + "Hooks to run after loadint the CRiSP emulator package.") -(defvar crisp-mode-running-xemacs (string-match "XEmacs\\Lucid" emacs-version)) +(defvar crisp-version "crisp.el release 1.1/$Revision: 1.2 $" + "The release number and RCS version for the CRiSP emulator.") -(if crisp-mode-running-xemacs +(if (string-match "XEmacs\\Lucid" emacs-version) (add-minor-mode 'crisp-mode-enabled crisp-mode-modeline-string) (or (assq 'crisp-mode-enabled minor-mode-alist) (setq minor-mode-alist @@ -127,8 +132,8 @@ (define-key crisp-mode-map [(meta f10)] 'compile) (define-key crisp-mode-map [(SunF37)] 'kill-buffer) -(define-key crisp-mode-map [(kp_add)] 'x-copy-primary-selection) -(define-key crisp-mode-map [(kp_subtract)] 'x-kill-primary-selection) +(define-key crisp-mode-map [(kp-add)] 'x-copy-primary-selection) +(define-key crisp-mode-map [(kp-subtract)] 'x-kill-primary-selection) (define-key crisp-mode-map [(insert)] 'x-yank-clipboard-selection) (define-key crisp-mode-map [(f16)] 'x-copy-primary-selection) ; copy on Sun5 kbd (define-key crisp-mode-map [(f20)] 'x-kill-primary-selection) ; cut on Sun5 kbd @@ -139,12 +144,23 @@ (define-key crisp-mode-map [(meta g)] 'goto-line) (define-key crisp-mode-map [(meta h)] 'help) (define-key crisp-mode-map [(meta i)] 'overwrite-mode) +(define-key crisp-mode-map [(meta j)] 'bookmark-jump) (define-key crisp-mode-map [(meta u)] 'advertised-undo) (define-key crisp-mode-map [(f14)] 'advertised-undo) (define-key crisp-mode-map [(meta w)] 'save-buffer) (if (eq crisp-override-meta-x 't) - (define-key crisp-mode-map [(meta x)] 'save-buffers-kill-emacs)) + (define-key crisp-mode-map [(meta x)] 'save-buffers-kill-emacs)) +(define-key crisp-mode-map [(meta ?0)] (lambda () (interactive) (bookmark-set "0"))) +(define-key crisp-mode-map [(meta ?1)] (lambda () (interactive) (bookmark-set "1"))) +(define-key crisp-mode-map [(meta ?2)] (lambda () (interactive) (bookmark-set "2"))) +(define-key crisp-mode-map [(meta ?3)] (lambda () (interactive) (bookmark-set "3"))) +(define-key crisp-mode-map [(meta ?4)] (lambda () (interactive) (bookmark-set "4"))) +(define-key crisp-mode-map [(meta ?5)] (lambda () (interactive) (bookmark-set "5"))) +(define-key crisp-mode-map [(meta ?6)] (lambda () (interactive) (bookmark-set "6"))) +(define-key crisp-mode-map [(meta ?7)] (lambda () (interactive) (bookmark-set "7"))) +(define-key crisp-mode-map [(meta ?8)] (lambda () (interactive) (bookmark-set "8"))) +(define-key crisp-mode-map [(meta ?9)] (lambda () (interactive) (bookmark-set "9"))) (define-key crisp-mode-map [(shift right)] 'fkey-forward-word) (define-key crisp-mode-map [(shift left)] 'fkey-backward-word) @@ -157,10 +173,10 @@ (define-key crisp-mode-map [(end)] 'crisp-end) (defun crisp-home () - "Home the point according to Crisp conventions. -First call to this moves point to beginning of the line. Second -consecutive call moves point to beginning of the screen. Third -consecutive call moves the point to the beginning of the buffer." + "\"Home\" the point, the way CRiSP would do it. +The first use moves point to beginning of the line. Second +consecutive use moves point to beginning of the screen. Third +consecutive use moves point to the beginning of the buffer." (interactive nil) (cond ((and (eq last-command 'crisp-home) (eq last-last-command 'crisp-home)) @@ -172,10 +188,10 @@ (setq last-last-command last-command)) (defun crisp-end () - "End the point according to Crisp conventions. -First call to this moves point to end of the line. Second -consecutive call moves point to the end of the screen. Third -consecutive call moves point to the end of the buffer." + "\"End\" the point, the way CRiSP would do it. +The first use moves point to end of the line. Second +consecutive use moves point to the end of the screen. Third +consecutive use moves point to the end of the buffer." (interactive nil) (cond ((and (eq last-command 'crisp-end) (eq last-last-command 'crisp-end)) @@ -190,7 +206,7 @@ ;; Now enable the mode (defun crisp-mode () - "Toggle Crisp minor mode." + "Toggle CRiSP emulation minor mode." (interactive nil) (setq crisp-mode-enabled (not crisp-mode-enabled)) (cond diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/games/gomoku.el --- a/lisp/games/gomoku.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/games/gomoku.el Mon Aug 13 08:56:04 2007 +0200 @@ -3,7 +3,7 @@ ;; Copyright (C) 1988, 1994 Free Software Foundation, Inc. ;; Author: Philippe Schnoebelen -;; Adapted-By: ESR, Daniel.Pfeiffer@Informatik.START.dbp.de +;; Adapted-By: ESR ;; Keywords: games ;; This file is part of XEmacs. @@ -19,14 +19,20 @@ ;; 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. +;; 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. +;;; Synched up with: FSF 19.30. ;;; Commentary: +;;; Gomoku game between you and GNU Emacs. Last modified on 13 Sep 1988 +;;; +;;; Written by Ph. Schnoebelen (phs@lifia.imag.fr), 1987, 1988 +;;; with precious advices from J.-F. Rit. +;;; This has been tested with GNU Emacs 18.50. + ;; RULES: ;; ;; Gomoku is a game played between two players on a rectangular board. Each @@ -71,117 +77,66 @@ ;;; ;;; GOMOKU MODE AND KEYMAP. ;;; -(require 'facemenu) - (defvar gomoku-mode-hook nil "If non-nil, its value is called on entry to Gomoku mode.") (defvar gomoku-mode-map nil "Local keymap to use in Gomoku mode.") -(if gomoku-mode-map nil +(if gomoku-mode-map + nil (setq gomoku-mode-map (make-sparse-keymap)) (set-keymap-name gomoku-mode-map 'gomoku-mode-map) - ;; Key bindings for cursor motion. - (define-key gomoku-mode-map "y" 'gomoku-move-nw) ; y - (define-key gomoku-mode-map "u" 'gomoku-move-ne) ; u - (define-key gomoku-mode-map "b" 'gomoku-move-sw) ; b - (define-key gomoku-mode-map "n" 'gomoku-move-se) ; n - (define-key gomoku-mode-map "h" 'backward-char) ; h - (define-key gomoku-mode-map "l" 'forward-char) ; l - (define-key gomoku-mode-map "j" 'gomoku-move-down) ; j - (define-key gomoku-mode-map "k" 'gomoku-move-up) ; k - - (define-key gomoku-mode-map [kp-7] 'gomoku-move-nw) - (define-key gomoku-mode-map [kp-9] 'gomoku-move-ne) - (define-key gomoku-mode-map [kp-1] 'gomoku-move-sw) - (define-key gomoku-mode-map [kp-3] 'gomoku-move-se) - (define-key gomoku-mode-map [kp-4] 'backward-char) - (define-key gomoku-mode-map [kp-6] 'forward-char) - (define-key gomoku-mode-map [kp-2] 'gomoku-move-down) - (define-key gomoku-mode-map [kp-8] 'gomoku-move-up) - - (define-key gomoku-mode-map "\C-n" 'gomoku-move-down) ; C-n - (define-key gomoku-mode-map "\C-p" 'gomoku-move-up) ; C-p + ;; Key bindings for cursor motion. Arrow keys are just "function" + ;; keys, see below. + (define-key gomoku-mode-map "y" 'gomoku-move-nw) ; Y + (define-key gomoku-mode-map "u" 'gomoku-move-ne) ; U + (define-key gomoku-mode-map "b" 'gomoku-move-sw) ; B + (define-key gomoku-mode-map "n" 'gomoku-move-se) ; N + (define-key gomoku-mode-map "h" 'gomoku-move-left) ; H + (define-key gomoku-mode-map "l" 'gomoku-move-right) ; L + (define-key gomoku-mode-map "j" 'gomoku-move-down) ; J + (define-key gomoku-mode-map "k" 'gomoku-move-up) ; K + (define-key gomoku-mode-map "\C-n" 'gomoku-move-down) ; C-N + (define-key gomoku-mode-map "\C-p" 'gomoku-move-up) ; C-P + (define-key gomoku-mode-map "\C-f" 'gomoku-move-right) ; C-F + (define-key gomoku-mode-map "\C-b" 'gomoku-move-left) ; C-B ;; Key bindings for entering Human moves. + ;; If you have a mouse, you may also bind some mouse click ... (define-key gomoku-mode-map "X" 'gomoku-human-plays) ; X (define-key gomoku-mode-map "x" 'gomoku-human-plays) ; x - (define-key gomoku-mode-map " " 'gomoku-human-plays) ; SPC (define-key gomoku-mode-map "\C-m" 'gomoku-human-plays) ; RET - (define-key gomoku-mode-map "\C-c\C-p" 'gomoku-human-plays) ; C-c C-p - (define-key gomoku-mode-map "\C-c\C-b" 'gomoku-human-takes-back) ; C-c C-b - (define-key gomoku-mode-map "\C-c\C-r" 'gomoku-human-resigns) ; C-c C-r - (define-key gomoku-mode-map "\C-c\C-e" 'gomoku-emacs-plays) ; C-c C-e - - (define-key gomoku-mode-map [kp-enter] 'gomoku-human-plays) - (define-key gomoku-mode-map [insert] 'gomoku-human-plays) - (define-key gomoku-mode-map [down-mouse-1] 'gomoku-click) - (define-key gomoku-mode-map [drag-mouse-1] 'gomoku-click) - (define-key gomoku-mode-map [mouse-1] 'gomoku-click) - (define-key gomoku-mode-map [down-mouse-2] 'gomoku-click) - (define-key gomoku-mode-map [mouse-2] 'gomoku-mouse-play) - (define-key gomoku-mode-map [drag-mouse-2] 'gomoku-mouse-play) + (define-key gomoku-mode-map "\C-c\C-p" 'gomoku-human-plays) ; C-C C-P + (define-key gomoku-mode-map "\C-c\C-b" 'gomoku-human-takes-back) ; C-C C-B + (define-key gomoku-mode-map "\C-c\C-r" 'gomoku-human-resigns) ; C-C C-R + (define-key gomoku-mode-map "\C-c\C-e" 'gomoku-emacs-plays) ; C-C C-E - (substitute-key-definition 'previous-line 'gomoku-move-up - gomoku-mode-map (current-global-map)) - (substitute-key-definition 'next-line 'gomoku-move-down - gomoku-mode-map (current-global-map)) - (substitute-key-definition 'beginning-of-line 'gomoku-beginning-of-line - gomoku-mode-map (current-global-map)) - (substitute-key-definition 'end-of-line 'gomoku-end-of-line - gomoku-mode-map (current-global-map)) - (substitute-key-definition 'undo 'gomoku-human-takes-back - gomoku-mode-map (current-global-map)) - (substitute-key-definition 'advertised-undo 'gomoku-human-takes-back - gomoku-mode-map (current-global-map))) - -(defvar gomoku-emacs-won () - "*For making font-lock use the winner's face for the line.") + (define-key gomoku-mode-map [up] 'gomoku-move-up) + (define-key gomoku-mode-map [down] 'gomoku-move-down) + (define-key gomoku-mode-map [left] 'gomoku-move-left) + (define-key gomoku-mode-map [right] 'gomoku-move-right) + (define-key gomoku-mode-map [kp-enter] 'gomoku-human-plays) + (define-key gomoku-mode-map [button2] 'gomoku-click) + (define-key gomoku-mode-map [insert] 'gomoku-human-plays)) -(defvar gomoku-font-lock-O-face - (if window-system - (list (facemenu-get-face 'fg:red) 'bold)) - "*Face to use for Emacs' O.") - -(defvar gomoku-font-lock-X-face - (if window-system - (list (facemenu-get-face 'fg:green) 'bold)) - "*Face to use for your X.") - -(defvar gomoku-font-lock-keywords - '(("O" . gomoku-font-lock-O-face) - ("X" . gomoku-font-lock-X-face) - ("[-|/\\]" 0 (if gomoku-emacs-won - gomoku-font-lock-O-face - gomoku-font-lock-X-face))) - "*Font lock rules for Gomoku.") - -(put 'gomoku-mode 'front-sticky - (put 'gomoku-mode 'rear-nonsticky '(intangible))) -(put 'gomoku-mode 'intangible 1) (defun gomoku-mode () "Major mode for playing Gomoku against Emacs. -You and Emacs play in turn by marking a free square. You mark it with X -and Emacs marks it with O. The winner is the first to get five contiguous +You and Emacs play in turn by marking a free square. You mark it with X +and Emacs marks it with O. The winner is the first to get five contiguous marks horizontally, vertically or in diagonal. - You play by moving the cursor over the square you choose and hitting \\[gomoku-human-plays]. - Other useful commands: \\{gomoku-mode-map} Entry to this mode calls the value of `gomoku-mode-hook' if that value -is non-nil. One interesting value is `turn-on-font-lock'." +is non-nil." (interactive) (setq major-mode 'gomoku-mode mode-name "Gomoku") (gomoku-display-statistics) (use-local-map gomoku-mode-map) - (make-local-variable 'font-lock-defaults) - (setq font-lock-defaults '(gomoku-font-lock-keywords t)) - (toggle-read-only t) (run-hooks 'gomoku-mode-hook)) ;;; @@ -315,8 +270,8 @@ ;; please send me a note. Thanks. -;; As we chose values 0, 1 and 6 to denote empty, X and O squares, the -;; contents of a qtuple are uniquely determined by the sum of its elements and +;; As we choosed values 0, 1 and 6 to denote empty, X and O squares, the +;; contents of a qtuple is uniquely determined by the sum of its elements and ;; we just have to set up a translation table. (defconst gomoku-score-trans-table @@ -579,8 +534,7 @@ gomoku-board-height m gomoku-vector-length (1+ (* (+ m 2) (1+ n))) gomoku-draw-limit (/ (* 7 n m) 10)) - (setq gomuku emacs-won nil - gomoku-game-history nil + (setq gomoku-game-history nil gomoku-number-of-moves 0 gomoku-number-of-human-moves 0 gomoku-emacs-played-first nil @@ -641,58 +595,66 @@ (defun gomoku-terminate-game (result) "Terminate the current game with RESULT." - (message - (cond - ((eq result 'emacs-won) - (setq gomoku-number-of-emacs-wins (1+ gomoku-number-of-emacs-wins)) - (cond ((< gomoku-number-of-moves 20) - "This was a REALLY QUICK win.") - (gomoku-human-refused-draw - "I won... Too bad you refused my offer of a draw !") - (gomoku-human-took-back - "I won... Taking moves back will not help you !") - ((not gomoku-emacs-played-first) - "I won... Playing first did not help you much !") - ((and (zerop gomoku-number-of-human-wins) - (zerop gomoku-number-of-draws) - (> gomoku-number-of-emacs-wins 1)) - "I'm becoming tired of winning...") - ("I won."))) - ((eq result 'human-won) - (setq gomoku-number-of-human-wins (1+ gomoku-number-of-human-wins)) - (concat "OK, you won this one." - (cond - (gomoku-human-took-back - " I, for one, never take my moves back...") - (gomoku-emacs-played-first - ".. so what ?") - (" Now, let me play first just once.")))) - ((eq result 'human-resigned) - (setq gomoku-number-of-emacs-wins (1+ gomoku-number-of-emacs-wins)) - "So you resign. That's just one more win for me.") - ((eq result 'nobody-won) - (setq gomoku-number-of-draws (1+ gomoku-number-of-draws)) - (concat "This is a draw. " - (cond - (gomoku-human-took-back - "I, for one, never take my moves back...") - (gomoku-emacs-played-first - "Just chance, I guess.") - ("Now, let me play first just once.")))) - ((eq result 'draw-agreed) - (setq gomoku-number-of-draws (1+ gomoku-number-of-draws)) - (concat "Draw agreed. " - (cond - (gomoku-human-took-back - "I, for one, never take my moves back...") - (gomoku-emacs-played-first - "You were lucky.") - ("Now, let me play first just once.")))) - ((eq result 'crash-game) - "Sorry, I have been interrupted and cannot resume that game..."))) - (gomoku-display-statistics) - ;;(ding) - (setq gomoku-game-in-progress nil)) + (let (message) + (cond + ((eq result 'emacs-won) + (setq gomoku-number-of-emacs-wins (1+ gomoku-number-of-emacs-wins)) + (setq message + (cond ((< gomoku-number-of-moves 20) + "This was a REALLY QUICK win.") + (gomoku-human-refused-draw + "I won... Too bad you refused my offer of a draw !") + (gomoku-human-took-back + "I won... Taking moves back will not help you !") + ((not gomoku-emacs-played-first) + "I won... Playing first did not help you much !") + ((and (zerop gomoku-number-of-human-wins) + (zerop gomoku-number-of-draws) + (> gomoku-number-of-emacs-wins 1)) + "I'm becoming tired of winning...") + (t + "I won.")))) + ((eq result 'human-won) + (setq gomoku-number-of-human-wins (1+ gomoku-number-of-human-wins)) + (setq message + (cond + (gomoku-human-took-back + "OK, you won this one. I, for one, never take my moves back...") + (gomoku-emacs-played-first + "OK, you won this one... so what ?") + (t + "OK, you won this one. Now, let me play first just once.")))) + ((eq result 'human-resigned) + (setq gomoku-number-of-emacs-wins (1+ gomoku-number-of-emacs-wins)) + (setq message "So you resign. That's just one more win for me.")) + ((eq result 'nobody-won) + (setq gomoku-number-of-draws (1+ gomoku-number-of-draws)) + (setq message + (cond + (gomoku-human-took-back + "This is a draw. I, for one, never take my moves back...") + (gomoku-emacs-played-first + "This is a draw. Just chance, I guess.") + (t + "This is a draw. Now, let me play first just once.")))) + ((eq result 'draw-agreed) + (setq gomoku-number-of-draws (1+ gomoku-number-of-draws)) + (setq message + (cond + (gomoku-human-took-back + "Draw agreed. I, for one, never take my moves back...") + (gomoku-emacs-played-first + "Draw agreed. You were lucky.") + (t + "Draw agreed. Now, let me play first just once.")))) + ((eq result 'crash-game) + (setq message + "Sorry, I have been interrupted and cannot resume that game..."))) + + (gomoku-display-statistics) + (if message (message message)) + (ding) + (setq gomoku-game-in-progress nil))) (defun gomoku-crash-game () "What to do when Emacs detects it has been interrupted." @@ -710,24 +672,19 @@ "Start a Gomoku game between you and Emacs. If a game is in progress, this command allow you to resume it. If optional arguments N and M are given, an N by M board is used. -If prefix arg is given for N, M is prompted for. -You and Emacs play in turn by marking a free square. You mark it with X +You and Emacs play in turn by marking a free square. You mark it with X and Emacs marks it with O. The winner is the first to get five contiguous marks horizontally, vertically or in diagonal. - You play by moving the cursor over the square you choose and hitting \\\\[gomoku-human-plays]. Use \\[describe-mode] for more info." - (interactive (if current-prefix-arg - (list (prefix-numeric-value current-prefix-arg) - (eval (read-minibuffer "Height: "))))) + (interactive) (gomoku-switch-to-window) (cond (gomoku-emacs-is-computing (gomoku-crash-game)) - ((or (not gomoku-game-in-progress) - (<= gomoku-number-of-moves 2)) + ((not gomoku-game-in-progress) (let ((max-width (gomoku-max-width)) (max-height (gomoku-max-height))) (or n (setq n max-width)) @@ -739,8 +696,8 @@ ((> n max-width) (error "I cannot display %d columns in that window" n))) (if (and (> m max-height) - (not (eq m gomoku-saved-board-height)) - ;; Use EQ because SAVED-BOARD-HEIGHT may be nil + (not (equal m gomoku-saved-board-height)) + ;; Use EQUAL because SAVED-BOARD-HEIGHT may be nil (not (y-or-n-p (format "Do you really want %d rows " m)))) (setq m max-height))) (message "One moment, please...") @@ -772,8 +729,8 @@ (setq score (aref gomoku-score-table square)) (gomoku-play-move square 6) (cond ((>= score gomoku-winning-threshold) - (setq gomoku-emacs-won t) ; for font-lock (gomoku-find-filled-qtuple square 6) + (gomoku-cross-winning-qtuple) (gomoku-terminate-game 'emacs-won)) ((zerop score) (gomoku-terminate-game 'nobody-won)) @@ -784,43 +741,11 @@ (t (gomoku-prompt-for-move))))))))) -;; For small square dimensions this is approximate, since though measured in -;; pixels, event's (X . Y) is a character's top-left corner. (defun gomoku-click (click) - "Position at the square where you click." - (interactive "e") - (and (windowp (posn-window (setq click (event-end click)))) - (numberp (posn-point click)) - (select-window (posn-window click)) - (setq click (posn-col-row click)) - (gomoku-goto-xy - (min (max (/ (+ (- (car click) - gomoku-x-offset - 1) - (window-hscroll) - gomoku-square-width - (% gomoku-square-width 2) - (/ gomoku-square-width 2)) - gomoku-square-width) - 1) - gomoku-board-width) - (min (max (/ (+ (- (cdr click) - gomoku-y-offset - 1) - (let ((inhibit-point-motion-hooks t)) - (count-lines 1 (window-start))) - gomoku-square-height - (% gomoku-square-height 2) - (/ gomoku-square-height 2)) - gomoku-square-height) - 1) - gomoku-board-height)))) - -(defun gomoku-mouse-play (click) "Play at the square where you click." (interactive "e") - (if (gomoku-click click) - (gomoku-human-plays))) + (mouse-set-point click) + (gomoku-human-plays)) (defun gomoku-human-plays () "Signal to the Gomoku program that you have played. @@ -848,6 +773,7 @@ ;; detecting wins, it just gives an indication that ;; we confirm with GOMOKU-FIND-FILLED-QTUPLE. (gomoku-find-filled-qtuple square 1)) + (gomoku-cross-winning-qtuple) (gomoku-terminate-game 'human-won)) (t (gomoku-emacs-plays))))))))) @@ -909,12 +835,13 @@ "Ask for another game, and start it." (if (y-or-n-p "Another game ") (gomoku gomoku-board-width gomoku-board-height) - (message "Chicken !"))) + (message "Chicken !"))) (defun gomoku-offer-a-draw () "Offer a draw and return T if Human accepted it." (or (y-or-n-p "I offer you a draw. Do you accept it ") - (not (setq gomoku-human-refused-draw t)))) + (prog1 (setq gomoku-human-refused-draw t) + nil))) ;;; ;;; DISPLAYING THE BOARD. @@ -949,18 +876,30 @@ ;; 2 instead of 1 because WINDOW-HEIGHT includes the mode line ! gomoku-square-height))) +(defun gomoku-point-x () + "Return the board column where point is, or nil if it is not a board column." + (let ((col (- (current-column) gomoku-x-offset))) + (if (and (>= col 0) + (zerop (% col gomoku-square-width)) + (<= (setq col (1+ (/ col gomoku-square-width))) + gomoku-board-width)) + col))) + (defun gomoku-point-y () - "Return the board row where point is." - (let ((inhibit-point-motion-hooks t)) - (1+ (/ (- (count-lines 1 (point)) gomoku-y-offset (if (bolp) 0 1)) - gomoku-square-height)))) + "Return the board row where point is, or nil if it is not a board row." + (let ((row (- (count-lines 1 (point)) gomoku-y-offset 1))) + (if (and (>= row 0) + (zerop (% row gomoku-square-height)) + (<= (setq row (1+ (/ row gomoku-square-height))) + gomoku-board-height)) + row))) (defun gomoku-point-square () - "Return the index of the square point is on." - (let ((inhibit-point-motion-hooks t)) - (gomoku-xy-to-index (1+ (/ (- (current-column) gomoku-x-offset) - gomoku-square-width)) - (gomoku-point-y)))) + "Return the index of the square point is on, or nil if not on the board." + (let (x y) + (and (setq x (gomoku-point-x)) + (setq y (gomoku-point-y)) + (gomoku-xy-to-index x y)))) (defun gomoku-goto-square (index) "Move point to square number INDEX." @@ -968,89 +907,70 @@ (defun gomoku-goto-xy (x y) "Move point to square at X, Y coords." - (let ((inhibit-point-motion-hooks t)) - (goto-line (+ 1 gomoku-y-offset (* gomoku-square-height (1- y))))) + (goto-line (+ 1 gomoku-y-offset (* gomoku-square-height (1- y)))) (move-to-column (+ gomoku-x-offset (* gomoku-square-width (1- x))))) (defun gomoku-plot-square (square value) - "Draw 'X', 'O' or '.' on SQUARE depending on VALUE, leave point there." - (or (= value 1) - (gomoku-goto-square square)) - (let ((inhibit-read-only t) - (inhibit-point-motion-hooks t)) - (insert-and-inherit (cond ((= value 1) ?X) - ((= value 6) ?O) - (?.))) - (and window-system - (zerop value) - (put-text-property (1- (point)) (point) 'mouse-face 'highlight)) + "Draw 'X', 'O' or '.' on SQUARE (depending on VALUE), leave point there." + (gomoku-goto-square square) + (gomoku-put-char (cond ((= value 1) ?X) + ((= value 6) ?O) + (t ?.))) + (sit-for 0)) ; Display NOW + +(defun gomoku-put-char (char) + "Draw CHAR on the Gomoku screen." + (let ((inhibit-read-only t)) + (insert char) (delete-char 1) - (backward-char 1)) - (sit-for 0)) ; Display NOW + (backward-char 1))) (defun gomoku-init-display (n m) "Display an N by M Gomoku board." (buffer-disable-undo (current-buffer)) - (let ((inhibit-read-only t) - (point 1) opoint - (intangible t) - (i m) j x) - ;; Try to minimize number of chars (because of text properties) - (setq tab-width - (if (zerop (% gomoku-x-offset gomoku-square-width)) - gomoku-square-width - (max (/ (+ (% gomoku-x-offset gomoku-square-width) - gomoku-square-width 1) 2) 2))) + (let ((inhibit-read-only t)) (erase-buffer) - (newline gomoku-y-offset) - (while (progn - (setq j n - x (- gomoku-x-offset gomoku-square-width)) - (while (>= (setq j (1- j)) 0) - (insert-char ?\t (/ (- (setq x (+ x gomoku-square-width)) - (current-column)) - tab-width)) - (insert-char ? (- x (current-column))) - (if (setq intangible (not intangible)) - (put-text-property point (point) 'intangible 2)) - (and (zerop j) - (= i (- m 2)) - (progn - (while (>= i 3) - (append-to-buffer (current-buffer) opoint (point)) - (setq i (- i 2))) - (goto-char (point-max)))) - (setq point (point)) - (insert ?.) - (if window-system - (put-text-property point (point) - 'mouse-face 'highlight))) - (> (setq i (1- i)) 0)) - (if (= i (1- m)) - (setq opoint point)) - (insert-char ?\n gomoku-square-height)) - (or (eq (char-after 1) ?.) - (put-text-property 1 2 'point-entered - (lambda (x x) (if (bobp) (forward-char))))) - (or intangible - (put-text-property point (point) 'intangible 2)) - (put-text-property point (point) 'point-entered - (lambda (x x) (if (eobp) (backward-char)))) - (put-text-property (point-min) (point) 'category 'gomoku-mode)) - (gomoku-goto-xy (/ (1+ n) 2) (/ (1+ m) 2)) ; center of the board - (sit-for 0)) ; Display NOW + (let (string1 string2 string3 string4) + ;; We do not use gomoku-plot-square which would be too slow for + ;; initializing the display. Rather we build STRING1 for lines where + ;; board squares are to be found, and STRING2 for empty lines. STRING1 is + ;; like STRING2 except for dots every DX squares. Empty lines are filled + ;; with spaces so that cursor moving up and down remains on the same + ;; column. + (setq string1 (concat (make-string (1- gomoku-square-width) ? ) ".") + string1 (apply 'concat + (make-list (1- n) string1)) + string1 (concat (make-string gomoku-x-offset ? ) "." string1 "\n") + string2 (make-string (+ 1 gomoku-x-offset + (* (1- n) gomoku-square-width)) + ? ) + string2 (concat string2 "\n") + string3 (apply 'concat + (make-list (1- gomoku-square-height) string2)) + string3 (concat string3 string1) + string3 (apply 'concat + (make-list (1- m) string3)) + string4 (apply 'concat + (make-list gomoku-y-offset string2))) + (insert string4 string1 string3)) + (gomoku-goto-xy (/ (1+ n) 2) (/ (1+ m) 2)) ; center of the board + (sit-for 0))) ; Display NOW (defun gomoku-display-statistics () "Obnoxiously display some statistics about previous games in mode line." ;; We store this string in the mode-line-process local variable. ;; This is certainly not the cleanest way out ... (setq mode-line-process - (format ": Won %d, lost %d%s" - gomoku-number-of-human-wins - gomoku-number-of-emacs-wins - (if (zerop gomoku-number-of-draws) - "" - (format ", drew %d" gomoku-number-of-draws)))) + (cond + ((not (zerop gomoku-number-of-draws)) + (format ": Won %d, lost %d, drew %d" + gomoku-number-of-human-wins + gomoku-number-of-emacs-wins + gomoku-number-of-draws)) + (t + (format ": Won %d, lost %d" + gomoku-number-of-human-wins + gomoku-number-of-emacs-wins)))) (force-mode-line-update)) (defun gomoku-switch-to-window () @@ -1058,11 +978,11 @@ (interactive) (let ((buff (get-buffer "*Gomoku*"))) (if buff ; Buffer exists: - (switch-to-buffer buff) ; no problem. - (if gomoku-game-in-progress - (gomoku-crash-game)) ; buffer has been killed or something - (switch-to-buffer "*Gomoku*") ; Anyway, start anew. - (gomoku-mode)))) + (switch-to-buffer buff) ; no problem. + (if gomoku-game-in-progress + (gomoku-crash-game)) ; buffer has been killed or something + (switch-to-buffer "*Gomoku*") ; Anyway, start anew. + (gomoku-mode)))) ;;; ;;; CROSSING WINNING QTUPLES. @@ -1073,6 +993,19 @@ ;; squares ! It only knows the square where the last move has been played and ;; who won. The solution is to scan the board along all four directions. +(defvar gomoku-winning-qtuple-beg nil + "First square of the winning qtuple.") + +(defvar gomoku-winning-qtuple-end nil + "Last square of the winning qtuple.") + +(defvar gomoku-winning-qtuple-dx nil + "Direction of the winning qtuple (along the X axis).") + +(defvar gomoku-winning-qtuple-dy nil + "Direction of the winning qtuple (along the Y axis).") + + (defun gomoku-find-filled-qtuple (square value) "Return T if SQUARE belongs to a qtuple filled with VALUEs." (or (gomoku-check-filled-qtuple square value 1 0) @@ -1082,105 +1015,121 @@ (defun gomoku-check-filled-qtuple (square value dx dy) "Return T if SQUARE belongs to a qtuple filled with VALUEs along DX, DY." + ;; And record it in the WINNING-QTUPLE-... variables. (let ((a 0) (b 0) (left square) (right square) - (depl (gomoku-xy-to-index dx dy))) + (depl (gomoku-xy-to-index dx dy)) + a+4) (while (and (> a -4) ; stretch tuple left (= value (aref gomoku-board (setq left (- left depl))))) (setq a (1- a))) - (while (and (< b (+ a 4)) ; stretch tuple right + (setq a+4 (+ a 4)) + (while (and (< b a+4) ; stretch tuple right (= value (aref gomoku-board (setq right (+ right depl))))) (setq b (1+ b))) - (cond ((= b (+ a 4)) ; tuple length = 5 ? - (gomoku-cross-qtuple (+ square (* a depl)) (+ square (* b depl)) - dx dy) + (cond ((= b a+4) ; tuple length = 5 ? + (setq gomoku-winning-qtuple-beg (+ square (* a depl)) + gomoku-winning-qtuple-end (+ square (* b depl)) + gomoku-winning-qtuple-dx dx + gomoku-winning-qtuple-dy dy) t)))) +(defun gomoku-cross-winning-qtuple () + "Cross winning qtuple, as found by `gomoku-find-filled-qtuple'." + (gomoku-cross-qtuple gomoku-winning-qtuple-beg + gomoku-winning-qtuple-end + gomoku-winning-qtuple-dx + gomoku-winning-qtuple-dy)) + (defun gomoku-cross-qtuple (square1 square2 dx dy) "Cross every square between SQUARE1 and SQUARE2 in the DX, DY direction." (save-excursion ; Not moving point from last square - (let ((depl (gomoku-xy-to-index dx dy)) - (inhibit-read-only t) - (inhibit-point-motion-hooks t)) + (let ((depl (gomoku-xy-to-index dx dy))) ;; WARNING: this function assumes DEPL > 0 and SQUARE2 > SQUARE1 - (while (/= square1 square2) + (while (not (= square1 square2)) (gomoku-goto-square square1) (setq square1 (+ square1 depl)) (cond - ((= dy 0) ; Horizontal - (forward-char 1) - (insert-char ?- (1- gomoku-square-width) t) - (delete-region (point) (progn - (skip-chars-forward " \t") - (point)))) - ((= dx 0) ; Vertical - (let ((n 1) - (column (current-column))) + ((and (= dx 1) (= dy 0)) ; Horizontal + (let ((n 1)) + (while (< n gomoku-square-width) + (setq n (1+ n)) + (forward-char 1) + (gomoku-put-char ?-)))) + ((and (= dx 0) (= dy 1)) ; Vertical + (let ((n 1)) (while (< n gomoku-square-height) (setq n (1+ n)) - (forward-line 1) - (indent-to column) - (insert-and-inherit ?|)))) - ((= dx -1) ; 1st Diagonal - (indent-to (prog1 (- (current-column) (/ gomoku-square-width 2)) - (forward-line (/ gomoku-square-height 2)))) - (insert-and-inherit ?/)) - (t ; 2nd Diagonal - (indent-to (prog1 (+ (current-column) (/ gomoku-square-width 2)) - (forward-line (/ gomoku-square-height 2)))) - (insert-and-inherit ?\\)))))) + (next-line 1) + (gomoku-put-char ?|)))) + ((and (= dx -1) (= dy 1)) ; 1st Diagonal + (backward-char (/ gomoku-square-width 2)) + (next-line (/ gomoku-square-height 2)) + (gomoku-put-char ?/)) + ((and (= dx 1) (= dy 1)) ; 2nd Diagonal + (forward-char (/ gomoku-square-width 2)) + (next-line (/ gomoku-square-height 2)) + (gomoku-put-char ?\\)))))) (sit-for 0)) ; Display NOW ;;; ;;; CURSOR MOTION. ;;; -;; previous-line and next-line don't work right with intangible newlines +(defun gomoku-move-left () + "Move point backward one column on the Gomoku board." + (interactive) + (let ((x (gomoku-point-x))) + (backward-char (cond ((null x) 1) + ((> x 1) gomoku-square-width) + (t 0))))) + +(defun gomoku-move-right () + "Move point forward one column on the Gomoku board." + (interactive) + (let ((x (gomoku-point-x))) + (forward-char (cond ((null x) 1) + ((< x gomoku-board-width) gomoku-square-width) + (t 0))))) + (defun gomoku-move-down () "Move point down one row on the Gomoku board." (interactive) - (if (< (gomoku-point-y) gomoku-board-height) - (next-line gomoku-square-height))) + (let ((y (gomoku-point-y))) + (next-line (cond ((null y) 1) + ((< y gomoku-board-height) gomoku-square-height) + (t 0))))) (defun gomoku-move-up () "Move point up one row on the Gomoku board." (interactive) - (if (> (gomoku-point-y) 1) - (previous-line gomoku-square-height))) + (let ((y (gomoku-point-y))) + (previous-line (cond ((null y) 1) + ((> y 1) gomoku-square-height) + (t 0))))) (defun gomoku-move-ne () "Move point North East on the Gomoku board." (interactive) (gomoku-move-up) - (forward-char)) + (gomoku-move-right)) (defun gomoku-move-se () "Move point South East on the Gomoku board." (interactive) (gomoku-move-down) - (forward-char)) + (gomoku-move-right)) (defun gomoku-move-nw () "Move point North West on the Gomoku board." (interactive) (gomoku-move-up) - (backward-char)) + (gomoku-move-left)) (defun gomoku-move-sw () "Move point South West on the Gomoku board." (interactive) (gomoku-move-down) - (backward-char)) - -(defun gomoku-beginning-of-line () - "Move point to first square on the Gomoku board row." - (interactive) - (move-to-column gomoku-x-offset)) - -(defun gomoku-end-of-line () - "Move point to last square on the Gomoku board row." - (interactive) - (move-to-column (+ gomoku-x-offset - (* gomoku-square-width (1- gomoku-board-width))))) + (gomoku-move-left)) (provide 'gomoku) diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/hyperbole/hui-mouse.el --- a/lisp/hyperbole/hui-mouse.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/hyperbole/hui-mouse.el Mon Aug 13 08:56:04 2007 +0200 @@ -458,7 +458,7 @@ (goto-char (point-max))) ((looking-at "~") (dired-flag-backup-files)) ((looking-at "#") (dired-flag-auto-save-files)) - (t (dired-flag-file-deleted 1)))) + (t (dired-flag-file-deletion 1)))) ;;; ************************************************************************ ;;; smart-gnus functions diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/modes/hideif.el --- a/lisp/modes/hideif.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/modes/hideif.el Mon Aug 13 08:56:04 2007 +0200 @@ -138,7 +138,7 @@ (define-key hide-ifdef-mode-submap "\C-s" 'show-ifdef-block) (define-key hide-ifdef-mode-submap "\C-q" 'hide-ifdef-toggle-read-only) - (let ((where (where-is-internal 'toggle-read-only '(keymap) t))) + (let ((where (where-is-internal 'toggle-read-only nil t))) (if where (define-key hide-ifdef-mode-submap where @@ -168,8 +168,8 @@ ; (cons '(hide-ifdef-mode " Ifdef") ; minor-mode-alist))) ;; XEmacs: do it right. -;;;###autoload -(add-minor-mode 'hide-ifdef-mode " Ifdef") +;;;don't ###autoload because of startup code doesn't define the map +(add-minor-mode 'hide-ifdef-mode " Ifdef" hide-ifdef-mode-map) ;; fix c-mode syntax table so we can recognize whole symbols. (defvar hide-ifdef-syntax-table diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/modes/list-mode.el --- a/lisp/modes/list-mode.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/modes/list-mode.el Mon Aug 13 08:56:04 2007 +0200 @@ -158,12 +158,15 @@ (defun list-mode-item-mouse-selected (event) (interactive "e") - ;; #### sometimes event-closest-point returns nil. + ;; Sometimes event-closest-point returns nil. + ;; So beep instead of bombing. (let ((point (event-closest-point event))) - (list-mode-item-selected-1 (extent-at point - (event-buffer event) - 'list-mode-item nil 'at) - event))) + (if point + (list-mode-item-selected-1 (extent-at point + (event-buffer event) + 'list-mode-item nil 'at) + event) + (ding)))) (defun add-list-mode-item (start end &optional buffer activate-callback user-data) diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/modes/outl-mouse.el --- a/lisp/modes/outl-mouse.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/modes/outl-mouse.el Mon Aug 13 08:56:04 2007 +0200 @@ -109,10 +109,12 @@ ;; ;; No user definable variables beyond this point. ;; -(defconst outline-up-arrow - (make-pixmap ; an up-arrow - (if (featurep 'xpm) - (concat "/* XPM */ + +;; I'll bet there's a neat way to do this with specifiers -- a pity the +;; sucks so badly on it. -sb +(defconst outline-up-arrow ; XEmacs + (make-glyph ; an up-arrow + (cond ((featurep 'xpm) (vector 'xpm :data (concat "/* XPM */ static char * arrow[] = { \"10 10 5 1\", \" c none\", @@ -129,15 +131,19 @@ \" ..ooooXX \", \" ..ooooXX \", \"..OOOOOOXX\", -\"OOOOOOOOOO\"};") - (list 10 10 (concat "\000\000\000\000\060\000\060\000\150\000" - "\150\000\324\000\324\000\376\001\376\001")))) +\"OOOOOOOOOO\"};"))) + ((featurep 'x) + (vector 'xbm + :data + (list 10 10 + (concat "\000\000\000\000\060\000\060\000\150\000" + "\150\000\324\000\324\000\376\001\376\001")))) + (t "^"))) "Bitmap object for outline up glyph.") -(defconst outline-up-arrow-mask - (make-pixmap ; an up-arrow - (if (featurep 'xpm) - (concat "/* XPM */ +(defconst outline-up-arrow-mask ; XEmacs + (make-glyph ; an up-arrow + (cond ((featurep 'xpm) (vector 'xpm :data (concat "/* XPM */ static char * arrow[] = { \"10 10 5 1\", \" c none\", @@ -154,15 +160,19 @@ \" ..ooooXX \", \" ..ooooXX \", \"..OOOOOOXX\", -\"OOOOOOOOOO\"};") - (list 10 10 (concat "\000\000\000\000\060\000\060\000\130\000" - "\130\000\254\000\274\000\006\001\376\001")))) +\"OOOOOOOOOO\"};"))) + ((featurep 'x) + (vector 'xbm + :data + (list 10 10 + (concat "\000\000\000\000\060\000\060\000\130\000" + "\130\000\254\000\274\000\006\001\376\001")))) + (t "+"))) "Bitmap object for outline depressed up glyph.") -(defconst outline-down-arrow - (make-pixmap ; a down-arrow - (if (featurep 'xpm) - (concat "/* XPM */ +(defconst outline-down-arrow ; XEmacs + (make-glyph ; a down-arrow + (cond ((featurep 'xpm) (vector 'xpm :data (concat "/* XPM */ static char * down[] = { \"10 10 5 1\", \" c " outline-glyph-lit-colour "\", @@ -179,15 +189,19 @@ \"ooo..XXooo\", \"ooo..XXooo\", \"oooo.Xoooo\", -\"oooo.Xoooo\"};") - (list 10 10 (concat "\000\000\000\000\376\001\202\001\364\000" - "\324\000\150\000\150\000\060\000\060\000")))) +\"oooo.Xoooo\"};"))) + ((featurep 'x) + (vector 'xbm + :data + (list 10 10 + (concat "\000\000\000\000\376\001\202\001\364\000" + "\324\000\150\000\150\000\060\000\060\000")))) + (t "v"))) "Bitmap object for outline down glyph.") -(defconst outline-down-arrow-mask - (make-pixmap ; a down-arrow - (if (featurep 'xpm) - (concat "/* XPM */ +(defconst outline-down-arrow-mask ; XEmacs + (make-glyph ; a down-arrow + (cond ((featurep 'xpm) (vector 'xpm :data (concat "/* XPM */ static char * down[] = { \"10 10 5 1\", \" c " outline-glyph-shade-colour "\", @@ -204,15 +218,19 @@ \"ooo..XXooo\", \"ooo..XXooo\", \"oooo.Xoooo\", -\"oooo.Xoooo\"};") - (list 10 10 (concat "\000\000\000\000\376\001\376\001\254\000" - "\254\000\130\000\130\000\060\000\060\000")))) +\"oooo.Xoooo\"};"))) + ((featurep 'x) + (vector 'xbm + :data + (list 10 10 + (concat "\000\000\000\000\376\001\376\001\254\000" + "\254\000\130\000\130\000\060\000\060\000")))) + (t "+"))) "Bitmap object for outline depressed down glyph.") (defconst outline-right-arrow - (make-pixmap ; a right-arrow - (if (featurep 'xpm) - (concat "/* XPM */ + (make-glyph ; a right-arrow + (cond ((featurep 'xpm) (vector 'xpm :data (concat "/* XPM */ static char * right[] = { \"10 10 5 1\", \" c " outline-glyph-lit-colour "\", @@ -229,15 +247,19 @@ \" ooOOOOXX\", \" OOOOXXXX\", \" OOOXXXXXX\", -\" OXXXXXXXX\"};") - (list 10 10 (concat "\000\000\006\000\032\000\142\000\232\001" - "\352\001\172\000\036\000\006\000\000\000")))) +\" OXXXXXXXX\"};"))) + ((featurep 'x) + (vector 'xbm + :data + (list 10 10 + (concat "\000\000\006\000\032\000\142\000\232\001" + "\352\001\172\000\036\000\006\000\000\000")))) + (t ">"))) "Bitmap object for outline right glyph.") (defconst outline-right-arrow-mask - (make-pixmap ; a right-arrow - (if (featurep 'xpm) - (concat "/* XPM */ + (make-glyph ; a right-arrow + (cond ((featurep 'xpm) (vector 'xpm :data (concat "/* XPM */ static char * right[] = { \"10 10 5 1\", \" c " outline-glyph-shade-colour "\", @@ -254,9 +276,14 @@ \" ooOOOOXX\", \" OOOOXXXX\", \" OOOXXXXXX\", -\" OXXXXXXXX\"};") - (list 10 10 (concat "\000\000\006\000\036\000\176\000\346\001" - "\236\001\146\000\036\000\006\000\000\000")))) +\" OXXXXXXXX\"};"))) + ((featurep 'x) + (vector 'xbm + :data + (list 10 10 + (concat "\000\000\006\000\036\000\176\000\346\001" + "\236\001\146\000\036\000\006\000\000\000")))) + (t "+"))) "Bitmap object for outline depressed right glyph.") (defvar outline-glyph-menu diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/modes/outline.el --- a/lisp/modes/outline.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/modes/outline.el Mon Aug 13 08:56:04 2007 +0200 @@ -172,16 +172,19 @@ ;;; #+XEmacs (defun outline-install-menubar (&optional remove) ;; install or remove the outline menus - (let ((menus (cdr outline-mode-menu)) path) - (and (not remove) - (set-buffer-menubar (copy-sequence current-menubar))) - (while menus - (setq path (list (car (car menus)))) - (if (and remove (find-menu-item current-menubar path)) - (delete-menu-item path) - (or (car (find-menu-item current-menubar path)) - (add-menu nil (car (car menus)) (cdr (car menus)) nil))) - (setq menus (cdr menus))))) + ;; This is a nop if menubars aren't available + (when (and (featurep 'menubar) ; XEmacs + current-menubar) + (let ((menus (cdr outline-mode-menu)) path) + (and (not remove) + (set-buffer-menubar (copy-sequence current-menubar))) + (while menus + (setq path (list (car (car menus)))) + (if (and remove (find-menu-item current-menubar path)) + (delete-menu-item path) + (or (car (find-menu-item current-menubar path)) + (add-menu nil (car (car menus)) (cdr (car menus)) nil))) + (setq menus (cdr menus)))))) ;;;###autoload (defvar outline-minor-mode nil diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/modes/sendmail.el --- a/lisp/modes/sendmail.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/modes/sendmail.el Mon Aug 13 08:56:04 2007 +0200 @@ -290,7 +290,9 @@ ;; Emacs and XEmacs less stupid about default mail addresses. ;; We trust the administrator if he has set `mail-host-address'. -(defcustom query-user-mail-address (not mail-host-address) +;; We trust the user if he has already customized `user-mail-address'. +(defcustom query-user-mail-address (and (not mail-host-address) + (not user-mail-address)) "If non-nil, prompt the user for his mail address." :group 'message :type 'boolean) @@ -1003,10 +1005,8 @@ t) (or soft (progn (goto-char end) - ;; #### FSF has the next two clauses reversed. - ;; which is correct? - (skip-chars-backward "\n") - (insert "\n" field ": "))) + (insert field ": \n") + (forward-char -1))) nil))) (defun mail-text () diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/modes/sh-script.el --- a/lisp/modes/sh-script.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/modes/sh-script.el Mon Aug 13 08:56:04 2007 +0200 @@ -926,6 +926,7 @@ (interactive) (let ((previous (save-excursion (while (and (not (bobp)) + (not (eq (point-min) (point-at-bol))) (progn (forward-line -1) (back-to-indentation) diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/packages/add-log.el --- a/lisp/packages/add-log.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/packages/add-log.el Mon Aug 13 08:56:04 2007 +0200 @@ -1,6 +1,6 @@ ;;; add-log.el --- change log maintenance commands for Emacs -;; Copyright (C) 1985, 1986, 1988, 1993, 1994 Free Software Foundation, Inc. +;; Copyright (C) 1985, 86, 88, 93, 94, 1997 Free Software Foundation, Inc. ;; Keywords: maint @@ -21,7 +21,7 @@ ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. -;;; Synched up with: FSF 19.34. +;;; Synched up with: Emacs 20.0. ;;; Commentary: @@ -53,14 +53,37 @@ "*Electronic mail address of user, for inclusion in ChangeLog daily headers. This defaults to the value of `user-mail-address'.") +;; XEmacs: ;; So that the dump-time value doesn't go into loaddefs.el with the autoload. (or add-log-mailing-address (setq add-log-mailing-address user-mail-address)) + (defvar change-log-font-lock-keywords - '(("^[SMTWF].+" . font-lock-function-name-face) ; Date line. - ("^\t\\* \\([^ :\n]+\\)" 1 font-lock-comment-face) ; File name. - ("(\\([^)\n]+\\)):" 1 font-lock-keyword-face)) ; Function name. + '(;; + ;; Date lines, new and old styles. + ("^\\sw.........[0-9: ]*" + (0 font-lock-string-face) + ("\\([^<]+\\)<\\([A-Za-z0-9_.-]+@[A-Za-z0-9_.-]+\\)>" nil nil + (1 font-lock-reference-face) + (2 font-lock-variable-name-face))) + ;; + ;; File names. + ("^\t\\* \\([^ ,:([\n]+\\)" + (1 font-lock-function-name-face) + ("\\=, \\([^ ,:([\n]+\\)" nil nil (1 font-lock-function-name-face))) + ;; + ;; Function or variable names. + ("(\\([^ ,:\n]+\\)" + (1 font-lock-keyword-face) + ("\\=, \\([^ ,:\n]+\\)" nil nil (1 font-lock-keyword-face))) + ;; + ;; Conditionals. + ("\\[!?\\([^]\n]+\\)\\]\\(:\\| (\\)" (1 font-lock-variable-name-face)) + ;; + ;; Acknowledgments. + ("^\t\\(From\\|Reported by\\)" 1 font-lock-comment-face) + ) "Additional expressions to highlight in Change Log mode.") (put 'change-log-mode 'font-lock-defaults '(change-log-font-lock-keywords t)) @@ -69,16 +92,31 @@ "Keymap for Change Log major mode.") (if change-log-mode-map nil - (setq change-log-mode-map (make-sparse-keymap)) - (define-key change-log-mode-map "\M-q" 'change-log-fill-paragraph)) + (setq change-log-mode-map (make-sparse-keymap))) + +(defvar change-log-time-zone-rule nil + "Time zone used for calculating change log time stamps. +It takes the same format as the TZ argument of `set-time-zone-rule'. +If nil, use local time.") + +(defun iso8601-time-zone (time) + (let* ((utc-offset (or (car (current-time-zone time)) 0)) + (sign (if (< utc-offset 0) ?- ?+)) + (sec (abs utc-offset)) + (ss (% sec 60)) + (min (/ sec 60)) + (mm (% min 60)) + (hh (/ min 60))) + (format (cond ((not (zerop ss)) "%c%02d:%02d:%02d") + ((not (zerop mm)) "%c%02d:%02d") + (t "%c%02d")) + sign hh mm ss))) (defun change-log-name () (or change-log-default-name (if (eq system-type 'vax-vms) - "$CHANGE_LOG$.TXT" - (if (or (eq system-type 'ms-dos) (eq system-type 'windows-nt)) - "changelo" - "ChangeLog")))) + "$CHANGE_LOG$.TXT" + "ChangeLog"))) ;;;###autoload (defun prompt-for-change-log-name () @@ -162,7 +200,8 @@ Second arg is file name of change log. If nil, uses `change-log-default-name'. Third arg OTHER-WINDOW non-nil means visit in other window. Fourth arg NEW-ENTRY non-nil means always create a new entry at the front; -never append to an existing entry." +never append to an existing entry. Today's date is calculated according to +`change-log-time-zone-rule' if non-nil, otherwise in local time." (interactive (list current-prefix-arg (prompt-for-change-log-name))) (or add-log-full-name @@ -202,14 +241,23 @@ (change-log-mode)) (undo-boundary) (goto-char (point-min)) - (if (looking-at (concat (regexp-quote (substring (current-time-string) - 0 10)) - ".* " (regexp-quote add-log-full-name) - " <" (regexp-quote add-log-mailing-address))) - (forward-line 1) - (insert (current-time-string) - " " add-log-full-name - " <" add-log-mailing-address ">\n\n")) + (let ((new-entry (concat (if change-log-time-zone-rule + (let ((tz (getenv "TZ")) + (now (current-time))) + (unwind-protect + (progn + (set-time-zone-rule + change-log-time-zone-rule) + (concat + (format-time-string "%Y-%m-%d " now) + (iso8601-time-zone now))) + (set-time-zone-rule tz))) + (format-time-string "%Y-%m-%d")) + " " add-log-full-name + " <" add-log-mailing-address ">"))) + (if (looking-at (regexp-quote new-entry)) + (forward-line 1) + (insert new-entry "\n\n"))) ;; Search only within the first paragraph. (if (looking-at "\n*[^\n* \t]") @@ -282,14 +330,6 @@ (add-change-log-entry whoami file-name t)) ;;;###autoload (define-key ctl-x-4-map "a" 'add-change-log-entry-other-window) -(defvar change-log-mode-map nil - "Keymap for Change Log major mode.") -(if change-log-mode-map - nil - (setq change-log-mode-map (make-sparse-keymap)) - (set-keymap-name change-log-mode-map 'change-log-mode-map) - (define-key change-log-mode-map "\M-q" 'change-log-fill-paragraph)) - ;;;###autoload (defun change-log-mode () "Major mode for editing change logs; like Indented Text Mode. @@ -307,17 +347,21 @@ indent-tabs-mode t tab-width 8) (use-local-map change-log-mode-map) + (set (make-local-variable 'fill-paragraph-function) + 'change-log-fill-paragraph) ;; Let each entry behave as one paragraph: ;; We really do want "^" in paragraph-start below: it is only the lines that ;; begin at column 0 (despite the left-margin of 8) that we are looking for. - (set (make-local-variable 'paragraph-start) "\\s *$\\|\f\\|^\\sw") - (set (make-local-variable 'paragraph-separate) "\\s *$\\|\f\\|^\\sw") + (set (make-local-variable 'paragraph-start) "\\s *$\\|\f\\|^\\<") + (set (make-local-variable 'paragraph-separate) "\\s *$\\|\f\\|^\\<") ;; Let all entries for one day behave as one page. ;; Match null string on the date-line so that the date-line ;; is grouped with what follows. (set (make-local-variable 'page-delimiter) "^\\<\\|^\f") (set (make-local-variable 'version-control) 'never) (set (make-local-variable 'adaptive-fill-regexp) "\\s *") + ;;(set (make-local-variable 'font-lock-defaults) + ;;'(change-log-font-lock-keywords t)) (run-hooks 'change-log-mode-hook)) ;; It might be nice to have a general feature to replace this. The idea I @@ -328,16 +372,32 @@ "Fill the paragraph, but preserve open parentheses at beginning of lines. Prefix arg means justify as well." (interactive "P") - (let ((end (save-excursion (forward-paragraph) (point))) - (beg (save-excursion (backward-paragraph)(point))) + (let ((end (progn (forward-paragraph) (point))) + (beg (progn (backward-paragraph) (point))) (paragraph-start (concat paragraph-start "\\|\\s *\\s("))) - (fill-region beg end justify))) + (fill-region beg end justify) + t)) (defvar add-log-current-defun-header-regexp "^\\([A-Z][A-Z_ ]*[A-Z_]\\|[-_a-zA-Z]+\\)[ \t]*[:=]" "*Heuristic regexp used by `add-log-current-defun' for unknown major modes.") ;;;###autoload +(defvar add-log-lisp-like-modes + '(emacs-lisp-mode lisp-mode scheme-mode lisp-interaction-mode) + "*Modes that look like Lisp to `add-log-current-defun'.") + +;;;###autoload +(defvar add-log-c-like-modes + '(c-mode c++-mode c++-c-mode objc-mode) + "*Modes that look like C to `add-log-current-defun'.") + +;;;###autoload +(defvar add-log-tex-like-modes + '(TeX-mode plain-TeX-mode LaTeX-mode plain-tex-mode latex-mode) + "*Modes that look like TeX to `add-log-current-defun'.") + +;;;###autoload (defun add-log-current-defun () "Return name of function definition point is in, or nil. @@ -353,8 +413,7 @@ (condition-case nil (save-excursion (let ((location (point))) - (cond ((memq major-mode '(emacs-lisp-mode lisp-mode scheme-mode - lisp-interaction-mode)) + (cond ((memq major-mode add-log-lisp-like-modes) ;; If we are now precisely at the beginning of a defun, ;; make sure beginning-of-defun finds that one ;; rather than the previous one. @@ -373,14 +432,15 @@ (skip-chars-forward " '") (buffer-substring (point) (progn (forward-sexp 1) (point)))))) - ((and (memq major-mode '(c-mode c++-mode c++-c-mode objc-mode)) - (save-excursion (beginning-of-line) - ;; Use eq instead of = here to avoid - ;; error when at bob and char-after - ;; returns nil. - (while (eq (char-after (- (point) 2)) ?\\) - (forward-line -1)) - (looking-at "[ \t]*#[ \t]*define[ \t]"))) + ((and (memq major-mode add-log-c-like-modes) + (save-excursion + (beginning-of-line) + ;; Use eq instead of = here to avoid + ;; error when at bob and char-after + ;; returns nil. + (while (eq (char-after (- (point) 2)) ?\\) + (forward-line -1)) + (looking-at "[ \t]*#[ \t]*define[ \t]"))) ;; Handle a C macro definition. (beginning-of-line) (while (eq (char-after (- (point) 2)) ?\\) ;not =; note above @@ -389,7 +449,7 @@ (skip-chars-forward " \t") (buffer-substring (point) (progn (forward-sexp 1) (point)))) - ((memq major-mode '(c-mode c++-mode c++-c-mode objc-mode)) + ((memq major-mode add-log-c-like-modes) (beginning-of-line) ;; See if we are in the beginning part of a function, ;; before the open brace. If so, advance forward. @@ -484,10 +544,7 @@ (looking-at "struct \\|union \\|class ") (setq middle (point))) (buffer-substring middle end))))))))) - ((memq major-mode - '(TeX-mode plain-TeX-mode LaTeX-mode;; tex-mode.el - plain-tex-mode latex-mode;; cmutex.el - )) + ((memq major-mode add-log-tex-like-modes) (if (re-search-backward "\\\\\\(sub\\)*\\(section\\|paragraph\\|chapter\\)" nil t) (progn diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/packages/auto-save.el --- a/lisp/packages/auto-save.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/packages/auto-save.el Mon Aug 13 08:56:04 2007 +0200 @@ -2,7 +2,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; File: auto-save.el -;; Version: $Revision: 1.3 $ +;; Version: $Revision: 1.4 $ ;; RCS: ;; Description: Safer autosaving with support for efs and /tmp. ;; This version of auto-save is designed to work with efs, @@ -11,7 +11,7 @@ ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defconst auto-save-version (substring "$Revision: 1.3 $" 11 -2) +(defconst auto-save-version (substring "$Revision: 1.4 $" 11 -2) "Version number of auto-save.") ;;; Copyright (C) 1992 by Sebastian Kremer @@ -250,7 +250,17 @@ ;; the next Emacs session (the one after the crash) the ;; pid will be different, but file-less buffers like ;; *mail* must be recovered manually anyway. - (name-prefix (if file-name nil (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. +;; (name-prefix (if file-name nil (make-temp-name "#%"))) + (name-prefix (if file-name nil "#%")) + (save-name (or file-name ;; Prevent autosave errors. Buffername ;; (to become non-dir part of filename) will @@ -476,10 +486,10 @@ (t (setq total (1+ total)) (with-output-to-temp-buffer "*Directory*" - (call-process "ls" nil standard-output nil - "-l" afile (if file (list file)))) + (apply 'call-process "ls" nil standard-output nil + "-l" afile (if file (list file)))) (if (yes-or-no-p (format "Recover %s from auto save file? " - file)) + (or file "non-file buffer"))) (let* ((obuf (current-buffer)) (buf (set-buffer (if file diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/packages/etags.el --- a/lisp/packages/etags.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/packages/etags.el Mon Aug 13 08:56:04 2007 +0200 @@ -807,8 +807,8 @@ "Form for `tags-loop-continue' to eval to change one file.") (defvar tags-loop-scan - '(error (substitute-command-keys - "No \\[tags-search] or \\[tags-query-replace] in progress.")) + '(error "%s" (substitute-command-keys + "No \\[tags-search] or \\[tags-query-replace] in progress.")) "Form for `tags-loop-continue' to eval to scan one file. If it returns non-nil, this file needs processing by evalling \`tags-loop-operate'. Otherwise, move on to the next file.") diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/packages/font-lock.el --- a/lisp/packages/font-lock.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/packages/font-lock.el Mon Aug 13 08:56:04 2007 +0200 @@ -1101,8 +1101,6 @@ (let* ((match (nth 0 highlight)) (start (match-beginning match)) (end (match-end match)) (override (nth 2 highlight))) - (and end - (goto-char end)) ;; tlp00 hack to allow for back to back fonts (let ((newface (nth 1 highlight))) (or (symbolp newface) (setq newface (eval newface))) @@ -1820,7 +1818,8 @@ ;; In FSF this has the simpler definition of "\\sw+" for ctoken. ;; I'm not sure if ours is more correct. - (list (concat "^\\(" ctoken "\\)[ \t]*(") 1 'font-lock-function-name-face) + ;; This is a subset of the next rule, and is slower when present. --dmoore + ;; (list (concat "^\\(" ctoken "\\)[ \t]*(") 1 'font-lock-function-name-face) ;; ;; fontify the names of functions being defined. ;; FSF doesn't have this but I think it should be fast for us because @@ -1829,13 +1828,17 @@ ;; the time to do the regexp phase of font-lock for a C file!) Not ;; including this discriminates against those who don't follow the ;; GNU coding style. --ben + ;; x?x?x?y?z should always be: (x(xx?)?)?y?z --dmoore (list (concat - "^\\(" ctoken "[ \t]+\\)?" ; type specs; there can be no - "\\(" ctoken "[ \t]+\\)?" ; more than 3 tokens, right? - "\\(" ctoken "[ \t]+\\)?" + "^\\(" + "\\(" ctoken "[ \t]+\\)" ; type specs; there can be no + "\\(" + "\\(" ctoken "[ \t]+\\)" ; more than 3 tokens, right? + "\\(" ctoken "[ \t]+\\)" + "?\\)?\\)?" "\\([*&]+[ \t]*\\)?" ; pointer "\\(" ctoken "\\)[ \t]*(") ; name - 8 'font-lock-function-name-face) + 10 'font-lock-function-name-face) ;; ;; This is faster but not by much. I don't see why not. ;(list (concat "^\\(" ctoken "\\)[ \t]*(") 1 'font-lock-function-name-face) @@ -1934,7 +1937,9 @@ (append ;; ;; The list `c-font-lock-keywords-1' less that for function names. - (cdr c-font-lock-keywords-1) + ;; the simple function form regexp has been removed. --dmoore + ;;(cdr c-font-lock-keywords-1) + c-font-lock-keywords-1 ;; ;; Fontify function name definitions, possibly incorporating class name. (list diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/packages/gnuserv.el --- a/lisp/packages/gnuserv.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/packages/gnuserv.el Mon Aug 13 08:56:04 2007 +0200 @@ -461,7 +461,8 @@ nil ;yep (server-write-to-client (car client) nil) ;nope, tell client (setq server-clients (delq client server-clients)))) - (setq old-clients (cdr old-clients)))))))) + (setq old-clients (cdr old-clients))) + t))))) ;; Ask before killing a server buffer. diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/packages/info.el --- a/lisp/packages/info.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/packages/info.el Mon Aug 13 08:56:04 2007 +0200 @@ -361,7 +361,7 @@ changed to name of the file to decode, otherwise the file is given to the command as standard input. If STRING is nil, no decoding is done.") -(defvar Info-footnote-tag "See" +(defvar Info-footnote-tag "Note" "*Symbol that identifies a footnote or cross-reference. All \"*Note\" references will be changed to use this word instead.") @@ -1829,7 +1829,9 @@ (bury-buffer (current-buffer)) (if (and (featurep 'toolbar) (eq toolbar-info-frame (selected-frame))) - (delete-frame toolbar-info-frame) + (condition-case nil + (delete-frame toolbar-info-frame) + (error (bury-buffer))) (switch-to-buffer (other-buffer (current-buffer)))))) (defun Info-undefined () diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/packages/pending-del.el --- a/lisp/packages/pending-del.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/packages/pending-del.el Mon Aug 13 08:56:04 2007 +0200 @@ -48,15 +48,19 @@ t))) (defun pending-delete-pre-hook () - (let ((type (and (symbolp this-command) - (get this-command 'pending-delete)))) - (cond ((eq type 'kill) - (delete-active-region t)) - ((eq type 'supersede) - (if (delete-active-region ()) - (setq this-command '(lambda () (interactive))))) - (type - (delete-active-region ()))))) + ;; don't ever signal an error in pre-command-hook! + (condition-case e + (let ((type (and (symbolp this-command) + (get this-command 'pending-delete)))) + (cond ((eq type 'kill) + (delete-active-region t)) + ((eq type 'supersede) + (if (delete-active-region ()) + (setq this-command '(lambda () (interactive))))) + (type + (delete-active-region ())))) + (error + (warn "Error caught in `pending-delete-pre-hook': %s" e)))) (put 'self-insert-command 'pending-delete t) diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/packages/rcompile.el --- a/lisp/packages/rcompile.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/packages/rcompile.el Mon Aug 13 08:56:04 2007 +0200 @@ -106,12 +106,16 @@ "Compile the current buffer's directory on HOST. Log in as USER. See \\[compile]." (interactive - (let ((parsed (and (featurep 'ange-ftp) - ;; XEmacs change - (or (and (fboundp 'ange-ftp-ftp-name) - (ange-ftp-ftp-name default-directory)) - (and (fboundp 'ange-ftp-ftp-path) - (ange-ftp-ftp-path default-directory))))) + (let ((parsed + ;; XEmacs change + (cond + ((featurep 'efs) + (efs-ftp-path default-directory)) + ((featurep 'ange-ftp) + (if (fboundp 'ange-ftp-ftp-name) + (ange-ftp-ftp-name default-directory) + (ange-ftp-ftp-path default-directory))) + (t nil))) host user command prompt) (if parsed (setq host (nth 0 parsed) @@ -145,12 +149,16 @@ (setq remote-compile-user user)) ((null remote-compile-user) (setq remote-compile-user (user-login-name)))) - (let* ((parsed (and (featurep 'ange-ftp) - ;; XEmacs change - (or (and (fboundp 'ange-ftp-ftp-name) - (ange-ftp-ftp-name default-directory)) - (and (fboundp 'ange-ftp-ftp-path) - (ange-ftp-ftp-path default-directory))))) + (let* ((parsed + ;; XEmacs change + (cond + ((featurep 'efs) + (efs-ftp-path default-directory)) + ((featurep 'ange-ftp) + (if (fboundp 'ange-ftp-ftp-name) + (ange-ftp-ftp-name default-directory) + (ange-ftp-ftp-path default-directory))) + (t nil))) (compile-command (format "%s %s -l %s \"(%scd %s; %s)\"" remote-shell-program diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/packages/vc.el --- a/lisp/packages/vc.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/packages/vc.el Mon Aug 13 08:56:04 2007 +0200 @@ -1160,8 +1160,8 @@ (vc-file-tree-walk subfunction) (vc-dir-all-files subfunction))) (save-excursion - (dired (make-string-stringlist (cons dir (nreverse filelist))) - dired-listing-switches) + (dired (cons dir (nreverse filelist)) + dired-listing-switches) (rename-buffer (generate-new-buffer-name "VC-DIRED")) (setq dired-buf (current-buffer)) (setq nonempty (not (zerop (buffer-size))))) diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/pcl-cvs/pcl-cvs.el --- a/lisp/pcl-cvs/pcl-cvs.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/pcl-cvs/pcl-cvs.el Mon Aug 13 08:56:04 2007 +0200 @@ -1,10 +1,10 @@ ;;; ;;;#ident "@(#)OrigId: pcl-cvs.el,v 1.93 1993/05/31 22:44:00 ceder Exp " ;;; -;;;#ident "@(#)cvs/contrib/pcl-cvs:$Name: r19-15b102 $:$Id: pcl-cvs.el,v 1.3 1997/03/21 03:43:23 steve Exp $" +;;;#ident "@(#)cvs/contrib/pcl-cvs:$Name: r19-16b90 $:$Id: pcl-cvs.el,v 1.4 1997/08/21 06:24:01 steve Exp $" ;;; ;;; pcl-cvs.el -- A Front-end to CVS 1.3 or later. -;;; Release 1.05-CVS-$Name: r19-15b102 $. +;;; Release 1.05-CVS-$Name: r19-16b90 $. ;;; Copyright (C) 1991, 1992, 1993 Per Cederqvist ;;; This program is free software; you can redistribute it and/or modify @@ -126,7 +126,7 @@ ;;; END OF THINGS TO CHECK WHEN INSTALLING ;;; -------------------------------------------------------- -(defconst pcl-cvs-version "1.05-CVS-$Name: r19-15b102 $" +(defconst pcl-cvs-version "1.05-CVS-$Name: r19-16b90 $" "A string denoting the current release version of pcl-cvs.") ;; You are NOT allowed to disable this message by default. However, you @@ -139,8 +139,8 @@ (defconst cvs-startup-message (if cvs-inhibit-copyright-message - "PCL-CVS release 1.05-CVS-$Name: r19-15b102 $" - "PCL-CVS release 1.05 from CVS release $Name: r19-15b102 $. + "PCL-CVS release 1.05-CVS-$Name: r19-16b90 $" + "PCL-CVS release 1.05 from CVS release $Name: r19-16b90 $. Copyright (C) 1992, 1993 Per Cederqvist Pcl-cvs comes with absolutely no warranty; for details consult the manual. This is free software, and you are welcome to redistribute it under certain @@ -507,7 +507,10 @@ (interactive (list (read-file-name "CVS Update (directory): " nil default-directory nil) current-prefix-arg)) - (cvs-do-update directory local nil) + ;; If the previous prompt was in a dialog box, the save-some-buffers + ;; call in cvs-do-update will lose. + (let ((use-dialog-box nil)) + (cvs-do-update directory local nil)) (switch-to-buffer cvs-buffer-name)) ;;---------- @@ -724,7 +727,7 @@ \\[cvs-mode-undo-local-changes] Revert the last checked in version - discard your changes to the file. Entry to this mode runs cvs-mode-hook. -This description is updated for release 1.05-CVS-$Name: r19-15b102 $ of pcl-cvs. +This description is updated for release 1.05-CVS-$Name: r19-16b90 $ of pcl-cvs. All bindings: \\{cvs-mode-map}" @@ -1013,7 +1016,7 @@ (insert "Pcl-cvs Version: " "@(#)OrigId: pcl-cvs.el,v 1.93 1993/05/31 22:44:00 ceder Exp\n") (insert "CVS Version: " - "@(#)lisp/pcl-cvs:$Name: r19-15b102 $:$Id: pcl-cvs.el,v 1.3 1997/03/21 03:43:23 steve Exp $\n\n") + "@(#)lisp/pcl-cvs:$Name: r19-16b90 $:$Id: pcl-cvs.el,v 1.4 1997/08/21 06:24:01 steve Exp $\n\n") (insert (format "--- Contents of stdout buffer (%d chars) ---\n" (length stdout))) (insert stdout) diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/prim/about.el --- a/lisp/prim/about.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/prim/about.el Mon Aug 13 08:56:04 2007 +0200 @@ -80,7 +80,7 @@ (view-mode nil 'kill-buffer) ;; assume the new view-less (let* ((buffer-read-only nil) (emacs-short-version (concat emacs-major-version "." emacs-minor-version)) - (emacs-about-version (format "version %s; March 1997" emacs-short-version)) + (emacs-about-version (format "version %s; August 1997" emacs-short-version)) (indent-tabs-mode t) ) (erase-buffer) @@ -129,7 +129,8 @@ (insert "XEmacs is the result of the time and effort of many people. The developers responsible for the " emacs-short-version " release are: - * ") (about-xref "Steve Baur" 'steve "Find out more about Steve Baur") (insert " + * ") (about-xref "Vin Shelton" 'vin "Find out more about Vin Shelton") (insert " + * ") (about-xref "Steve Baur" 'steve "Find out more about Steve Baur") (insert " * ") (about-xref "Martin Buchholz" 'mrb "Find out more about Martin Buchholz") (insert " * ") (about-xref "And many other contributors..." 'others "Read about the legion of XEmacs hackers") (insert " @@ -158,7 +159,7 @@ (toggle-read-only 0) (let ((rest (if who-to-load (list who-to-load) - '(steve mrb cthomp wing stig jwz mly vladimir baw piper bw wmperry kyle larsi jens))) + '(steve mrb cthomp wing stig jwz mly vladimir baw piper bw wmperry kyle larsi jens vin))) (got-error nil)) (while rest (let* ((who (car rest)) @@ -241,6 +242,7 @@ (w3-kyle . "http://www.wonderworks.com/kyle/") (w3-larsi . "http://www.ifi.uio.no/~larsi/") (w3-hrvoje . "ftp://gnjilux.cc.fer.hr/pub/unix/util/wget/") + (w3-upa . "http://www.upa.org") ;; add more here ) "Mappings between xref symbols and URLs") @@ -307,6 +309,7 @@ ((eq xref 'kyle) "About Kyle Jones") ((eq xref 'larsi) "About Lars Magne Ingebrigtsen") ((eq xref 'jens) "About Jens Lautenbacher") + ((eq xref 'vin) "About Vin Shelton") ((eq xref 'others) "About Everyone") ((eq xref 'features) "New XEmacs Features") ((eq xref 'history) "XEmacs History") @@ -548,12 +551,9 @@ Steve took over the maintenance of XEmacs in November of 1996 (it seemed like a good idea at the time ...). In real life he is a - network administrator and Unix systems programmer for Miranova - Systems, Inc. - - Steve's main contributions to XEmacs have been reviving the FAQ, - testing and integrating patches, tracking down and fixing bugs, and - answering hundreds of questions on Usenet.") + network administrator for Calag.com, Inc. A small ISP in central + California. His main hobby while not maintaining XEmacs or working + is ... you have got to be kidding ...") (insert "\n\n\tClick ") (about-xref "here" prev-page "Return to previous page") @@ -818,6 +818,29 @@ (insert " to go back to the previous page.\n") ) + ((eq xref 'vin) + (about-face "Vin Shelton" 'bold) + (insert " + + Vin maintains the XEmacs patch pages in order to bring ") (about-face "you" 'italic) (insert " a more + stable XEmacs. (Actually, he does it 'cause it's fun and he's been + using emacs for a long, long time.) Vin also contributed the detached + minibuffer code as well as a few minor enhancements to the menubar + options. + + I own and operate my own consulting firm, EtherSoft. Shhh, don't + tell anyone, but it's named after an Ultimate team I used to play + with in Austin, Texas - the Ether Bunnies. I'm getting too old + to play competitive Ultimate any more, so now I've gotten roped + into serving on the board of directors of the Ultimate Players + Association. See ") + (about-xref "http://www.upa.org/" 'w3-upa "Visit the UPA homepage") + + (insert ".\n\n\tClick ") + (about-xref "here" prev-page "Return to previous page") + (insert " to go back to the previous page.\n") + ) + ((eq xref 'others) (insert "Click ") (about-xref "here" 'about "Return to previous page") @@ -916,6 +939,11 @@ the exams and XEmacs betas are released at a high rate this may take some time... + ") (about-xref "Vin Shelton" 'vin "Find out more about Vin Shelton") (insert " + Vin maintains the XEmacs patch pages. Vin also contributed the + detached minibuffer code, as well as a few minor enhancements to + the menubar options. + Darrell Kindred Unofficial maintainer of the xemacs-beta list of extant bugs and contributor of an extraordinary number of diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/prim/cmdloop.el --- a/lisp/prim/cmdloop.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/prim/cmdloop.el Mon Aug 13 08:56:04 2007 +0200 @@ -341,9 +341,11 @@ (inhibit-quit t)) (message "%s%s%s" pre prompt yn) (setq event (next-command-event event)) - (prog1 - (or quit-flag (eq 'keyboard-quit (key-binding event))) - (setq quit-flag nil))) + (condition-case nil + (prog1 + (or quit-flag (eq 'keyboard-quit (key-binding event))) + (setq quit-flag nil)) + (wrong-type-argument t))) (progn (message "%s%s%s%s" pre prompt yn (single-key-description event)) (setq quit-flag nil) diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/prim/files.el --- a/lisp/prim/files.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/prim/files.el Mon Aug 13 08:56:04 2007 +0200 @@ -1300,8 +1300,9 @@ (val (cdr (car result)))) (cond ((eq key 'mode) (setq mode-p t) - (funcall (intern (concat (downcase (symbol-name val)) - "-mode")))) + (and enable-local-variables + (funcall (intern (concat (downcase (symbol-name val)) + "-mode"))))) (set-any-p (hack-one-local-variable key val)) (t @@ -1949,7 +1950,7 @@ `dired-kept-versions' controls dired's clean-directory (.) command. If `delete-old-versions' is nil, system will query user before trimming versions. Otherwise it does it silently." - (interactive "p") + (interactive "_p") (let ((modp (buffer-modified-p)) (large (> (buffer-size) 50000)) (make-backup-files (or (and make-backup-files (not (eq args 0))) diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/prim/frame.el --- a/lisp/prim/frame.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/prim/frame.el Mon Aug 13 08:56:04 2007 +0200 @@ -721,6 +721,7 @@ map-frame-hook 'deiconify-emacs) (iconify-frame me))) + (defun deiconify-emacs (&optional ignore) (or iconification-data (error "not iconified?")) (setq frame-icon-title-format (car iconification-data) @@ -728,9 +729,9 @@ iconification-data (car (cdr (cdr iconification-data)))) (while iconification-data (let ((visibility (cdr (car iconification-data)))) - (cond ((eq visibility 't) + (cond (visibility ;; JV (Note non-nil means visible in XEmacs) (make-frame-visible (car (car iconification-data)))) -; (t ;; (eq visibility 'icon) +; (t ;; (eq visibility 'icon) ;; JV Not in XEmacs!!! ; (make-frame-visible (car (car iconification-data))) ; (sleep-for 500 t) ; process X events; I really want to XSync() here ; (iconify-frame (car (car iconification-data)))) @@ -810,9 +811,8 @@ (or (get mode 'frame-name) get-frame-for-buffer-default-frame-name))) - -(defun get-frame-for-buffer-make-new-frame (buffer &optional frame-name) - (let* ((fr (make-frame (and frame-name (list (cons 'name frame-name))))) +(defun get-frame-for-buffer-make-new-frame (buffer &optional frame-name plist) + (let* ((fr (make-frame plist)) (w (frame-root-window fr))) ;; ;; Make the one buffer being displayed in this newly created @@ -847,6 +847,7 @@ ;; name. That always takes priority. ;; (let ((limit (get name 'instance-limit)) + (defaults (get name 'frame-defaults)) (matching-frames '()) frames frame already-visible) ;; Sort the list so that iconic frames will be found last. They @@ -884,7 +885,11 @@ ((or (null matching-frames) (eq limit 0) ; means create with reckless abandon (and limit (< (length matching-frames) limit))) - (get-frame-for-buffer-make-new-frame buffer name)) + (get-frame-for-buffer-make-new-frame + buffer + name + (alist-to-plist (acons 'name name + (plist-to-alist defaults))))) (t ;; do not switch any of the window/buffer associations in an ;; existing frame; this function only picks a frame; the diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/prim/minibuf.el --- a/lisp/prim/minibuf.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/prim/minibuf.el Mon Aug 13 08:56:04 2007 +0200 @@ -268,6 +268,8 @@ "If this variable is non-nil, a string will not be added to the minibuffer history if its length is less than that value.") +(define-error 'input-error "Keyboard input error") + (defun read-from-minibuffer (prompt &optional initial-contents keymap readp @@ -420,7 +422,10 @@ ;; total total kludge (if (stringp v) (setq v (list 'quote v))) (setq val v)) - (error (setq err e)))) + (end-of-file + (setq err + '(input-error "End of input before end of expression"))) + (error (setq err e)))) ;; Add the value to the appropriate history list unless ;; it's already the most recent element, or it's only ;; two characters long. @@ -1764,25 +1769,29 @@ (defun mouse-file-display-completion-list (window dir minibuf user-data) (let ((standard-output (window-buffer window))) - (display-completion-list - (directory-files dir nil nil nil t) - :window-width (* 2 (window-width window)) - :activate-callback - 'mouse-read-file-name-activate-callback - :user-data user-data - :reference-buffer minibuf - :help-string ""))) + (condition-case nil + (display-completion-list + (directory-files dir nil nil nil t) + :window-width (* 2 (window-width window)) + :activate-callback + 'mouse-read-file-name-activate-callback + :user-data user-data + :reference-buffer minibuf + :help-string "") + (t nil)))) (defun mouse-directory-display-completion-list (window dir minibuf user-data) (let ((standard-output (window-buffer window))) - (display-completion-list - (delete "." (directory-files dir nil nil nil 1)) - :window-width (window-width window) - :activate-callback - 'mouse-read-file-name-activate-callback - :user-data user-data - :reference-buffer minibuf - :help-string ""))) + (condition-case nil + (display-completion-list + (delete "." (directory-files dir nil nil nil 1)) + :window-width (window-width window) + :activate-callback + 'mouse-read-file-name-activate-callback + :user-data user-data + :reference-buffer minibuf + :help-string "") + (t nil)))) (defun mouse-read-file-name-activate-callback (event extent user-data) (let* ((file (extent-string extent)) diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/prim/overlay.el --- a/lisp/prim/overlay.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/prim/overlay.el Mon Aug 13 08:56:04 2007 +0200 @@ -177,7 +177,7 @@ (setq before (append before (list overlay))) (setq after (append after (list overlay))))))) (extent-list)) - (list before after))) + (cons before after))) (defun overlay-recenter (pos) "Recenter the overlays of the current buffer around position POS." diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/prim/process.el --- a/lisp/prim/process.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/prim/process.el Mon Aug 13 08:56:04 2007 +0200 @@ -160,7 +160,7 @@ (progn (require 'background) ; whizzy comint background code (background (substring command 0 (match-beginning 0)))) - (shell-command-on-region (point) (point) command nil))))) + (shell-command-on-region (point) (point) command output-buffer))))) ;; We have a sentinel to prevent insertion of a termination message ;; in the buffer itself. @@ -192,19 +192,17 @@ If OUTPUT-BUFFER is not a buffer and not nil, insert output in the current buffer. In either case, the output is inserted after point (leaving mark after it)." - (interactive (if (not (region-exists-p)) - (error "The region is not active now") - (let ((string + (interactive (let ((string ;; Do this before calling region-beginning ;; and region-end, in case subprocess output ;; relocates them while we are in the minibuffer. - (read-shell-command "Shell command on region: "))) - ;; call-interactively recognizes region-beginning and - ;; region-end specially, leaving them in the history. - (list (region-beginning) (region-end) - string - current-prefix-arg - current-prefix-arg)))) + (read-shell-command "Shell command on region: "))) + ;; call-interactively recognizes region-beginning and + ;; region-end specially, leaving them in the history. + (list (region-beginning) (region-end) + string + current-prefix-arg + current-prefix-arg))) (if (or replace (and output-buffer (not (or (bufferp output-buffer) (stringp output-buffer))))) diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/prim/simple.el --- a/lisp/prim/simple.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/prim/simple.el Mon Aug 13 08:56:04 2007 +0200 @@ -1077,7 +1077,7 @@ ;; just isn't aware of this. However, there's no harm in putting ;; the region's text in the kill ring, anyway. ((or (and buffer-read-only (not inhibit-read-only)) - (text-property-not-all beg end 'read-only nil)) + (text-property-not-all (min beg end) (max beg end) 'read-only nil)) ;; This is redundant. ;; (if verbose (message "Copying %d characters" ;; (- (max beg end) (min beg end)))) @@ -1104,11 +1104,13 @@ ;; Search back in buffer-undo-list for this string, ;; in case a change hook made property changes. (setq tail buffer-undo-list) - (while (not (stringp (car-safe (car-safe tail)))) ; XEmacs - (setq tail (cdr tail))) + (while (and tail + (not (stringp (car-safe (car-safe tail))))) ; XEmacs + (pop tail)) ;; Take the same string recorded for undo ;; and put it in the kill-ring. - (kill-new (car (car tail))))) + (and tail + (kill-new (car (car tail)))))) (t ;; if undo is not kept, grab the string then delete it (which won't @@ -1205,7 +1207,7 @@ ;; It is cleaner to avoid activation, even though the command ;; loop would deactivate the mark because we inserted text. (goto-char (prog1 (mark t) - (set-marker (mark-marker) (point) (current-buffer)))))) + (set-marker (mark-marker t) (point) (current-buffer)))))) nil) @@ -3131,6 +3133,7 @@ (let ((clear-stream (and message-stack (eq 'stream (frame-type frame))))) (remove-message label frame) (let ((buffer (get-buffer " *Echo Area*")) + (inhibit-read-only t) (zmacs-region-stays zmacs-region-stays)) ; preserve from change (erase-buffer buffer)) (if clear-stream @@ -3169,7 +3172,8 @@ (error (setq remove-message-hook nil) (message "remove-message-hook error: %s" e) (sit-for 2) - (erase-buffer (get-buffer " *Echo Area*")) + (let ((inhibit-read-only t)) + (erase-buffer (get-buffer " *Echo Area*"))) (signal (car e) (cdr e)))) (setq log (cdr log))))) @@ -3189,7 +3193,8 @@ (zmacs-region-stays zmacs-region-stays)) ; preserve from change (save-excursion (set-buffer buffer) - (insert message)) + (let ((inhibit-read-only t)) + (insert message))) ;; Conditionalizing on the device type in this way is not that clean, ;; but neither is having a device method, as I originally implemented ;; it: all non-stream devices behave in the same way. Perhaps diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/psgml/psgml-html.el --- a/lisp/psgml/psgml-html.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/psgml/psgml-html.el Mon Aug 13 08:56:04 2007 +0200 @@ -29,11 +29,9 @@ ; Parts were taken from html-helper-mode and from code by Alastair Burt. -; Feb 18 1997, Heiko Muenkel: Added the hook variable html-mode-hook. -; With that you can now use the hm--html-minor-mode together -; with this mode. For that you've to add the following line -; to your ~/.emacs: -; (add-hook 'html-mode-hook 'hm--html-minor-mode) +; If you'd like to use the hm--html-minor-mode together with this +; mode, you have to put the following line to your ~/.emacs: +; (add-hook 'html-mode-hook 'hm--html-minor-mode) ;;; Code: @@ -112,9 +110,6 @@ If you want to not install some type of tag, override this variable. Order is significant: menus go in this order.") -(defvar html-mode-hook nil - "*Hook called by `html-mode'.") - ;;}}} end of user variables ;;{{{ type based keymap and menu variable and function setup @@ -223,8 +218,7 @@ ; sigh ... need to call this now to get things working. (sgml-build-custom-menus) (add-submenu nil sgml-html-menu "SGML") - (delete-menu-item '("SGML")) - (run-hooks 'html-mode-hook)) + (delete-menu-item '("SGML"))) (defun html-helper-add-type-to-alist (type) "Add a type specification to the alist. diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/sunpro/sunpro-init.el --- a/lisp/sunpro/sunpro-init.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/sunpro/sunpro-init.el Mon Aug 13 08:56:04 2007 +0200 @@ -77,6 +77,14 @@ (setq exec-path (append exec-path (list (concat sunpro-dir "bin/")))))))) (defun sunpro-startup () + "Runs at startup if support for Sun Workshop is compiled in. Don't run this." + + ;; Sun distribution censors yow, among other things... + (unless (locate-file "yow.el" load-path) + (fmakunbound 'yow) + (delete-menu-item '("Apps" "Games" "Quote from Zippy")) + (delete-menu-item '("Apps" "Games" "Psychoanalyze Zippy!"))) + (when (not (noninteractive)) (flet @@ -118,9 +126,10 @@ (if (file-exists-p (concat doc-directory mule-doc-file-name)) (setq internal-doc-file-name mule-doc-file-name)))) - ;; Connect to tooltalk + ;; Connect to tooltalk, but only on an X server. (and (featurep 'tooltalk) (fboundp 'command-line-do-tooltalk) + (eq 'x (device-type)) (command-line-do-tooltalk nil)) ;; Sun's pending-del default is like textedit's diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/tm/tm-edit.el --- a/lisp/tm/tm-edit.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/tm/tm-edit.el Mon Aug 13 08:56:04 2007 +0200 @@ -6,7 +6,7 @@ ;; MORIOKA Tomohiko ;; Maintainer: MORIOKA Tomohiko ;; Created: 1994/08/21 renamed from mime.el -;; Version: $Revision: 1.7 $ +;; Version: $Revision: 1.8 $ ;; Keywords: mail, news, MIME, multimedia, multilingual ;; This file is part of tm (Tools for MIME). @@ -120,7 +120,7 @@ ;;; (defconst mime-editor/RCS-ID - "$Id: tm-edit.el,v 1.7 1997/03/22 05:29:22 steve Exp $") + "$Id: tm-edit.el,v 1.8 1997/08/21 06:24:11 steve Exp $") (defconst mime-editor/version (get-version-string mime-editor/RCS-ID)) @@ -210,6 +210,7 @@ ("image" ("gif") ("jpeg") + ("png") ("tiff") ("x-pic") ("x-mag") @@ -245,6 +246,11 @@ "base64" "inline" (("filename" . file)) ) + ("\\.png$" + "image" "png" nil + "base64" + "inline" (("filename" . file)) + ) ("\\.tiff$" "image" "tiff" nil "base64" diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/tm/tm-image.el --- a/lisp/tm/tm-image.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/tm/tm-image.el Mon Aug 13 08:56:04 2007 +0200 @@ -7,7 +7,7 @@ ;; Dan Rich ;; Maintainer: MORIOKA Tomohiko ;; Created: 1995/12/15 -;; Version: $Id: tm-image.el,v 1.6 1997/03/16 05:55:42 steve Exp $ +;; Version: $Id: tm-image.el,v 1.7 1997/08/21 06:24:12 steve Exp $ ;; Keywords: image, picture, X-Face, MIME, multimedia, mail, news @@ -132,6 +132,7 @@ ("image/x-xpixmap" . xpm) ("image/x-pic" . pic) ("image/x-mag" . mag) + ("image/png" . png) )) (defvar mime-viewer/ps-to-gif-command "pstogif") diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/tm/tm-mh-e.el --- a/lisp/tm/tm-mh-e.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/tm/tm-mh-e.el Mon Aug 13 08:56:04 2007 +0200 @@ -6,7 +6,7 @@ ;; OKABE Yasuo ;; Maintainer: MORIOKA Tomohiko ;; Created: 1993/11/21 (obsolete mh-e-mime.el) -;; Version: $Revision: 1.2 $ +;; Version: $Revision: 1.3 $ ;; Keywords: mail, MH, MIME, multimedia, encoded-word, multilingual ;; This file is part of tm (Tools for MIME). @@ -48,7 +48,7 @@ ;;; (defconst tm-mh-e/RCS-ID - "$Id: tm-mh-e.el,v 1.2 1996/12/22 00:29:40 steve Exp $") + "$Id: tm-mh-e.el,v 1.3 1997/08/21 06:24:13 steve Exp $") (defconst tm-mh-e/version (get-version-string tm-mh-e/RCS-ID)) @@ -73,20 +73,26 @@ ;; Display message NUMBER of FOLDER. ;; Sets the current buffer to the show buffer. (set-buffer folder) - (or show-buffer - (setq show-buffer mh-show-buffer)) ;; Bind variables in folder buffer in case they are local - (let ((msg-filename (mh-msg-filename msg-num))) + (let ((formfile mhl-formfile) + (clean-message-header mh-clean-message-header) + (invisible-headers mh-invisible-headers) + (visible-headers mh-visible-headers) + (msg-filename (mh-msg-filename msg-num)) + (show-buffer mh-show-buffer) + ) (if (not (file-exists-p msg-filename)) (error "Message %d does not exist" msg-num)) (set-buffer show-buffer) (cond ((not (equal msg-filename buffer-file-name)) ;; Buffer does not yet contain message. - (clear-visited-file-modtime) - (unlock-buffer) - (setq buffer-file-name nil) ; no locking during setup + (mh-unvisit-file) (setq buffer-read-only nil) (erase-buffer) + ;; Changing contents, so this hook needs to be reinitialized. + ;; pgp.el uses this. + (if (boundp 'write-contents-hooks) ;Emacs 19 + (setq write-contents-hooks nil)) (if mode (let* ((aname (concat "article-" folder)) (abuf (get-buffer aname)) @@ -114,18 +120,21 @@ (mime/viewer-mode nil nil nil aname (concat "show-" folder)) (goto-char (point-min)) + (let ( (buffer-read-only nil) ) + (cond (clean-message-header + (mh-clean-msg-header (point-min) + invisible-headers + visible-headers) + (goto-char (point-min))) + (t + (mh-start-of-uncleaned-message)))) + (goto-char (point-min)) ) - (let ((clean-message-header mh-clean-message-header) - (invisible-headers mh-invisible-headers) - (visible-headers mh-visible-headers) - ) - ;; 1995/9/21 - ;; modified by ARIURA - ;; to support mhl. - (if mhl-formfile + (progn + (if formfile (mh-exec-lib-cmd-output "mhl" "-nobell" "-noclear" - (if (stringp mhl-formfile) - (list "-form" mhl-formfile)) + (if (stringp formfile) + (list "-form" formfile)) msg-filename) (insert-file-contents msg-filename)) ;; end @@ -145,11 +154,14 @@ (setq buffer-file-name msg-filename) (mh-show-mode) )) + (set-buffer-modified-p nil) (or (eq buffer-undo-list t) ;don't save undo info for prev msgs (setq buffer-undo-list nil)) -;;; Added by itokon (02/19/96) + (set-buffer-auto-saved) + ;; the parts of set-visited-file-name we want to do (no locking) (setq buffer-file-name msg-filename) -;;; + (setq buffer-backed-up nil) + (auto-save-mode 1) (set-mark nil) (setq mode-line-buffer-identification (list (format mh-show-buffer-mode-line-buffer-id diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/tm/tm-view.el --- a/lisp/tm/tm-view.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/tm/tm-view.el Mon Aug 13 08:56:04 2007 +0200 @@ -4,7 +4,7 @@ ;; Author: MORIOKA Tomohiko ;; Created: 1994/7/13 (1994/8/31 obsolete tm-body.el) -;; Version: $Revision: 1.5 $ +;; Version: $Revision: 1.6 $ ;; Keywords: mail, news, MIME, multimedia ;; This file is part of tm (Tools for MIME). @@ -42,7 +42,7 @@ ;;; (defconst mime-viewer/RCS-ID - "$Id: tm-view.el,v 1.5 1997/03/09 02:37:51 steve Exp $") + "$Id: tm-view.el,v 1.6 1997/08/21 06:24:14 steve Exp $") (defconst mime-viewer/version (get-version-string mime-viewer/RCS-ID)) (defconst mime/viewer-version mime-viewer/version) @@ -77,6 +77,10 @@ (method "tm-image" nil 'file 'type 'encoding 'mode 'name) (mode "play" "print") ) + ((type . "image/png") + (method "tm-image" nil 'file 'type 'encoding 'mode 'name) + (mode "play" "print") + ) ((type . "image/tiff") (method "tm-image" nil 'file 'type 'encoding 'mode 'name) (mode "play" "print") diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/utils/forms.el --- a/lisp/utils/forms.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/utils/forms.el Mon Aug 13 08:56:04 2007 +0200 @@ -300,10 +300,10 @@ (provide 'forms) ;;; official (provide 'forms-mode) ;;; for compatibility -(defconst forms-version (substring "$Revision: 1.1.1.2 $" 11 -2) +(defconst forms-version (substring "$Revision: 1.2 $" 11 -2) "The version number of forms-mode (as string). The complete RCS id is: - $Id: forms.el,v 1.1.1.2 1996/12/18 03:54:04 steve Exp $") + $Id: forms.el,v 1.2 1997/08/21 06:24:16 steve Exp $") (defvar forms-mode-hooks nil "Hook functions to be run upon entering Forms mode.") @@ -1677,6 +1677,8 @@ (if forms-use-text-properties (let ((inhibit-read-only t)) (set-text-properties (point-min) (point-max) nil))) + (if forms-use-extents + (map-extents '(lambda (x ignore) (detach-extent x) nil))) (erase-buffer) ;; Verify the number of fields, extend forms--the-record-list if needed. diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/utils/lib-complete.el --- a/lisp/utils/lib-complete.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/utils/lib-complete.el Mon Aug 13 08:56:04 2007 +0200 @@ -5,7 +5,7 @@ ;; Last Modified By: Heiko M|nkel ;; Additional XEmacs integration By: Chuck Thompson ;; Last Modified On: Thu Jul 1 14:23:00 1994 -;; RCS Info : $Revision: 1.2 $ $Locker: $ +;; RCS Info : $Revision: 1.3 $ $Locker: $ ;; ======================================================================== ;; NOTE: this file must be recompiled if changed. ;; @@ -273,7 +273,11 @@ FILTER (or MUST-MATCH FULL) nil))) (cond ((equal library "") DEFAULT) - (FULL (locate-file library read-library-internal-search-path ".el:.elc")) + (FULL (locate-file library read-library-internal-search-path + ;; decompression doesn't work with Mule -slb + (if (featurep 'mule) + ".el:.elc" + ".el:.el.gz:.elc"))) (t library)))) ;; NOTE: as a special case, read-library may be used to read a filename @@ -286,8 +290,11 @@ "Front end to read-library" (read-library "Find Library file: " load-path nil t t (function (lambda (fn) - (cond - ((string-match "\\.el$" fn) + (cond + ;; decompression doesn't work with mule -slb + ((string-match (if (featurep 'mule) + "\\.el$" + "\\.el\\(\\.gz\\)?$") fn) (substring fn 0 (match-beginning 0)))))) )) diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/utils/skeleton.el --- a/lisp/utils/skeleton.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/utils/skeleton.el Mon Aug 13 08:56:04 2007 +0200 @@ -165,6 +165,7 @@ (and skeleton-autowrap (or (eq last-command 'mouse-drag-region) (and (boundp 'transient-mark-mode) + (boundp 'mark-active) transient-mark-mode mark-active)) -1))) (if (stringp str) @@ -211,6 +212,7 @@ (and skeleton-autowrap (or (eq last-command 'mouse-drag-region) (and (boundp 'transient-mark-mode) + (boundp 'mark-active) transient-mark-mode mark-active)) -1))) (if (stringp str) @@ -518,6 +520,7 @@ (let ((mark (and skeleton-autowrap (or (eq last-command 'mouse-drag-region) (and (boundp 'transient-mark-mode) + (boundp 'mark-active) transient-mark-mode mark-active)))) (skeleton-end-hook)) (if (or arg diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/utils/smtpmail.el --- a/lisp/utils/smtpmail.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/utils/smtpmail.el Mon Aug 13 08:56:04 2007 +0200 @@ -97,7 +97,7 @@ (backward-char 1) (setq delimline (point-marker)) ;; (sendmail-synch-aliases) - (if (and mail-aliases (fboundp expand-mail-aliases)) ; XEmacs + (if (and mail-aliases (fboundp 'expand-mail-aliases)) ; XEmacs (expand-mail-aliases (point-min) delimline)) (goto-char (point-min)) ;; ignore any blank lines in the header @@ -446,8 +446,7 @@ "Get address list suitable for smtp RCPT TO:
." (require 'mail-utils) ;; pick up mail-strip-quoted-names (let - ((case-fold-search t) - (simple-address-list "") + ((simple-address-list "") this-line this-line-end addr-regexp) @@ -456,6 +455,7 @@ (save-excursion ;; (set-buffer smtpmail-address-buffer) (erase-buffer) + (let ((case-fold-search t)) (insert-buffer-substring smtpmail-text-buffer header-start header-end) (goto-char (point-min)) ;; RESENT-* fields should stop processing of regular fields. @@ -497,7 +497,7 @@ ) (setq smtpmail-recipient-address-list recipient-address-list)) - ) + )) ) ) ) diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/utils/text-props.el --- a/lisp/utils/text-props.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/utils/text-props.el Mon Aug 13 08:56:04 2007 +0200 @@ -310,11 +310,15 @@ The optional fourth argument, BUFFER-OR-STRING, is the string or buffer containing the text." (map-extents #'(lambda (extent ignored) + ;; #### dmoore - shouldn't this use + ;; (extent-start-position extent) + ;; (extent-end-position extent) (remove-text-properties start end (list (extent-property extent 'text-prop) nil) - buffer-or-string)) + buffer-or-string) + nil) buffer-or-string start end nil nil 'text-prop) (add-text-properties start end props buffer-or-string)) diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/version.el --- a/lisp/version.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/version.el Mon Aug 13 08:56:04 2007 +0200 @@ -23,10 +23,10 @@ ;; The following line is modified automatically ;; by loading inc-version.el, each time a new Emacs is dumped. -(defconst emacs-version "19.15" "\ +(defconst emacs-version "19.16" "\ Version numbers of this version of Emacs.") -(setq emacs-version (purecopy (concat emacs-version " XEmacs Lucid"))) +(setq emacs-version (purecopy (concat emacs-version " XEmacs Lucid (beta90)"))) (defconst emacs-major-version (progn (or (string-match "^[0-9]+" emacs-version) diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/x11/x-compose.el --- a/lisp/x11/x-compose.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/x11/x-compose.el Mon Aug 13 08:56:04 2007 +0200 @@ -1,5 +1,5 @@ ;; Compose-key processing in emacs. -;; Copyright (C) 1992, 1993 Free Software Foundation, Inc. +;; Copyright (C) 1992, 1993, 1997 Free Software Foundation, Inc. ;; This file is part of XEmacs. @@ -18,6 +18,12 @@ ;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. ;;; created by jwz, 14-jun-92. +;;; changed by Heiko Muenkel, 11-jun-97: Fixed the degree bug. +;;; changed by Jan Vroonhof, July 1997: Use function-key-map instead +;;; of global map. +;;; Preliminary support for +;;; XFree86 deadkeys +;;; , August 1997 allow : for diaresis like xlib ;;; This file implements DEC-, OpenWindows-, and HP-compatible "Compose" ;;; processing for XEmacs. @@ -94,20 +100,28 @@ ;;; The command `compose-key' exists so that this file may be autoloaded. ;;;this doesn't work yet###autoload -(define-function 'compose-key compose-map) +;; (define-function 'compose-key compose-map) ;; The "Compose" key: ;; (keysym is lower case because we downcase everything in the Symbol font...) ;; ;;;this doesn't work yet###autoload -(define-key global-map [multi-key] 'compose-key) +;; Ditched JV, (define-key function-key-map [multi-key] 'compose-key) +(define-key function-key-map [multi-key] compose-map) + +;; The following is necessary, because one can't rebind [degree] +;; and use it to insert the degree sign! +(defun compose-insert-degree () + "Inserts a degree sign." + (interactive) + (insert ?\260)) ;; The "Dead" keys: ;; -(define-key global-map [acute] compose-acute-map) -(define-key global-map [cedilla] compose-cedilla-map) -(define-key global-map [diaeresis] compose-diaeresis-map) -(define-key global-map [degree] compose-ring-map) +(define-key function-key-map [acute] compose-acute-map) +(define-key function-key-map [cedilla] compose-cedilla-map) +(define-key function-key-map [diaeresis] compose-diaeresis-map) +(define-key function-key-map [degree] compose-ring-map) ;; The dead keys as seen by the "Compose" map: ;; @@ -120,6 +134,7 @@ (define-key compose-map "`" compose-grave-map) (define-key compose-map "," compose-cedilla-map) (define-key compose-map "\"" compose-diaeresis-map) +(define-key compose-map ":" compose-diaeresis-map) (define-key compose-map "^" compose-circumflex-map) (define-key compose-map "~" compose-tilde-map) (define-key compose-map "*" compose-ring-map) @@ -143,126 +158,201 @@ ;; Sun according to MIT: ;; (cond ((x-valid-keysym-name-p "SunFA_Acute") - (define-key global-map [SunFA_Acute] compose-acute-map) + (define-key function-key-map [SunFA_Acute] + compose-acute-map) (define-key compose-map [SunFA_Acute] compose-acute-map) - (define-key global-map [SunFA_Grave] compose-grave-map) + (define-key function-key-map [SunFA_Grave] + compose-grave-map) (define-key compose-map [SunFA_Grave] compose-grave-map) - (define-key global-map [SunFA_Cedilla] compose-cedilla-map) + (define-key function-key-map [SunFA_Cedilla] + compose-cedilla-map) (define-key compose-map [SunFA_Cedilla] compose-cedilla-map) - (define-key global-map [SunFA_Diaeresis] compose-diaeresis-map) + (define-key function-key-map [SunFA_Diaeresis] compose-diaeresis-map) (define-key compose-map [SunFA_Diaeresis] compose-diaeresis-map) - (define-key global-map [SunFA_Circum] compose-circumflex-map) + (define-key function-key-map [SunFA_Circum] + compose-circumflex-map) (define-key compose-map [SunFA_Circum] compose-circumflex-map) - (define-key global-map [SunFA_Tilde] compose-tilde-map) + (define-key function-key-map [SunFA_Tilde] + compose-tilde-map) (define-key compose-map [SunFA_Tilde] compose-tilde-map) )) ;; Sun according to OpenWindows 2: ;; (cond ((x-valid-keysym-name-p "Dead_Grave") - (define-key global-map [Dead_Grave] compose-grave-map) + (define-key function-key-map [Dead_Grave] + compose-grave-map) (define-key compose-map [Dead_Grave] compose-grave-map) - (define-key global-map [Dead_Circum] compose-circumflex-map) + (define-key function-key-map [Dead_Circum] + compose-circumflex-map) (define-key compose-map [Dead_Circum] compose-circumflex-map) - (define-key global-map [Dead_Tilde] compose-tilde-map) + (define-key function-key-map [Dead_Tilde] + compose-tilde-map) (define-key compose-map [Dead_Tilde] compose-tilde-map) )) ;; Sun according to OpenWindows 3: ;; (cond ((x-valid-keysym-name-p "SunXK_FA_Acute") - (define-key global-map [SunXK_FA_Acute] compose-acute-map) + (define-key function-key-map [SunXK_FA_Acute] + compose-acute-map) (define-key compose-map [SunXK_FA_Acute] compose-acute-map) - (define-key global-map [SunXK_FA_Grave] compose-grave-map) + (define-key function-key-map [SunXK_FA_Grave] + compose-grave-map) (define-key compose-map [SunXK_FA_Grave] compose-grave-map) - (define-key global-map [SunXK_FA_Cedilla] compose-cedilla-map) + (define-key function-key-map [SunXK_FA_Cedilla] compose-cedilla-map) (define-key compose-map [SunXK_FA_Cedilla] compose-cedilla-map) - (define-key global-map [SunXK_FA_Diaeresis] compose-diaeresis-map) + (define-key function-key-map [SunXK_FA_Diaeresis] + compose-diaeresis-map) (define-key compose-map [SunXK_FA_Diaeresis] compose-diaeresis-map) - (define-key global-map [SunXK_FA_Circum] compose-circumflex-map) + (define-key function-key-map [SunXK_FA_Circum] compose-circumflex-map) (define-key compose-map [SunXK_FA_Circum] compose-circumflex-map) - (define-key global-map [SunXK_FA_Tilde] compose-tilde-map) + (define-key function-key-map [SunXK_FA_Tilde] + compose-tilde-map) (define-key compose-map [SunXK_FA_Tilde] compose-tilde-map) )) ;; DEC according to MIT: ;; (cond ((x-valid-keysym-name-p "Dacute_accent") - (define-key global-map [Dacute_accent] compose-acute-map) + (define-key function-key-map [Dacute_accent] + compose-acute-map) (define-key compose-map [Dacute_accent] compose-acute-map) - (define-key global-map [Dgrave_accent] compose-grave-map) + (define-key function-key-map [Dgrave_accent] + compose-grave-map) (define-key compose-map [Dgrave_accent] compose-grave-map) - (define-key global-map [Dcedilla_accent] compose-cedilla-map) + (define-key function-key-map [Dcedilla_accent] compose-cedilla-map) (define-key compose-map [Dcedilla_accent] compose-cedilla-map) - (define-key global-map [Dcircumflex_accent] compose-circumflex-map) + (define-key function-key-map [Dcircumflex_accent] + compose-circumflex-map) (define-key compose-map [Dcircumflex_accent] compose-circumflex-map) - (define-key global-map [Dtilde] compose-tilde-map) + (define-key function-key-map [Dtilde] + compose-tilde-map) (define-key compose-map [Dtilde] compose-tilde-map) - (define-key global-map [Dring_accent] compose-ring-map) + (define-key function-key-map [Dring_accent] + compose-ring-map) (define-key compose-map [Dring_accent] compose-ring-map) )) ;; DEC according to OpenWindows 3: ;; (cond ((x-valid-keysym-name-p "DXK_acute_accent") - (define-key global-map [DXK_acute_accent] compose-acute-map) + (define-key function-key-map [DXK_acute_accent] compose-acute-map) (define-key compose-map [DXK_acute_accent] compose-acute-map) - (define-key global-map [DXK_grave_accent] compose-grave-map) + (define-key function-key-map [DXK_grave_accent] compose-grave-map) (define-key compose-map [DXK_grave_accent] compose-grave-map) - (define-key global-map [DXK_cedilla_accent] compose-cedilla-map) + (define-key function-key-map [DXK_cedilla_accent] + compose-cedilla-map) (define-key compose-map [DXK_cedilla_accent] compose-cedilla-map) - (define-key global-map [DXK_circumflex_accent] compose-circumflex-map) + (define-key function-key-map [DXK_circumflex_accent] + compose-circumflex-map) (define-key compose-map [DXK_circumflex_accent] compose-circumflex-map) - (define-key global-map [DXK_tilde] compose-tilde-map) + (define-key function-key-map [DXK_tilde] + compose-tilde-map) (define-key compose-map [DXK_tilde] compose-tilde-map) - (define-key global-map [DXK_ring_accent] compose-ring-map) + (define-key function-key-map [DXK_ring_accent] compose-ring-map) (define-key compose-map [DXK_ring_accent] compose-ring-map) )) ;; HP according to MIT: ;; (cond ((x-valid-keysym-name-p "hpmute_acute") - (define-key global-map [hpmute_acute] compose-acute-map) + (define-key function-key-map [hpmute_acute] + compose-acute-map) (define-key compose-map [hpmute_acute] compose-acute-map) - (define-key global-map [hpmute_grave] compose-grave-map) + (define-key function-key-map [hpmute_grave] + compose-grave-map) (define-key compose-map [hpmute_grave] compose-grave-map) - (define-key global-map [hpmute_diaeresis] compose-diaeresis-map) + (define-key function-key-map [hpmute_diaeresis] compose-diaeresis-map) (define-key compose-map [hpmute_diaeresis] compose-diaeresis-map) - (define-key global-map [hpmute_asciicircum] compose-circumflex-map) + (define-key function-key-map [hpmute_asciicircum] + compose-circumflex-map) (define-key compose-map [hpmute_asciicircum] compose-circumflex-map) - (define-key global-map [hpmute_asciitilde] compose-tilde-map) + (define-key function-key-map [hpmute_asciitilde] + compose-tilde-map) (define-key compose-map [hpmute_asciitilde] compose-tilde-map) )) ;; HP according to OpenWindows 3: ;; (cond ((x-valid-keysym-name-p "hpXK_mute_acute") - (define-key global-map [hpXK_mute_acute] compose-acute-map) + (define-key function-key-map [hpXK_mute_acute] compose-acute-map) (define-key compose-map [hpXK_mute_acute] compose-acute-map) - (define-key global-map [hpXK_mute_grave] compose-grave-map) + (define-key function-key-map [hpXK_mute_grave] compose-grave-map) (define-key compose-map [hpXK_mute_grave] compose-grave-map) - (define-key global-map [hpXK_mute_diaeresis] compose-diaeresis-map) + (define-key function-key-map [hpXK_mute_diaeresis] + compose-diaeresis-map) (define-key compose-map [hpXK_mute_diaeresis] compose-diaeresis-map) - (define-key global-map [hpXK_mute_asciicircum] compose-circumflex-map) + (define-key function-key-map [hpXK_mute_asciicircum] + compose-circumflex-map) (define-key compose-map [hpXK_mute_asciicircum] compose-circumflex-map) - (define-key global-map [hpXK_mute_asciitilde] compose-tilde-map) + (define-key function-key-map [hpXK_mute_asciitilde] + compose-tilde-map) (define-key compose-map [hpXK_mute_asciitilde] compose-tilde-map) )) ;; HP according to HP-UX 8.0: ;; (cond ((x-valid-keysym-name-p "XK_mute_acute") - (define-key global-map [XK_mute_acute] compose-acute-map) + (define-key function-key-map [XK_mute_acute] + compose-acute-map) (define-key compose-map [XK_mute_acute] compose-acute-map) - (define-key global-map [XK_mute_grave] compose-grave-map) + (define-key function-key-map [XK_mute_grave] + compose-grave-map) (define-key compose-map [XK_mute_grave] compose-grave-map) - (define-key global-map [XK_mute_diaeresis] compose-diaeresis-map) + (define-key function-key-map [XK_mute_diaeresis] + compose-diaeresis-map) (define-key compose-map [XK_mute_diaeresis] compose-diaeresis-map) - (define-key global-map [XK_mute_asciicircum] compose-circumflex-map) + (define-key function-key-map [XK_mute_asciicircum] + compose-circumflex-map) (define-key compose-map [XK_mute_asciicircum] compose-circumflex-map) - (define-key global-map [XK_mute_asciitilde] compose-tilde-map) + (define-key function-key-map + [XK_mute_asciitilde] compose-tilde-map) (define-key compose-map [XK_mute_asciitilde] compose-tilde-map) )) +;; Xfree seems to use lower case and a hyphen +(cond ((x-valid-keysym-name-p "dead-tilde") + (define-key function-key-map [dead-acute] + compose-acute-map) + (define-key compose-map [dead-acute] compose-acute-map) + (define-key function-key-map [dead-grave] + compose-grave-map) + (define-key compose-map [dead-grave] compose-grave-map) + (define-key function-key-map [dead-cedilla] compose-cedilla-map) + (define-key compose-map [dead-cedilla] compose-cedilla-map) + (define-key function-key-map [dead_diaeresis] compose-diaeresis-map) + (define-key compose-map [dead-diaeresis] compose-diaeresis-map) + (define-key function-key-map [dead-circum] compose-circumflex-map) + (define-key compose-map [dead-circum] compose-circumflex-map) + (define-key function-key-map [dead-circumflex] compose-circumflex-map) + (define-key compose-map [dead-circumflex] compose-circumflex-map) + (define-key function-key-map [dead-tilde] + compose-tilde-map) + (define-key compose-map [dead-tilde] compose-tilde-map) + )) +;; and AIX uses underscore, sigh.... +(cond ((x-valid-keysym-name-p "dead_tilde") + (define-key function-key-map [dead_acute] + compose-acute-map) + (define-key compose-map [dead_acute] compose-acute-map) + (define-key function-key-map [dead_grave] + compose-grave-map) + (define-key compose-map [dead_grave] compose-grave-map) + (define-key function-key-map [dead_cedilla] compose-cedilla-map) + (define-key compose-map [dead_cedilla] compose-cedilla-map) + (define-key function-key-map [dead_diaeresis] compose-diaeresis-map) + (define-key compose-map [dead_diaeresis] compose-diaeresis-map) +; There seems to be several spellings for circumflex.... + (define-key function-key-map [dead_circum] compose-circumflex-map) + (define-key compose-map [dead_circum] compose-circumflex-map) + (define-key function-key-map [dead_circumflex] compose-circumflex-map) + (define-key compose-map [dead_circumflex] compose-circumflex-map) + (define-key function-key-map [dead_tilde] + compose-tilde-map) + (define-key compose-map [dead_tilde] compose-tilde-map) + )) + + ;;; The contents of the "dead key" maps. These are shared by the ;;; compose-map. @@ -284,7 +374,8 @@ (define-key compose-acute-map "y" [yacute]) (set-keymap-name compose-grave-map 'compose-grave-map) -(define-key compose-grave-map " " [grave]) +(define-key compose-grave-map " " "`") +(define-key compose-grave-map "`" [grave]) (define-key compose-grave-map "A" [Agrave]) (define-key compose-grave-map "E" [Egrave]) (define-key compose-grave-map "I" [Igrave]) @@ -297,6 +388,7 @@ (define-key compose-grave-map "u" [ugrave]) (set-keymap-name compose-cedilla-map 'compose-cedilla-map) +(define-key compose-cedilla-map " " ",") (define-key compose-cedilla-map "," [cedilla]) (define-key compose-cedilla-map "C" [Ccedilla]) (define-key compose-cedilla-map "c" [ccedilla]) @@ -304,6 +396,7 @@ (set-keymap-name compose-diaeresis-map 'compose-diaeresis-map) (define-key compose-diaeresis-map " " [diaeresis]) (define-key compose-diaeresis-map "\"" [diaeresis]) +(define-key compose-diaeresis-map ":" [diaeresis]) (define-key compose-diaeresis-map "A" [Adiaeresis]) (define-key compose-diaeresis-map "E" [Ediaeresis]) (define-key compose-diaeresis-map "I" [Idiaeresis]) @@ -322,7 +415,7 @@ (define-key compose-circumflex-map "!" [brokenbar]) (define-key compose-circumflex-map "-" [macron]) (define-key compose-circumflex-map "_" [macron]) -(define-key compose-circumflex-map "0" [degree]) +(define-key compose-circumflex-map "0" 'compose-insert-degree) (define-key compose-circumflex-map "1" [onesuperior]) (define-key compose-circumflex-map "2" [twosuperior]) (define-key compose-circumflex-map "3" [threesuperior]) @@ -348,7 +441,7 @@ (define-key compose-tilde-map "o" [otilde]) (set-keymap-name compose-ring-map 'compose-ring-map) -(define-key compose-ring-map " " [degree]) +(define-key compose-ring-map " " 'compose-insert-degree) (define-key compose-ring-map "A" [Aring]) (define-key compose-ring-map "a" [aring]) @@ -363,7 +456,8 @@ (define-key compose-map " ~" "~") (define-key compose-map " " [nobreakspace]) (define-key compose-map " \"" [diaeresis]) -(define-key compose-map " *" [degree]) +(define-key compose-map " :" [diaeresis]) +(define-key compose-map " *" 'compose-insert-degree) (define-key compose-map "!!" [exclamdown]) (define-key compose-map "!^" [brokenbar]) @@ -417,7 +511,7 @@ (define-key compose-map "0c" [copyright]) (define-key compose-map "0R" [registered]) (define-key compose-map "0r" [registered]) -(define-key compose-map "0^" [degree]) +(define-key compose-map "0^" 'compose-insert-degree) (define-key compose-map "1^" [onesuperior]) (define-key compose-map "14" [onequarter]) @@ -450,6 +544,7 @@ (define-key compose-map "A^" [Acircumflex]) (define-key compose-map "A~" [Atilde]) (define-key compose-map "A\"" [Adiaeresis]) +(define-key compose-map "A:" [Adiaeresis]) (define-key compose-map "A*" [Aring]) (define-key compose-map "AE" [AE]) @@ -466,11 +561,13 @@ (define-key compose-map "E'" [Eacute]) (define-key compose-map "E^" [Ecircumflex]) (define-key compose-map "E\"" [Ediaeresis]) +(define-key compose-map "E:" [Ediaeresis]) (define-key compose-map "I`" [Igrave]) (define-key compose-map "I'" [Iacute]) (define-key compose-map "I^" [Icircumflex]) (define-key compose-map "I\"" [Idiaeresis]) +(define-key compose-map "I:" [Idiaeresis]) (define-key compose-map "L-" [sterling]) (define-key compose-map "L=" [sterling]) @@ -491,6 +588,7 @@ (define-key compose-map "O^" [Ocircumflex]) (define-key compose-map "O~" [Otilde]) (define-key compose-map "O\"" [Odiaeresis]) +(define-key compose-map "O:" [Odiaeresis]) (define-key compose-map "O/" [Ooblique]) (define-key compose-map "P!" [paragraph]) @@ -511,6 +609,7 @@ (define-key compose-map "U'" [Uacute]) (define-key compose-map "U^" [Ucircumflex]) (define-key compose-map "U\"" [Udiaeresis]) +(define-key compose-map "U:" [Udiaeresis]) (define-key compose-map "X0" [currency]) (define-key compose-map "XO" [currency]) @@ -535,6 +634,7 @@ (define-key compose-map "a^" [acircumflex]) (define-key compose-map "a~" [atilde]) (define-key compose-map "a\"" [adiaeresis]) +(define-key compose-map "a:" [adiaeresis]) (define-key compose-map "a*" [aring]) (define-key compose-map "ae" [ae]) @@ -551,11 +651,13 @@ (define-key compose-map "e'" [eacute]) (define-key compose-map "e^" [ecircumflex]) (define-key compose-map "e\"" [ediaeresis]) +(define-key compose-map "e:" [ediaeresis]) (define-key compose-map "i`" [igrave]) (define-key compose-map "i'" [iacute]) (define-key compose-map "i^" [icircumflex]) (define-key compose-map "i\"" [idiaeresis]) +(define-key compose-map "i:" [idiaeresis]) (define-key compose-map "l-" [sterling]) (define-key compose-map "l=" [sterling]) @@ -576,6 +678,7 @@ (define-key compose-map "o^" [ocircumflex]) (define-key compose-map "o~" [otilde]) (define-key compose-map "o\"" [odiaeresis]) +(define-key compose-map "o:" [odiaeresis]) (define-key compose-map "o/" [oslash]) (define-key compose-map "p!" [paragraph]) @@ -596,6 +699,7 @@ (define-key compose-map "u'" [uacute]) (define-key compose-map "u^" [ucircumflex]) (define-key compose-map "u\"" [udiaeresis]) +(define-key compose-map "u:" [udiaeresis]) (define-key compose-map "u/" [mu]) (define-key compose-map "x0" [currency]) @@ -607,6 +711,7 @@ (define-key compose-map "y=" [yen]) (define-key compose-map "y'" [yacute]) (define-key compose-map "y\"" [ydiaeresis]) +(define-key compose-map "y:" [ydiaeresis]) (define-key compose-map "|C" [cent]) (define-key compose-map "|c" [cent]) @@ -645,6 +750,7 @@ ((eq c ?`) compose-grave-map) ((eq c ?,) compose-cedilla-map) ((eq c ?:) compose-diaeresis-map) + ((eq c ?\") compose-diaeresis-map) ((eq c ?^) compose-circumflex-map) ((eq c ?~) compose-tilde-map) ((eq c ?.) compose-ring-map) diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/x11/x-font-menu.el --- a/lisp/x11/x-font-menu.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/x11/x-font-menu.el Mon Aug 13 08:56:04 2007 +0200 @@ -452,10 +452,6 @@ (or weight from-weight) (or size from-size) default-name)) - (setq save-options-font-hack (list 'font-menu-set-font - (or family from-family) - (or weight from-weight) - (or size from-size))) (while faces (cond ((face-font-instance (car faces)) (message "Changing font of `%s'..." (car faces)) diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/x11/x-init.el --- a/lisp/x11/x-init.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/x11/x-init.el Mon Aug 13 08:56:04 2007 +0200 @@ -81,6 +81,10 @@ (interactive) (ow-find t)) +(defun x-initialize-compose () + "Enable compose processing" + (require 'x-compose)) + ;;; Load X-server specific code. ;;; Specifically, load some code to repair the grievous damage that MIT and ;;; Sun have done to the default keymap for the Sun keyboards. @@ -181,6 +185,7 @@ ;; site-start-file or .emacs file, so sites and users have a ;; chance to override it. (add-hook 'before-init-hook 'x-initialize-keyboard) + (add-hook 'before-init-hook 'x-initialize-compose) (setq post-x-win-initted t))) diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/x11/x-iso8859-1.el --- a/lisp/x11/x-iso8859-1.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/x11/x-iso8859-1.el Mon Aug 13 08:56:04 2007 +0200 @@ -18,6 +18,7 @@ ;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. ;; created by jwz, 13-jun-92. +;; changed by Heiko Muenkel, 12-jun-1997: Added a grave keysym. ;; Under X, when the user types a character that is ISO-8859/1 but not ASCII, ;; it comes in as a symbol instead of as a character code. This keeps things @@ -92,6 +93,7 @@ ;; distributions. If a vendor varies from this, adjustments will need ;; to be made... + (grave ?\140) (nobreakspace ?\240) (exclamdown ?\241) (cent ?\242) @@ -115,9 +117,9 @@ (acute ?\264) ; Why is there an acute keysym that is (mu ?\265) ; distinct from apostrophe/quote, but (paragraph ?\266) ; no grave keysym that is distinct from - (periodcentered ?\267) ; backquote? - (cedilla ?\270) - (onesuperior ?\271) + (periodcentered ?\267) ; backquote? + (cedilla ?\270) ; I've added the grave keysym, because it's + (onesuperior ?\271) ; used in x-compose (Heiko Muenkel). (masculine ?\272) (guillemotright ?\273) (onequarter ?\274) diff -r 11c6df210d7f -r 56c54cf7c5b6 lisp/x11/x-menubar.el --- a/lisp/x11/x-menubar.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/x11/x-menubar.el Mon Aug 13 08:56:04 2007 +0200 @@ -1013,7 +1013,6 @@ ;;; The Options menu -(defvar save-options-font-hack nil) (defvar options-save-faces nil "if t, save-options will save all the face information. @@ -1282,25 +1281,6 @@ (prin1 var)))) (if var (princ "\n"))) options-menu-saved-forms) - (when save-options-font-hack - (princ "(require 'x-font-menu)\n") - (princ "(setq save-options-font-hack '(") - (princ (car save-options-font-hack)) - (princ " ") - (prin1 (cadr save-options-font-hack)) - (princ " ") - (prin1 (caddr save-options-font-hack)) - (princ " ") - (prin1 (format "%d" (cadddr save-options-font-hack))) - (princ "))\n(") - (princ (car save-options-font-hack)) - (princ " ") - (prin1 (cadr save-options-font-hack)) - (princ " ") - (prin1 (caddr save-options-font-hack)) - (princ " ") - (prin1 (format "%d" (cadddr save-options-font-hack))) - (princ ")\n")) )) (set-marker options-output-marker nil) (save-excursion diff -r 11c6df210d7f -r 56c54cf7c5b6 lwlib/lwlib.c --- a/lwlib/lwlib.c Mon Aug 13 08:55:32 2007 +0200 +++ b/lwlib/lwlib.c Mon Aug 13 08:56:04 2007 +0200 @@ -36,7 +36,7 @@ #define alloca __builtin_alloca #endif -#if ((!__GNUC__) && !defined(__hpux)) && !defined(_AIX) && !defined (_SCO_DS) && !defined (__USLC__) && !defined(sinix) +#if ((!__GNUC__) && !defined(__hpux)) && !defined(_AIX) && !defined (_SCO_DS) && !defined (__USLC__) && !defined(sinix) && !defined(_SEQUENT_) #include #endif diff -r 11c6df210d7f -r 56c54cf7c5b6 lwlib/xlwmenu.c --- a/lwlib/xlwmenu.c Mon Aug 13 08:55:32 2007 +0200 +++ b/lwlib/xlwmenu.c Mon Aug 13 08:56:04 2007 +0200 @@ -76,15 +76,15 @@ offset(menu.button_foreground), XtRString, "XtDefaultForeground"}, {XtNmargin, XtCMargin, XtRDimension, sizeof(Dimension), offset(menu.margin), XtRImmediate, (XtPointer)2}, - {XmNmarginWidth, XmCMarginWidth, XmRHorizontalDimension, sizeof(Dimension), + {XmNmarginWidth, XmCMarginWidth, XtRDimension, sizeof(Dimension), offset(menu.horizontal_margin), XtRImmediate, (XtPointer)2}, - {XmNmarginHeight, XmCMarginHeight, XmRVerticalDimension, sizeof(Dimension), + {XmNmarginHeight, XmCMarginHeight, XtRDimension, sizeof(Dimension), offset(menu.vertical_margin), XtRImmediate, (XtPointer)1}, - {XmNspacing, XmCSpacing, XmRHorizontalDimension, sizeof(Dimension), + {XmNspacing, XmCSpacing, XtRDimension, sizeof(Dimension), offset(menu.column_spacing), XtRImmediate, (XtPointer)4}, {XmNindicatorSize, XmCIndicatorSize, XtRDimension, sizeof(Dimension), offset(menu.indicator_size), XtRImmediate, (XtPointer)0}, - {XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension, + {XmNshadowThickness, XmCShadowThickness, XtRDimension, sizeof (Dimension), offset (menu.shadow_thickness), XtRImmediate, (XtPointer) 2}, {XmNselectColor, XmCSelectColor, XtRPixel, sizeof (Pixel), diff -r 11c6df210d7f -r 56c54cf7c5b6 man/info.texi --- a/man/info.texi Mon Aug 13 08:55:32 2007 +0200 +++ b/man/info.texi Mon Aug 13 08:56:04 2007 +0200 @@ -932,13 +932,15 @@ selected. @item Info-directory-list -The list of directories to search for Info files. Each element is a -string (directory name) or @code{nil} (try default directory). +The list of directories to search for Info files. This variable is set +on startup automatically either from the @code{INFOPATH} environment +variable (if it exists) or, else, @code{Info-default-directory-list}. +Any user settings of this variable will be ignored. -@item Info-directory -The standard directory for Info documentation files. Only used when the -function @code{Info-directory} is called. -@end table +@item Info-default-directory-list +List of default directories to search for Info documentation files. +This value is used as the default for @code{Info-directory-list} in the +absence of a setting for the @code{INFOPATH} environment variable. @node Create an Info File, , Advanced Info, Top @comment node-name, next, previous, up diff -r 11c6df210d7f -r 56c54cf7c5b6 man/texinfo.texi --- a/man/texinfo.texi Mon Aug 13 08:55:32 2007 +0200 +++ b/man/texinfo.texi Mon Aug 13 08:56:04 2007 +0200 @@ -13,7 +13,7 @@ @paragraphindent 2 @finalout @comment %**end of header -@comment $Id: texinfo.texi,v 1.2 1997/03/09 02:38:21 steve Exp $ +@comment $Id: texinfo.texi,v 1.3 1997/08/21 06:24:24 steve Exp $ @c Before release, run C-u C-c C-u C-a (texinfo-all-menus-update with a @c prefix arg). This updates the node pointers, which texinfmt.el needs. @@ -12968,7 +12968,7 @@ @item If you are using Emacs, list the name of the file in a second @file{dir} file, in its directory; and then add the name of that directory to the -@code{Info-directory-list} variable in your personal or site +@code{Info-default-directory-list} variable in your personal or site initialization file. This tells Emacs's Info reader where to look for @file{dir} @@ -12997,13 +12997,13 @@ In this case, the absolute file name of the @file{info-test} file is written as the second part of the menu entry.@refill -@vindex Info-directory-list +@vindex Info-default-directory-list Alternatively, you could write the following in your @file{.emacs} file:@refill @example @group -(setq Info-directory-list +(setq Info-default-directory-list '("/home/bob/manuals" "/usr/local/emacs/info")) @end group diff -r 11c6df210d7f -r 56c54cf7c5b6 src/alloc.c --- a/src/alloc.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/alloc.c Mon Aug 13 08:56:04 2007 +0200 @@ -1604,9 +1604,12 @@ 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 diff -r 11c6df210d7f -r 56c54cf7c5b6 src/buffer.c --- a/src/buffer.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/buffer.c Mon Aug 13 08:56:04 2007 +0200 @@ -460,7 +460,7 @@ */ (filename)) { - /* This function can GC */ + /* This function can GC. GC checked 1997.04.06. */ REGISTER Lisp_Object tail, buf, tem; struct gcpro gcpro1; @@ -1239,6 +1239,10 @@ if (EQ (buf, Vecho_area_buffer)) return Qnil; + /* Or the special invisible internal prin1 buffer. */ + if (EQ (buf, Vprin1_to_string_buffer)) + return Qnil; + /* Query if the buffer is still modified. */ if (INTERACTIVE && !NILP (b->filename) && BUF_MODIFF (b) > BUF_SAVE_MODIFF (b)) diff -r 11c6df210d7f -r 56c54cf7c5b6 src/callint.c --- a/src/callint.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/callint.c Mon Aug 13 08:56:04 2007 +0200 @@ -740,7 +740,7 @@ case 'n': /* Read number from minibuffer. */ { read_number: - args[argnum] = call2 (Qread_number, PROMPT (), Qt); + args[argnum] = call2 (Qread_number, PROMPT (), Qnil); /* numbers are too boring to go on command history */ /* arg_from_tty = 1; */ break; diff -r 11c6df210d7f -r 56c54cf7c5b6 src/callproc.c --- a/src/callproc.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/callproc.c Mon Aug 13 08:56:04 2007 +0200 @@ -451,7 +451,7 @@ close (fd[0]); if (fd1 >= 0) close (fd1); - report_file_error ("Cannot open", error_file); + report_file_error ("Cannot open", Fcons(error_file, Qnil)); } fork_error = Qnil; diff -r 11c6df210d7f -r 56c54cf7c5b6 src/cmdloop.c --- a/src/cmdloop.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/cmdloop.c Mon Aug 13 08:56:04 2007 +0200 @@ -216,6 +216,26 @@ static DOESNT_RETURN command_loop_3 (void) { +#ifdef LWLIB_MENUBARS_LUCID + extern int in_menu_callback; /* defined in menubar-x.c */ +#endif /* LWLIB_MENUBARS_LUCID */ + +#ifdef LWLIB_MENUBARS_LUCID + /* + * #### Fix the menu code so this isn't necessary. + * + * We cannot allow the lwmenu code to be reentered, because the + * code is not written to be reentrant and will crash. Therefore + * paths from the menu callbacks back into the menu code have to + * be blocked. Fnext_event is the normal path into the menu code, + * but waiting to signal an error there is too late in case where + * a new command loop has been started. The error will be caught + * and Fnext_event will be called again, looping forever. So we + * signal an error here to avoid the loop. + */ + if (in_menu_callback) + error ("Attempt to enter command_loop_3 inside menu callback"); +#endif /* LWLIB_MENUBARS_LUCID */ /* This function can GC */ for (;;) { diff -r 11c6df210d7f -r 56c54cf7c5b6 src/console-tty.h --- a/src/console-tty.h Mon Aug 13 08:55:32 2007 +0200 +++ b/src/console-tty.h Mon Aug 13 08:56:04 2007 +0200 @@ -167,6 +167,8 @@ CONST char *end_motion; /* rmcup, te */ CONST char *keypad_on; /* smkx, ks */ CONST char *keypad_off; /* rmkx, ke */ + + CONST char *orig_pair; /* op, op */ } sd; /* costs of various operations */ diff -r 11c6df210d7f -r 56c54cf7c5b6 src/console.c --- a/src/console.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/console.c Mon Aug 13 08:56:04 2007 +0200 @@ -273,12 +273,23 @@ */ (console)) { + Lisp_Object device; + CHECK_LIVE_CONSOLE (console); - /* select the console's selected frame's selected window. This will call - selected_frame_1(). */ - if (!NILP (CONSOLE_SELECTED_DEVICE (XCONSOLE (console)))) - Fselect_window (FRAME_SELECTED_WINDOW (XFRAME (DEVICE_SELECTED_FRAME (XDEVICE (CONSOLE_SELECTED_DEVICE (XCONSOLE (console))))))); + device = CONSOLE_SELECTED_DEVICE (XCONSOLE (console)); + if (!NILP (device)) + { + struct device *d = XDEVICE (device); + Lisp_Object frame = DEVICE_SELECTED_FRAME (d); + if (!NILP (frame)) + { + struct frame *f = XFRAME(frame); + Fselect_window (FRAME_SELECTED_WINDOW (f)); + } + else + error ("Can't select console with no frames."); + } else error ("Can't select a console with no devices"); return Qnil; diff -r 11c6df210d7f -r 56c54cf7c5b6 src/database.c --- a/src/database.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/database.c Mon Aug 13 08:56:04 2007 +0200 @@ -543,8 +543,10 @@ DB_FUNCS *funcblock; struct database_struct *dbase = NULL; void *db = NULL; + struct gcpro gcpro1; - CHECK_STRING (file); + GCPRO1 (file); + file = Fexpand_file_name (file, Qnil); if (NILP (ackcess)) { @@ -623,6 +625,8 @@ dbase->funcs = funcblock; XSETDATABASE (retval, dbase); + UNGCPRO; + return (retval); } diff -r 11c6df210d7f -r 56c54cf7c5b6 src/device-x.c --- a/src/device-x.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/device-x.c Mon Aug 13 08:56:04 2007 +0200 @@ -370,7 +370,8 @@ Vdefault_x_device = Qnil; DEVICE_LOOP_NO_BREAK (devcons, concons) { - if (DEVICE_X_P (XDEVICE (XCAR (devcons)))) + if (DEVICE_X_P (XDEVICE (XCAR (devcons))) && + !EQ (device, XCAR (devcons))) { Vdefault_x_device = XCAR (devcons); goto double_break; diff -r 11c6df210d7f -r 56c54cf7c5b6 src/dired.c --- a/src/dired.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/dired.c Mon Aug 13 08:56:04 2007 +0200 @@ -53,7 +53,7 @@ */ (dirname, full, match, nosort, files_only)) { - /* This function can GC */ + /* This function can GC. GC checked 1997.04.06. */ DIR *d; Bytecount dirname_length; Lisp_Object list, name, dirfilename = Qnil; @@ -66,10 +66,8 @@ char slashfilename[MAXNAMLEN+2]; char *filename = slashfilename; - struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; - - /* #### Needs more gcpro's */ - GCPRO5 (dirname, match, files_only, tail_cons, dirfilename); + struct gcpro gcpro1, gcpro2, gcpro3; + GCPRO3 (dirname, dirfilename, tail_cons); /* If the file name has special constructs in it, call the corresponding file handler. */ @@ -85,6 +83,8 @@ nosort); } + /* #### why do we do Fexpand_file_name after file handlers here, + but earlier everywhere else? */ dirname = Fexpand_file_name (dirname, Qnil); dirfilename = Fdirectory_file_name (dirname); @@ -225,7 +225,7 @@ */ (file, dirname)) { - /* This function can GC */ + /* This function can GC. GC checked 1996.04.06. */ Lisp_Object handler; /* If the directory name has special constructs in it, @@ -254,12 +254,16 @@ */ (file, dirname)) { - /* This function can GC */ + /* This function can GC. GC checked 1997.06.04. */ Lisp_Object handler; + struct gcpro gcpro1; + GCPRO1 (dirname); + dirname = Fexpand_file_name (dirname, Qnil); /* If the file name has special constructs in it, call the corresponding file handler. */ handler = Ffind_file_name_handler (dirname, Qfile_name_all_completions); + UNGCPRO; if (!NILP (handler)) return call3 (handler, Qfile_name_all_completions, file, dirname); @@ -615,7 +619,7 @@ */ (filename)) { - /* This function can call lisp */ + /* This function can GC. GC checked 1997.06.04. */ Lisp_Object values[12]; Lisp_Object dirname = Qnil; struct stat s; @@ -623,20 +627,23 @@ Lisp_Object handler; struct gcpro gcpro1, gcpro2; - GCPRO1 (filename); + GCPRO2 (filename, dirname); filename = Fexpand_file_name (filename, Qnil); /* If the file name has special constructs in it, call the corresponding file handler. */ handler = Ffind_file_name_handler (filename, Qfile_attributes); - UNGCPRO; if (!NILP (handler)) - return call2 (handler, Qfile_attributes, filename); + { + UNGCPRO; + return call2 (handler, Qfile_attributes, filename); + } if (lstat ((char *) XSTRING_DATA (filename), &s) < 0) - return Qnil; - - GCPRO2 (filename, dirname); + { + UNGCPRO; + return Qnil; + } #ifdef BSD4_2 dirname = Ffile_name_directory (filename); diff -r 11c6df210d7f -r 56c54cf7c5b6 src/editfns.c --- a/src/editfns.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/editfns.c Mon Aug 13 08:56:04 2007 +0200 @@ -920,10 +920,11 @@ static long difftm (CONST struct tm *a, CONST struct tm *b); -DEFUN ("format-time-string", Fformat_time_string, 2, 2, 0, /* +DEFUN ("format-time-string", Fformat_time_string, 1, 2, 0, /* Use FORMAT-STRING to format the time TIME. TIME is specified as (HIGH LOW . IGNORED) or (HIGH . LOW), as from -`current-time' and `file-attributes'. +`current-time' and `file-attributes'. If TIME is not specified it +defaults to the current time. FORMAT-STRING may contain %-sequences to substitute parts of the time. %a is replaced by the abbreviated name of the day of week. %A is replaced by the full name of the day of week. diff -r 11c6df210d7f -r 56c54cf7c5b6 src/event-Xt.c --- a/src/event-Xt.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/event-Xt.c Mon Aug 13 08:56:04 2007 +0200 @@ -651,7 +651,7 @@ force anyone to remember them. The case of the other character sets is significant, however. */ - if ((((unsigned int) keysym) & (~0xFF)) == ((unsigned int) 0xFF00)) + if ((((unsigned int) keysym) & (~0x1FF)) == ((unsigned int) 0xFE00)) { char buf [255]; char *s1, *s2; diff -r 11c6df210d7f -r 56c54cf7c5b6 src/event-stream.c --- a/src/event-stream.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/event-stream.c Mon Aug 13 08:56:04 2007 +0200 @@ -1978,11 +1978,28 @@ XCOMMAND_BUILDER (con->command_builder); int store_this_key = 0; struct gcpro gcpro1; +#ifdef LWLIB_MENUBARS_LUCID + extern int in_menu_callback; /* defined in menubar-x.c */ +#endif /* LWLIB_MENUBARS_LUCID */ + GCPRO1 (event); - /* DO NOT do QUIT anywhere within this function or the functions it calls. We want to read the ^G as an event. */ +#ifdef LWLIB_MENUBARS_LUCID + /* + * #### Fix the menu code so this isn't necessary. + * + * We cannot allow the lwmenu code to be reentered, because the + * code is not written to be reentrant and will crash. Therefore + * paths from the menu callbacks back into the menu code have to + * be blocked. Fnext_event is the normal path into the menu code, + * so we signal an error here. + */ + if (in_menu_callback) + error ("Attempt to call next-event inside menu callback"); +#endif /* LWLIB_MENUBARS_LUCID */ + if (NILP (event)) event = Fmake_event (); else diff -r 11c6df210d7f -r 56c54cf7c5b6 src/extents.c --- a/src/extents.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/extents.c Mon Aug 13 08:56:04 2007 +0200 @@ -6184,6 +6184,9 @@ ME_ALL_EXTENTS_CLOSED | ME_END_CLOSED | /* it might QUIT or error if the user has fucked with the extent plist. */ + /* #### dmoore - I think this should include + ME_MIGHT_MOVE_SOE, since the callback function + might recurse back into map_extents_bytind. */ ME_MIGHT_THROW | ME_MIGHT_MODIFY_EXTENTS); diff -r 11c6df210d7f -r 56c54cf7c5b6 src/fileio.c --- a/src/fileio.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/fileio.c Mon Aug 13 08:56:04 2007 +0200 @@ -410,7 +410,7 @@ */ (file)) { - /* This function can call lisp */ + /* This function can GC. GC checked 1997.04.06. */ Bufbyte *beg; Bufbyte *p; Lisp_Object handler; @@ -478,7 +478,7 @@ */ (file)) { - /* This function can call lisp */ + /* This function can GC. GC checked 1997.04.06. */ Bufbyte *beg, *p, *end; Lisp_Object handler; @@ -514,7 +514,7 @@ */ (filename)) { - /* This function can call lisp */ + /* This function can GC. GC checked 1997.04.06. */ Lisp_Object handler; /* If the file name has special constructs in it, @@ -614,7 +614,7 @@ */ (file)) { - /* This function can call lisp */ + /* This function can GC. GC checked 1997.04.06. */ char *buf; Lisp_Object handler; @@ -800,7 +800,7 @@ */ (directory)) { - /* This function can call lisp */ + /* This function can GC. GC checked 1997.04.06. */ char *buf; Lisp_Object handler; @@ -868,7 +868,7 @@ */ (name, defalt)) { - /* This function can call lisp */ + /* This function can GC. GC checked 1997.04.06. */ Bufbyte *nm; Bufbyte *newdir, *p, *o; @@ -890,7 +890,6 @@ Bufbyte *tmp, *defdir; #endif /* DOS_NT */ Lisp_Object handler; - struct gcpro gcpro1; CHECK_STRING (name); @@ -1398,10 +1397,10 @@ */ (filename, defalt)) { - /* This function can call lisp */ - struct gcpro gcpro1; + /* This function can GC. GC checked 1997.04.06. */ Lisp_Object expanded_name; Lisp_Object handler; + struct gcpro gcpro1; CHECK_STRING (filename); @@ -1525,7 +1524,7 @@ */ (string)) { - /* This function can call lisp */ + /* This function can GC. GC checked 1997.04.06. */ Bufbyte *nm; Bufbyte *s, *p, *o, *x, *endp; @@ -1828,7 +1827,7 @@ */ (filename, newname, ok_if_already_exists, keep_time)) { - /* This function can call lisp */ + /* This function can GC. GC checked 1997.04.06. */ int ifd, ofd, n; char buf[16 * 1024]; struct stat st, out_st; @@ -1994,7 +1993,7 @@ */ (dirname)) { - /* This function can call lisp */ + /* This function can GC. GC checked 1997.04.06 */ char dir [MAXPATHLEN]; Lisp_Object handler; struct gcpro gcpro1; @@ -2038,7 +2037,7 @@ */ (dirname)) { - /* This function can call lisp */ + /* This function can GC. GC checked 1997.04.06. */ Lisp_Object handler; struct gcpro gcpro1; @@ -2065,7 +2064,7 @@ */ (filename)) { - /* This function can call lisp */ + /* This function can GC. GC checked 1997.04.06. */ Lisp_Object handler; struct gcpro gcpro1; @@ -2094,7 +2093,7 @@ int internal_delete_file (Lisp_Object filename) { - /* This function can call lisp */ + /* This function can GC. GC checked 1997.04.06. */ return NILP (condition_case_1 (Qt, Fdelete_file, filename, internal_delete_file_1, Qnil)); } @@ -2110,7 +2109,7 @@ */ (filename, newname, ok_if_already_exists)) { - /* This function can call lisp */ + /* This function can GC. GC checked 1997.04.06. */ Lisp_Object handler; struct gcpro gcpro1, gcpro2; @@ -2203,7 +2202,7 @@ */ (filename, newname, ok_if_already_exists)) { - /* This function can call lisp */ + /* This function can GC. GC checked 1997.04.06. */ Lisp_Object handler; struct gcpro gcpro1, gcpro2; @@ -2260,7 +2259,7 @@ */ (filename, linkname, ok_if_already_exists)) { - /* This function can call lisp */ + /* This function can GC. GC checked 1997.06.04. */ Lisp_Object handler; struct gcpro gcpro1, gcpro2; diff -r 11c6df210d7f -r 56c54cf7c5b6 src/fns.c --- a/src/fns.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/fns.c Mon Aug 13 08:56:04 2007 +0200 @@ -3008,8 +3008,8 @@ If the 5-minute or 15-minute load averages are not available, return a shortened list, containing only those averages which are available. -On most systems, this won't work unless the emacs executable is installed -as setgid kmem (assuming that /dev/kmem is in the group kmem). +On some systems, this won't work due to permissions on /dev/kmem in +which case you can't use this. */ ()) { diff -r 11c6df210d7f -r 56c54cf7c5b6 src/frame.c --- a/src/frame.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/frame.c Mon Aug 13 08:56:04 2007 +0200 @@ -1400,12 +1400,39 @@ called_from_delete_device); if (NILP (next) || EQ (next, frame)) 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. */ if (NILP (next) || EQ (next, frame)) ; - else if (EQ (frame, Fselected_frame (Qnil))) - Fselect_frame (next); else - set_device_selected_frame (d, next); + { + int did_select = 0; + /* if this is the global selected frame, select another one. */ + if (EQ (frame, Fselected_frame (Qnil))) + { + Fselect_frame (next); + did_select = 1; + } + /* + * If the new frame we just selected is on a different + * device then we still need to change DEVICE_SELECTED_FRAME(d) + * to a live frame, if there are any left on this device. + */ + if (!EQ (device, FRAME_DEVICE(XFRAME(next)))) + { + Lisp_Object next_f = + next_frame_internal (frame, Qt, device, + called_from_delete_device); + if (NILP (next_f) || EQ (next_f, frame)) + ; + else + set_device_selected_frame (d, next_f); + } + else if (! did_select) + set_device_selected_frame (d, next); + + } } /* Don't allow minibuf_window to remain on a deleted frame. */ diff -r 11c6df210d7f -r 56c54cf7c5b6 src/getloadavg.c --- a/src/getloadavg.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/getloadavg.c Mon Aug 13 08:56:04 2007 +0200 @@ -19,7 +19,6 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Synched up with: FSF 19.31. */ /* Compile-time symbols that this file uses: @@ -32,8 +31,6 @@ Must be defined unless one of apollo, DGUX, NeXT, or UMAX is defined; otherwise, no load average is available. - Does not need to be defined if HPUX is - defined and HPUX_PRE_8_0 is not defined. NLIST_STRUCT Include nlist.h, not a.out.h, and the nlist n_name element is a pointer, not an array. @@ -83,10 +80,9 @@ #include #endif - -#ifdef emacs +#ifdef XEMACS #include "lisp.h" /* for encapsulated open, close, read, write */ -#endif +#endif /* XEMACS */ /* Exclude all the code except the test program at the end if the system has its own `getloadavg' function. @@ -116,6 +112,12 @@ #define LDAV_CVT(n) (LOAD_AVE_CVT (n) / 100.0) #endif +#ifdef XEMACS +#if defined (HAVE_KSTAT_H) +#include +#endif /* HAVE_KSTAT_H */ +#endif /* XEMACS */ + #if !defined (BSD) && defined (ultrix) /* Ultrix behaves like BSD on Vaxen. */ #define BSD @@ -150,7 +152,7 @@ #define decstation #endif -#if (defined(sun) && defined(USG)) || defined (SOLARIS2) +#if (defined(sun) && defined(SVR4)) || defined (SOLARIS2) #define SUNOS_5 #endif @@ -291,11 +293,6 @@ /* VAX C can't handle multi-line #ifs, or lines longer that 256 characters. */ #ifndef NLIST_STRUCT -/* XEmacs addition */ -#ifdef _AIX -#define NLIST_STRUCT -#endif - #ifdef MORE_BSD #define NLIST_STRUCT #endif @@ -381,8 +378,9 @@ #define LDAV_SYMBOL "avenrun" #endif -#include +#ifdef HAVE_UNISTD_H #include +#endif #include @@ -431,9 +429,6 @@ #endif /* LOAD_AVE_TYPE */ #ifdef NeXT -/* This undef is needed to shut up the NeXT compiler about a stupid - non-problem. */ -#undef index #ifdef HAVE_MACH_MACH_H #include #else @@ -472,10 +467,11 @@ #include #endif -/* XEmacs addition */ -#if !defined(LDAV_DONE) && defined(HPUX) && !defined (HPUX_PRE_8_0) +#ifdef XEMACS +#if defined (HAVE_SYS_PSTAT_H) #include -#endif +#endif /* HAVE_SYS_PSTAT_H (on HPUX) */ +#endif /* XEMACS */ #if defined(HAVE_FCNTL_H) || defined(_POSIX_VERSION) #include @@ -500,10 +496,8 @@ #endif /* DGUX */ #ifdef LOAD_AVE_TYPE -#if defined (VMS) || !defined (SUNOS_5) /* File descriptor open to /dev/kmem or VMS load ave driver. */ static int channel; -#endif /* VMS || !SUNOS_5 */ /* Nonzero iff channel is valid. */ static int getloadavg_initialized; /* Offset in kmem to seek to read load average, or 0 means invalid. */ @@ -537,6 +531,64 @@ elem = -1; #endif +#ifdef XEMACS +#if ! defined (LDAV_DONE) && defined (HAVE_KSTAT_H) && defined (HAVE_LIBKSTAT) +#define LDAV_DONE + +/* getloadavg is best implemented using kstat (kernel stats), + on systems (like SunOS5) that support it, + since you don't have to be superusers to use it. + Thanks to Zlatko Calusic . + Integrated to XEmacs by Hrvoje Niksic . */ + static kstat_ctl_t *kc; + static kstat_t *ksp; + static kstat_named_t *buf; + + if (!getloadavg_initialized) + { + kc = kstat_open(); + if (!kc) + return -1; + getloadavg_initialized = 1; + } + ksp = kstat_lookup(kc, "unix", 0, "system_misc"); + if (!ksp) + return -1; + if (kstat_read(kc, ksp, ksp->ks_data) < 0) + return -1; + buf = malloc(ksp->ks_data_size); + if (!buf) + return -1; + memcpy(buf, ksp->ks_data, ksp->ks_data_size); + if (nelem > 3) + nelem = 3; + for (elem = 0; elem < nelem; elem++) + loadavg[elem] = (buf + 6 + elem)->value.ul / 256.0; + free(buf); + +#endif /* HAVE_KSTAT_H && HAVE_LIBKSTAT */ + +#if !defined (LDAV_DONE) && defined (HAVE_SYS_PSTAT_H) +#define LDAV_DONE + /* This is totally undocumented, and is not guaranteed to work, but + mayhap it might .... If it does work, it will work only on HP-UX + 8.0 or later. -- Darryl Okahata */ +#undef LOAD_AVE_TYPE /* Make sure these don't exist. */ +#undef LOAD_AVE_CVT +#undef LDAV_SYMBOL + struct pst_dynamic procinfo; + union pstun statbuf; + + statbuf.pst_dynamic = &procinfo; + if (pstat (PSTAT_DYNAMIC, statbuf, sizeof (struct pst_dynamic), 0, 0) == -1) + return (-1); + loadavg[elem++] = procinfo.psd_avg_1_min; + loadavg[elem++] = procinfo.psd_avg_5_min; + loadavg[elem++] = procinfo.psd_avg_15_min; +#endif /* HPUX */ + +#endif /* XEMACS */ + #if !defined (LDAV_DONE) && defined (__linux__) #define LDAV_DONE #undef LOAD_AVE_TYPE @@ -606,12 +658,8 @@ struct processor_set_basic_info info; unsigned info_count; - if (nelem > 1) - { - /* We only know how to get the 1-minute average for this system. */ - errno = EINVAL; - return -1; - } + /* We only know how to get the 1-minute average for this system, + so even if the caller asks for more than 1, we only return 1. */ if (!getloadavg_initialized) { @@ -647,11 +695,11 @@ struct proc_summary proc_sum_data; struct stat_descr proc_info; double load; - unsigned int i, j; + register unsigned int i, j; if (cpus == 0) { - unsigned int c, i; + register unsigned int c, i; struct cpu_config conf; struct stat_descr desc; @@ -754,12 +802,10 @@ struct tbl_loadavg load_ave; table (TBL_LOADAVG, 0, &load_ave, 1, sizeof (load_ave)); - while (elem < nelem && elem < 3) - { - loadavg[elem++] = (load_ave.tl_lscale == 0 - ? load_ave.tl_avenrun.d[0] - : (load_ave.tl_avenrun.l[0] / (double) load_ave.tl_lscale)); - } + loadavg[elem++] + = (load_ave.tl_lscale == 0 + ? load_ave.tl_avenrun.d[0] + : (load_ave.tl_avenrun.l[0] / (double) load_ave.tl_lscale)); #endif /* OSF_MIPS */ #if !defined (LDAV_DONE) && (defined (MSDOS) || defined (WIN32)) @@ -824,27 +870,6 @@ return -1; #endif /* VMS */ -#if !defined (LDAV_DONE) && defined (HPUX) && !defined (HPUX_PRE_8_0) -#define LDAV_DONE - /* - * This is totally undocumented, and is not guaranteed to work, but - * mayhap it might .... If it does work, it will work only on HP-UX - * 8.0 or later. -- Darryl Okahata - */ -#undef LOAD_AVE_TYPE /* Make sure these don't exist. */ -#undef LOAD_AVE_CVT -#undef LDAV_SYMBOL - struct pst_dynamic procinfo; - union pstun statbuf; - - statbuf.pst_dynamic = &procinfo; - if (pstat (PSTAT_DYNAMIC, statbuf, sizeof (struct pst_dynamic), 0, 0) == -1) - return (-1); - loadavg[elem++] = procinfo.psd_avg_1_min; - loadavg[elem++] = procinfo.psd_avg_5_min; - loadavg[elem++] = procinfo.psd_avg_15_min; -#endif /* HPUX */ - #if !defined (LDAV_DONE) && defined(LOAD_AVE_TYPE) && !defined(VMS) /* UNIX-specific code -- read the average from /dev/kmem. */ diff -r 11c6df210d7f -r 56c54cf7c5b6 src/glyphs-x.c --- a/src/glyphs-x.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/glyphs-x.c Mon Aug 13 08:56:04 2007 +0200 @@ -57,7 +57,11 @@ #include "sysfile.h" +#ifdef HAVE_PNG +#include +#else #include +#endif #define LISP_DEVICE_TO_X_SCREEN(dev) \ XDefaultScreenOfDisplay (DEVICE_X_DISPLAY (XDEVICE (dev))) @@ -110,7 +114,8 @@ Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask); + int dest_mask, + Lisp_Object domain); #include "bitmaps.h" @@ -1034,7 +1039,7 @@ static void xbm_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask) + int dest_mask, Lisp_Object domain) { Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); CONST char *gcc_go_home; @@ -1268,7 +1273,7 @@ static void jpeg_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask) + int dest_mask, Lisp_Object domain) { struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); @@ -1745,7 +1750,7 @@ static void gif_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask) + int dest_mask, Lisp_Object domain) { struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); @@ -1919,8 +1924,6 @@ #ifdef HAVE_PNG -#include - /********************************************************************** * PNG * **********************************************************************/ @@ -2030,7 +2033,7 @@ static void png_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask) + int dest_mask, Lisp_Object domain) { struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); @@ -2324,7 +2327,7 @@ static void tiff_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask) + int dest_mask, Lisp_Object domain) { abort (); } @@ -2554,6 +2557,7 @@ static XpmColorSymbol * extract_xpm_color_names (XpmAttributes *xpmattrs, Lisp_Object device, + Lisp_Object domain, Lisp_Object color_symbol_alist) { /* This function can GC */ @@ -2587,7 +2591,7 @@ else { assert (COLOR_SPECIFIERP (value)); - value = Fspecifier_instance (value, Qnil, Qnil, Qnil); + value = Fspecifier_instance (value, domain, Qnil, Qnil); } if (NILP (value)) continue; @@ -2636,7 +2640,7 @@ static void xpm_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask) + int dest_mask, Lisp_Object domain) { /* This function can GC */ struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); @@ -2697,7 +2701,7 @@ xpmattrs.valuemask |= XpmCloseness; } - color_symbols = extract_xpm_color_names (&xpmattrs, device, + color_symbols = extract_xpm_color_names (&xpmattrs, device, domain, color_symbol_alist); result = XpmCreatePixmapFromBuffer (dpy, @@ -3048,7 +3052,7 @@ static void xface_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask) + int dest_mask, Lisp_Object domain) { Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); int i, stattis; @@ -3213,7 +3217,7 @@ static void autodetect_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask) + int dest_mask, Lisp_Object domain) { Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); struct gcpro gcpro1, gcpro2, gcpro3; @@ -3241,10 +3245,10 @@ if (is_cursor_font) cursor_font_instantiate (image_instance, result, pointer_fg, - pointer_bg, dest_mask); + pointer_bg, dest_mask, domain); else string_instantiate (image_instance, result, pointer_fg, - pointer_bg, dest_mask); + pointer_bg, dest_mask, domain); UNGCPRO; } @@ -3310,7 +3314,7 @@ static void font_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask) + int dest_mask, Lisp_Object domain) { /* This function can GC */ Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); @@ -3408,7 +3412,7 @@ static void cursor_font_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask) + int dest_mask, Lisp_Object domain) { /* This function can GC */ Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); diff -r 11c6df210d7f -r 56c54cf7c5b6 src/glyphs.c --- a/src/glyphs.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/glyphs.c Mon Aug 13 08:56:04 2007 +0200 @@ -479,7 +479,8 @@ } static Lisp_Object -instantiate_image_instantiator (Lisp_Object device, Lisp_Object instantiator, +instantiate_image_instantiator (Lisp_Object device, Lisp_Object domain, + Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask) { @@ -499,7 +500,7 @@ ("Don't know how to instantiate this image instantiator?", instantiator); IIFORMAT_METH (meths, instantiate, (ii, instantiator, pointer_fg, - pointer_bg, dest_mask)); + pointer_bg, dest_mask, domain)); } UNGCPRO; @@ -982,7 +983,8 @@ if (VECTORP (data) && EQ (vector_data (XVECTOR (data))[0], Qinherit)) signal_simple_error ("inheritance not allowed here", data); - ii = instantiate_image_instantiator (device, data, Qnil, Qnil, dest_mask); + ii = instantiate_image_instantiator (device, device, data, + Qnil, Qnil, dest_mask); RETURN_UNGCPRO (ii); } @@ -1327,7 +1329,7 @@ static void nothing_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask) + int dest_mask, Lisp_Object domain) { struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); @@ -1369,7 +1371,7 @@ static void inherit_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask) + int dest_mask, Lisp_Object domain) { /* handled specially in image_instantiate */ abort (); @@ -1396,7 +1398,7 @@ void string_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask) + 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); @@ -1432,7 +1434,7 @@ formatted_string_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask) + 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); @@ -1596,6 +1598,7 @@ record_unwind_protect (image_instantiate_cache_result, locative); instance = instantiate_image_instantiator (device, + domain, instantiator, pointer_fg, pointer_bg, dest_mask); diff -r 11c6df210d7f -r 56c54cf7c5b6 src/glyphs.h --- a/src/glyphs.h Mon Aug 13 08:55:32 2007 +0200 +++ b/src/glyphs.h Mon Aug 13 08:56:04 2007 +0200 @@ -95,7 +95,8 @@ Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask); + int dest_mask, + Lisp_Object domain); }; struct ii_keyword_entry @@ -496,7 +497,7 @@ Lisp_Object alist_to_tagged_vector (Lisp_Object tag, Lisp_Object alist); void string_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask); + int dest_mask, Lisp_Object domain); Lisp_Object allocate_glyph (enum glyph_type type, void (*after_change) (Lisp_Object glyph, Lisp_Object property, diff -r 11c6df210d7f -r 56c54cf7c5b6 src/insdel.c --- a/src/insdel.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/insdel.c Mon Aug 13 08:56:04 2007 +0200 @@ -1219,7 +1219,7 @@ { /* This function can GC */ Lisp_Object buffer; - XSETBUFFER (buffer, buf); + XSETBUFFER (buffer, current_buffer); if (!in_first_change) { @@ -1281,6 +1281,7 @@ /* Now in any case run the before-change-functions if any. */ if (!preparing_for_armageddon && + !EQ (buffer, Vprin1_to_string_buffer) && (!NILP (symbol_value_in_buffer (Qbefore_change_functions, buffer)) || /* Obsolete, for compatibility */ !NILP (symbol_value_in_buffer (Qbefore_change_function, buffer)))) @@ -1339,6 +1340,7 @@ } if (!preparing_for_armageddon && + !EQ (buffer, Vprin1_to_string_buffer) && (!NILP (symbol_value_in_buffer (Qafter_change_functions, buffer)) || /* Obsolete, for compatibility */ !NILP (symbol_value_in_buffer (Qafter_change_function, buffer)))) diff -r 11c6df210d7f -r 56c54cf7c5b6 src/lread.c --- a/src/lread.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/lread.c Mon Aug 13 08:56:04 2007 +0200 @@ -1736,7 +1736,7 @@ if (p == lim) goto loser; - for (; p < lim; p++) + for (; (p < lim) && (*p != '\0'); p++) { int c = *p; unsigned EMACS_INT onum; diff -r 11c6df210d7f -r 56c54cf7c5b6 src/md5.c --- a/src/md5.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/md5.c Mon Aug 13 08:56:04 2007 +0200 @@ -34,7 +34,7 @@ typedef unsigned char *POINTER;/* POINTER defines a generic pointer type */ typedef unsigned short int UINT2;/* UINT2 defines a two byte word */ -typedef unsigned long int UINT4;/* UINT4 defines a four byte word */ +typedef unsigned int UINT4;/* UINT4 defines a four byte word */ #define PROTO_LIST(list) list #define MD_CTX MD5_CTX diff -r 11c6df210d7f -r 56c54cf7c5b6 src/menubar-x.c --- a/src/menubar-x.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/menubar-x.c Mon Aug 13 08:56:04 2007 +0200 @@ -308,6 +308,18 @@ } +#ifdef LWLIB_MENUBARS_LUCID +int in_menu_callback; + +Lisp_Object +restore_in_menu_callback(Lisp_Object val) +{ + in_menu_callback = XINT(val); + return Qnil; +} +#endif /* LWLIB_MENUBARS_LUCID */ + + /* The order in which callbacks are run is funny to say the least. It's sometimes tricky to avoid running a callback twice, and to avoid returning prematurely. So, this function returns true @@ -338,6 +350,7 @@ Lisp_Object rest = Qnil; Lisp_Object frame; int any_changes = 0; + int count; if (!f) f = x_any_window_to_frame (d, XtWindow (XtParent (widget))); @@ -357,8 +370,22 @@ assert (hack_wv->type == INCREMENTAL_TYPE); VOID_TO_LISP (submenu_desc, hack_wv->call_data); + + /* + * #### Fix the menu code so this isn't necessary. + * + * Protect against reentering the menu code otherwise we will + * crash later when the code gets confused at the state + * changes. + */ + count = specpdl_depth (); + record_unwind_protect (restore_in_menu_callback, + make_int (in_menu_callback)); + in_menu_callback = 1; wv = menu_item_descriptor_to_widget_value (submenu_desc, SUBMENU_TYPE, 1, 0); + unbind_to (count, Qnil); + if (!wv) { wv = xmalloc_widget_value (); diff -r 11c6df210d7f -r 56c54cf7c5b6 src/process.c --- a/src/process.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/process.c Mon Aug 13 08:56:04 2007 +0200 @@ -1023,6 +1023,8 @@ } p->pid = make_int (pid); + /* #### dmoore - why is this commented out, otherwise we leave + subtty = forkin, but then we close forkin just below. */ /* p->subtty = -1; */ #ifdef WINDOWSNT @@ -1094,11 +1096,12 @@ */ (int nargs, Lisp_Object *args)) { + /* This function can call lisp */ /* !!#### This function has not been Mule-ized */ - /* This function can GC */ Lisp_Object buffer, name, program, proc, current_dir; Lisp_Object tem; int speccount = specpdl_depth (); + struct gcpro gcpro1, gcpro2, gcpro3; #ifdef VMS char *new_argv; int len; @@ -1107,44 +1110,39 @@ #endif int i; + name = args[0]; buffer = args[1]; + program = args[2]; + current_dir = Qnil; + + /* Protect against various file handlers doing GCs below. */ + GCPRO3 (buffer, program, current_dir); + if (!NILP (buffer)) buffer = Fget_buffer_create (buffer); - CHECK_STRING (args[0]); /* name */ - CHECK_STRING (args[2]); /* program */ + CHECK_STRING (name); + CHECK_STRING (program); /* Make sure that the child will be able to chdir to the current buffer's current directory, or its unhandled equivalent. We can't just have the child check for an error when it does the chdir, since it's in a vfork. - We have to GCPRO around this because Fexpand_file_name and - Funhandled_file_name_directory might call a file name handling - function. The argument list is protected by the caller, so all - we really have to worry about is buffer. */ - { - struct gcpro gcpro1, gcpro2; /* Caller gc-protects args[] */ - - current_dir = current_buffer->directory; - - GCPRO2 (buffer, current_dir); - - current_dir = - expand_and_dir_to_file (Funhandled_file_name_directory (current_dir), - Qnil); + Note: these assignments and calls are like this in order to insure + "caller protects args" GC semantics. */ + current_dir = current_buffer->directory; + current_dir = Funhandled_file_name_directory (current_dir); + current_dir = expand_and_dir_to_file (current_dir, Qnil); + #if 0 /* This loser breaks ange-ftp */ - if (NILP (Ffile_accessible_directory_p (current_dir))) - report_file_error ("Setting current directory", - list1 (current_buffer->directory)); + /* dmoore - if you re-enable this code, you have to gcprotect + current_buffer through the above calls. */ + if (NILP (Ffile_accessible_directory_p (current_dir))) + report_file_error ("Setting current directory", + list1 (current_buffer->directory)); #endif /* 0 */ - UNGCPRO; - } - - name = args[0]; - program = args[2]; - #ifdef VMS /* Make a one member argv with all args concatenated together separated by a blank. */ @@ -1167,36 +1165,31 @@ /* Need to add code here to check for program existence on VMS */ #else /* not VMS */ - new_argv = (char **) - alloca ((nargs - 1) * sizeof (char *)); - - new_argv[0] = (char *) XSTRING_DATA (program); - /* If program file name is not absolute, search our path for it */ if (!IS_DIRECTORY_SEP (XSTRING_BYTE (program, 0)) && !(XSTRING_LENGTH (program) > 1 && IS_DEVICE_SEP (XSTRING_BYTE (program, 1)))) { - struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; /* Caller protects args[] */ - GCPRO4 (buffer, current_dir, name, program); - + struct gcpro ngcpro1; + tem = Qnil; + NGCPRO1 (tem); locate_file (Vexec_path, program, EXEC_SUFFIXES, &tem, X_OK); - UNGCPRO; if (NILP (tem)) report_file_error ("Searching for program", list1 (program)); - tem = Fexpand_file_name (tem, Qnil); - new_argv[0] = (char *) XSTRING_DATA (tem); + program = Fexpand_file_name (tem, Qnil); + NUNGCPRO; } else { - /* #### dmoore - file-directory-p can call lisp, make sure everything - here protects itself. */ if (!NILP (Ffile_directory_p (program))) error ("Specified program for new process is a directory"); } + /* Nothing below here GCs so our string pointers shouldn't move. */ + new_argv = (char **) alloca ((nargs - 1) * sizeof (char *)); + new_argv[0] = (char *) XSTRING_DATA (program); for (i = 3; i < nargs; i++) { tem = args[i]; @@ -1226,6 +1219,7 @@ create_process (proc, new_argv, (char *) XSTRING_DATA (current_dir)); + UNGCPRO; return unbind_to (speccount, proc); } @@ -1728,12 +1722,24 @@ /* If the restriction isn't what it should be, set it. */ if (old_begv != BUF_BEGV (buf) || old_zv != BUF_ZV (buf)) - Fnarrow_to_region (make_int (old_begv), make_int (old_zv), - p->buffer); + { + Fwiden(p->buffer); + old_begv = bufpos_clip_to_bounds (BUF_BEG (buf), + old_begv, + BUF_Z (buf)); + old_zv = bufpos_clip_to_bounds (BUF_BEG (buf), + old_zv, + BUF_Z (buf)); + Fnarrow_to_region (make_int (old_begv), make_int (old_zv), + p->buffer); + } /* Handling the process output should not deactivate the mark. */ zmacs_region_stays = old_zmacs_region_stays; buf->read_only = old_read_only; + old_point = bufpos_clip_to_bounds (BUF_BEGV (buf), + old_point, + BUF_ZV (buf)); BUF_SET_PT (buf, old_point); UNGCPRO; @@ -2508,6 +2514,9 @@ Fset_marker (p->mark, make_int (BUF_PT (current_buffer)), p->buffer); + opoint = bufpos_clip_to_bounds(BUF_BEGV (XBUFFER (p->buffer)), + opoint, + BUF_ZV (XBUFFER (p->buffer))); BUF_SET_PT (current_buffer, opoint); Fset_buffer (old); NUNGCPRO; diff -r 11c6df210d7f -r 56c54cf7c5b6 src/redisplay-output.c --- a/src/redisplay-output.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/redisplay-output.c Mon Aug 13 08:56:04 2007 +0200 @@ -333,13 +333,23 @@ full redraw of the block in order to make sure that the cursor is updated properly. */ if (ddb->type != TEXT +#if 0 + /* I'm not sure exactly what this code wants to do, but it's + * not right--it doesn't update when cursor_elt changes from, e.g., + * 0 to 8, and the new or old cursor loc overlaps this block. + * I've replaced it with the more conservative test below. + * -dkindred@cs.cmu.edu 23-Mar-1997 */ && ((cdl->cursor_elt == -1 && ddl->cursor_elt != -1) || (cdl->cursor_elt != -1 && ddl->cursor_elt == -1)) && (ddl->cursor_elt == -1 || (cursor_start && cursor_width && (cursor_start + cursor_width) >= start_pixpos - && cursor_start <= block_end))) + && cursor_start <= block_end)) +#else + && (cdl->cursor_elt != ddl->cursor_elt) +#endif + ) force = 1; if (f->windows_structure_changed || diff -r 11c6df210d7f -r 56c54cf7c5b6 src/redisplay-tty.c --- a/src/redisplay-tty.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/redisplay-tty.c Mon Aug 13 08:56:04 2007 +0200 @@ -424,18 +424,16 @@ int y2 = WINDOW_TEXT_BOTTOM (w); unsigned char divv = '|'; - tty_turn_on_face (w, DEFAULT_INDEX); + tty_turn_on_face (w, MODELINE_INDEX); for (line = y1; line < y2; line++) { cmgoto (f, line, WINDOW_TEXT_LEFT (w) - 1); send_string_to_tty_console (c, &divv, 1); TTY_INC_CURSOR_X (c, 1); } - tty_turn_off_face (w, DEFAULT_INDEX); /* Draw the divider in the modeline. */ cmgoto (f, y2, WINDOW_TEXT_LEFT (w) - 1); - tty_turn_on_face (w, MODELINE_INDEX); send_string_to_tty_console (c, &divv, 1); TTY_INC_CURSOR_X (c, 1); tty_turn_off_face (w, MODELINE_INDEX); @@ -917,6 +915,7 @@ if (!CONSOLE_TTY_P (c)) return; + OUTPUT1_IF (c, TTY_SD (c).orig_pair); OUTPUT1_IF (c, TTY_SD (c).keypad_off); OUTPUT1_IF (c, TTY_SD (c).cursor_normal); OUTPUT1_IF (c, TTY_SD (c).end_motion); @@ -1202,6 +1201,7 @@ TTY_SD (c).turn_on_bold = tgetstr ("md", &bufptr); TTY_SD (c).turn_on_dim = tgetstr ("mh", &bufptr); TTY_SD (c).turn_off_attributes = tgetstr ("me", &bufptr); + TTY_SD (c).orig_pair = tgetstr ("op", &bufptr); TTY_SD (c).visual_bell = tgetstr ("vb", &bufptr); TTY_SD (c).audio_bell = tgetstr ("bl", &bufptr); diff -r 11c6df210d7f -r 56c54cf7c5b6 src/redisplay.c --- a/src/redisplay.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/redisplay.c Mon Aug 13 08:56:04 2007 +0200 @@ -277,8 +277,8 @@ struct display_line *dl); static void regenerate_window (struct window *w, Bufpos start_pos, Bufpos point, int type); -static void regenerate_window_point_center (struct window *w, Bufpos point, - int type); +static Bufpos regenerate_window_point_center (struct window *w, Bufpos point, + int type); int window_half_pixpos (struct window *w); int line_at_center (struct window *w, int type, Bufpos start, Bufpos point); Bufpos point_at_center (struct window *w, int type, Bufpos start, @@ -4784,9 +4784,10 @@ } /* Given a window and a point, update the given display lines such - that point is displayed in the middle of the window. */ - -static void + that point is displayed in the middle of the window. + Return the window's new start position. */ + +static Bufpos regenerate_window_point_center (struct window *w, Bufpos point, int type) { Bufpos startp; @@ -4799,7 +4800,7 @@ regenerate_window (w, startp, point, type); Fset_marker (w->start[type], make_int (startp), w->buffer); - return; + return startp; } /* Given a window and a set of display lines, return a boolean @@ -5006,7 +5007,7 @@ if (!MINI_WINDOW_P (w) && !EQ (Fmarker_buffer (w->start[CURRENT_DISP]), w->buffer)) { - regenerate_window_point_center (w, pointm, DESIRED_DISP); + startp = regenerate_window_point_center (w, pointm, DESIRED_DISP); goto regeneration_done; } @@ -5140,7 +5141,7 @@ startp < marker_position (w->last_start[CURRENT_DISP])) || (startp == BUF_ZV (b))) { - regenerate_window_point_center (w, pointm, DESIRED_DISP); + startp = regenerate_window_point_center (w, pointm, DESIRED_DISP); goto regeneration_done; } @@ -5178,11 +5179,9 @@ back onto the screen. */ if (scroll_step) { - Bufpos bufpos; - - bufpos = vmotion (w, startp, + startp = vmotion (w, startp, (pointm < startp) ? -scroll_step : scroll_step, 0); - regenerate_window (w, bufpos, pointm, DESIRED_DISP); + regenerate_window (w, startp, pointm, DESIRED_DISP); if (point_visible (w, pointm, DESIRED_DISP)) goto regeneration_done; @@ -5190,7 +5189,7 @@ /* We still haven't managed to get the screen drawn with point on the screen, so just center it and be done with it. */ - regenerate_window_point_center (w, pointm, DESIRED_DISP); + startp = regenerate_window_point_center (w, pointm, DESIRED_DISP); regeneration_done: @@ -7519,7 +7518,7 @@ else *closest = Dynarr_atp (db->runes, - Dynarr_length (db->runes) - 1)->bufpos; + Dynarr_length (db->runes) - 2)->bufpos; } if (dl->modeline) diff -r 11c6df210d7f -r 56c54cf7c5b6 src/s/decosf4.0-static.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/s/decosf4.0-static.h Mon Aug 13 08:56:04 2007 +0200 @@ -0,0 +1,13 @@ +/* Synched up with: Not in FSF. */ + +#include "decosf4-0.h" + +#ifdef NOT_C_CODE +/* This is to get rid of the definition that selects dynamic linking. */ +#undef LD_SWITCH_CALL_SHARED +#ifdef USE_GCC +#define LD_SWITCH_CALL_SHARED -static -Xlinker -non_shared +#else +#define LD_SWITCH_CALL_SHARED -non_shared +#endif /* USE_GCC */ +#endif /* NOT_C_CODE */ diff -r 11c6df210d7f -r 56c54cf7c5b6 src/search.c --- a/src/search.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/search.c Mon Aug 13 08:56:04 2007 +0200 @@ -41,7 +41,7 @@ #include "regex.h" -#define REGEXP_CACHE_SIZE 5 +#define REGEXP_CACHE_SIZE 20 /* If the regexp is non-nil, then the buffer contains the compiled form of that regexp, suitable for searching. */ diff -r 11c6df210d7f -r 56c54cf7c5b6 src/specifier.c --- a/src/specifier.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/specifier.c Mon Aug 13 08:56:04 2007 +0200 @@ -2344,6 +2344,8 @@ else if (DEVICEP (domain)) device = domain; else + /* #### dmoore - dammit, this should just signal an error or something + shouldn't it? */ abort (); if (NILP (buffer) && !NILP (window)) diff -r 11c6df210d7f -r 56c54cf7c5b6 src/undo.c --- a/src/undo.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/undo.c Mon Aug 13 08:56:04 2007 +0200 @@ -206,19 +206,23 @@ void record_extent (Lisp_Object extent, int attached) { - Lisp_Object buffer = Fextent_object (extent); - struct buffer *b = XBUFFER (buffer); /* !!#### */ - Lisp_Object token; - - if (!undo_prelude (b, 1)) - return; + Lisp_Object obj = Fextent_object (extent); - if (attached) - token = extent; + if (BUFFERP (obj)) + { + Lisp_Object token; + struct buffer *b = XBUFFER (obj); + if (!undo_prelude (b, 1)) + return; + if (attached) + token = extent; + else + token = list3 (extent, Fextent_start_position (extent), + Fextent_end_position (extent)); + b->undo_list = Fcons (token, b->undo_list); + } else - token = list3 (extent, Fextent_start_position (extent), - Fextent_end_position (extent)); - b->undo_list = Fcons (token, b->undo_list); + return; } #if 0 /* FSFmacs */ diff -r 11c6df210d7f -r 56c54cf7c5b6 src/xmu.c --- a/src/xmu.c Mon Aug 13 08:55:32 2007 +0200 +++ b/src/xmu.c Mon Aug 13 08:56:04 2007 +0200 @@ -167,7 +167,7 @@ /* shared data for the image read/parse logic */ static short hexTable[256]; /* conversion value */ -static Bool initialized = False; /* easier to fill in at run time */ +static int hex_initialized; /* easier to fill in at run time */ /* @@ -201,7 +201,7 @@ hexTable['}'] = -1; hexTable['\n'] = -1; hexTable['\t'] = -1; - initialized = True; + hex_initialized = 1; } /* @@ -268,7 +268,7 @@ #endif /* first time initialization */ - if (initialized == False) initHexTable(); + if (!hex_initialized) initHexTable(); /* error cleanup and return macro */ #define RETURN(code) { if (data) free (data); return code; }