# HG changeset patch # User cvs # Date 1186996567 -7200 # Node ID 2f8bb876ab1d1e7ffff053407e5eaaeedeb2e046 # Parent 9f011ab08d488bd7f3fb5f723412fa0aaa4f04ab Import from CVS: tag r21-2-32 diff -r 9f011ab08d48 -r 2f8bb876ab1d CHANGES-beta --- a/CHANGES-beta Mon Aug 13 11:15:00 2007 +0200 +++ b/CHANGES-beta Mon Aug 13 11:16:07 2007 +0200 @@ -1,4 +1,15 @@ +to 21.2.32 "Kastor & Polydeukes" +-- Internal Postgres RDBMS support from Steve Baur +-- Improve gutter useability +-- Fix window geometry with gutters +-- Fix async updates so that they only occur when neccessary +-- Gutter documentation from Stephen Turnbull +-- redisplay-gutter-area fixes from Andy Piper +-- pdump file in MS-Windows executable from Mike Alexander +-- Miscellaneous fixes from Andy Piper + to 21.2.31 "Iris" +-- Make XEmacs work on Windows again. to 21.2.30 "Hygeia" -- Make (find-tag-other-window) always use other window, diff -r 9f011ab08d48 -r 2f8bb876ab1d ChangeLog --- a/ChangeLog Mon Aug 13 11:15:00 2007 +0200 +++ b/ChangeLog Mon Aug 13 11:16:07 2007 +0200 @@ -1,3 +1,39 @@ +2000-03-20 Martin Buchholz + + * XEmacs 21.2.32 is released. + +2000-03-15 Olivier Galibert + + * configure.in: Add dumper.o object when pdumping. + +2000-02-20 Olivier Galibert + + * Makefile.in.in: Add pdump install support + + * configure.in: Add EMACS_PROGNAME config.h variable. + +2000-03-10 SL Baur + + * configure.usage: document --with-postgresql flag. + +2000-03-06 SL Baur + + * configure.in: add autodetection of PostgreSQL runtime libraries + +2000-03-09 Yoshiki Hayashi + + * aclocal.m4 (XE_SHLIB_STUFF): Define ld_shlibs to yes + when C compiler can produce shared libraries. + +2000-03-01 Didier Verna + + * etc/NEWS: update the rect.el entry. + +2000-02-26 Martin Buchholz + + * configure.in: Unconditionally define SHELL, to allow working + with (unreleased) autoconf 2.14.1, found on Mandrake 7.0 systems. + 2000-02-23 Martin Buchholz * XEmacs 21.2.31 is released. @@ -15,7 +51,7 @@ 2000-02-19 Marcus Thiessel * PROBLEMS: Update email address. Describe more HP Motif errors. - + 2000-02-19 Jan Vroonhof * configure.in: Split Solaris version test in two parts. In the @@ -58,7 +94,7 @@ 2000-02-11 Martin Buchholz - * configure.in: + * configure.in: * src/config.h.in: Define _POSIX_C_SOURCE, _XOPEN_SOURCE, _XOPEN_SOURCE_EXTENDED, but only on tested Operating systems - Linux && SunOS >= 5.5. @@ -152,7 +188,7 @@ 2000-01-08 Martin Buchholz - * configure.in: + * configure.in: - Allow find-tag to work in the build directory. - rename src/gdbinit to src/.gdbinit, so that gdb can find it. - Less verbose messages when creating .sbinit, .gdbinit, TAGS. @@ -198,7 +234,7 @@ 1999-12-13 Martin Buchholz - * configure.in: + * configure.in: * configure.usage: - Autodetect NAS. Change Docs accordingly. @@ -254,7 +290,7 @@ 1999-11-26 Martin Buchholz - * configure.in: + * configure.in: Add configure support for Unix 98 type ssize_t. 1999-11-27 Martin Buchholz @@ -269,7 +305,7 @@ * INSTALL: Update configure option. 1999-10-12 Alexandre Oliva - + * configure.in (native_sound_lib, *-sgi-*): Check for audio.h. (LIBS): Check for libCsup. @@ -287,7 +323,7 @@ 1999-11-17 Martin Buchholz - * Makefile.in.in (install-arch-dep): + * Makefile.in.in (install-arch-dep): Fix `make install' if prefix != exec_prefix. 1999-11-15 Martin Buchholz @@ -357,7 +393,7 @@ 1999-09-19 Michael Sperber [Mr. Preprocessor] * configure.in (EMACS_CONFIGURATION): Use $configuration, not - $canonical, so that installation paths and dynamic path setup will + $canonical, so that installation paths and dynamic path setup will stay in synch. 1999-09-20 Andy Piper @@ -371,9 +407,9 @@ 1999-08-27 Jan Vroonhof - * modules/zlib/Makefile (distclean): - * modules/ldap/Makefile (distclean): - * modules/sample/Makefile (distclean): + * modules/zlib/Makefile (distclean): + * modules/ldap/Makefile (distclean): + * modules/sample/Makefile (distclean): * modules/base64/Makefile (distclean): new target * Makefile.in.in (top_distclean): Add package directories @@ -384,10 +420,10 @@ * configure.in: Warn, but otherwise ignore, obsolete arguments. 1999-08-20 Olivier Galibert - + * configure.in: Add --pdump option. * configure.usage: Ditto. - + 1999-08-04 Andy Piper * configure.in: report widget usage correctly. beef up setting. @@ -424,10 +460,10 @@ 1999-07-23 Jan Vroonhof - * etc/custom/example-themes/example-theme.el: - * etc/custom/example-themes/europe-theme.el: + * etc/custom/example-themes/example-theme.el: + * etc/custom/example-themes/europe-theme.el: * etc/custom/example-themes/ex-custom-file: Some simple examples - illustrating the custom theme support. + illustrating the custom theme support. 1999-07-17 MORIOKA Tomohiko @@ -479,7 +515,7 @@ 1999-06-25 Michael Sperber [Mr. Preprocessor] * configure.in (with_prefix): Added --with-prefix, defaults to - yes, to control whether the value of --prefix is compiled into the + yes, to control whether the value of --prefix is compiled into the binary. 1999-07-03 Andy Piper @@ -558,7 +594,7 @@ 1999-05-31 SL Baur * configure.in (CPP): Don't check for include subdirectories in - site-prefix directories. This check loses in valid configurations + site-prefix directories. This check loses in valid configurations like /usr/jp in TurboLinux. Conditionally add include directory to site switches. @@ -577,7 +613,7 @@ 1999-05-06 Hrvoje Niksic - * aclocal.m4 (ld_dynamic_link_flags): Change -Bexport to -Bdynamic + * aclocal.m4 (ld_dynamic_link_flags): Change -Bexport to -Bdynamic for Solaris. 1999-05-03 Hrvoje Niksic @@ -647,7 +683,7 @@ 1999-01-05 Gunnar Evermann - * PROBLEMS: Document crashes on SPARC with gcc 2.8.1. + * PROBLEMS: Document crashes on SPARC with gcc 2.8.1. 1999-03-01 XEmacs Build Bot @@ -668,29 +704,29 @@ 1999-02-10 Martin Buchholz - * configure.in: + * configure.in: - Fixup xfs comments and redundant option checking - * configure.in: - * INSTALL: + * configure.in: + * INSTALL: * lisp/paths.el: - improved automounter tmp directory support. - support 4 (!) empirically discovered automounter conventions 1999-02-10 Martin Buchholz - * lwlib/lwlib.h: - - redo CONST hacking to deal with X11 R4, which was + * lwlib/lwlib.h: + - redo CONST hacking to deal with X11 R4, which was broken in a previous patch. 1999-02-10 Martin Buchholz - * configure.in: + * configure.in: - irix uses -rpath 1999-02-10 Martin Buchholz - * configure.in: + * configure.in: - Check for XOpenIM before using xim=xlib - only use XmIm if $have_motif = yes @@ -725,10 +761,10 @@ * configure.in: remove -O3 prevention on cygwin - current versions cope ok now. remove dll prevention on cygwin - the new module code checks correctly. - + 1999-01-10 J. Kean Johnston - * configure.in: Added moduledir as the path where loadable modules + * configure.in: Added moduledir as the path where loadable modules are stored. Added --with-site-modules and --moduledir options. - Ensure the SCO OpenServer compiles with --dynamic by default - Check for dlfcn.h for dynamic loader @@ -1443,7 +1479,7 @@ * XEmacs 21.0-beta33 is released. -1998-03-26 Didier Verna +1998-03-26 Didier Verna * configure.in, Makefile.in: Removed infopath_user_defined---we always want to propagate it. @@ -1788,7 +1824,7 @@ * etc/FTP: Update address of what was formerly ftp.ibp.fr. -1998-01-08 Didier Verna +1998-01-08 Didier Verna * configure.in: Get rid of INFOPATH for configure time. * configure.usage (Usage): Ditto. @@ -2104,7 +2140,7 @@ ChangeLog, README, Todo, paths.h, config.h, inc/*, runemacs.c, xemacs.mak. -1997-11-05 Didier Verna +1997-11-05 Didier Verna * configure.in: Added the --site-prefixes options for the configure script. You give a colon or space separated list of prefixes, and @@ -4025,5 +4061,3 @@ Thu Dec 5 11:56:05 1996 Joseph J Nuspl * configure.in (LIBS): Fix typo in dialog box test. - - diff -r 9f011ab08d48 -r 2f8bb876ab1d INSTALL --- a/INSTALL Mon Aug 13 11:15:00 2007 +0200 +++ b/INSTALL Mon Aug 13 11:16:07 2007 +0200 @@ -2,8 +2,6 @@ Copyright (c) 1994, 1995, 1996 Board of Trustees, University of Illinois Copyright (c) 1994-1999 Free Software Foundation, Inc. -Synched up with: FSF 19.30. - Permission is granted to anyone to make or distribute verbatim copies of this document as received, in any medium, provided that the copyright notice and permission notice are preserved, @@ -18,20 +16,24 @@ of the Free Software Foundation are approved by the Foundation. -BUILDING AND INSTALLATION (Unix and Cygwin, see the file nt/README -for instructions on building under Microsoft Windows): +BUILDING AND INSTALLATION FOR UNIX AND CYGWIN + +(for Microsoft Windows, see nt/README also.) + +PREREQUISITES +============= -1) Make sure your system has enough swapping space allocated to handle - a program whose pure code is 900k bytes and whose data area is at - least 400k and can reach 8Mb or more. Note that a typical XEmacs - build is much bigger. If the swapping space is - insufficient, you will get an error in the command `temacs -batch - -l loadup dump', found in `./src/Makefile.in.in', or possibly when - running the final dumped XEmacs. +Make sure your system has enough swapping space allocated to handle a +program whose pure code is 900k bytes and whose data area is at least +400k and can reach 8Mb or more. Note that a typical XEmacs build is +much bigger. If the swapping space is insufficient, you will get an +error in the command `temacs -batch -l loadup dump', found in +`./src/Makefile.in.in', or possibly when running the final dumped +XEmacs. - Verify that your users have a high enough stack limit. On some - systems such as OpenBSD and OSF/Tru64 the default is 2MB which is - too low. See 'PROBLEMS' for details. +Verify that your users have a high enough stack limit. On some systems +such as OpenBSD and OSF/Tru64 the default is 2MB which is too low. See +'PROBLEMS' for details. Building XEmacs requires about 100 Mb of disk space (including the XEmacs sources). Once installed, XEmacs occupies between 20 and 100 Mb @@ -44,8 +46,10 @@ the documentation yourself, you will need at least version 1.68 of makeinfo (GNU texinfo-3.11). +ADD-ON LIBRARIES +================ -2) Decide on what other software packages you would like to use with +Decide on what other software packages you would like to use with XEmacs, but are not yet available on your system. On some systems, Motif and CDE are optional additions. On Solaris, the SUNWaudmo package enables native sound support. There are also a number of free @@ -72,37 +76,19 @@ these variables as needed assuming your libraries are organised as a typical /usr tree. -3) [N.B. Most of this section can be done during or after the -compilation of the core source code, but is present early to catch -your attention.] +PACKAGE SYSTEM +============== -Decide what Initial Lisp you need with XEmacs. XEmacs is -distributed separately from most of its runtime environment. This is -done to make it easier for administrators to tune an installation for -what the local users need. Note that while XEmacs will compile and -install without any packages present at least some additional lisp -packages are needed to bring XEmacs up to "normal" editor -functionality. Installation and upgrading of the packages can be done -almost automatically when from inside XEmacs when it has been compiled -and installed. - -More information and suggestions for which packages to install see the -file README.packages. - -IMPORTANT! The file README.packages contain information vital to have -a fully working XEmacs. This information was not included in this file -only because it is too large for this terse INSTALL. Please read +The file README.packages contain information vital to have a fully +working XEmacs. This information was not included in this file only +because it is too large for this terse INSTALL. Please read README.packages now! -By default, packages will be searched for in the path - -~/.xemacs::$prefix/lib/xemacs-${version}/mule-packages:$prefix/lib/xemacs/mule-packages:$prefix/lib/xemacs-${version}/xemacs-packages:$prefix/lib/xemacs/xemacs-packages +CONFIGURATION OPTIONS +===================== -This may be changed by specifying a different value with the ---package-path configuration option. - -4) In the top level directory of the XEmacs distribution, run the - program `configure' as follows: +In the top level directory of the XEmacs distribution, run the +program `configure' as follows: ./configure [CONFIGURATION-NAME] [--OPTION[=VALUE]] ... @@ -202,12 +188,17 @@ EXECDIR/lib/xemacs-VERSION/CONFIGURATION-NAME. EXECDIR/bin should be a directory that is normally in users' PATHs. -For example, the command - - ./configure mips-dec-ultrix --with-x11=yes - -configures XEmacs to build for a DECstation running Ultrix, with -support for the X11 window system. +If you specify --prefix (or any of the other installation directory +options), they will get compiled into the xemacs executable so it will +be able to find its various associated file. However, XEmacs has +quite elaborate logic to find out the locations of these directories +dynamically. Sometimes, it is desirable *not* to compile these +directories into the executable so you can move the XEmacs +installation around (as whole) at will. This is true for binary kits, +for instance. Therefore, you can specify --without-prefix on the +configure command line to prevent the installation prefix to become +part of the generated executable; everything else will continue to +work as usual. The `--with-menubars=TYPE' option allows you to specify which X toolkit you wish to use for the menubar. The valid options are @@ -379,24 +370,35 @@ `--with-xim', `--with-canna' and `--with-wnn' as your system supports. +MAIL LOCKING +============ + +Find out what the preferred method for locking mail spool files is in +your environment. Presently, XEmacs supports lockf, flock, and dot +locking. Specify the locking method via the --mail-locking=METHOD +option to configure. Valid values for METHOD are --mail-locking are +`lockf', `flock', and `dot'. + +RUNNING CONFIGURE +================= + `configure' doesn't do any compilation or installation itself. It just creates the files that influence those things: `./src/config.h', and all the Makefile's in the build tree. -The `--with-pop', `--with-hesiod', and `--with-kerberos' options are used -in conjunction with movemail. As of XEmacs 20.1, movemail is identical -to the one used in Emacs. - When it is done, `configure' prints a description of what it did and creates a shell script `config.status' which, when run, recreates the same configuration. If `configure' exits with an error after disturbing the status quo, it removes `config.status'. -5) Look at `./lisp/paths.el'; if some of those values are not right -for your system, set up the file `./lisp/site-init.el' with XEmacs -Lisp code to override them; it is not a good idea to edit paths.el -itself. YOU MUST USE THE LISP FUNCTION `setq' TO ASSIGN VALUES, -rather than `defvar', as used by `./lisp/paths.el'. For example, +AUXILIARY PATHS +=============== + +Look at `./lisp/paths.el'; if some of those values are not right for +your system, set up the file `./lisp/site-init.el' with XEmacs Lisp +code to override them; it is not a good idea to edit paths.el itself. +YOU MUST USE THE LISP FUNCTION `setq' TO ASSIGN VALUES, rather than +`defvar', as used by `./lisp/paths.el'. For example, (setq news-inews-program "/usr/bin/inews") @@ -415,17 +417,16 @@ XEmacs cannot detect, you may need to change the value of `directory-abbrev-alist'. -6) Put into `./lisp/site-init.el' or `./lisp/site-load.el' any Emacs -Lisp code you want XEmacs to load before it is dumped out. Use +SITE-SPECIFIC STARTUP CODE +========================== + +Put into `./lisp/site-init.el' or `./lisp/site-load.el' any Emacs Lisp +code you want XEmacs to load before it is dumped out. Use site-load.el for additional libraries if you arrange for their documentation strings to be in the lib-src/DOC file (see src/Makefile.in.in if you wish to figure out how to do that). For all else, use site-init.el. -If you set load-path to a different value in site-init.el or -site-load.el, XEmacs will use *precisely* that value when it starts up -again. If you do this, you are on your own! - Note that, on some systems, the code you place in site-init.el must not use expand-file-name or any other function which may look something up in the system's password and user information database. @@ -434,12 +435,18 @@ The `site-*.el' files are nonexistent in the distribution. You do not need to create them if you have nothing to put in them. -7) Refer to the file `./etc/TERMS' for information on fields you may +TERMCAP CONFIGURATION +===================== + +Refer to the file `./etc/TERMS' for information on fields you may wish to add to various termcap entries. The files `./etc/termcap.ucb' and `./etc/termcap.dat' may already contain appropriately-modified entries. -8) Run `make' in the top directory of the XEmacs distribution to finish +RUNNING MAKE +============ + +Run `make' in the top directory of the XEmacs distribution to finish building XEmacs in the standard way. The final executable file is named `src/emacs'. You can execute this file "in place" without copying it, if you wish; then it automatically uses the sibling @@ -511,27 +518,7 @@ If these directories are not what you want, you can specify where to install XEmacs's libraries and data files or where XEmacs should search for its lisp files by giving values for `make' variables as part of -the command. See the section below called `MAKE VARIABLES' for more -information on this. - -Using GNU Make allows for simultaneous builds with and without the ---srcdir option. - -9) If your system uses lock files to interlock access to mailer inbox -files, then you might need to make the movemail program setuid or -setgid to enable it to write the lock files. We believe this is safe. -The setuid/setgid bits need not be set on any other XEmacs-related -executables. - -10) You are done with the hard part! You can remove executables and -object files from the build directory by typing `make clean'. To also -remove the files that `configure' created (so you can compile XEmacs -for a different configuration), type `make distclean'. - -11) You should now go to the XEmacs web page at http://www.xemacs.org/ -and decide what additional Lisp support you wish to have. - -MAKE VARIABLES +the command. You can change where the build process installs XEmacs and its data files by specifying values for `make' variables as part of the `make' @@ -643,7 +630,7 @@ (where VERSION and CONFIGURATION-NAME are as described above). `docdir' indicates where to put Lisp documentation strings that XEmacs - refers to as it runs. It defaults the value of `archlibdir' + refers to as it runs. It defaults to the value of `archlibdir' (see above). `moduledir' indicates where XEmacs installs and expects to find @@ -667,126 +654,33 @@ Makefiles for the subdirectories, so you don't have to specify them when running make in the subdirectories. - -CONFIGURATION BY HAND - -Instead of running the `configure' program, you have to perform the -following steps. - -1) Copy `./src/config.h.in' to `./src/config.h'. +Using GNU Make allows for simultaneous builds with and without the +--srcdir option. -2) Consult `./etc/MACHINES' to see what configuration name you should -use for your system. Look at the code of the `configure' script to -see which operating system and architecture description files from -`src/s' and `src/m' should be used for that configuration name. Edit -`src/config.h', and change the two `#include' directives to include -the appropriate system and architecture description files. - -3) Edit `./src/config.h' to set the right options for your system. If -you need to override any of the definitions in the s/*.h and m/*.h -files for your system and machine, do so by editing config.h, not by -changing the s/*.h and m/*.h files. Occasionally you may need to -redefine parameters used in `./lib-src/movemail.c'. +MAIL-LOCKING POST-INSTALLATION +============================== -4) If you're going to use the make utility to build XEmacs, you will -still need to run `configure' first, giving the appropriate values for -the variables in the sections entitled "Things `configure' Might Edit" -and "Where To Install Things." Note that you may only need to change -the variables `prefix' and `exec_prefix', since the rest of the -variables have reasonable defaults based on them. For each Makefile -variable of this type, there is a corresponding configure option; for -example, to change the location of the lock directory, you might use - - ./configure --lockdir=/nfs/xemacslock - -The `configure' script is built from `configure.in' by the `autoconf' -program. However, since XEmacs has configuration requirements that -autoconf can't meet, `configure.in' uses a marriage of custom-baked -configuration code and autoconf macros. New versions of autoconf -could very well break this arrangement, so it may be wise to avoid -rebuilding `configure' from `configure.in' when possible. - - -BUILDING XEMACS BY HAND - -Once XEmacs is configured, running `make' in the top directory performs -the following steps. - -1) Run `make src/paths.h' in the top directory. This produces -`./src/paths.h' from the template file `./src/paths.h.in', changing -the paths to the values specified in `./Makefile'. - -2) Cd to `./lib-src' and run `make'. This creates executables named -`ctags' and `etags' and `wakeup' and `make-docfile' and `digest-doc' -and `test-distrib'. And others. - -3) Cd to `./src' and Run `make'. This refers to files in the `./lisp' -and `./lib-src' subdirectories using names `../lisp' and -`../lib-src'. +If your system uses dot-locking to interlock access to mailer inbox +files, then you might need to make the movemail program setuid or +setgid to enable it to write the lock files. We believe this is safe. +The setuid/setgid bits need not be set on any other XEmacs-related +executables. -This creates a file `./src/xemacs' which is the runnable XEmacs, -assigning it a new build version number by incrementing the build -version stored in `./lisp/version.el'. - -It also creates a file in `./lib-src' whose name is `DOC' followed by -the current XEmacs version. This file contains documentation strings -for all the functions in XEmacs. Each time you run make to make a new -xemacs, a new DOC file with a new name is made. You must keep the DOC -file for an XEmacs version as long as you keep using that XEmacs -version. - - -INSTALLATION BY HAND - -The steps below are done by running `make install' in the main -directory of the XEmacs distribution. - -1) Copy `./lisp' and its subdirectories, `./etc', and the executables -in `./lib-src' to their final destinations, as selected in `./src/paths.h'. +CLEANING UP +========== -Strictly speaking, not all of the executables in `./lib-src' need be copied. -- The programs `cvtmail', `emacsserver', `env', `fakemail', `hexl', - `movemail', `timer', `vcdiff', `wakeup', and `yow' are used by - XEmacs; they do need to be copied. -- The programs `etags', `ctags', `emacsclient', `b2m', `rcs2log', - `gnuclient', `gnudoit', and `gnuattach' are intended to be run - by users; they are handled below. -- The programs `make-docfile' and `test-distrib' were - used in building XEmacs, and are not needed any more. -- The programs `digest-doc' and `sorted-doc' convert a `DOC' file into - a file for users to read. There is no important reason to move them. - -2) Copy the files in `./info' to the place specified in -`./lisp/site-init.el' or `./lisp/paths.el'. Note that if the -destination directory already contains a file named `dir', you -probably don't want to replace it with the `dir' file in the XEmacs -distribution. Instead, you should make sure that the existing `dir' -file contains an appropriate menu entry for the XEmacs info. +You are done with the hard part! You can remove executables and +object files from the build directory by typing `make clean'. To also +remove the files that `configure' created (so you can compile XEmacs +for a different configuration), type `make distclean'. -3) Create a directory for XEmacs to use for clash detection, named as -indicated by the PATH_LOCK macro in `./src/paths.h'. - -4) Copy `./src/xemacs' to `/usr/local/bin', or to some other directory -in users' search paths. `./src/xemacs' has an alternate name -`./src/emacs-EMACSVERSION'; you may wish to make a symbolic link named -`/usr/local/bin/xemacs' pointing to that alternate name, as an easy way -of installing different versions. - -You can delete `./src/temacs'. +READ README.packages +==================== -5) Copy the programs `b2m', `emacsclient', `ctags', `etags', `rcs2log', -`gnuclient', `gnudoit', and `gnuattach' from `./lib-src' to -`/usr/local/bin'. These programs are intended for users to run. - -6) Copy the man pages in `./etc' for xemacs, ctags, etags, and gnuserv -into the appropriate man directories. - -7) The files in the `./src' subdirectory, except for `xemacs', are not -used by XEmacs once it is built. The source would be handy for -debugging. - +Do it! PROBLEMS +======== The most likely problem is that you forgot to read and follow the directions in README.packages. You can not have a working XEmacs @@ -794,7 +688,3 @@ See the file PROBLEMS in this directory for a list of various problems sometimes encountered, and what to do about them. - - -If all else fails, please see etc/InstallGuide courtesy -of Jonathan Seth Hayward. diff -r 9f011ab08d48 -r 2f8bb876ab1d Makefile.in.in --- a/Makefile.in.in Mon Aug 13 11:15:00 2007 +0200 +++ b/Makefile.in.in Mon Aug 13 11:16:07 2007 +0200 @@ -295,11 +295,29 @@ dump-elc dump-elcs: ${GENERATED_HEADERS} FRC.dump-elcs cd ./src && $(RECURSIVE_MAKE) dump-elcs -autoloads: src - MAKE='$(MAKE)' EMACS='./src/$(PROGNAME)' $(SHELL) ${srcdir}/lib-src/update-autoloads.sh +autoloads: lisp/auto-autoloads.el lisp/custom-load.el -custom-loads: - MAKE='$(MAKE)' EMACS='./src/$(PROGNAME)' $(SHELL) ${srcdir}/lib-src/update-custom.sh +FRC.lisp.auto.autoloads.el: +lisp/auto-autoloads.el: FRC.lisp.auto.autoloads.el + rm -f lisp/auto-autoloads.el + ${blddir}/src/${PROGNAME} -batch -vanilla \ + -l autoload -f batch-update-directory lisp + ${blddir}/src/${PROGNAME} -batch -vanilla \ + -f batch-byte-compile lisp/auto-autoloads.el + @rm -f lisp/auto-autoloads.el~ +#ifdef MULE + rm -f lisp/mule/auto-autoloads.el + ${blddir}/src/${PROGNAME} -batch -vanilla \ + -l autoload -f batch-update-directory lisp/mule + ${blddir}/src/${PROGNAME} -batch -vanilla \ + -f batch-byte-compile lisp/mule/auto-autoloads.el + @rm -f lisp/mule/auto-autoloads.el~ +#endif + +FRC.lisp.custom.load.el: +lisp/custom-load.el: FRC.lisp.custom.load.el + ${blddir}/src/${PROGNAME} -batch -vanilla -l cus-dep \ + -f Custom-make-dependencies lisp finder: src @echo "Building finder database ..." @@ -418,6 +436,9 @@ for subdir in `find ${archlibdir} -type d ! -name RCS ! -name SCCS ! -name CVS -print` ; \ do (cd $${subdir} && $(RM) -r RCS CVS SCCS \#* *~) ; done ; \ else true; fi +#ifdef PDUMP + ${INSTALL_DATA} src/${PROGNAME}.dmp ${bindir}/${PROGNAME}-${version}-`src/${PROGNAME} -sd`.dmp +#endif #ifdef WINDOWSNT ${INSTALL_PROGRAM} src/${PROGNAME} ${bindir}/${PROGNAME} -chmod 0755 ${bindir}/${PROGNAME} diff -r 9f011ab08d48 -r 2f8bb876ab1d PROBLEMS --- a/PROBLEMS Mon Aug 13 11:15:00 2007 +0200 +++ b/PROBLEMS Mon Aug 13 11:16:07 2007 +0200 @@ -144,9 +144,15 @@ ** AIX *** On AIX 4.3, you must specify --with-dialogs=athena with configure -*** The libXt shipped with AIX 4.3 is broken. This causes xemacs -nw - to fail in various ways. The solution is to build against stock - X11R6. +*** The libXt shipped with AIX 4.3 up to 4.3.2 is broken. This causes + xemacs -nw to fail in various ways. The official APAR is this: + +APAR NUMBER: RESOLVED AS: PROGRAM ERROR + +ABSTRACT: +: LIBXT.A INCORRECT HANDLING OF EXCEPTIONS IN XTAPPADDINPUT + + The solution is to install X11.base.lib at version >=4.3.2.5. *** On AIX, you get this compiler error message: diff -r 9f011ab08d48 -r 2f8bb876ab1d aclocal.m4 --- a/aclocal.m4 Mon Aug 13 11:15:00 2007 +0200 +++ b/aclocal.m4 Mon Aug 13 11:16:07 2007 +0200 @@ -386,6 +386,7 @@ dll_ld=$CC dll_ldflags=$xcldf can_build_shared=yes + ld_shlibs=yes else # OK - only NOW do we futz about with ld. # See if the linker supports building shared libraries. diff -r 9f011ab08d48 -r 2f8bb876ab1d configure --- a/configure Mon Aug 13 11:15:00 2007 +0200 +++ b/configure Mon Aug 13 11:16:07 2007 +0200 @@ -92,6 +92,7 @@ subdirs= MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} ac_max_here_lines=12 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 @@ -350,6 +351,7 @@ with_sparcworks | \ with_tooltalk | \ with_ldap | \ + with_postgresql | \ with_pop | \ with_kerberos | \ with_hesiod | \ @@ -832,7 +834,7 @@ fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:836: checking whether ln -s works" >&5 +echo "configure:838: checking whether ln -s works" >&5 rm -f conftestdata if ln -s X conftestdata 2>/dev/null @@ -995,6 +997,15 @@ PROGNAME=xemacs fi +{ test "$extra_verbose" = "yes" && cat << EOF + Defining EMACS_PROGNAME = "$PROGNAME" +EOF +cat >> confdefs.h <&6 -echo "configure:1084: checking "host system type"" >&5 +echo "configure:1095: checking "host system type"" >&5 internal_configuration=`echo $configuration | sed 's/-\(workshop\)//'` canonical=`${CONFIG_SHELL-/bin/sh} $srcdir/config.sub "$internal_configuration"` configuration=`echo "$configuration" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'` @@ -1575,7 +1586,7 @@ # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1579: checking for $ac_word" >&5 +echo "configure:1590: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1602,7 +1613,7 @@ # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1606: checking for $ac_word" >&5 +echo "configure:1617: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1650,7 +1661,7 @@ # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1654: checking for $ac_word" >&5 +echo "configure:1665: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1679,7 +1690,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1683: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1694: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS' @@ -1692,12 +1703,12 @@ cat > conftest.$ac_ext << EOF -#line 1696 "configure" +#line 1707 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1725,19 +1736,19 @@ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1729: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1740: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1734: checking whether we are using GNU C" >&5 +echo "configure:1745: checking whether we are using GNU C" >&5 cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1752: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1755,7 +1766,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1759: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1770: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -1788,7 +1799,7 @@ # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1792: checking for $ac_word" >&5 +echo "configure:1803: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1815,7 +1826,7 @@ # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1819: checking for $ac_word" >&5 +echo "configure:1830: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1863,7 +1874,7 @@ # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1867: checking for $ac_word" >&5 +echo "configure:1878: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1892,7 +1903,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1896: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1907: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS' @@ -1905,12 +1916,12 @@ cat > conftest.$ac_ext << EOF -#line 1909 "configure" +#line 1920 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1938,19 +1949,19 @@ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1942: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1953: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1947: checking whether we are using GNU C" >&5 +echo "configure:1958: checking whether we are using GNU C" >&5 cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1965: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1968,7 +1979,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1972: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1983: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -2001,7 +2012,7 @@ # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2005: checking for $ac_word" >&5 +echo "configure:2016: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2028,7 +2039,7 @@ # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2032: checking for $ac_word" >&5 +echo "configure:2043: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2076,7 +2087,7 @@ # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2080: checking for $ac_word" >&5 +echo "configure:2091: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2105,7 +2116,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2109: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2120: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS' @@ -2118,12 +2129,12 @@ cat > conftest.$ac_ext << EOF -#line 2122 "configure" +#line 2133 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -2151,19 +2162,19 @@ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:2155: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2166: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:2160: checking whether we are using GNU C" >&5 +echo "configure:2171: checking whether we are using GNU C" >&5 cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2178: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -2181,7 +2192,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:2185: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:2196: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -2218,7 +2229,7 @@ test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP" echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2222: checking how to run the C preprocessor" >&5 +echo "configure:2233: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2231,13 +2242,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2252: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2248,13 +2259,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2258: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2269: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2265,13 +2276,13 @@ rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2275: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2286: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2298,9 +2309,9 @@ echo $ac_n "checking for AIX""... $ac_c" 1>&6 -echo "configure:2302: checking for AIX" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext <&6 -echo "configure:2330: checking for GNU libc" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext < int main() { @@ -2340,7 +2351,7 @@ ; return 0; } EOF -if { (eval echo configure:2344: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2355: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* have_glibc=yes else @@ -2417,7 +2428,7 @@ esac cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:2444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then : else @@ -2653,7 +2664,7 @@ if test "$GCC" = "yes"; then echo $ac_n "checking for buggy gcc versions""... $ac_c" 1>&6 -echo "configure:2657: checking for buggy gcc versions" >&5 +echo "configure:2668: checking for buggy gcc versions" >&5 GCC_VERSION=`$CC --version` case `uname -s`:`uname -m`:$GCC_VERSION in *:sun4*:2.8.1|*:sun4*:egcs-2.90.*) @@ -2768,12 +2779,15 @@ test -n "$objects_system" && extra_objs="$extra_objs $objects_system" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"$objects_system\"" fi -test -n "$unexec" && extra_objs="$extra_objs $unexec" && if test "$extra_verbose" = "yes"; then +test -n "$unexec" && test ! "$pdump" = "yes" && extra_objs="$extra_objs $unexec" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"$unexec\"" fi +test "$pdump" = "yes" && extra_objs="$extra_objs dumper.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"dumper.o\"" + fi echo $ac_n "checking for dynodump""... $ac_c" 1>&6 -echo "configure:2777: checking for dynodump" >&5 +echo "configure:2791: checking for dynodump" >&5 if test "$unexec" != "unexsol2.o"; then echo "$ac_t""no" 1>&6 else @@ -2811,12 +2825,12 @@ done echo $ac_n "checking for terminateAndUnload in -lC""... $ac_c" 1>&6 -echo "configure:2815: checking for terminateAndUnload in -lC" >&5 +echo "configure:2829: checking for terminateAndUnload in -lC" >&5 ac_lib_var=`echo C'_'terminateAndUnload | sed 'y%./+-%__p_%'` xe_check_libs=" -lC " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2935,7 +2949,7 @@ if test "$add_runtime_path" = "yes"; then echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6 -echo "configure:2939: checking "for runtime libraries flag"" >&5 +echo "configure:2953: checking "for runtime libraries flag"" >&5 case "$opsys" in sol2 ) dash_r="-R" ;; decosf* | linux* | irix*) dash_r="-rpath " ;; @@ -2957,14 +2971,14 @@ done fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +#line 2975 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:2982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* dash_r="$try_dash_r" else @@ -3066,10 +3080,10 @@ fi after_morecore_hook_exists=yes echo $ac_n "checking for malloc_get_state""... $ac_c" 1>&6 -echo "configure:3070: checking for malloc_get_state" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_malloc_get_state=yes" else @@ -3112,10 +3126,10 @@ fi echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6 -echo "configure:3116: checking for malloc_set_state" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_malloc_set_state=yes" else @@ -3158,16 +3172,16 @@ fi echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6 -echo "configure:3162: checking whether __after_morecore_hook exists" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -3226,7 +3240,7 @@ # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3230: checking for $ac_word" >&5 +echo "configure:3244: checking for $ac_word" >&5 if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. @@ -3281,7 +3295,7 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:3285: checking for a BSD compatible install" >&5 +echo "configure:3299: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" @@ -3335,7 +3349,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3339: checking for $ac_word" >&5 +echo "configure:3353: checking for $ac_word" >&5 if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. @@ -3367,15 +3381,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3371: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3379: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3393: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3405,10 +3419,10 @@ done echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:3409: checking for sys/wait.h that is POSIX.1 compatible" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #include @@ -3424,7 +3438,7 @@ s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:3428: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -3448,10 +3462,10 @@ fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3452: checking for ANSI C header files" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #include @@ -3459,7 +3473,7 @@ #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3463: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3477: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3476,7 +3490,7 @@ if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3494,7 +3508,7 @@ if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3512,7 +3526,7 @@ if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3523,7 +3537,7 @@ exit (0); } EOF -if { (eval echo configure:3527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:3541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then : else @@ -3549,10 +3563,10 @@ fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:3553: checking whether time.h and sys/time.h may both be included" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #include @@ -3561,7 +3575,7 @@ struct tm *tp; ; return 0; } EOF -if { (eval echo configure:3565: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -3585,10 +3599,10 @@ fi echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6 -echo "configure:3589: checking for sys_siglist declaration in signal.h or unistd.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #include @@ -3600,7 +3614,7 @@ char *msg = *(sys_siglist + 1); ; return 0; } EOF -if { (eval echo configure:3604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3618: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_decl_sys_siglist=yes else @@ -3625,9 +3639,9 @@ echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6 -echo "configure:3629: checking for struct utimbuf" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext < @@ -3646,7 +3660,7 @@ static struct utimbuf x; x.actime = x.modtime; ; return 0; } EOF -if { (eval echo configure:3650: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3664: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 { test "$extra_verbose" = "yes" && cat << \EOF @@ -3666,10 +3680,10 @@ rm -f conftest* echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:3670: checking return type of signal handlers" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #include @@ -3686,7 +3700,7 @@ int i; ; return 0; } EOF -if { (eval echo configure:3690: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3704: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -3708,10 +3722,10 @@ echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3712: checking for size_t" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3742,10 +3756,10 @@ fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:3746: checking for pid_t" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3776,10 +3790,10 @@ fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:3780: checking for uid_t in sys/types.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF @@ -3815,10 +3829,10 @@ fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:3819: checking for mode_t" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3849,10 +3863,10 @@ fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:3853: checking for off_t" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3883,10 +3897,10 @@ fi echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 -echo "configure:3887: checking for ssize_t" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3918,9 +3932,9 @@ echo $ac_n "checking for struct timeval""... $ac_c" 1>&6 -echo "configure:3922: checking for struct timeval" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext < @@ -3936,7 +3950,7 @@ static struct timeval x; x.tv_sec = x.tv_usec; ; return 0; } EOF -if { (eval echo configure:3940: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3954: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 HAVE_TIMEVAL=yes @@ -3958,10 +3972,10 @@ rm -f conftest* echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:3962: checking whether struct tm is in sys/time.h or time.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #include @@ -3969,7 +3983,7 @@ struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:3973: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3987: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -3993,10 +4007,10 @@ fi echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 -echo "configure:3997: checking for tm_zone in struct tm" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #include <$ac_cv_struct_tm> @@ -4004,7 +4018,7 @@ struct tm tm; tm.tm_zone; ; return 0; } EOF -if { (eval echo configure:4008: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4022: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_zone=yes else @@ -4027,10 +4041,10 @@ else echo $ac_n "checking for tzname""... $ac_c" 1>&6 -echo "configure:4031: checking for tzname" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #ifndef tzname /* For SGI. */ @@ -4040,7 +4054,7 @@ atoi(*tzname); ; return 0; } EOF -if { (eval echo configure:4044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_var_tzname=yes else @@ -4066,10 +4080,10 @@ echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:4070: checking for working const" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4136: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -4143,7 +4157,7 @@ echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:4147: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:4161: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` cat > conftestmake <<\EOF @@ -4168,12 +4182,12 @@ echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:4172: checking whether byte ordering is bigendian" >&5 +echo "configure:4186: checking whether byte ordering is bigendian" >&5 ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -4184,11 +4198,11 @@ #endif ; return 0; } EOF -if { (eval echo configure:4188: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4202: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -4199,7 +4213,7 @@ #endif ; return 0; } EOF -if { (eval echo configure:4203: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4217: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -4216,7 +4230,7 @@ rm -f conftest* if test $ac_cv_c_bigendian = unknown; then cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_c_bigendian=no else @@ -4256,10 +4270,10 @@ echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:4260: checking size of short" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < main() @@ -4270,7 +4284,7 @@ exit(0); } EOF -if { (eval echo configure:4274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_short=`cat conftestval` else @@ -4298,10 +4312,10 @@ exit 1 fi echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:4302: checking size of int" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < main() @@ -4312,7 +4326,7 @@ exit(0); } EOF -if { (eval echo configure:4316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_int=`cat conftestval` else @@ -4334,10 +4348,10 @@ echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:4338: checking size of long" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < main() @@ -4348,7 +4362,7 @@ exit(0); } EOF -if { (eval echo configure:4352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_long=`cat conftestval` else @@ -4370,10 +4384,10 @@ echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:4374: checking size of long long" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < main() @@ -4384,7 +4398,7 @@ exit(0); } EOF -if { (eval echo configure:4388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_long_long=`cat conftestval` else @@ -4406,10 +4420,10 @@ echo $ac_n "checking size of void *""... $ac_c" 1>&6 -echo "configure:4410: checking size of void *" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < main() @@ -4420,7 +4434,7 @@ exit(0); } EOF -if { (eval echo configure:4424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_void_p=`cat conftestval` else @@ -4443,7 +4457,7 @@ echo $ac_n "checking for long file names""... $ac_c" 1>&6 -echo "configure:4447: checking for long file names" >&5 +echo "configure:4461: checking for long file names" >&5 ac_cv_sys_long_file_names=yes # Test for long file names in all the places we know might matter: @@ -4489,10 +4503,10 @@ echo $ac_n "checking for sin""... $ac_c" 1>&6 -echo "configure:4493: checking for sin" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_sin=yes" else @@ -4533,12 +4547,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6 -echo "configure:4537: checking for sin in -lm" >&5 +echo "configure:4551: checking for sin in -lm" >&5 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'` xe_check_libs=" -lm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4593,14 +4607,14 @@ cat > conftest.$ac_ext < int main() { return atanh(1.0) + asinh(1.0) + acosh(1.0); ; return 0; } EOF -if { (eval echo configure:4604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_INVERSE_HYPERBOLIC @@ -4617,14 +4631,14 @@ rm -f conftest* echo "checking type of mail spool file locking" 1>&6 -echo "configure:4621: checking type of mail spool file locking" >&5 +echo "configure:4635: checking type of mail spool file locking" >&5 for ac_func in lockf flock do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4625: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4720,12 +4734,12 @@ case "$opsys" in decosf*) echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6 -echo "configure:4724: checking for cma_open in -lpthreads" >&5 +echo "configure:4738: checking for cma_open in -lpthreads" >&5 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lpthreads " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4772,7 +4786,7 @@ esac echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6 -echo "configure:4776: checking whether the -xildoff compiler flag is required" >&5 +echo "configure:4790: checking whether the -xildoff compiler flag is required" >&5 if ${CC-cc} '-###' -xildon no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then echo "$ac_t""no" 1>&6; @@ -4784,7 +4798,7 @@ if test "$opsys" = "sol2"; then if test "$os_release" -ge 56; then echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6 -echo "configure:4788: checking for \"-z ignore\" linker flag" >&5 +echo "configure:4802: checking for \"-z ignore\" linker flag" >&5 case "`ld -h 2>&1`" in *-z\ ignore\|record* ) echo "$ac_t""yes" 1>&6 ld_switch_site="-z ignore $ld_switch_site" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-z ignore\" to \$ld_switch_site"; fi ;; @@ -4795,7 +4809,7 @@ echo "checking "for specified window system"" 1>&6 -echo "configure:4799: checking "for specified window system"" >&5 +echo "configure:4813: checking "for specified window system"" >&5 if test "$with_x11" != "no"; then test "$x_includes $x_libraries" != "NONE NONE" && \ @@ -4828,7 +4842,7 @@ # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:4832: checking for X" >&5 +echo "configure:4846: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -4888,12 +4902,12 @@ # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4897: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4911: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4962,14 +4976,14 @@ ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -5078,17 +5092,17 @@ case "`(uname -sr) 2>/dev/null`" in "SunOS 5"*) echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 -echo "configure:5082: checking whether -R must be followed by a space" >&5 +echo "configure:5096: checking whether -R must be followed by a space" >&5 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +#line 5099 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:5106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_nospace=yes else @@ -5104,14 +5118,14 @@ else LIBS="$ac_xsave_LIBS -R $x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +#line 5122 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:5129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_space=yes else @@ -5147,12 +5161,12 @@ else echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:5151: checking for dnet_ntoa in -ldnet" >&5 +echo "configure:5165: checking for dnet_ntoa in -ldnet" >&5 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` xe_check_libs=" -ldnet " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5187,12 +5201,12 @@ if test $ac_cv_lib_dnet_dnet_ntoa = no; then echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 -echo "configure:5191: checking for dnet_ntoa in -ldnet_stub" >&5 +echo "configure:5205: checking for dnet_ntoa in -ldnet_stub" >&5 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` xe_check_libs=" -ldnet_stub " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5232,10 +5246,10 @@ # The nsl library prevents programs from opening the X display # on Irix 5.2, according to dickey@clark.net. echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:5236: checking for gethostbyname" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -5279,12 +5293,12 @@ if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:5283: checking for gethostbyname in -lnsl" >&5 +echo "configure:5297: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` xe_check_libs=" -lnsl " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5325,10 +5339,10 @@ # -lsocket must be given before -lnsl if both are needed. # We assume that if connect needs -lnsl, so does gethostbyname. echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:5329: checking for connect" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -5374,12 +5388,12 @@ xe_msg_checking="for connect in -lsocket" test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:5378: checking "$xe_msg_checking"" >&5 +echo "configure:5392: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` xe_check_libs=" -lsocket $X_EXTRA_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5414,10 +5428,10 @@ # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. echo $ac_n "checking for remove""... $ac_c" 1>&6 -echo "configure:5418: checking for remove" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_remove=yes" else @@ -5461,12 +5475,12 @@ if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:5465: checking for remove in -lposix" >&5 +echo "configure:5479: checking for remove in -lposix" >&5 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` xe_check_libs=" -lposix " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5501,10 +5515,10 @@ # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:5505: checking for shmat" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shmat=yes" else @@ -5548,12 +5562,12 @@ if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:5552: checking for shmat in -lipc" >&5 +echo "configure:5566: checking for shmat in -lipc" >&5 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` xe_check_libs=" -lipc " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5600,12 +5614,12 @@ xe_msg_checking="for IceConnectionNumber in -lICE" test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:5604: checking "$xe_msg_checking"" >&5 +echo "configure:5618: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` xe_check_libs=" -lICE $X_EXTRA_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5785,7 +5799,7 @@ echo "checking for X defines extracted by xmkmf" 1>&6 -echo "configure:5789: checking for X defines extracted by xmkmf" >&5 +echo "configure:5803: checking for X defines extracted by xmkmf" >&5 rm -fr conftestdir if mkdir conftestdir; then cd conftestdir @@ -5817,15 +5831,15 @@ ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6 -echo "configure:5821: checking for X11/Intrinsic.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5829: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5843: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5849,12 +5863,12 @@ echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6 -echo "configure:5853: checking for XOpenDisplay in -lX11" >&5 +echo "configure:5867: checking for XOpenDisplay in -lX11" >&5 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5890,12 +5904,12 @@ xe_msg_checking="for XGetFontProperty in -lX11" test -n "-b i486-linuxaout" && xe_msg_checking="$xe_msg_checking using extra libs -b i486-linuxaout" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:5894: checking "$xe_msg_checking"" >&5 +echo "configure:5908: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 -b i486-linuxaout" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5933,12 +5947,12 @@ echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6 -echo "configure:5937: checking for XShapeSelectInput in -lXext" >&5 +echo "configure:5951: checking for XShapeSelectInput in -lXext" >&5 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'` xe_check_libs=" -lXext " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5972,12 +5986,12 @@ echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6 -echo "configure:5976: checking for XtOpenDisplay in -lXt" >&5 +echo "configure:5990: checking for XtOpenDisplay in -lXt" >&5 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'` xe_check_libs=" -lXt " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6011,14 +6025,14 @@ echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6 -echo "configure:6015: checking the version of X11 being used" >&5 +echo "configure:6029: checking the version of X11 being used" >&5 cat > conftest.$ac_ext < int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; } EOF -if { (eval echo configure:6022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:6036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ./conftest foobar; x11_release=$? else @@ -6042,10 +6056,10 @@ for ac_func in XConvertCase do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6046: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6100,15 +6114,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6104: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6112: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6126: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6139,7 +6153,7 @@ echo $ac_n "checking for XFree86""... $ac_c" 1>&6 -echo "configure:6143: checking for XFree86" >&5 +echo "configure:6157: checking for XFree86" >&5 if test -d "/usr/X386/include" -o \ -f "/etc/XF86Config" -o \ -f "/etc/X11/XF86Config" -o \ @@ -6159,12 +6173,12 @@ test -z "$with_xmu" && { echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6 -echo "configure:6163: checking for XmuReadBitmapDataFromFile in -lXmu" >&5 +echo "configure:6177: checking for XmuReadBitmapDataFromFile in -lXmu" >&5 ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'` xe_check_libs=" -lXmu " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6214,19 +6228,19 @@ echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6 -echo "configure:6218: checking for main in -lXbsd" >&5 +echo "configure:6232: checking for main in -lXbsd" >&5 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'` xe_check_libs=" -lXbsd " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6263,22 +6277,22 @@ fi if test "$with_msw" != "no"; then echo "checking for MS-Windows" 1>&6 -echo "configure:6267: checking for MS-Windows" >&5 +echo "configure:6281: checking for MS-Windows" >&5 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6 -echo "configure:6270: checking for main in -lgdi32" >&5 +echo "configure:6284: checking for main in -lgdi32" >&5 ac_lib_var=`echo gdi32'_'main | sed 'y%./+-%__p_%'` xe_check_libs=" -lgdi32 " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6344,12 +6358,12 @@ fi fi cat > conftest.$ac_ext < int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; } EOF -if { (eval echo configure:6353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:6367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_MSG_SELECT @@ -6424,7 +6438,7 @@ esac echo "checking for WM_COMMAND option" 1>&6 -echo "configure:6428: checking for WM_COMMAND option" >&5; +echo "configure:6442: checking for WM_COMMAND option" >&5; if test "$with_wmcommand" != "no"; then { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_WMCOMMAND @@ -6439,15 +6453,15 @@ test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no test -z "$with_xauth" && { ac_safe=`echo "X11/Xauth.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xauth.h""... $ac_c" 1>&6 -echo "configure:6443: checking for X11/Xauth.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6451: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6465: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6470,12 +6484,12 @@ } test -z "$with_xauth" && { echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6 -echo "configure:6474: checking for XauGetAuthByAddr in -lXau" >&5 +echo "configure:6488: checking for XauGetAuthByAddr in -lXau" >&5 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'` xe_check_libs=" -lXau " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6531,15 +6545,15 @@ for dir in "" "Tt/" "desktop/" ; do ac_safe=`echo "${dir}tt_c.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ${dir}tt_c.h""... $ac_c" 1>&6 -echo "configure:6535: checking for ${dir}tt_c.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6543: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6557: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6575,12 +6589,12 @@ xe_msg_checking="for tt_message_create in -ltt" test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:6579: checking "$xe_msg_checking"" >&5 +echo "configure:6593: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'` xe_check_libs=" -ltt $extra_libs" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6648,15 +6662,15 @@ test -z "$with_cde" && { ac_safe=`echo "Dt/Dt.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Dt/Dt.h""... $ac_c" 1>&6 -echo "configure:6652: checking for Dt/Dt.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6660: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6674: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6679,12 +6693,12 @@ } test -z "$with_cde" && { echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6 -echo "configure:6683: checking for DtDndDragStart in -lDtSvc" >&5 +echo "configure:6697: checking for DtDndDragStart in -lDtSvc" >&5 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'` xe_check_libs=" -lDtSvc " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6764,7 +6778,7 @@ fi echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6 -echo "configure:6768: checking if drag and drop API is needed" >&5 +echo "configure:6782: checking if drag and drop API is needed" >&5 if test "$with_dragndrop" != "no" ; then if test -n "$dragndrop_proto" ; then with_dragndrop=yes @@ -6785,18 +6799,18 @@ fi echo "checking for LDAP" 1>&6 -echo "configure:6789: checking for LDAP" >&5 +echo "configure:6803: checking for LDAP" >&5 test -z "$with_ldap" && { ac_safe=`echo "ldap.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ldap.h""... $ac_c" 1>&6 -echo "configure:6792: checking for ldap.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6800: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6814: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6819,15 +6833,15 @@ } test -z "$with_ldap" && { ac_safe=`echo "lber.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for lber.h""... $ac_c" 1>&6 -echo "configure:6823: checking for lber.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6831: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6845: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6851,12 +6865,12 @@ if test "$with_ldap" != "no"; then echo $ac_n "checking for ldap_search in -lldap""... $ac_c" 1>&6 -echo "configure:6855: checking for ldap_search in -lldap" >&5 +echo "configure:6869: checking for ldap_search in -lldap" >&5 ac_lib_var=`echo ldap'_'ldap_search | sed 'y%./+-%__p_%'` xe_check_libs=" -lldap " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6892,12 +6906,12 @@ xe_msg_checking="for ldap_open in -lldap" test -n "-llber" && xe_msg_checking="$xe_msg_checking using extra libs -llber" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:6896: checking "$xe_msg_checking"" >&5 +echo "configure:6910: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lldap -llber" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6933,12 +6947,12 @@ xe_msg_checking="for ldap_open in -lldap" test -n "-llber -lkrb" && xe_msg_checking="$xe_msg_checking using extra libs -llber -lkrb" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:6937: checking "$xe_msg_checking"" >&5 +echo "configure:6951: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lldap -llber -lkrb" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6974,12 +6988,12 @@ xe_msg_checking="for ldap_open in -lldap" test -n "-llber -lkrb -ldes" && xe_msg_checking="$xe_msg_checking using extra libs -llber -lkrb -ldes" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:6978: checking "$xe_msg_checking"" >&5 +echo "configure:6992: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lldap -llber -lkrb -ldes" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7041,10 +7055,10 @@ for ac_func in ldap_set_option ldap_get_lderrno ldap_result2error ldap_parse_result do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7045: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7096,18 +7110,238 @@ fi +echo "checking for PostgreSQL" 1>&6 +echo "configure:7115: checking for PostgreSQL" >&5 +postgres_includes_found=no +save_c_switch_site="$c_switch_site" +if test "$with_postgresql" != "no"; then + ac_safe=`echo "libpq-fe.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for libpq-fe.h""... $ac_c" 1>&6 +echo "configure:7121: checking for libpq-fe.h" >&5 + +cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:7129: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + postgres_includes_found=yes +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test "$postgres_includes_found" = "no" -a "$with_postgresql" != "no" -a \ + -d "/usr/include/pgsql"; then + c_switch_site="$c_switch_site -I/usr/include/pgsql" + ac_safe=`echo "libpq-fe.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for libpq-fe.h""... $ac_c" 1>&6 +echo "configure:7155: checking for libpq-fe.h" >&5 + +cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:7163: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + postgres_includes_found=yes +else + echo "$ac_t""no" 1>&6 +fi + + if test "$postgres_includes_found" != "yes"; then + c_switch_site="$save_c_switch_site" + fi +fi +if test "$postgres_includes_found" = "no" -a "$with_postgresql" != "no" -a \ + -d "/usr/local/pgsql/include"; then + c_switch_site="$c_switch_site -I/usr/local/pgsql/include" + ac_safe=`echo "libpq-fe.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for libpq-fe.h""... $ac_c" 1>&6 +echo "configure:7192: checking for libpq-fe.h" >&5 + +cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:7200: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + postgres_includes_found=yes +else + echo "$ac_t""no" 1>&6 +fi + + if test "$postgres_includes_found" != "yes"; then + c_switch_site="$save_c_switch_site" + fi +fi + +if test "$postgres_includes_found" = "yes"; then + +echo $ac_n "checking for PQconnectdb in -lpq""... $ac_c" 1>&6 +echo "configure:7228: checking for PQconnectdb in -lpq" >&5 +ac_lib_var=`echo pq'_'PQconnectdb | sed 'y%./+-%__p_%'` + +xe_check_libs=" -lpq " +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +xe_check_libs="" + +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then + echo "$ac_t""yes" 1>&6 + with_postgresql=yes +else + echo "$ac_t""no" 1>&6 +with_postgresql=no +fi + + +fi +if test "$with_postgresql" = "yes"; then + +echo $ac_n "checking for PQconnectStart in -lpq""... $ac_c" 1>&6 +echo "configure:7269: checking for PQconnectStart in -lpq" >&5 +ac_lib_var=`echo pq'_'PQconnectStart | sed 'y%./+-%__p_%'` + +xe_check_libs=" -lpq " +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +xe_check_libs="" + +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then + echo "$ac_t""yes" 1>&6 + with_postgresqlv7=yes +else + echo "$ac_t""no" 1>&6 +with_postgresqlv7=no +fi + + +fi +if test "$with_postgresql" = "yes"; then + { test "$extra_verbose" = "yes" && cat << \EOF + Defining HAVE_POSTGRESQL +EOF +cat >> confdefs.h <<\EOF +#define HAVE_POSTGRESQL 1 +EOF +} + + if test "$with_postgresqlv7" = "yes"; then + { test "$extra_verbose" = "yes" && cat << \EOF + Defining HAVE_POSTGRESQLV7 +EOF +cat >> confdefs.h <<\EOF +#define HAVE_POSTGRESQLV7 1 +EOF +} + + fi + LIBS="-lpq $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lpq\" to \$LIBS"; fi + extra_objs="$extra_objs postgresql.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"postgresql.o\"" + fi +else + c_switch_site=$save_c_switch_site +fi + if test "$window_system" != "none"; then echo "checking for graphics libraries" 1>&6 -echo "configure:7103: checking for graphics libraries" >&5 +echo "configure:7337: checking for graphics libraries" >&5 xpm_problem="" if test -z "$with_xpm"; then echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6 -echo "configure:7108: checking for Xpm - no older than 3.4f" >&5 +echo "configure:7342: checking for Xpm - no older than 3.4f" >&5 xe_check_libs=-lXpm cat > conftest.$ac_ext < @@ -7116,7 +7350,7 @@ XpmIncludeVersion != XpmLibraryVersion() ? 1 : XpmIncludeVersion < 30406 ? 2 : 0 ;} EOF -if { (eval echo configure:7120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:7354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ./conftest dummy_arg; xpm_status=$?; if test "$xpm_status" = "0"; then @@ -7158,17 +7392,17 @@ libs_x="-lXpm $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXpm\" to \$libs_x"; fi echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6 -echo "configure:7162: checking for \"FOR_MSW\" xpm" >&5 +echo "configure:7396: checking for \"FOR_MSW\" xpm" >&5 xe_check_libs=-lXpm cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* xpm_for_msw=no else @@ -7194,15 +7428,15 @@ test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for compface.h""... $ac_c" 1>&6 -echo "configure:7198: checking for compface.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7206: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7440: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7225,12 +7459,12 @@ } test -z "$with_xface" && { echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6 -echo "configure:7229: checking for UnGenFace in -lcompface" >&5 +echo "configure:7463: checking for UnGenFace in -lcompface" >&5 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'` xe_check_libs=" -lcompface " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7293,12 +7527,12 @@ if test "$with_png $with_tiff" != "no no"; then echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6 -echo "configure:7297: checking for inflate in -lc" >&5 +echo "configure:7531: checking for inflate in -lc" >&5 ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'` xe_check_libs=" -lc " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7328,12 +7562,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6 -echo "configure:7332: checking for inflate in -lz" >&5 +echo "configure:7566: checking for inflate in -lz" >&5 ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'` xe_check_libs=" -lz " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7363,12 +7597,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6 -echo "configure:7367: checking for inflate in -lgz" >&5 +echo "configure:7601: checking for inflate in -lgz" >&5 ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'` xe_check_libs=" -lgz " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7409,15 +7643,15 @@ test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6 -echo "configure:7413: checking for jpeglib.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7421: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7655: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7440,12 +7674,12 @@ } test -z "$with_jpeg" && { echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6 -echo "configure:7444: checking for jpeg_destroy_decompress in -ljpeg" >&5 +echo "configure:7678: checking for jpeg_destroy_decompress in -ljpeg" >&5 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'` xe_check_libs=" -ljpeg " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7492,10 +7726,10 @@ png_problem="" test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6 -echo "configure:7496: checking for pow" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_pow=yes" else @@ -7539,15 +7773,15 @@ } test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for png.h""... $ac_c" 1>&6 -echo "configure:7543: checking for png.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7551: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7785: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7570,12 +7804,12 @@ } test -z "$with_png" && { echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6 -echo "configure:7574: checking for png_read_image in -lpng" >&5 +echo "configure:7808: checking for png_read_image in -lpng" >&5 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'` xe_check_libs=" -lpng " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7609,10 +7843,10 @@ } if test -z "$with_png"; then echo $ac_n "checking for workable png version information""... $ac_c" 1>&6 -echo "configure:7613: checking for workable png version information" >&5 +echo "configure:7847: checking for workable png version information" >&5 xe_check_libs="-lpng -lz" cat > conftest.$ac_ext < int main(int c, char **v) { @@ -7620,7 +7854,7 @@ if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1; return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;} EOF -if { (eval echo configure:7624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:7858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ./conftest dummy_arg; png_status=$?; if test "$png_status" = "0"; then @@ -7663,15 +7897,15 @@ test -z "$with_tiff" && { ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6 -echo "configure:7667: checking for tiffio.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7675: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7909: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7694,12 +7928,12 @@ } test -z "$with_tiff" && { echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6 -echo "configure:7698: checking for TIFFClientOpen in -ltiff" >&5 +echo "configure:7932: checking for TIFFClientOpen in -ltiff" >&5 ac_lib_var=`echo tiff'_'TIFFClientOpen | sed 'y%./+-%__p_%'` xe_check_libs=" -ltiff " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7749,10 +7983,10 @@ if test "$with_x11" = "yes"; then echo "checking for X11 graphics libraries" 1>&6 -echo "configure:7753: checking for X11 graphics libraries" >&5 +echo "configure:7987: checking for X11 graphics libraries" >&5 echo "checking for the Athena widgets" 1>&6 -echo "configure:7756: checking for the Athena widgets" >&5 +echo "configure:7990: checking for the Athena widgets" >&5 case "$with_athena" in "xaw" | "") athena_variant=Xaw athena_3d=no ;; @@ -7766,12 +8000,12 @@ if test "$athena_3d" = "no"; then echo $ac_n "checking for XawScrollbarSetThumb in -l$athena_variant""... $ac_c" 1>&6 -echo "configure:7770: checking for XawScrollbarSetThumb in -l$athena_variant" >&5 +echo "configure:8004: checking for XawScrollbarSetThumb in -l$athena_variant" >&5 ac_lib_var=`echo $athena_variant'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'` xe_check_libs=" -l$athena_variant " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7798,12 +8032,12 @@ echo "$ac_t""yes" 1>&6 echo $ac_n "checking for threeDClassRec in -l$athena_variant""... $ac_c" 1>&6 -echo "configure:7802: checking for threeDClassRec in -l$athena_variant" >&5 +echo "configure:8036: checking for threeDClassRec in -l$athena_variant" >&5 ac_lib_var=`echo $athena_variant'_'threeDClassRec | sed 'y%./+-%__p_%'` xe_check_libs=" -l$athena_variant " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7845,12 +8079,12 @@ else echo $ac_n "checking for threeDClassRec in -l$athena_variant""... $ac_c" 1>&6 -echo "configure:7849: checking for threeDClassRec in -l$athena_variant" >&5 +echo "configure:8083: checking for threeDClassRec in -l$athena_variant" >&5 ac_lib_var=`echo $athena_variant'_'threeDClassRec | sed 'y%./+-%__p_%'` xe_check_libs=" -l$athena_variant " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7879,12 +8113,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for threeDClassRec in -lXaw""... $ac_c" 1>&6 -echo "configure:7883: checking for threeDClassRec in -lXaw" >&5 +echo "configure:8117: checking for threeDClassRec in -lXaw" >&5 ac_lib_var=`echo Xaw'_'threeDClassRec | sed 'y%./+-%__p_%'` xe_check_libs=" -lXaw " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7926,15 +8160,15 @@ if test "$athena_3d" = "no"; then ac_safe=`echo "X11/Xaw/ThreeD.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xaw/ThreeD.h""... $ac_c" 1>&6 -echo "configure:7930: checking for X11/Xaw/ThreeD.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7938: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8172: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7954,15 +8188,15 @@ echo "$ac_t""no" 1>&6 ac_safe=`echo "X11/Xaw/XawInit.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xaw/XawInit.h""... $ac_c" 1>&6 -echo "configure:7958: checking for X11/Xaw/XawInit.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7966: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8200: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7988,15 +8222,15 @@ else ac_safe=`echo "X11/$athena_variant/XawInit.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/$athena_variant/XawInit.h""... $ac_c" 1>&6 -echo "configure:7992: checking for X11/$athena_variant/XawInit.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8000: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8013,15 +8247,15 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "X11/$athena_variant/ThreeD.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/$athena_variant/ThreeD.h""... $ac_c" 1>&6 -echo "configure:8017: checking for X11/$athena_variant/ThreeD.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8025: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8259: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8049,15 +8283,15 @@ if test -z "$athena_h_path"; then ac_safe=`echo "$athena_variant/XawInit.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $athena_variant/XawInit.h""... $ac_c" 1>&6 -echo "configure:8053: checking for $athena_variant/XawInit.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8061: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8295: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8074,15 +8308,15 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "$athena_variant/ThreeD.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $athena_variant/ThreeD.h""... $ac_c" 1>&6 -echo "configure:8078: checking for $athena_variant/ThreeD.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8086: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8320: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8111,15 +8345,15 @@ if test -z "$athena_h_path" -a "$athena_variant" != "Xaw3d"; then ac_safe=`echo "X11/Xaw3d/XawInit.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xaw3d/XawInit.h""... $ac_c" 1>&6 -echo "configure:8115: checking for X11/Xaw3d/XawInit.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8123: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8357: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8136,15 +8370,15 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "X11/Xaw3d/ThreeD.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xaw3d/ThreeD.h""... $ac_c" 1>&6 -echo "configure:8140: checking for X11/Xaw3d/ThreeD.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8148: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8382: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8176,15 +8410,15 @@ if test -z "$athena_h_path" -a "$athena_variant" != "Xaw3d"; then ac_safe=`echo "Xaw3d/XawInit.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Xaw3d/XawInit.h""... $ac_c" 1>&6 -echo "configure:8180: checking for Xaw3d/XawInit.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8188: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8422: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8201,15 +8435,15 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "Xaw3d/ThreeD.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Xaw3d/ThreeD.h""... $ac_c" 1>&6 -echo "configure:8205: checking for Xaw3d/ThreeD.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8213: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8447: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8241,15 +8475,15 @@ if test -z "$athena_h_path"; then ac_safe=`echo "X11/Xaw/ThreeD.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xaw/ThreeD.h""... $ac_c" 1>&6 -echo "configure:8245: checking for X11/Xaw/ThreeD.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8487: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8284,15 +8518,15 @@ ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6 -echo "configure:8288: checking for Xm/Xm.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8296: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8530: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8309,12 +8543,12 @@ echo "$ac_t""yes" 1>&6 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6 -echo "configure:8313: checking for XmStringFree in -lXm" >&5 +echo "configure:8547: checking for XmStringFree in -lXm" >&5 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'` xe_check_libs=" -lXm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8354,9 +8588,9 @@ if test "$have_motif" = "yes"; then echo $ac_n "checking for Lesstif""... $ac_c" 1>&6 -echo "configure:8358: checking for Lesstif" >&5 +echo "configure:8592: checking for Lesstif" >&5 cat > conftest.$ac_ext < #ifdef LESSTIF_VERSION @@ -8689,7 +8923,7 @@ if test "$with_mule" = "yes" ; then echo "checking for Mule-related features" 1>&6 -echo "configure:8693: checking for Mule-related features" >&5 +echo "configure:8927: checking for Mule-related features" >&5 { test "$extra_verbose" = "yes" && cat << \EOF Defining MULE EOF @@ -8714,15 +8948,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:8718: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8726: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8960: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8753,12 +8987,12 @@ echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6 -echo "configure:8757: checking for strerror in -lintl" >&5 +echo "configure:8991: checking for strerror in -lintl" >&5 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'` xe_check_libs=" -lintl " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8802,18 +9036,18 @@ echo "checking for Mule input methods" 1>&6 -echo "configure:8806: checking for Mule input methods" >&5 +echo "configure:9040: checking for Mule input methods" >&5 case "$with_xim" in "" | "yes" ) echo "checking for XIM" 1>&6 -echo "configure:8809: checking for XIM" >&5 +echo "configure:9043: checking for XIM" >&5 echo $ac_n "checking for XOpenIM in -lX11""... $ac_c" 1>&6 -echo "configure:8812: checking for XOpenIM in -lX11" >&5 +echo "configure:9046: checking for XOpenIM in -lX11" >&5 ac_lib_var=`echo X11'_'XOpenIM | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9062: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8848,12 +9082,12 @@ if test "$have_motif $have_lesstif" = "yes no"; then echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6 -echo "configure:8852: checking for XmImMbLookupString in -lXm" >&5 +echo "configure:9086: checking for XmImMbLookupString in -lXm" >&5 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'` xe_check_libs=" -lXm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8929,15 +9163,15 @@ if test "$with_xfs" = "yes" ; then echo "checking for XFontSet" 1>&6 -echo "configure:8933: checking for XFontSet" >&5 +echo "configure:9167: checking for XFontSet" >&5 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6 -echo "configure:8936: checking for XmbDrawString in -lX11" >&5 +echo "configure:9170: checking for XmbDrawString in -lX11" >&5 ac_lib_var=`echo X11'_'XmbDrawString | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8988,15 +9222,15 @@ test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support test -z "$with_wnn" && { ac_safe=`echo "wnn/jllib.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for wnn/jllib.h""... $ac_c" 1>&6 -echo "configure:8992: checking for wnn/jllib.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9000: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9021,10 +9255,10 @@ for ac_func in crypt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:9025: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -9076,12 +9310,12 @@ test "$ac_cv_func_crypt" != "yes" && { echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:9080: checking for crypt in -lcrypt" >&5 +echo "configure:9314: checking for crypt in -lcrypt" >&5 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` xe_check_libs=" -lcrypt " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9127,12 +9361,12 @@ if test -z "$with_wnn" -o "$with_wnn" = "yes"; then echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6 -echo "configure:9131: checking for jl_dic_list_e in -lwnn" >&5 +echo "configure:9365: checking for jl_dic_list_e in -lwnn" >&5 ac_lib_var=`echo wnn'_'jl_dic_list_e | sed 'y%./+-%__p_%'` xe_check_libs=" -lwnn " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9161,12 +9395,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for jl_dic_list_e in -lwnn4""... $ac_c" 1>&6 -echo "configure:9165: checking for jl_dic_list_e in -lwnn4" >&5 +echo "configure:9399: checking for jl_dic_list_e in -lwnn4" >&5 ac_lib_var=`echo wnn4'_'jl_dic_list_e | sed 'y%./+-%__p_%'` xe_check_libs=" -lwnn4 " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9195,12 +9429,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for jl_dic_list_e in -lwnn6""... $ac_c" 1>&6 -echo "configure:9199: checking for jl_dic_list_e in -lwnn6" >&5 +echo "configure:9433: checking for jl_dic_list_e in -lwnn6" >&5 ac_lib_var=`echo wnn6'_'jl_dic_list_e | sed 'y%./+-%__p_%'` xe_check_libs=" -lwnn6 " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9229,12 +9463,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dic_list_e in -lwnn6_fromsrc""... $ac_c" 1>&6 -echo "configure:9233: checking for dic_list_e in -lwnn6_fromsrc" >&5 +echo "configure:9467: checking for dic_list_e in -lwnn6_fromsrc" >&5 ac_lib_var=`echo wnn6_fromsrc'_'dic_list_e | sed 'y%./+-%__p_%'` xe_check_libs=" -lwnn6_fromsrc " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9293,12 +9527,12 @@ if test "$with_wnn6" != "no"; then echo $ac_n "checking for jl_fi_dic_list in -l$libwnn""... $ac_c" 1>&6 -echo "configure:9297: checking for jl_fi_dic_list in -l$libwnn" >&5 +echo "configure:9531: checking for jl_fi_dic_list in -l$libwnn" >&5 ac_lib_var=`echo $libwnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'` xe_check_libs=" -l$libwnn " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9344,15 +9578,15 @@ if test "$with_canna" != "no"; then ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6 -echo "configure:9348: checking for canna/jrkanji.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9356: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9590: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9379,15 +9613,15 @@ c_switch_site="$c_switch_site -I/usr/local/canna/include" ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6 -echo "configure:9383: checking for canna/jrkanji.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9391: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9625: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9415,15 +9649,15 @@ test -z "$with_canna" && { ac_safe=`echo "canna/RK.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for canna/RK.h""... $ac_c" 1>&6 -echo "configure:9419: checking for canna/RK.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9427: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9661: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9446,12 +9680,12 @@ } test -z "$with_canna" && { echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6 -echo "configure:9450: checking for RkBgnBun in -lRKC" >&5 +echo "configure:9684: checking for RkBgnBun in -lRKC" >&5 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'` xe_check_libs=" -lRKC " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9485,12 +9719,12 @@ } test -z "$with_canna" && { echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6 -echo "configure:9489: checking for jrKanjiControl in -lcanna" >&5 +echo "configure:9723: checking for jrKanjiControl in -lcanna" >&5 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'` xe_check_libs=" -lcanna " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9550,12 +9784,12 @@ libs_x="-lXm $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXm\" to \$libs_x"; fi echo $ac_n "checking for layout_object_getvalue in -li18n""... $ac_c" 1>&6 -echo "configure:9554: checking for layout_object_getvalue in -li18n" >&5 +echo "configure:9788: checking for layout_object_getvalue in -li18n" >&5 ac_lib_var=`echo i18n'_'layout_object_getvalue | sed 'y%./+-%__p_%'` xe_check_libs=" -li18n " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9652,10 +9886,10 @@ for ac_func in cbrt closedir dup2 eaccess fmod fpathconf frexp ftime getaddrinfo gethostname getnameinfo getpagesize gettimeofday getcwd getpt getwd logb lrand48 matherr mkdir mktime perror poll random rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf stpcpy strcasecmp strerror tzset ulimit usleep utimes waitpid vsnprintf fsync ftruncate umask do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:9656: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -9713,10 +9947,10 @@ for ac_func in getloadavg do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:9717: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -9775,12 +10009,12 @@ echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6 -echo "configure:9779: checking for kstat_open in -lkstat" >&5 +echo "configure:10013: checking for kstat_open in -lkstat" >&5 ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lkstat " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9825,12 +10059,12 @@ echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6 -echo "configure:9829: checking for kvm_read in -lkvm" >&5 +echo "configure:10063: checking for kvm_read in -lkvm" >&5 ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'` xe_check_libs=" -lkvm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9875,16 +10109,16 @@ fi echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6 -echo "configure:9879: checking whether netdb declares h_errno" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext < int main() { return h_errno; ; return 0; } EOF -if { (eval echo configure:9888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 { test "$extra_verbose" = "yes" && cat << \EOF @@ -9904,16 +10138,16 @@ rm -f conftest* echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6 -echo "configure:9908: checking for sigsetjmp" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext < int main() { sigjmp_buf bar; sigsetjmp (bar, 0); ; return 0; } EOF -if { (eval echo configure:9917: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:10151: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 { test "$extra_verbose" = "yes" && cat << \EOF @@ -9933,11 +10167,11 @@ rm -f conftest* echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6 -echo "configure:9937: checking whether localtime caches TZ" >&5 +echo "configure:10171: checking whether localtime caches TZ" >&5 if test "$ac_cv_func_tzset" = "yes"; then cat > conftest.$ac_ext < #if STDC_HEADERS @@ -9972,7 +10206,7 @@ exit (0); } EOF -if { (eval echo configure:9976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:10210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then emacs_cv_localtime_cache=no else @@ -10002,9 +10236,9 @@ if test "$HAVE_TIMEVAL" = "yes"; then echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6 -echo "configure:10006: checking whether gettimeofday accepts one or two arguments" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""two" 1>&6 else @@ -10047,19 +10281,19 @@ echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:10051: checking for inline" >&5 +echo "configure:10285: checking for inline" >&5 ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:10297: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -10091,35 +10325,25 @@ ;; esac -if test "$ac_cv_c_inline" != "no"; then - { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_INLINE -EOF -cat >> confdefs.h <<\EOF -#define HAVE_INLINE 1 -EOF -} - - test "$GCC" = "yes" && extra_objs="$extra_objs inline.o" && if test "$extra_verbose" = "yes"; then +test "$ac_cv_c_inline" != "no" -a "$GCC" = "yes" && extra_objs="$extra_objs inline.o" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"inline.o\"" fi -fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:10113: checking for working alloca.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:10123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -10143,10 +10367,10 @@ fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:10147: checking for alloca" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -10213,10 +10437,10 @@ echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:10217: checking whether alloca needs Cray hooks" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&6 -echo "configure:10244: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -10296,10 +10520,10 @@ fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:10300: checking stack direction for C alloca" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:10546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_c_stack_direction=1 else @@ -10347,15 +10571,15 @@ ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:10351: checking for vfork.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10359: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10583: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10383,10 +10607,10 @@ fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:10387: checking for working vfork" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < @@ -10481,7 +10705,7 @@ } } EOF -if { (eval echo configure:10485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:10709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_func_vfork_works=yes else @@ -10507,10 +10731,10 @@ echo $ac_n "checking for working strcoll""... $ac_c" 1>&6 -echo "configure:10511: checking for working strcoll" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < main () @@ -10520,7 +10744,7 @@ strcoll ("123", "456") >= 0); } EOF -if { (eval echo configure:10524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:10748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_func_strcoll_works=yes else @@ -10548,10 +10772,10 @@ for ac_func in getpgrp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10552: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -10602,10 +10826,10 @@ done echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:10606: checking whether getpgrp takes no argument" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:10888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_func_getpgrp_void=yes else @@ -10687,10 +10911,10 @@ echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:10691: checking for working mmap" >&5 +echo "configure:10915: checking for working mmap" >&5 case "$opsys" in ultrix* ) have_mmap=no ;; *) cat > conftest.$ac_ext < #include @@ -10723,7 +10947,7 @@ return 1; } EOF -if { (eval echo configure:10727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:10951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then have_mmap=yes else @@ -10749,9 +10973,9 @@ if test "$rel_alloc $have_mmap" = "default yes"; then if test "$doug_lea_malloc" = "yes"; then echo $ac_n "checking for M_MMAP_THRESHOLD""... $ac_c" 1>&6 -echo "configure:10753: checking for M_MMAP_THRESHOLD" >&5 +echo "configure:10977: checking for M_MMAP_THRESHOLD" >&5 cat > conftest.$ac_ext < int main() { @@ -10763,7 +10987,7 @@ ; return 0; } EOF -if { (eval echo configure:10767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:10991: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rel_alloc=no; echo "$ac_t""yes" 1>&6; else @@ -10788,15 +11012,15 @@ ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for termios.h""... $ac_c" 1>&6 -echo "configure:10792: checking for termios.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10800: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11024: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10839,15 +11063,15 @@ echo "$ac_t""no" 1>&6 ac_safe=`echo "termio.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for termio.h""... $ac_c" 1>&6 -echo "configure:10843: checking for termio.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10851: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11075: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10879,10 +11103,10 @@ echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:10883: checking for socket" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_socket=yes" else @@ -10920,15 +11144,15 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6 -echo "configure:10924: checking for netinet/in.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10932: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11156: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10945,15 +11169,15 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6 -echo "configure:10949: checking for arpa/inet.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10957: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11181: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10978,9 +11202,9 @@ } echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6 -echo "configure:10982: checking "for sun_len member in struct sockaddr_un"" >&5 +echo "configure:11206: checking "for sun_len member in struct sockaddr_un"" >&5 cat > conftest.$ac_ext < @@ -10991,7 +11215,7 @@ static struct sockaddr_un x; x.sun_len = 1; ; return 0; } EOF -if { (eval echo configure:10995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_SOCKADDR_SUN_LEN @@ -11009,9 +11233,9 @@ fi rm -f conftest* echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6 -echo "configure:11013: checking "for ip_mreq struct in netinet/in.h"" >&5 +echo "configure:11237: checking "for ip_mreq struct in netinet/in.h"" >&5 cat > conftest.$ac_ext < @@ -11021,7 +11245,7 @@ static struct ip_mreq x; ; return 0; } EOF -if { (eval echo configure:11025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_MULTICAST @@ -11052,10 +11276,10 @@ echo $ac_n "checking for msgget""... $ac_c" 1>&6 -echo "configure:11056: checking for msgget" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_msgget=yes" else @@ -11093,15 +11317,15 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6 -echo "configure:11097: checking for sys/ipc.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11105: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11329: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11118,15 +11342,15 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "sys/msg.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/msg.h""... $ac_c" 1>&6 -echo "configure:11122: checking for sys/msg.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11130: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11354: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11164,15 +11388,15 @@ ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dirent.h""... $ac_c" 1>&6 -echo "configure:11168: checking for dirent.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11176: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11400: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11199,15 +11423,15 @@ echo "$ac_t""no" 1>&6 ac_safe=`echo "sys/dir.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/dir.h""... $ac_c" 1>&6 -echo "configure:11203: checking for sys/dir.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11211: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11435: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11240,15 +11464,15 @@ ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for nlist.h""... $ac_c" 1>&6 -echo "configure:11244: checking for nlist.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11252: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11476: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11278,22 +11502,22 @@ echo "checking "for sound support"" 1>&6 -echo "configure:11282: checking "for sound support"" >&5 +echo "configure:11506: checking "for sound support"" >&5 test -z "$with_native_sound" -a -n "$native_sound_lib" && with_native_sound=yes if test "$with_native_sound" != "no"; then if test -n "$native_sound_lib"; then ac_safe=`echo "multimedia/audio_device.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for multimedia/audio_device.h""... $ac_c" 1>&6 -echo "configure:11289: checking for multimedia/audio_device.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11297: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11521: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11341,12 +11565,12 @@ if test -z "$native_sound_lib"; then echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6 -echo "configure:11345: checking for ALopenport in -laudio" >&5 +echo "configure:11569: checking for ALopenport in -laudio" >&5 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'` xe_check_libs=" -laudio " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11388,12 +11612,12 @@ if test -z "$native_sound_lib"; then echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6 -echo "configure:11392: checking for AOpenAudio in -lAlib" >&5 +echo "configure:11616: checking for AOpenAudio in -lAlib" >&5 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'` xe_check_libs=" -lAlib " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11442,15 +11666,15 @@ for dir in "machine" "sys" "linux"; do ac_safe=`echo "${dir}/soundcard.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ${dir}/soundcard.h""... $ac_c" 1>&6 -echo "configure:11446: checking for ${dir}/soundcard.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11454: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11678: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11504,15 +11728,15 @@ if test "$with_nas_sound" != "no"; then ac_safe=`echo "audio/audiolib.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for audio/audiolib.h""... $ac_c" 1>&6 -echo "configure:11508: checking for audio/audiolib.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11516: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11740: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11530,12 +11754,12 @@ echo $ac_n "checking for AuOpenServer in -laudio""... $ac_c" 1>&6 -echo "configure:11534: checking for AuOpenServer in -laudio" >&5 +echo "configure:11758: checking for AuOpenServer in -laudio" >&5 ac_lib_var=`echo audio'_'AuOpenServer | sed 'y%./+-%__p_%'` xe_check_libs=" -laudio " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11585,7 +11809,7 @@ fi libs_x="-laudio $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-laudio\" to \$libs_x"; fi cat > conftest.$ac_ext < EOF @@ -11616,7 +11840,7 @@ # Extract the first word of "esd-config", so it can be a program name with args. set dummy esd-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:11620: checking for $ac_word" >&5 +echo "configure:11844: checking for $ac_word" >&5 if test -n "$have_esd_config"; then ac_cv_prog_have_esd_config="$have_esd_config" # Let the user override the test. @@ -11645,10 +11869,10 @@ c_switch_site="$c_switch_site `esd-config --cflags`" && if test "$extra_verbose" = "yes"; then echo " Appending \"`esd-config --cflags`\" to \$c_switch_site"; fi LIBS="`esd-config --libs` $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"`esd-config --libs`\" to \$LIBS"; fi echo $ac_n "checking for esd_play_stream""... $ac_c" 1>&6 -echo "configure:11649: checking for esd_play_stream" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_esd_play_stream=yes" else @@ -11722,7 +11946,7 @@ if test "$with_tty" = "yes" ; then echo "checking for TTY-related features" 1>&6 -echo "configure:11726: checking for TTY-related features" >&5 +echo "configure:11950: checking for TTY-related features" >&5 { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_TTY EOF @@ -11738,12 +11962,12 @@ if test -z "$with_ncurses"; then echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 -echo "configure:11742: checking for tgetent in -lncurses" >&5 +echo "configure:11966: checking for tgetent in -lncurses" >&5 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -lncurses " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11787,15 +12011,15 @@ ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6 -echo "configure:11791: checking for ncurses/curses.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11799: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11817,15 +12041,15 @@ ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6 -echo "configure:11821: checking for ncurses/term.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11829: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12053: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11855,15 +12079,15 @@ c_switch_site="$c_switch_site -I/usr/include/ncurses" ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6 -echo "configure:11859: checking for ncurses/curses.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11867: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12091: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11898,12 +12122,12 @@ for lib in curses termlib termcap; do echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6 -echo "configure:11902: checking for tgetent in -l$lib" >&5 +echo "configure:12126: checking for tgetent in -l$lib" >&5 ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -l$lib " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11945,12 +12169,12 @@ else echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 -echo "configure:11949: checking for tgetent in -lcurses" >&5 +echo "configure:12173: checking for tgetent in -lcurses" >&5 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -lcurses " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11979,12 +12203,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 -echo "configure:11983: checking for tgetent in -ltermcap" >&5 +echo "configure:12207: checking for tgetent in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -ltermcap " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12043,15 +12267,15 @@ test -z "$with_gpm" && { ac_safe=`echo "gpm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for gpm.h""... $ac_c" 1>&6 -echo "configure:12047: checking for gpm.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12055: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12279: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12074,12 +12298,12 @@ } test -z "$with_gpm" && { echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6 -echo "configure:12078: checking for Gpm_Open in -lgpm" >&5 +echo "configure:12302: checking for Gpm_Open in -lgpm" >&5 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'` xe_check_libs=" -lgpm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12140,20 +12364,20 @@ test "$with_database_gdbm $with_database_dbm $with_database_berkdb" \ != "no no no" && echo "checking for database support" 1>&6 -echo "configure:12144: checking for database support" >&5 +echo "configure:12368: checking for database support" >&5 if test "$with_database_gdbm $with_database_dbm" != "no no"; then ac_safe=`echo "ndbm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ndbm.h""... $ac_c" 1>&6 -echo "configure:12149: checking for ndbm.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12157: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12381: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12183,12 +12407,12 @@ if test "$with_database_gdbm" != "no"; then echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6 -echo "configure:12187: checking for dbm_open in -lgdbm" >&5 +echo "configure:12411: checking for dbm_open in -lgdbm" >&5 ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lgdbm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12227,10 +12451,10 @@ if test "$with_database_dbm" != "no"; then echo $ac_n "checking for dbm_open""... $ac_c" 1>&6 -echo "configure:12231: checking for dbm_open" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dbm_open=yes" else @@ -12272,12 +12496,12 @@ echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6 -echo "configure:12276: checking for dbm_open in -ldbm" >&5 +echo "configure:12500: checking for dbm_open in -ldbm" >&5 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'` xe_check_libs=" -ldbm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12329,10 +12553,10 @@ if test "$with_database_berkdb" != "no"; then echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6 -echo "configure:12333: checking for Berkeley db.h" >&5 +echo "configure:12557: checking for Berkeley db.h" >&5 for path in "db/db.h" "db.h"; do cat > conftest.$ac_ext < @@ -12354,7 +12578,7 @@ ; return 0; } EOF -if { (eval echo configure:12358: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:12582: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* db_h_path="$path"; break else @@ -12370,9 +12594,9 @@ if test "$with_database_berkdb" != "no"; then echo $ac_n "checking for Berkeley DB version""... $ac_c" 1>&6 -echo "configure:12374: checking for Berkeley DB version" >&5 +echo "configure:12598: checking for Berkeley DB version" >&5 cat > conftest.$ac_ext < #if DB_VERSION_MAJOR > 1 @@ -12391,10 +12615,10 @@ rm -f conftest* echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6 -echo "configure:12395: checking for $dbfunc" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$dbfunc=yes" else @@ -12436,12 +12660,12 @@ echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6 -echo "configure:12440: checking for $dbfunc in -ldb" >&5 +echo "configure:12664: checking for $dbfunc in -ldb" >&5 ac_lib_var=`echo db'_'$dbfunc | sed 'y%./+-%__p_%'` xe_check_libs=" -ldb " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12516,12 +12740,12 @@ if test "$with_socks" = "yes"; then echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6 -echo "configure:12520: checking for SOCKSinit in -lsocks" >&5 +echo "configure:12744: checking for SOCKSinit in -lsocks" >&5 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'` xe_check_libs=" -lsocks " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12587,19 +12811,19 @@ if test "$with_modules" != "no"; then echo "checking for module support" 1>&6 -echo "configure:12591: checking for module support" >&5 +echo "configure:12815: checking for module support" >&5 ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 -echo "configure:12595: checking for dlfcn.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12603: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12827: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12617,12 +12841,12 @@ echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:12621: checking for dlopen in -ldl" >&5 +echo "configure:12845: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` xe_check_libs=" -ldl " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12652,12 +12876,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6 -echo "configure:12656: checking for dlopen in -lc" >&5 +echo "configure:12880: checking for dlopen in -lc" >&5 ac_lib_var=`echo c'_'dlopen | sed 'y%./+-%__p_%'` xe_check_libs=" -lc " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12707,12 +12931,12 @@ else echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "configure:12711: checking for shl_load in -ldld" >&5 +echo "configure:12935: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` xe_check_libs=" -ldld " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12750,12 +12974,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6 -echo "configure:12754: checking for dld_init in -ldld" >&5 +echo "configure:12978: checking for dld_init in -ldld" >&5 ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'` xe_check_libs=" -ldld " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12811,7 +13035,7 @@ xealias=$internal_configuration echo "checking how to build dynamic libraries for ${xehost}" 1>&6 -echo "configure:12815: checking how to build dynamic libraries for ${xehost}" >&5 +echo "configure:13039: checking how to build dynamic libraries for ${xehost}" >&5 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts. case "$xehost" in *-*-linux-gnu*) ;; @@ -12839,9 +13063,9 @@ XEGCC=yes else echo $ac_n "checking checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:12843: checking checking whether we are using GNU C" >&5 +echo "configure:13067: checking checking whether we are using GNU C" >&5 cat > conftest.$ac_ext <&6 -echo "configure:12867: checking how to produce PIC code" >&5 +echo "configure:13091: checking how to produce PIC code" >&5 wl= can_build_shared=yes @@ -12956,18 +13180,18 @@ # Check to make sure the dll_cflags actually works. echo $ac_n "checking if PIC flag ${dll_cflags} really works""... $ac_c" 1>&6 -echo "configure:12960: checking if PIC flag ${dll_cflags} really works" >&5 +echo "configure:13184: checking if PIC flag ${dll_cflags} really works" >&5 save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $dll_cflags -DPIC" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13195: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also @@ -12998,7 +13222,7 @@ xldf= xcldf= echo $ac_n "checking if C compiler can produce shared libraries""... $ac_c" 1>&6 -echo "configure:13002: checking if C compiler can produce shared libraries" >&5 +echo "configure:13226: checking if C compiler can produce shared libraries" >&5 if test "$XEGCC" = yes; then xcldf="-shared" xldf="-shared" @@ -13049,14 +13273,14 @@ xe_libs= ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5' cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cc_produces_so=yes else @@ -13081,7 +13305,7 @@ if test "$XEGCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:13085: checking for ld used by GCC" >&5 +echo "configure:13309: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. @@ -13106,7 +13330,7 @@ esac else echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:13110: checking for GNU ld" >&5 +echo "configure:13334: checking for GNU ld" >&5 fi if test -z "$LTLD"; then @@ -13144,7 +13368,7 @@ # Check to see if it really is or isn't GNU ld. echo $ac_n "checking if the linker is GNU ld""... $ac_c" 1>&6 -echo "configure:13148: checking if the linker is GNU ld" >&5 +echo "configure:13372: checking if the linker is GNU ld" >&5 # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LTLD -v 2>&1 &5; then xe_gnu_ld=yes @@ -13167,11 +13391,12 @@ dll_ld=$CC dll_ldflags=$xcldf can_build_shared=yes + ld_shlibs=yes else # OK - only NOW do we futz about with ld. # See if the linker supports building shared libraries. echo $ac_n "checking whether the linker supports shared libraries""... $ac_c" 1>&6 -echo "configure:13175: checking whether the linker supports shared libraries" >&5 +echo "configure:13400: checking whether the linker supports shared libraries" >&5 dll_ld=$CC dll_ldflags=$LDFLAGS ld_shlibs=yes @@ -13386,10 +13611,10 @@ for ac_func in dlerror _dlerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:13390: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -13451,11 +13676,11 @@ fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:13684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then : else @@ -14149,6 +14374,12 @@ test "$with_ldap" = yes && echo " Compiling in support for LDAP." +if test "$with_postgresql" = yes; then + echo " Compiling in support for PostgreSQL." + if test "$with_postgresqlv7" = yes; then + echo " Using PostgreSQL V7 bindings." + fi +fi test "$with_ncurses" = yes && echo " Compiling in support for ncurses." test "$with_gpm" = yes && echo " Compiling in support for GPM (General Purpose Mouse)." @@ -14211,7 +14442,7 @@ test "$with_kerberos" = yes && echo " Using Kerberos for POP authentication." test "$with_hesiod" = yes && echo " Using Hesiod to get POP server host." test "$use_union_type" = yes && echo " Using the union type for Lisp_Objects." -test "$pdump" = yes && echo " Using the new portable dumper (wishful thinking)." +test "$pdump" = yes && echo " Using the new portable dumper." test "$debug" = yes && echo " Compiling in extra code for debugging." test "$usage_tracking" = yes && echo " Compiling with usage tracking active (Sun internal)." if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc" \ diff -r 9f011ab08d48 -r 2f8bb876ab1d configure.in --- a/configure.in Mon Aug 13 11:15:00 2007 +0200 +++ b/configure.in Mon Aug 13 11:16:07 2007 +0200 @@ -307,6 +307,7 @@ dnl Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} dnl Maximum number of lines to put in a shell here document. ac_max_here_lines=12 ])dnl AC_INIT_PARSE_ARGS @@ -505,6 +506,7 @@ with_sparcworks | \ with_tooltalk | \ with_ldap | \ + with_postgresql | \ with_pop | \ with_kerberos | \ with_hesiod | \ @@ -1001,6 +1003,8 @@ PROGNAME=xemacs fi +AC_DEFINE_UNQUOTED(EMACS_PROGNAME, "$PROGNAME") + dnl ---------------------------------- dnl Error checking and debugging flags dnl ---------------------------------- @@ -1947,7 +1951,8 @@ dnl Add s&m-determined objects (including unexec) to link line test -n "$objects_machine" && XE_ADD_OBJS($objects_machine) test -n "$objects_system" && XE_ADD_OBJS($objects_system) -test -n "$unexec" && XE_ADD_OBJS($unexec) +test -n "$unexec" && test ! "$pdump" = "yes" && XE_ADD_OBJS($unexec) +test "$pdump" = "yes" && XE_ADD_OBJS(dumper.o) dnl Dynodump (Solaris 2.x, x<6) AC_MSG_CHECKING(for dynodump) @@ -2898,6 +2903,55 @@ AC_CHECK_FUNCS(ldap_set_option ldap_get_lderrno ldap_result2error ldap_parse_result) fi +dnl Autodetect PostgreSQL +dnl The default installation location (non-Linux) is /usr/local/pgsql; +dnl a different prefix can be selected at build/install time. If PostgreSQL +dnl is installed into a different prefix, that prefix must be specified in +dnl in the --site-prefixes flag. +dnl The default RPM-based Linux installation location is /usr. +AC_CHECKING(for PostgreSQL) +postgres_includes_found=no +save_c_switch_site="$c_switch_site" +dnl First check site prefixes +if test "$with_postgresql" != "no"; then + AC_CHECK_HEADER(libpq-fe.h,postgres_includes_found=yes) +fi +dnl test for Linux-style installation in /usr +if test "$postgres_includes_found" = "no" -a "$with_postgresql" != "no" -a \ + -d "/usr/include/pgsql"; then + c_switch_site="$c_switch_site -I/usr/include/pgsql" + AC_CHECK_HEADER(libpq-fe.h,postgres_includes_found=yes) + if test "$postgres_includes_found" != "yes"; then + c_switch_site="$save_c_switch_site" + fi +fi +if test "$postgres_includes_found" = "no" -a "$with_postgresql" != "no" -a \ + -d "/usr/local/pgsql/include"; then + c_switch_site="$c_switch_site -I/usr/local/pgsql/include" + AC_CHECK_HEADER(libpq-fe.h,postgres_includes_found=yes) + if test "$postgres_includes_found" != "yes"; then + c_switch_site="$save_c_switch_site" + fi +fi + +dnl last check -- can we link against libpq? +if test "$postgres_includes_found" = "yes"; then + AC_CHECK_LIB(pq,PQconnectdb,with_postgresql=yes,with_postgresql=no) +fi +if test "$with_postgresql" = "yes"; then + AC_CHECK_LIB(pq,PQconnectStart,with_postgresqlv7=yes,with_postgresqlv7=no) +fi +if test "$with_postgresql" = "yes"; then + AC_DEFINE(HAVE_POSTGRESQL) + if test "$with_postgresqlv7" = "yes"; then + AC_DEFINE(HAVE_POSTGRESQLV7) + fi + XE_PREPEND(-lpq, LIBS) + XE_ADD_OBJS(postgresql.o) +else + c_switch_site=$save_c_switch_site +fi + dnl ---------------------- dnl Graphics libraries dnl ---------------------- @@ -3515,10 +3569,7 @@ AC_C_INLINE -if test "$ac_cv_c_inline" != "no"; then - AC_DEFINE(HAVE_INLINE) - test "$GCC" = "yes" && XE_ADD_OBJS(inline.o) -fi +test "$ac_cv_c_inline" != "no" -a "$GCC" = "yes" && XE_ADD_OBJS(inline.o) dnl HP-UX has a working alloca in libPW. dnl case "${GCC}${opsys}" in hpux* ) @@ -4477,6 +4528,12 @@ test "$with_ldap" = yes && echo " Compiling in support for LDAP." +if test "$with_postgresql" = yes; then + echo " Compiling in support for PostgreSQL." + if test "$with_postgresqlv7" = yes; then + echo " Using PostgreSQL V7 bindings." + fi +fi test "$with_ncurses" = yes && echo " Compiling in support for ncurses." test "$with_gpm" = yes && echo " Compiling in support for GPM (General Purpose Mouse)." @@ -4539,7 +4596,7 @@ test "$with_kerberos" = yes && echo " Using Kerberos for POP authentication." test "$with_hesiod" = yes && echo " Using Hesiod to get POP server host." test "$use_union_type" = yes && echo " Using the union type for Lisp_Objects." -test "$pdump" = yes && echo " Using the new portable dumper (wishful thinking)." +test "$pdump" = yes && echo " Using the new portable dumper." test "$debug" = yes && echo " Compiling in extra code for debugging." test "$usage_tracking" = yes && echo " Compiling with usage tracking active (Sun internal)." if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc" \ diff -r 9f011ab08d48 -r 2f8bb876ab1d configure.usage --- a/configure.usage Mon Aug 13 11:15:00 2007 +0200 +++ b/configure.usage Mon Aug 13 11:16:07 2007 +0200 @@ -139,6 +139,8 @@ --with-dnet (*) Compile with support for DECnet. --with-ldap (*) Compile with support for the LDAP protocol (requires installed LDAP libraries on the system). +--with-postgresql (*) Compile with support for the PostgreSQL RDBMS (requires + installed PostreSQL libraries on the system). --mail-locking=TYPE (*) Specify the locking to be used by movemail to prevent concurrent updates of mail spool files. Valid types are `lockf', `flock', and `dot'. diff -r 9f011ab08d48 -r 2f8bb876ab1d etc/NEWS --- a/etc/NEWS Mon Aug 13 11:15:00 2007 +0200 +++ b/etc/NEWS Mon Aug 13 11:16:07 2007 +0200 @@ -47,6 +47,28 @@ Delete key to delete backwards, despite the presence (according to Xlib) of a BackSpace key on the keyboard. +** Shifted motion keys now select text by default. You can turn this +off by setting `shifted-motion-keys-select-region' to nil. + +** You can now set the variable `kill-whole-line' to `always', which +makes `kill-line' (C-k) delete the entire line always, not just when +the cursor is at the beginning of the line. This behavior, as well as +the existing kill-whole-line behavior, now only take effect when +kill-line is called interactively, although this is a departure from a +previous behavior in the case of setting this variable kill-whole-line +to t. It is almost certainly what has always been intended, and most +likely the old way of doing things introduced bugs. + +The new function `historical-kill-line' ignores the `kill-whole-line' +setting and always gives the historical behavior of only killing to +the end of the line. This function is bound to Sh-C-k, so that the +kill to end of line behavior is available, even when `kill-whole-line' +has been customized. + +** XEmacs menus now have accelerators by default. If a menu item does +not have an accelerator specified, one is created dynamically, using +numbers 1-9 and letters. + ** Interactive searching and matching case improvements. Case sensitiveness in searching operations is normally controlled by @@ -68,13 +90,20 @@ ** You can now use the buffer tabs to switch between buffers. The tabs are located between the toolbar and the uppermost window, in a location called "gutter". If you dislike the buffer tabs, you can -disable them by specifying: +disable them by customizing `gutter-buffers-tab-visible-p', or by +placing this in your .emacs: - (set-specifier default-gutter-visible-p nil) + (set-gutter-element-visible-p default-gutter-visible-p 'buffers-tab nil) -in your `.emacs'. You can change the location of the gutter with +You can change the location of the gutter with `set-default-gutter-position', however currently only MS-Windows -supports tab widgets with orientations other than vertical.. +supports tab widgets with orientations other than vertical. + +** Kill and yank now interact with the clipboard by default under +Windows. This was done by changing the default value of +`interprogram-cut-function' and `interprogram-paste-function'. You +can get the old behavior by setting these to nil, and there is an +option on the options menu to do this. ** When you press RET at a minibuffer prompt that provides a default value, the value is stored in history instead of an empty line. Also, @@ -91,6 +120,13 @@ unwanted spaces, and an optional prefix now allows them to behave the old way. +Also, the behavior of `string-rectangle' is now compliant with +`pending-delete-mode': if this mode is active, then the string +replaces the region rectangle. Otherwise, the command does not delete +or overwrite any existing text. For those who want that feature but do +not use pending-delete-mode, a new function, `replace-rectangle', is +available. + As a side effect, the FORCE argument to `move-to-column' now understands the special value `coerce', which means that the line should not be filled if it is too short to reach the desired column. @@ -177,17 +213,40 @@ is now equivalent to -user-init-file ~/.emacs -user-init-directory ~/.xemacs. -** New variable `mswindows-meta-activates-menu'. -If you set this variable to nil then pressing the Alt key under -MS-Windows will no longer activate the menubar. The default is t. +** Init file may be called .emacs.el. + +Like in GNU Emacs 20.4 and on, you can now name the XEmacs init file +`.emacs.el'. Formerly the name had to be `.emacs'. If you use the +name `.emacs.el', you can byte-compile the file in the usual way. + +If both `.emacs' and `.emacs.el' exist, the latter file is the one +that is used. -** Pixel-based scrolling has been implemented. +** New variable `mswindows-meta-activates-menu'. +If you set this variable to nil then pressing and releasing the Alt +key under MS-Windows will no longer activate the menubar. The default +is t. This is not to be confused with `menu-accelerator-enabled', +which enables the use of Alt+ accelerators to invoke the +menus. + +** Pixel-based scrolling has been implemented. By default this will attempt to scroll in increments equal to the -height of the default face. Set `window-pixel-scroll-increment' to +height of the default face. Set `window-pixel-scroll-increment' to modify this behaviour. +** Operation progress can be displayed using graphical widgets. +See `lprogress-display' for details. This support has been switched +on by default for font-lock and some web browsing functions. If you +do not like this behaviour set `progress-display-use-echo-area'. + ** Etags changes. +** The PostgreSQL Relational Database Management System is now supported. +It is now possible to build XEmacs so that the programming interface +to the PostgreSQL RDBMS (libpq) is available in XEmacs Lisp. +Supported versions of PostgreSQL are 6.5.3 (earlier versions may work, +but have not been tested) and 7.0-beta1. + *** In DOS, etags looks for file.cgz if it cannot find file.c. *** New option --ignore-case-regex is an alternative to --regex. It is now @@ -241,15 +300,7 @@ between `temacs' and `xemacs'. This is all very experimental, though. Configure with `--pdump' to -try testing it. NOTE: it is expected that `make' will fail after -dumping `xemacs.dmp'. This is because Makefiles have not yet been -modified to not expect `temacs' producing an `xemacs' executable. You -can try it out by simply running `src/temacs'. If it starts without -failure, the portable dumping worked. - -#### NOTE: the portable dumper is not really usable yet, because the -state of built-in variables is not yet saved. Olivier promised to fix -it. Nag, nag. +try testing it. ** Much effort has been invested to make XEmacs Lisp faster: @@ -295,8 +346,8 @@ buffer. As a side effect subwindow support now works once again. All of this is still fairly experimental and there is no -documentation. The current APIs might change in a future version of -XEmacs. Some widgets are only available under MS-Windows. See the +documentation. The current APIs might change in a future version of +XEmacs. Some widgets are only available under MS-Windows. See the file glyphs-test.el in the XEmacs src distribution for examples of usage. @@ -443,6 +494,21 @@ global obarray. `keywordp' used to wrongly return t in both cases above. +** New variables `this-command-properties' and +`last-command-properties' are now available for communication between +consecutive commands. Commands should use these to communicate with +the pre/post-command hooks, subsequent commands, wrapping commands, +etc. in preference to looking at and/or setting `this-command'. + +** New functions `add-one-shot-hook' and `add-local-one-shot-hook' make +it possible to add a "one-shot" hook, which is to say a hook that runs +only once, and automatically removes itself after the first time it +has run. + +** The descriptor that specifies the text of a menu item can now be an +evaluated expression. This makes this descriptor parallel with +others, which can also be expressions. + * Changes in XEmacs 21.0 ======================== diff -r 9f011ab08d48 -r 2f8bb876ab1d etc/TUTORIAL.fr --- a/etc/TUTORIAL.fr Mon Aug 13 11:15:00 2007 +0200 +++ b/etc/TUTORIAL.fr Mon Aug 13 11:16:07 2007 +0200 @@ -1,9 +1,9 @@ -Copyright (c) 1997, Didier Verna . +Copyright (c) 1997-2000, Didier Verna . Se reporter à la fin du document pour les conditions. Vous lisez actuellement la version française du tutoriel d'Emacs. -Cette version a été produite à partir de la version anglaise, qui est +Cette version a été produite à partir de la version anglaise, qui est Copyright (c) 1985, 1996 Free Software Foundation, Inc. @@ -29,7 +29,7 @@ NOTE IMPORTANTE: pour quitter Emacs, tapez C-x C-c (deux caractères). -Quand vous trouvez les caractères >> au début d'une ligne, cette ligne +Quand vous trouvez les caractères >> au début d'une ligne, cette ligne vous donne des directives pour essayer une commande. Par exemple: <> >> Maintenant, tapez C-v («view next screen») pour passer à l'écran @@ -37,7 +37,7 @@ enfoncée et tapez 'v'). À partir de maintenant, refaites la même chose quand vous avez fini de lire tout l'écran. -Remarquez que quand vous changez d'écran, les deux dernières lignes de +Remarquez que quand vous changez d'écran, les deux dernières lignes de l'écran précédent sont conservées, ceci afin de conserver un minimum de continuité dans la lecture. @@ -70,7 +70,7 @@ * MOUVEMENTS DE BASE DU CURSEUR ------------------------------- -Passer d'un écran à l'autre, c'est bien ... mais comment faire pour se +Passer d'un écran à l'autre, c'est bien ... mais comment faire pour se déplacer dans le texte d'un seul écran? Il existe plusieurs manières de faire. La plus simple est d'utiliser @@ -98,8 +98,8 @@ >> Amenez le curseur sur cette ligne avec quelques C-n. ->> Déplacez vous sur la ligne avec des C-f, puis vers le haut avec des - C-p. Remarquez ce que fait C-p quand le curseur est au milieu de la +>> Déplacez vous sur la ligne avec des C-f, puis vers le haut avec des + C-p. Remarquez ce que fait C-p quand le curseur est au milieu de la ligne. Chaque ligne de texte se termine avec un caractère nommé Newline, qui @@ -125,7 +125,7 @@ se passe. Si vous trouvez que le déplacement caractère par caractère est trop -lent, vous pouvez vous déplacer mot par mot. M-f et M-b vous déplacent +lent, vous pouvez vous déplacer mot par mot. M-f et M-b vous déplacent respectivement d'un mot en avant et en arrière. >> Tapez quelques M-f et M-b. @@ -143,7 +143,7 @@ commandes Control agissent sur des unités plus primaires (caractères, lignes etc.). -Ce parallèle existe encore entre les lignes et les phrases: C-a et C-e +Ce parallèle existe encore entre les lignes et les phrases: C-a et C-e vous positionnent au début ou à la fin d'une ligne, tandis que M-a et M-e vous déplacent au début ou à la fin d'une phrase. @@ -157,7 +157,7 @@ «point». En d'autres termes, le curseur à l'écran se trouve où le point est dans le texte. -Voici un résumé des commandes simples de déplacement, y compris celles +Voici un résumé des commandes simples de déplacement, y compris celles relatives aux mots et aux phrases: C-f En avant d'un caractère @@ -203,21 +203,21 @@ déplacement plus complexes. La plupart des commandes d'Emacs acceptent un argument numérique, qui -sert souvent comme compteur de répétition. Pour donner un tel argument +sert souvent comme compteur de répétition. Pour donner un tel argument à une fonction, tapez C-u puis les chiffres, et enfin entrez la commande. Si vous disposez de la touche (ou ou ), vous pouvez aussi tapez directement les chiffres tout en maintenant la -touche enfoncée. Il est préférable d'apprendre la méthode C-u car +touche enfoncée. Il est préférable d'apprendre la méthode C-u car elle fonctionne sur tous les terminaux. Par exemple, C-u 8 C-f vous déplace de huit caractères en avant. - + >> Essayez d'utiliser C-n avec un argument numérique pour vous déplacer d'un seul coup sur une autre ligne. Certaines commandes n'interprètent pas leur argument numérique comme -un compteur de répétition. C'est le cas de C-v et M-v qui déplacent le -texte d'autant de lignes plutôt que d'écrans entiers. Par exemple, C-u +un compteur de répétition. C'est le cas de C-v et M-v qui déplacent le +texte d'autant de lignes plutôt que d'écrans entiers. Par exemple, C-u 4 C-v déroulera l'écran de 4 lignes. >> Essayez C-u 8 C-v. @@ -253,14 +253,14 @@ , celles-ci vous déplaceront d'écran en écran comme C-v et M-v. Toutes ces commandes acceptent des arguments numériques comme décrit -précédemment. +précédemment. * QUAND EMACS EST BLOQUÉ ------------------------ Si jamais Emacs ne répond plus à vos ordres, vous pouvez l'arrêter en -toute sécurité en tapant C-g. C-g peut aussi être utilisé pour stopper +toute sécurité en tapant C-g. C-g peut aussi être utilisé pour stopper une commande qui met trop de temps à s'exécuter. C-g sert également à annuler un argument numérique, ou une commande @@ -271,7 +271,7 @@ Maintenant, tapez C-f. Le curseur doit finalement ne bouger que d'un seul caractère, puisque vous avez annulé l'argument. -Si vous avez tapé un par erreur, vous pourrez toujours l'annuler +Si vous avez tapé un par erreur, vous pourrez toujours l'annuler avec C-g. @@ -296,12 +296,12 @@ Emacs peut afficher plusieurs fenêtres, chacune avec un texte différent. Le terme «fenêtre» signifie ici une zone particulière dans -la fenêtre d'Emacs; il ne s'agit pas de fenêtres pouvant se superposer +la fenêtre d'Emacs; il ne s'agit pas de fenêtres pouvant se superposer dans votre système de multifenétrage. Emacs peut aussi ouvrir -plusieurs fenêtres X (appelées «frames» en jargon Emacsien), mais ceci +plusieurs fenêtres X (appelées «frames» en jargon Emacsien), mais ceci est décrit ultérieurement. -Pour l'instant, mieux vaut ne pas trop s'occuper de plusieurs fenêtres +Pour l'instant, mieux vaut ne pas trop s'occuper de plusieurs fenêtres simultanées, sauf peut-être pour savoir les éliminer toutes sauf une. Ceci est effectué par la commande C-x 1 ('un', pas 'L'). Cette commande tue toutes les fenêtres sauf celle dans laquelle vous vous @@ -335,7 +335,7 @@ temps! Plus généralement, efface le caractère situé juste avant le -curseur. +curseur. >> Maintenant, tapez quelques caractères, puis effacez-les avec . Ne vous inquiétez pas pour le contenu de ce tutoriel, ce @@ -364,11 +364,11 @@ >> Tapez pour réinsérer le Newline que vous avez effacé. Rappelez-vous bien que la plupart des commandes acceptent un argument -numérique, y compris l'insertion de caractères: +numérique, y compris l'insertion de caractères: >> Tapez C-u 8 *, vous obtiendrez "********". -Vous connaissez maintenant les commandes de base pour insérer du texte +Vous connaissez maintenant les commandes de base pour insérer du texte et corriger des erreurs. Toujours grâce aux touches et , vous pouvez aussi effacer du texte par mot ou par ligne: @@ -386,7 +386,7 @@ texte pour vous donner la possibilité de le réintroduire. L'opération de réintroduction s'appelle le «yanking». Vous pouvez réintroduire le texte à la même place ou ailleurs. Vous pouvez même le réintroduire -plusieurs fois, pourquoi pas à des endroits différents. La commande de +plusieurs fois, pourquoi pas à des endroits différents. La commande de «yanking» est C-y. Notez bien la différence entre «effacer» et «supprimer». Un texte @@ -396,7 +396,7 @@ >> Placez le curseur au début d'une ligne non vide. Tapez C-k pour supprimer le texte sur cette ligne. ->> Tapez C-k une deuxième fois. Vous remarquerez que cette fois-ci, la +>> Tapez C-k une deuxième fois. Vous remarquerez que cette fois-ci, la ligne elle-même est supprimée (le caractère Newline). C-k traite son argument numérique de manière spéciale: il supprime @@ -455,7 +455,7 @@ Une alternative à C-x u est C-_. C-x u existe car c'est plus facile à taper sur certains claviers. Sur d'autres vous pouvez également -obtenir C-_ en tapant C-/. +obtenir C-_ en tapant C-/. Enfin, la commande d'annulation accepte les argument numériques. @@ -466,18 +466,18 @@ Pour sauver votre texte, vous avez besoin de le mettre dans un fichier, sans quoi il disparaîtra quand vous quitterez Emacs. On dit «trouver» un fichier («finding»), ou encore «visiter» un fichier -(«visiting»), ou bien «ouvrir». +(«visiting»), ou bien «ouvrir». Visiter un fichier revient à voir son contenu dans Emacs. Si vous -modifiez le texte du fichier dans Emacs, ces changements ne deviennent -pas permanent, sauf si vous «sauvez» le fichier. Cela permet de ne pas +modifiez le texte du fichier dans Emacs, ces changements ne deviennent +pas permanent, sauf si vous «sauvez» le fichier. Cela permet de ne pas avoir des fichiers à moitié modifiés sur votre système, à moins que vous ne le souhaitiez vraiment. D'autre part, quand Emacs «sauve» un -fichier, il commence par copier l'ancienne version sous un nouveau nom +fichier, il commence par copier l'ancienne version sous un nouveau nom afin que vous puissiez toujours revenir en arrière. Regardez en bas de la fenêtre d'Emacs. Vous trouverez une ligne -contenant des tirets '-', et la chaîne de caractères +contenant des tirets '-', et la chaîne de caractères «Emacs: TUTORIAL.FRANCAIS». Cela vous donne le nom du fichier que vous êtes en train de visiter. En ce moment, vous visitez le fichier «TUTORIAL.FRANCAIS» qui correspond au Tutoriel d'Emacs, version @@ -501,14 +501,14 @@ manière, on l'appelle «minibuffer». Les commandes d'édition ordinaires peuvent être utilisées pour éditer le nom du fichier. -Pendant que vous êtes en train de taper le nom du fichier, vous pouvez +Pendant que vous êtes en train de taper le nom du fichier, vous pouvez annuler la commande grâce à C-g. >> Tapez C-x C-f puis C-g. Cela annule le minibuffer ainsi que la commande C-x C-f. Vous n'allez finalement pas visiter de fichier. Quand le nom du fichier est correct, tapez . La commande -prendra alors effet et ira chercher le fichier. Après avoir terminé la +prendra alors effet et ira chercher le fichier. Après avoir terminé la saisie du nom, le minibuffer disparaît. Au bout d'un petit moment, le contenu du fichier apparaît et vous @@ -519,7 +519,7 @@ Cette commande copie le texte contenu dans Emacs vers le fichier lui-même. La première fois que vous le faites, Emacs sauvegarde la -version initiale du fichier sous un autre nom, en ajoutant un '~' à la +version initiale du fichier sous un autre nom, en ajoutant un '~' à la fin du nom. Quand la sauvegarde est terminée, Emacs affiche le nom du fichier dans @@ -528,17 +528,17 @@ système (non pas qu'Emacs ne puisse jamais crasher lui-même ...). >> Tapez C-x C-s pour sauver votre copie du tutoriel. - Vous devriez voir apparaître «Wrote ...TUTORIAL.FRANCAIS" tout en bas + Vous devriez voir apparaître «Wrote ...TUTORIAL.FRANCAIS" tout en bas de la fenêtre. NOTE: Sur certains systèmes, C-x C-s bloque l'écran et Emacs ne dit plus rien. Cela signifie qu'une «fonctionnalité» système que l'on -appelle le «flow control» intercepte le C-s et l'empêche de parvenir à +appelle le «flow control» intercepte le C-s et l'empêche de parvenir à Emacs. Pour débloquer la situation, tapez C-q. Reportez-vous dans ce cas à la section «Spontaneous Entry to Incremental Search» du manuel -d'Emacs pour plus d'information sur cette ... «particularité». +d'Emacs pour plus d'information sur cette ... «particularité». -Vous pouvez visiter des fichiers existant, mais aussi des fichiers qui +Vous pouvez visiter des fichiers existant, mais aussi des fichiers qui n'existent pas. C'est en fait comme cela que l'on crée un nouveau fichier dans Emacs. Initialement, le fichier sera inexistant, et la première fois que vous demanderez à Emacs de le sauver, il créera @@ -572,7 +572,7 @@ C-b. Par contre, TOUT texte que vous pouvez voir dans Emacs appartient à un buffer. ->> Tapez C-x 1 pour faire disparaître le buffer contenant la liste des +>> Tapez C-x 1 pour faire disparaître le buffer contenant la liste des buffers. Quand vous éditez un fichier, puis que vous en ouvrez un autre, le @@ -608,7 +608,7 @@ Remarquez qu'il existe des boutons n'ayant aucun équivalent clavier. Par exemple, le menu «Buffers» donne la liste de tous les -buffers par ordre de plus récente utilisation. Vous pouvez passer d'un +buffers par ordre de plus récente utilisation. Vous pouvez passer d'un buffer à l'autre en les sélectionnant par leur nom dans ce menu. @@ -622,12 +622,12 @@ cliquant le bouton de gauche au début de la portion à sélectionner, puis en Shift-cliquant à l'autre bout. -Pour supprimer un morceau de texte, utilisez C-w ou le bouton «Cut» du +Pour supprimer un morceau de texte, utilisez C-w ou le bouton «Cut» du menu «Edit». Notez bien que ces deux commandes ne sont pas -équivalentes: C-w ne fait que supprimer le texte en le sauvegardant de +équivalentes: C-w ne fait que supprimer le texte en le sauvegardant de manière interne (comme C-k), mais «Cut» sauvegarde en plus le texte dans le clipboard de X Window, où il pourra être accédé par d'autres -applications. +applications. Pour récupérer du texte en provenance d'autres applications, utilisez «Paste» du menu «Edit». @@ -664,11 +664,11 @@ Ces commandes, bien que très utiles, sont utilisées moins souvent que celles que vous avez déjà apprises. Vous en connaissez déjà deux: les commandes relatives aux fichiers (C-x C-f et C-x C-s). Un autre -exemple est la commande pour quitter définitivement Emacs, C-x C-c (ne +exemple est la commande pour quitter définitivement Emacs, C-x C-c (ne vous inquiétez pas des éventuels changements qui seraient perdus, C-x C-c vous propose de sauver ces changements avant de tuer Emacs). -C-z est la commande qui vous permet de quitter Emacs «temporairement», +C-z est la commande qui vous permet de quitter Emacs «temporairement», pour que vous puissiez y revenir plus tard. Sur les systèmes le permettant, C-z «suspend» Emacs, ce qui signifie @@ -688,7 +688,7 @@ des circonstances où vous ne vous déloguez pas, mieux vaut suspendre par C-z au lieu de sortir véritablement d'Emacs. -Il existe de nombreuses commandes sous C-x. Voici celles que vous avez +Il existe de nombreuses commandes sous C-x. Voici celles que vous avez apprises jusque là: C-x C-f Visiter un fichier (Find File). @@ -702,7 +702,7 @@ commande «replace-string» substitue globalement une chaîne de caractères par une autre. Si vous tapez M-x, Emacs vous affichera M-x en bas de la fenêtre et vous pourrez alors taper le nom d'une -commande, ici replace-string. Tapez simplement 'repl s ' +commande, ici replace-string. Tapez simplement 'repl s ' et Emacs complétera le nom pour vous. Terminez le nom avec La commande replace-string requiert deux arguments: la chaîne à @@ -710,12 +710,12 @@ chaînes par . >> Déplacez le curseur sur la ligne blanche en dessous de ce - paragraphe, puis tapez - M-x replsRemarquezNotez. + paragraphe, puis tapez + M-x replsRemarquezNotez. Remarquez comme cette ligne a changé: le mot R-e-m-a-r-q-u-e-z a été remplacé par N-o-t-e-z partout où il est apparu après le - curseur. + curseur. * SAUVEGARDE AUTOMATIQUE @@ -749,15 +749,15 @@ La ligne juste au dessus de la zone d'écho s'appelle ligne de mode («modeline»). Elle dit actuellement quelque chose comme ça: ---**-XEmacs: TUTORIAL.FRANCAIS (Fundamental)--L752--67%--------- +--**-XEmacs: TUTORIAL.FRANCAIS (Fundamental)--L752--67%--------- -Cette ligne fournit des renseignements utiles sur le status d'Emacs et +Cette ligne fournit des renseignements utiles sur le status d'Emacs et le texte que vous éditez. Vous connaissez déjà la signification du nom de fichier: c'est celui -que vous êtes en train d'éditer. -xx%- indique le pourcentage de texte +que vous êtes en train d'éditer. -xx%- indique le pourcentage de texte situé au dessus du curseur. Si vous pouvez voir le début du fichier à -l'écran, --Top-- sera indiqué au lieu de --00%--. Si le bas du fichier +l'écran, --Top-- sera indiqué au lieu de --00%--. Si le bas du fichier est visible, il y aura --Bot-- à la place. Si votre texte est tout entier contenu dans la fenêtre, vous verrez --All--. @@ -793,7 +793,7 @@ comme faisant partie des mots. Auparavant, ces caractères étaient considérés comme des séparateurs de mots. En général, les modes majeurs ne changent que très peu le comportement des commandes -habituelles. +habituelles. Pour voir la documentation du mode majeur courant, tapez C-h m. @@ -808,7 +808,7 @@ désactivés indépendamment du mode majeur courant. Vous pouvez en utiliser autant que possible en même temps. -Un mode mineur très utile pour éditer du texte est le mode +Un mode mineur très utile pour éditer du texte est le mode «Auto Fill». Quand ce mode est activé, Emacs coupe lui-même les lignes si vous tapez du texte trop long pour être contenu sur une seule. @@ -828,7 +828,7 @@ Tapez du texte jusqu'à ce que la ligne soit coupée, puis replacez la marge à 70. -Si vous faites des changements au milieu d'un paragraphe, le mode Auto +Si vous faites des changements au milieu d'un paragraphe, le mode Auto Fill ne recoupera pas les lignes tout seul. Pour réajuster les lignes d'un tel paragraphe, tapez M-q avec le curseur n'importe où dans le paragraphe. @@ -847,7 +847,7 @@ La commande de recherche d'Emacs est un peu différente de celle des autres éditeurs de texte dans la mesure où elle est incrémentale: la recherche intervient au fur et à mesure que vous tapez la chaîne à -rechercher. +rechercher. Pour démarrer une recherche, tapez C-s (en avant) ou C-r (en arrière). MAIS PAS TOUT DE SUITE !! Attendez un peu pour tester ... @@ -872,10 +872,10 @@ NOTE: Sur certains systèmes, C-x C-s bloque l'écran et Emacs ne dit plus rien. Cela signifie qu'une «fonctionnalité» système que l'on -appelle le «flow control» intercepte le C-s et l'empêche de parvenir à +appelle le «flow control» intercepte le C-s et l'empêche de parvenir à Emacs. Pour débloquer la situation, tapez C-q. Reportez-vous dans ce cas à la section «Spontaneous Entry to Incremental Search» du manuel -d'Emacs pour plus d'information sur cette ... «particularité». +d'Emacs pour plus d'information sur cette ... «particularité». Si vous êtes au milieu d'une recherche incrémentale et que vous tapez , vous constaterez que le dernier caractère de la chaîne est @@ -923,7 +923,7 @@ C-M-v (ou C-v si vous n'avez pas de touche ) est un exemple de Control-Méta caractère. L'ordre dans lequel les touches - et sont enfoncées n'a pas d'importance. Ce sont juste + et sont enfoncées n'a pas d'importance. Ce sont juste des modificateurs. Par contre, n'est pas un modificateur, donc vous êtes obligés de taper d'abord , et C-v ensuite. @@ -959,7 +959,7 @@ l'utiliser pour sortir du minibuffer ou éliminer des fenêtres superflues. ->> Tapez M-x pour vous rendre dans le minibuffer, puis tapez +>> Tapez M-x pour vous rendre dans le minibuffer, puis tapez pour en sortir. Il n'est pas possible d'utiliser C-g pour sortir d'un niveau récursif @@ -985,7 +985,7 @@ vous ne désirez finalement pas d'aide après avoir tapé C-h, tapez simplement C-g. -(Quelques sites redéfinissent la commande C-h. Cela ne devrait vraiment +(Quelques sites redéfinissent la commande C-h. Cela ne devrait vraiment pas être fait, donc allez vous plaindre à votre administrateur système. Si C-h ne marche pas, tapez M-x help.) @@ -994,7 +994,7 @@ la commande en question. >> Tapez C-h c C-p. - Le message doit ressembler à quelque chose comme + Le message doit ressembler à quelque chose comme C-p runs the command previous-line @@ -1041,11 +1041,11 @@ Ce tutoriel est fait pour être compréhensible par tout nouvel utilisateur. Donc si quelque chose n'est pas clair, n'hésitez pas à -vous plaindre !! +vous plaindre !! Si vous avez plus particulièrement des remarques à faire sur la version française, vous pouvez aussi me contacter directement -(Didier Verna ). +(Didier Verna ). COPIES / DISTRIBUTION @@ -1057,7 +1057,7 @@ Cracraft. * Ben Wing l'a mis à jour pour X Windows. * Martin Buchholz et Hrvoje Niksic y ont apporté des corrections pour - XEmacs. + XEmacs. * J'en (Didier Verna) ai fait une version française un beau jour de 1997. Cette version du tutoriel, tout comme Emacs, est copyrightée, et vous @@ -1082,4 +1082,3 @@ COPYING et à distribuer Emacs à vos amis. Aidez-nous à tuer l'obstructionnisme logiciel en utilisant, écrivant et partageant du logiciel libre! - diff -r 9f011ab08d48 -r 2f8bb876ab1d lib-src/ChangeLog --- a/lib-src/ChangeLog Mon Aug 13 11:15:00 2007 +0200 +++ b/lib-src/ChangeLog Mon Aug 13 11:16:07 2007 +0200 @@ -1,3 +1,22 @@ +2000-03-20 Martin Buchholz + + * XEmacs 21.2.32 is released. + +2000-03-20 Martin Buchholz + + * make-dump-id.c: Use config.h and systime.h for portability. + +2000-02-20 Olivier Galibert + + * make-dump-id.c: Added. + + * Makefile.in.in: Add support for make-dump-id. + +2000-03-12 Ben Wing + + * etags.c (canonicalize_filename): fixed a problem with gratuitous + capitalization of file names under MS Windows. + 2000-02-23 Martin Buchholz * XEmacs 21.2.31 is released. diff -r 9f011ab08d48 -r 2f8bb876ab1d lib-src/Makefile.in.in --- a/lib-src/Makefile.in.in Mon Aug 13 11:15:00 2007 +0200 +++ b/lib-src/Makefile.in.in Mon Aug 13 11:16:07 2007 +0200 @@ -375,6 +375,9 @@ make-po: ${srcdir}/make-po.c $(CC) $(cflags) ${srcdir}/make-po.c $(ldflags) -o $@ +make-dump-id: ${srcdir}/make-dump-id.c + $(CC) $(cflags) ${srcdir}/make-dump-id.c $(ldflags) -o $@ + cflags_gnuserv = $(CFLAGS) $(cppflags) $(c_switch_all) ldflags_gnuserv = $(LDFLAGS) $(ld_switch_all) @libs_xauth@ $(ld_libs_general) gnuslib.o: ${srcdir}/gnuslib.c ${srcdir}/gnuserv.h ../src/config.h diff -r 9f011ab08d48 -r 2f8bb876ab1d lib-src/etags.c --- a/lib-src/etags.c Mon Aug 13 11:15:00 2007 +0200 +++ b/lib-src/etags.c Mon Aug 13 11:16:07 2007 +0200 @@ -5457,7 +5457,7 @@ { #ifdef DOS_NT /* Canonicalize drive letter case. */ - if (islower (fn[0])) + if (islower (fn[0]) && fn[1] == ':') fn[0] = toupper (fn[0]); /* Convert backslashes to slashes. */ for (; *fn != '\0'; fn++) diff -r 9f011ab08d48 -r 2f8bb876ab1d lib-src/make-dump-id.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib-src/make-dump-id.c Mon Aug 13 11:16:07 2007 +0200 @@ -0,0 +1,59 @@ +/* Generate a unique dump-id for use with the portable dumper. + Copyright (C) 2000 Olivier Galibert, Martin Buchholz + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include +#include +#include +#include "../src/systime.h" + +/* Generates an (extremely) pseudo random number for the dump-id */ +static unsigned int +generate_dump_id (void) +{ + EMACS_TIME thyme; + EMACS_GET_TIME (thyme); + + return (unsigned int) (EMACS_SECS (thyme) ^ EMACS_USECS (thyme)); +} + +int +main (int argc, char *argv[]) +{ + FILE *f; + + if ((f = fopen ("dump-id.c", "w")) == NULL) + { + perror ("open dump-id.c"); + return EXIT_FAILURE; + } + + fprintf (f, + "#include \n" + "unsigned int dump_id = %uU;\n", + generate_dump_id ()); + + if ((fclose (f)) != 0) + { + perror ("close dump-id.c"); + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/ChangeLog --- a/lisp/ChangeLog Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/ChangeLog Mon Aug 13 11:16:07 2007 +0200 @@ -1,3 +1,482 @@ +2000-03-20 Martin Buchholz + + * XEmacs 21.2.32 is released. + +2000-03-20 Andy Piper + + * gutter-items.el (update-tab-in-gutter): force selection of the + selected-window if required to do so. + (buffers-tab-items): ditto. + (add-tab-to-gutter): ditto. + (create-frame-hook): use force-selection. + (default-gutter-position-changed): lambdify. + (update-tab-hook): deleted since it was only used in one place. + +2000-03-18 Andy Piper + + * files.el (find-file-noselect): undo change that shouldn't have + gone in. + +2000-03-17 Andy Piper + + * buffer.el (switch-to-buffer): use last-nonminibuf-window instead + of selected-window trickery. + + * gutter-items.el (update-tab-in-gutter): don't give dedicated + frames tabs. + (progress-display-stop-callback): progress -> progress-display + (progress-display-quit-function): ditto. + (clear-progress-display): ditto. + (remove-progress-display): ditto. + (append-progress-display): ditto. + (abort-progress-display): ditto. + (raw-append-progress-display): ditto. + (display-progress-display): ditto. + (current-progress-display-label): ditto. + (current-progress-display): ditto. + (lprogress-display): ditto and save the buffer + (progress-display): ditto. Otherwise the buffer sometimes gets + changed which confuses font-lock. + + * font-lock.el (font-lock-default-fontify-buffer): catch all + errors, not just quit. + (font-lock-mode): progress -> display-progress + (font-lock-default-fontify-buffer): ditto. + (font-lock-fontify-syntactically-region): ditto. + (font-lock-fontify-keywords-region): ditto. + +2000-03-14 Hrvoje Niksic + + * cl.el (gensym): Move to here from cl-macs.el. + (gentemp): Ditto. + +2000-03-16 Andy Piper + + * font-lock.el (font-lock-mode): use lprogress and friends for + progress management. + (font-lock-default-fontify-buffer): ditto. + (font-lock-fontify-syntactically-region): ditto. + (font-lock-fontify-keywords-region): ditto. + (font-lock-revert-cleanup): fix reverting. + (font-lock-revert-setup): ditto. + + * gutter-items.el (progress-use-echo-area): new variable. Use the + echo area for progress gauges if non-nil. + (clear-progress): remove echo area stuff and defer to + clear-message. + (append-progress): dispatch non-command events after each progress + increment. Remove echo area stuff. + (abort-progress): remove echo area stuff and defer to + display-message. + (raw-append-progress): ditto. Dispatch non-command events after + gutter redisplay. + (display-progress): defer echo area stuff to display-message. + + * gutter-items.el (clear-progress): + (abort-progress): indentation changes. + (display-progress): don't clear progress. + (append-progress): compare messages with equal. + (raw-append-progress): use dispatch-non-command-events to flush + widget creation events. + +2000-03-13 Ben Wing + + * abbrev.el: + * abbrev.el (abbrev-string-to-be-defined): New. + * abbrev.el (inverse-abbrev-string-to-be-defined): New. + Changes for use with the menubar. + +2000-03-12 Ben Wing + + * alist.el (vassoc): moved here from font-menu.el. + + * custom.el (defface): typo fix. + + * dialog.el (yes-or-no-p-dialog-box): + * dialog.el (message-box): + * files.el (save-some-buffers-1): + Put accelerators in the button names. + + * font-lock.el (font-lock-comment-face): + * font-lock.el (font-lock-keyword-face): + * font-lock.el (font-lock-function-name-face): + Fixed some of the colors under MS Windows because the existing + default colors were hardly different from black and needed to be + made lighter. + + * font-menu.el: + * font-menu.el (font-menu-split-long-menu): + * font-menu.el (font-menu-family-constructor): + * font-menu.el (font-menu-size-constructor): + * font-menu.el (font-menu-weight-constructor): + * font-menu.el (font-menu-set-font): + vassoc moved to alist.el. + Accelerators added to all menus. + Unused bound var new-props removed. + + * keydefs.el: I did a whole lot of rearranging to put things in a + more consistent order and fixed a number of cases where key + combinations involving up, down, left, right and so on were + defined but the corresponding keypad combinations were not + defined. + + * lisp-mode.el: + * lisp-mode.el (lisp-interaction-mode-popup-menu): + * lisp-mode.el (emacs-lisp-mode): + * lisp-mode.el (lisp-interaction-mode): + * lisp-mode.el (flet): + Added accelerators onto the menus. + Made all the different versions of the let function be indented + the same way. + Undid Steve's easy-menu-ification, because it makes it impossible + to have the menubar and popup menus different. + Cleaned up the menu; added items for find-function &c and some + indenting, and removed debug-on-*. + + * list-mode.el (list-mode-hook): + * list-mode.el (list-mode): + * list-mode.el (completion-setup-hook): + * list-mode.el (display-completion-list): + Added support for the :window-height keyword, which is required + because of other changes that I made for the file dialog box. I + also made the hook variables list-mode-hook and + completion-setup-hook and also minibuffer-setup-hook in + minibuf.el be permanent-local; see comment in list-mode.el. + + * map-ynp.el (map-y-or-n-p): + Added accelerators to the dialog buttons. + + * menubar-items.el (menu-truncate-list): + New internal function. + * menubar-items.el (submenu-generate-accelerator-spec): + * menubar-items.el (menu-item-strip-accelerator-spec): + * menubar-items.el (menu-item-generate-accelerator-spec): + New exported functions, for use in auto-generating accelerator specs. + + * menubar-items.el: + * menubar-items.el (default-menubar): + * menubar-items.el (maybe-add-init-button): + * menubar-items.el (bookmark-menu-filter): + * menubar-items.el (slow-format-buffers-menu-line): + * menubar-items.el (build-buffers-menu-internal): + * menubar-items.el (language-environment-menu-filter): + * menubar-items.el (default-popup-menu): + * menubar-items.el (popup-buffer-menu): + * menubar-items.el (popup-menubar-menu): + Did a major overhaul on this file, and in fact I'm nowhere near + done working on the menubar, and there will be more patches to + come. A basic summary of what I've done: + + a) I added accelerators to all of the menu items. For menus that + are auto-generated, such as the buffers menu, the accelerators are + automatically added to the beginning of each line using the + numbers 1 through 9, then zero, and then letters starting with A, + but omitting the letters that are already in use for the fixed + menu items at the top of the buffers menu. To facilitate adding + accelerators of this kind, I created some new functions + (*-accelerator-spec), which are also being used by other filters + that auto generate lists of things such as ftp sites to download + packages. If people really don't like these accelerators + appearing at the beginning of the menu items, a variable can be + added to optionally turn them off, but I think this is rather + pointless because other menu items have accelerators and many or + most of the menu users will use the accelerators if the support is + there. + + b) I combined the top level Tools and Apps menus into a single + Tools menu, because the distinction between the two is not + obvious, and the items on the menus are not used often enough that + putting some of them onto submenus is a problem. + + c) I created two new top level menus called View and Cmds because + there were too many items on the File and Edit menus, and I'm going + to be adding more items to these menus. In contrast to the Tools + menu, the items on these menus may be used quite often during an + editing session, and so should be available with fewer + keystrokes. + + d) I added a number of options to the options menu, including one + for controlling whether the alt key can be used to traverse to + menu items using the accelerators, one for controlling behavior of + control-k, one for controlling how the kill and yank functions + interact with the clipboard, a few additional buffers-menu + options, and various other things. I also did a bit of + rearranging, for example, combining the keyboard and mouse options + into a single keyboard and mouse submenu to facilitate the + accelerators on that level. + + e) I changed the variable buffers-menu-format-buffer-line-function + to take two arguments instead of one, the second argument being + the line number for use in creating an accelerator. I added a + hack to support existing functions with one argument (although I + doubt that very many of these exist), for backward compatibility. + + f) I moved the top level mule menu to be a submenu of the edit + menu. I think that most of the items on this menu are fairly + useless and there are certainly not enough frequently used items + to justify this being its own top level menu. + + g) I combined most of the items in big-menubar.el into the main menu. + If people think the main menu is too big, it would be possible to + create different configurations, some smaller. + + * menubar.el (check-menu-syntax): + Deleted some syntax checks that were no longer valid, partly + because of changes that were already made a long time ago, and + partly because of a change I made where I allow the name of the + menu item to be an evaluated expression rather than just a string, + similar to all of the other parameters of a menu item. + + * minibuf.el: + * minibuf.el (read-file-name-1): + * minibuf.el (mouse-read-file-name-1): + I made a number of changes to improve the appearance + and functioning of the file dialog box. They include: + + a) Fixing the problem where closing the dialog box by clicking on + the close button of the window didn't properly exit the + minibuffer. + + b) Fixing the problem that if you typed part of a file name, and + then clicked on a completion with the mouse, the file was not + correctly selected. + + c) Changing the title of the dialog box to reflect the operation + being done in accordance with user interface conventions, rather + than the name of the dialog box buffer, which is rather useless. + + d) Remove the words "possible completions are" which didn't + belong. + + e) Fix things so that the completions scroll off the end of the + completions windows only to the right, rather than both to the + right and down, which is in accordance with Windows user interface + conventions. + + * msw-init.el (init-post-mswindows-win): + Added a binding for meta-F4, which is the standard windows binding + for exiting a program. + + * select.el (get-selection-no-error): + * select.el (own-selection): + * select.el (own-clipboard): + Added an optional argument called append to the functions + own-selection and own-clipboard. This adds support for appending + text to the existing selection and allows the function + own-clipboard to be used as the value of the variable + interprogram- cut-function. + + Fixed a bug in own-selection in handling zmacs-region-stays. + + * simple.el (historical-kill-line): New. + + * simple.el (kill-line): + * simple.el (interprogram-cut-function): + * simple.el (interprogram-paste-function): + * simple.el (handle-pre-motion-command): + * simple.el (next-line): + * simple.el (previous-line): + a) Expanded the variable kill-whole-line, so that function + kill-line can be set to delete the entire line always, not just + when cursor is at the beginning of the line. This is controlled + by setting the variable kill-whole-line to the symbol 'always. + This behavior, as well as the existing kill-whole-line behavior, + now only take effect when kill-line is called interactively, + although this is a departure from a previous behavior in the case + of setting this variable kill-whole-line to t. It is almost + certainly what has always been intended, and most likely the old + way of doing things introduced bugs. I also created a function + called historical-kill-line, which ignores the kill-whole-line + setting and always gives the historical behavior of only killing + to the end of the line. I bound this function to shift- control-k + so that the kill to end of line behavior is available, even when + kill-whole-line has been set to change control-k into the simple + delete-whole-line behavior. (This can be set using the options + menu.) + + b) I changed things so that kill and yank now interact with the + clipboard by default under windows. This was done by changing the + default value of interprogram-cut- function and + interprogram-paste-function. You can get the old behavior by + setting these to nil, and there is an option on the options menu + to do this. + + c) I added support for selecting text using shifted motion keys. + This support is on by default and can be controlled by the + variable shifted-motion-keys-select-region. There is also a + variable called unshifted-motion-keys-deselect-region that + controls more specifically how the shifted motion key behavior + works. I did not put an option on the options menu to turn this + off, because I can't imagine why this would be useful. + + * simple.el (forward-block-of-lines): + * simple.el (backward-block-of-lines): + * simple.el (block-movement-size): + New. + + * simple.el (uncapitalized-title-words): + * simple.el (uncapitalized-title-word-regexp): + * simple.el (capitalize-string-as-title): + * simple.el (capitalize-region-as-title): + New. + + + * subr.el (add-hook): + * subr.el (make-local-hook): New. + * subr.el (remove-local-hook): New. + * subr.el (add-one-shot-hook): New. + * subr.el (add-local-one-shot-hook): New. + Added some functions to make using hooks easier. + These include: + + a) Functions add-local-hook and remove-local-hook to make it easy + to use local hooks. + + b) Functions add-one-shot-hook and add-local-one-shot-hook, which + make it possible to add a "one-shot" hook, which is to say a hook + that runs only once, and automatically removes itself after the + first time it has run. + +2000-03-09 Andy Piper + + * files.el (auto-mode-alist): pick up jsp, jhtml and xml files. + +2000-03-09 Yoshiki Hayashi + + * buff-menu.el (buffers-menu-omit-invisible-buffers): + Moved from menubar-items.el. + * dumped-lisp.el: Dump gutter-items regardless of menubar. + +2000-03-08 Andy Piper + + * gutter-items.el (build-buffers-tab-internal): add selected field + to buffers tab spec. + +2000-03-07 Yoshiki Hayashi + + * minibuf.el (last-exact-completion): Initialize to nil. + +2000-03-07 Didier Verna + + * startup.el (command-line-1): remove unused variable + `first-file-buffer'. + +2000-02-29 Hrvoje Niksic + + * loaddefs.el (completion-ignored-extensions): Removed ".log", + which is also used for Web server log files. + +2000-02-03 IKEYAMA Tomonori + + * mule/mule-charset.el: Setup auto-fill-chars. + +2000-03-02 SL Baur + + * subr.el (with-string-as-buffer-contents): Reimplement using + `with-temp-buffer'. Fixes non-unique buffer name problem, fixes + non-deletion of buffer after execution problem. + (with-output-to-string): Use unique buffer name. + +2000-02-29 Stephen J. Turnbull + + * gutter-items.el (buffers-tab-sort-function): New variable. + (buffers-tab-items): Funcall it to sort the buffer tab list. + +2000-02-29 Stephen J. Turnbull + + * startup.el (load-user-init-file): Merge two `if's to one `or'. + +2000-02-28 Martin Buchholz + + * menubar-items.el (maybe-add-init-button): Remove the "Load + .emacs" button from all menubars. + +2000-03-01 Didier Verna + + * rect.el (string-rectangle): depend on `pending-delete-mode' for + region rectangle replacement (from Jan Vroonhof). + (replace-rectangle): new function. + +2000-01-05 Yoshiki Hayashi + + * mule/mule-cmds.el (set-default-coding-systems): Use + set-terminal-coding-system and set-keyboard-coding-system. + * coding.el (set-terminal-coding-system): Use + set-console-tty-output-coding-system. + (set-keyboard-coding-system): Use + set-console-tty-input-coding-system. + +2000-02-21 Yoshiki Hayashi + + * minibuf.el (read-variable): Allow symbol to default argument. + +>>>>>>> 1.156.2.301 +2000-02-27 Andy Piper + + * gutter-items.el (update-tab-hook): new function to be used for + hooks. + (create-frame-hook): add update-tab-hook. + (record-buffer-hook): ditto. + (default-gutter-position-changed): ditto. + (default-gutter-position): updating the buffers tab is now handled + by a hook. + (default-gutter-position-changed-hook): new variable. + (gutter-element-visibility-changed-hook): ditto. + (set-gutter-element-visible-p): call it. + (set-gutter-element): use modify-specifier-instances. Set extents + as duplicable before using. + (remove-gutter-element): ditto. + (set-gutter-element-visible-p): ditto. + (init-gutter): new function. + (add-tab-to-gutter): use new gutter-element functions rather than + setting specifiers directly. + (clear-progress): ditto. + (abort-progress): ditto. + (gutter-buffers-tab-visible-p): renamed from + default-gutter-visible-p + + * specifier.el (modify-specifier-instances): new function from Jan + Vroonhof. + + * x-init.el (init-post-x-win): call init-gutter. + + * msw-init.el (init-post-mswindows-win): call init-gutter. + + * menubar-items.el (default-menubar): Update to reflect new gutter + variables. + +2000-02-26 Andy Piper + + * gutter-items.el (set-gutter-element): new function. Add gutter + elements to the specified gutter. + (remove-gutter-element): new function. Remove gutter elements from + the specified gutter. + (set-gutter-element-visible-p): new function. Set gutter element + visibility for the provided gutter-visible specifier. + +2000-02-23 Andy Piper + + * gutter-items.el (add-tab-to-gutter): specify dimensions + dynamically. + +2000-02-24 Martin Buchholz + + * gutter-items.el (add-tab-to-gutter): + * package-get.el (package-get-interactive-package-query): + * package-ui.el (pui-directory-exists): + (pui-install-selected-packages): + (pui-list-packages): + Use #'(lambda ...) instead of '(lambda ...). + +2000-02-21 Gregory Neil Shapiro + + * startup.el (load-user-init-file): Check to make sure user + has an init-file before calling load(). + +2000-02-20 Kirill 'Big K' Katsnelson + + * msw-glyphs.el (msgdi-device-p): Added this and 'msgdi specifier tag. + 2000-02-23 Martin Buchholz * XEmacs 21.2.31 is released. @@ -15,9 +494,9 @@ 2000-02-19 Martin Buchholz - * byte-optimize.el (byte-optimize-plus): - (byte-optimize-minus): - (byte-optimize-multiply): + * byte-optimize.el (byte-optimize-plus): + (byte-optimize-minus): + (byte-optimize-multiply): Optimize (- 0) to 0, not (-) Optimize (+ 5 3.0) to 8.0 Optimize (* 5 3.0) to 15.0 @@ -33,8 +512,8 @@ defaults. 2000-02-09 Stef Epardaud - - * font-lock.el: Javadoc enhancements + + * font-lock.el: Javadoc enhancements 1999-11-27 Oscar Figueiredo @@ -44,23 +523,23 @@ Conditionalize message display on ldap-verbose (ldap-add-entries, ldap-modify-entries, ldap-delete-entries): New defuns - (ldap-search): Is now defined as an obsolete wrapper calling + (ldap-search): Is now defined as an obsolete wrapper calling ldap-search-basic or ldap-search-entries -1999-12-06 Hirokazu FUKUI +1999-12-06 Hirokazu FUKUI Shuhei KOBAYASHI Jan Vroonhof - - * byte-optimize.el (byte-optimize-form-code-walker): Fixed. - When for-effect is true, didn't call `byte-optimize-form' - in and/or subforms without last. - -1999-12-07 Jan Vroonhof - - * package-get.el (package-get-download-sites): Use correct custom - type. - + + * byte-optimize.el (byte-optimize-form-code-walker): Fixed. + When for-effect is true, didn't call `byte-optimize-form' + in and/or subforms without last. + +1999-12-07 Jan Vroonhof + + * package-get.el (package-get-download-sites): Use correct custom + type. + 2000-02-15 Kirill 'Big K' Katsnelson * files.el (write-file): Ask for coding system when compiled with @@ -80,7 +559,7 @@ unexist function to help-map. (describe-coding-system): Don't use already assigend `C'. -2000-01-23 Björn Torkelsson +2000-01-23 Bjrn Torkelsson * info.el (Info-save-auto-generated-dir): nil -> 'never to make it work in custom. @@ -116,7 +595,7 @@ part of the tag entry first instead of only looking in the context area. -2000-01-23 Björn Torkelsson +2000-01-23 Bjrn Torkelsson * gutter-items.el: fixed typo(s) in customizing default-gutter-position * toobar.el: fixed typo(s) in customizing default-toolbar-position @@ -149,7 +628,7 @@ 2000-02-02 Per Abrahamsen * wid-edit.el (widget-match-inline): An atom never matches a - list. + list. 2000-01-29 Kirill 'Big K' Katsnelson @@ -173,9 +652,9 @@ 2000-01-28 Martin Buchholz - * coding.el (dontusethis-set-value-file-name-coding-system-handler): - (dontusethis-set-value-terminal-coding-system-handler): - (dontusethis-set-value-keyboard-coding-system-handler): + * coding.el (dontusethis-set-value-file-name-coding-system-handler): + (dontusethis-set-value-terminal-coding-system-handler): + (dontusethis-set-value-keyboard-coding-system-handler): Never undefine coding system aliases. Emergency fix for gnus. 2000-01-26 Hrvoje Niksic @@ -216,20 +695,20 @@ * process.el (shell-quote-argument): Use (nt-quote-process-args) for windows-nt. - * version.el: - * startup.el (user-init-file-base): - * process.el (call-process-region): - * files.el (make-backup-file-name): - (backup-file-name-p): - (file-relative-name): - (abbreviate-file-name): - (set-auto-mode): + * version.el: + * startup.el (user-init-file-base): + * process.el (call-process-region): + * files.el (make-backup-file-name): + (backup-file-name-p): + (file-relative-name): + (abbreviate-file-name): + (set-auto-mode): * code-process.el (call-process-region): Removed unnecessary branching on 'windows-nt and 'ms-dos system types. Phased 'ms-dos support out of the universe. * process.el: - * code-process.el: + * code-process.el: * bytecomp.el (byte-compile-file): Removed reference to buffer-file-type, and commented usage of binary-process-output NTEmacs variables. @@ -1080,7 +1559,7 @@ (ldap-encode-string): Guard against `encode-coding-string' not being defined -1999-08-23 Didier Verna +1999-08-23 Didier Verna * rect.el: Cosmetics suggested by Dave Love . Some doc strings improvements, and add a star to the `interactive' @@ -1115,14 +1594,14 @@ * gutter-items.el (remove-buffer-from-gutter-tab): fix *scratch* deletion problem. -1999-07-30 Didier Verna +1999-07-30 Didier Verna * cus-edit.el (custom-save-variables): I said, use prin1 instead of princ to output symbols. (custom-save-face-internal): ditto. (custom-save-resets): ditto. -1999-08-09 Didier Verna +1999-08-09 Didier Verna * gutter-items.el (select-buffers-tab-buffers-by-mode): use `regexp-quote' to protect the major mode name for use as a regular @@ -1813,7 +2292,7 @@ doc-directory. From Karl M. Hegbloom -1999-07-19 Didier Verna +1999-07-19 Didier Verna * rect.el: all functions rewritten, except when noted. Below is a list of interface changes. @@ -1864,7 +2343,7 @@ * gui.el (make-dialog-frame): turn off gutters for dialogs. -1999-07-15 Didier Verna +1999-07-15 Didier Verna * cus-edit.el (custom-prompt-variable): optional third arg makes prompt for a comment string. @@ -2577,7 +3056,7 @@ * simple.el (delete-key-deletes-forward): Revert to previous behavior. -1999-01-18 Didier Verna +1999-01-18 Didier Verna * menubar-items.el (xemacs-splash-buffer): handle the case of multiple elements in the splash buffer body. @@ -2615,7 +3094,7 @@ * package-get.el (package-get-custom): don't load package-get-custom as it is auto-generated. Fix group definition. -1999-03-05 Didier Verna +1999-03-05 Didier Verna * cus-dep.el (Custom-make-dependencies): use `prin1-to-string' instead of `symbol-name' (Thanks Kyle). @@ -2637,7 +3116,7 @@ * font-lock.el (font-lock-revert-cleanup): Null out to avoid repeated calls to font-lock during buffer reversion. -1999-02-12 Didier Verna +1999-02-12 Didier Verna * info.el (Info-build-node-completions): unconditionally widen the tag table buffer. @@ -2760,7 +3239,7 @@ * XEmacs 21.2.9 is released -1999-01-19 Didier Verna +1999-01-19 Didier Verna * replace.el (replace-search-function): new variable containing a function to perform a search-forward. @@ -2768,7 +3247,7 @@ to perform a re-search-forward. (perform-replace): use them. -1999-01-25 Didier Verna +1999-01-25 Didier Verna * select.el (selection-owner-p): use the name `XEmacs'. (cut-copy-clear-internal): ditto. @@ -2784,7 +3263,7 @@ * minibuf.el (minibuffer-completion-table): ditto. * cl-macs.el (return-from): ditto. -1999-01-04 Didier Verna +1999-01-04 Didier Verna * replace.el (delete-non-matching-lines): temporarily disable case-folding when called interactively with a regexp containing @@ -2867,7 +3346,7 @@ (pui-list-packages): Add warning when `package-get-remote' is nil. (package-ui-add-site): New function. -1998-12-01 Didier Verna +1998-12-01 Didier Verna * hyper-apropos.el (hyper-where-is): added the missing autoload. @@ -3350,7 +3829,7 @@ * package-get-base.el: removed. -1998-09-23 Didier Verna +1998-09-23 Didier Verna * simple.el (search-caps-disable-folding): moved from isearch-mode.el (no-upper-case-p): new function. @@ -3648,7 +4127,7 @@ * lisp-mode.el (with-string-as-buffer-contents): Set indentation. -1998-07-17 Didier Verna +1998-07-17 Didier Verna * faces.el (set-face-property): (set-face-dim-p): @@ -4246,7 +4725,7 @@ `save-some-buffers'. (save-some-buffers): Force redisplay only if windows were deleted. -1998-06-02 Didier Verna +1998-06-02 Didier Verna * cus-face.el (custom-face-attributes): generalized the use of toggle buttons for boolean attributes. @@ -4629,7 +5108,7 @@ * simple.el (zap-up-to-char): New function. Behaves like `zap-to-char' in Emacs 18. -1998-05-13 Didier Verna +1998-05-13 Didier Verna * mouse.el (drag-window-divider): give the vertical divider a pressed look when dragging it. @@ -5129,7 +5608,7 @@ * default.el: Removed. * site-start.el: Removed. -1998-04-29 Didier Verna +1998-04-29 Didier Verna * minibuf.el (minibuffer-history-minimum-string-length): Default to nil. @@ -5203,7 +5682,7 @@ * msw-glyphs.el: enable graphics support. -1998-04-23 Didier Verna +1998-04-23 Didier Verna * x-menubar.el (default-menubar): restored the line-number-mode option. @@ -5247,7 +5726,7 @@ * package-get.el (package-get-all): add `\n' separator to interactive specification so that both variables are read -1998-04-22 Didier Verna +1998-04-22 Didier Verna * x-menubar.el: ported the options menu to Custom. Moved the "read only" toggle button to the buffers menu. @@ -5386,7 +5865,7 @@ 1998-04-16 SL Baur * files.el (toggle-read-only): Fix docstring. - From Didier Verna + From Didier Verna 1998-04-14 Michael Sperber [Mr. Preprocessor] @@ -6029,7 +6508,7 @@ windows on the currently selected fgrame before searching other frames. -1998-02-25 Didier Verna +1998-02-25 Didier Verna * modeline.el (modeline-swap-buffers): originally named `mouse-release-modeline'. Whether to actually swap the buffers is @@ -6091,7 +6570,7 @@ configuration, hosing temp-buffer-show-function. -1998-02-23 Didier Verna +1998-02-23 Didier Verna * modeline.el (mouse-drag-modeline): - Always scroll the modeline that was originally clicked on. @@ -6100,7 +6579,7 @@ keep on dragging the modeline even if the motion event occurs in another window. -1998-02-23 Didier Verna +1998-02-23 Didier Verna * x-mouse.el (x-init-pointer-shape): use a crossed-arrows cursor glyph on the modeline to indicate that dragging the mouse has an @@ -6127,7 +6606,7 @@ Prevents display flickering when the mouse pointer moves. -1998-02-17 Didier Verna +1998-02-17 Didier Verna * mouse.el (default-mouse-track-set-point-in-window): rewrote this function to handle correctly the case of a toolbar one side of the @@ -6274,7 +6753,7 @@ * loadup.el: test-atoms debugging stuffs removed. -1998-02-03 Martin Buchholz > +1998-02-03 Martin Buchholz * lisp/loaddefs.el (completion-ignored-extensions): Add ".class" @@ -6457,7 +6936,7 @@ * (abbrev-mode): (put)'ed a `:menu-tag' on it and `auto-fill-function'. -1998-01-02 Karl M. Hegbloom <> +1998-01-02 Karl M. Hegbloom * modeline.el (modeline-minor-mode-menu): Changed the string-only menus to :style 'toggle. @@ -6481,7 +6960,7 @@ (toolbar-mail-reader): Add support for `send'. From Jonathan Marten -1998-01-05 Karl M. Hegbloom <> +1998-01-05 Karl M. Hegbloom * info.el (Info-emacs-info-file-name): Add defvar for `Info-emacs-info-file-name' so that `Info-goto-emacs-command-node' @@ -6548,7 +7027,7 @@ * packages.el (package-require): Update to reflect new data format. -1998-01-02 Didier Verna +1998-01-02 Didier Verna * x-menubar.el (default-menubar): make the tutorials available through the menubar. (Plus some compilation warnings cleanup). @@ -6798,7 +7277,7 @@ * cl.el (eql): Compare integers with `eq'. (cl-map-extents): Check for `map-extents' first. -1997-12-17 Didier Verna +1997-12-17 Didier Verna * leim/quail/latin-pre.el ("french-prefix"): doc string cleanup + added the 'numero', 'copyright' and 'trademark' symbols. diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/ChangeLog.1 --- a/lisp/ChangeLog.1 Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/ChangeLog.1 Mon Aug 13 11:16:07 2007 +0200 @@ -130,7 +130,7 @@ 1997-12-07 Hrvoje Niksic - * wid-edit.el (widget-prettyprint-to-string): Nix cl-prettyprint's + * wid-edit.el (widget-prettyprint-to-string): Nix cl-prettyprint's newlines. 1997-12-06 Hrvoje Niksic @@ -151,7 +151,7 @@ 1997-12-07 SL Baur - * egg/egg-cwnn-leim.el (egg-pinyin-activate): New file. Interface + * egg/egg-cwnn-leim.el (egg-pinyin-activate): New file. Interface to Chinese Wnn server. * egg/egg-kwnn-leim.el: New file. Interface to Korean Wnn @@ -237,10 +237,10 @@ 1997-12-05 Mark Borges * mail/mail-extr.el (all-top-level-domains): - Two letter country codes synched with + Two letter country codes synched with http://www.iana.org/in-notes/iana/assignments/country-codes as updated by the RIPE Network Coordination Centre. - Source: ISO 3166 Maintenance Agency + Source: ISO 3166 Maintenance Agency Latest change: Thu Aug 7 17:59:51 MET DST 1997 1997-12-03 Eric Eide @@ -331,7 +331,7 @@ 1997-11-29 SL Baur - * update-elc.el ((preloaded-file-list site-load-packages)): Modify + * update-elc.el ((preloaded-file-list site-load-packages)): Modify error message to be more build-report.el friendly. * dumped-lisp.el (preloaded-file-list): Remove tooltalk/ prefix @@ -367,7 +367,7 @@ * x-menubar.el (default-menubar): Disable WWW items in help menu if no browse-url. - * help.el (xemacs-www-page): Print error message intead of bombing + * help.el (xemacs-www-page): Print error message intead of bombing if not browse-url. (xemacs-www-faq): Ditto. @@ -389,14 +389,14 @@ * x-toolbar.el (pending-delete): Don't (require 'pending-del). * x-menubar.el (pending-delete): Don't (require 'pending-del). - * x-menubar.el (bookmark-menu-filter): Add guards against bookmark + * x-menubar.el (bookmark-menu-filter): Add guards against bookmark package not being loaded. * mule/char-table.el: Imported from tm. * mule/chartblxmas.el: Ditto. * alist.el: Ditto. * overlay.el: Unpackaged for Quail. - + * x-menubar.el (default-menubar): Put guard on evaluation of `ps-paper-type'. (default-menubar): Put guard on `paren-mode'. @@ -427,7 +427,7 @@ * packages.el (packages-useful-lisp): advice.el is a package. - * x-menubar.el (default-menubar): Make `Options ... Color Printing' + * x-menubar.el (default-menubar): Make `Options ... Color Printing' a toggle. 1997-11-26 Kyle Jones @@ -448,7 +448,7 @@ 1997-11-25 Hrvoje Niksic - * custom.el (custom-declare-variable): Attach the symbol to + * custom.el (custom-declare-variable): Attach the symbol to load history. 1997-11-23 SL Baur @@ -505,7 +505,7 @@ 1997-11-17 Marc Paquette * efs/dired.el: Removed special case for windows-nt in - dired-get-filename(); no longer needed because we now do + dired-get-filename(); no longer needed because we now do CRLF->LF conversion upstream. 1997-11-18 Jonathan Harris @@ -657,9 +657,9 @@ 1997-11-12 Greg Klanderman - * packages/compile.el (compilation-build-compilation-error-regexp-alist): + * packages/compile.el (compilation-build-compilation-error-regexp-alist): Added documentation for this function. - + ** (compilation-error-regexp-systems-list): Update documentation to note that `compilation-build-compilation-error-regexp-alist' must be called after changing the value. Update customization to @@ -751,7 +751,7 @@ * utils/shadow.el (list-load-path-shadows): Supress message when no shadowings are found. - * loadup.el: Modify algorithm for finding initial lisp directories + * loadup.el: Modify algorithm for finding initial lisp directories since the search now starts from lisp/ not lisp/prim/. * update-elc.el: Ditto. * make-docfile.el: Ditto. @@ -856,7 +856,7 @@ Reinstated code that uses (mono x) as a specifer tag, but conditioned it on (featurep 'x) because x is not a valid specifier tag under native-win32. - + * Added file headers to: w32-faces.el, w32-init.el @@ -937,7 +937,7 @@ 1997-11-07 Kyle Jones * prim/modeline.el (mouse-drag-modeline): Don't - allow the window size to shrink to a size that is not a + allow the window size to shrink to a size that is not a multiple of the height of the default face's font. * prim/modeline.el (mouse-drag-modeline): Don't @@ -961,12 +961,12 @@ 1997-11-05 Jens-Ulrik Holger Petersen * mule/mule-cmds.el (set-default-coding-systems): Make - add-hook to `comint-exec-hook' be an append, for when the user + add-hook to `comint-exec-hook' be an append, for when the user changes language environment say. 1997-11-05 SL Baur - * prim/winnt.el: Use a cleaner method for getting Text/Binary file + * prim/winnt.el: Use a cleaner method for getting Text/Binary file type in the mode-line for MS Windows. 1997-11-06 Hrvoje Niksic @@ -1005,7 +1005,7 @@ fontifying after fontify-buffer. (lazy-shot-unstall): Make sure buffer is left in a fontified state if needed. Take optional argument. - + * packages/ps-print.el (ps-print-ensure-fontified): Added temporary support for lazy-shot. @@ -1014,10 +1014,10 @@ * utils/text-props.el (set-text-properties): Updated docstring. -1997-11-04 Didier Verna - - * mule/mule-cmds.el (set-default-coding-systems): - The coding-system argument to comint-exec-hook wasn't evaluated +1997-11-04 Didier Verna + + * mule/mule-cmds.el (set-default-coding-systems): + The coding-system argument to comint-exec-hook wasn't evaluated before building the lambda expression. 1997-11-04 Jens-Ulrik Holger Petersen @@ -1088,7 +1088,7 @@ * shell.el (shell-chdrive-regexp): New for DOS/NT (shell-mode): Added shell-font-lock-keywrods (shell-mode): Use $PWD for ksh - (shell-directory-tracker): Use dirs and dirtrack-toggle. This may + (shell-directory-tracker): Use dirs and dirtrack-toggle. This may cause problems at is interferes with "dired" (shell-snarf-envar): NEW (shell-copy-environment-variable): NEW @@ -1165,7 +1165,7 @@ characters, instead of consing a string each time. (synthesize-keysym): Better error checking. - * prim/keymap.el (synthesize-keysym): Don't bug out when reading a + * prim/keymap.el (synthesize-keysym): Don't bug out when reading a non-character event. 1997-11-02 Tomasz Cholewo @@ -1191,7 +1191,7 @@ * prim/packages.el: Updated commentary. (packages-useful-lisp): Added `cl-macs'. -1997-10-27 Didier Verna +1997-10-27 Didier Verna * prim/help-nomule.el (help-with-tutorial): The 'didactic' blank lines message is now taken directly from each tutorial, and thus @@ -1213,7 +1213,7 @@ Suggested by Michael Kifer * mule/mule-init.el: Remove `help-with-tutorial-for-mule'. - Suggested by Didier Verna + Suggested by Didier Verna * Disable Cyrillic CCL until CCL engine gets fixed. From: Martin Buchholz @@ -1230,7 +1230,7 @@ 1997-10-30 SL Baur - * vm/vm-vars.el (vm-image-directory): Use locate-data-directory if + * vm/vm-vars.el (vm-image-directory): Use locate-data-directory if it exists. * language/european.el: Remove erroneous references to @@ -1438,7 +1438,7 @@ * modes/enriched.el (enriched-face-ans): Use color-name instead of color-instance-name. - color-instance-name will not handle the specifiers that + color-instance-name will not handle the specifiers that are passed as arguments. 1997-10-28 Tomasz Cholewo @@ -1451,14 +1451,14 @@ * pcl-cvs/pcl-cvs-xemacs.el: Add `cvs-mode-update-no-prompt' to menu. From Stig Bjorlykke -1997-10-28 Didier Verna +1997-10-28 Didier Verna * packages/man.el (manual-entry): corrected the `when' form to include 'section' in the buffer name. 1997-10-28 SL Baur - * prim/packages (packages-find-pacakges): Fix test on + * prim/packages (packages-find-pacakges): Fix test on inhibit-package-init 1997-10-27 Tomasz Cholewo @@ -1488,7 +1488,7 @@ * egg/egg-leim.el: Registers EGG/Wnn with LEIM when loaded * egg/egg.el: Bind `toggle-egg-mode' to "\C-\" only if LEIM is - not present when loaded + not present when loaded 1997-10-27 SL Baur @@ -1610,7 +1610,7 @@ 1997-10-23 Per Abrahamsen * custom/cus-edit.el (hook): Use `widget-group-match' instead of - `widget-editable-list-match'. + `widget-editable-list-match'. 1997-10-23 SL Baur @@ -1626,7 +1626,7 @@ 1997-10-20 Jan Vroonhof * extents.c: Renamed shot property to initial-redisplay-function - (extent_fragment_update): Changed the bookkeeping whether an event + (extent_fragment_update): Changed the bookkeeping whether an event has been spawned. The initial-redisplay-function property is no longer set to nil. @@ -1641,7 +1641,7 @@ 1997-10-22 Hrvoje Niksic - * prim/startup.el (command-line-1): Run term-setup-hook regardless + * prim/startup.el (command-line-1): Run term-setup-hook regardless of `input-pending-p'. * custom/cus-edit.el (custom-split-regexp-maybe): Use `split-string'. @@ -1681,7 +1681,7 @@ 1997-10-21 SL Baur - * prim/about.el (about-maintainer-glyph): Pictures have been moved + * prim/about.el (about-maintainer-glyph): Pictures have been moved to photos subdirectory. 1997-10-21 Hrvoje Niksic @@ -1696,7 +1696,7 @@ 1997-10-21 Colin Rafferty * x11/x-menubar.el (default-menubar): Made it use lazy-shot - instead of lazy-lock in "Syntax Highlighting->Lazy". + instead of lazy-lock in "Syntax Highlighting->Lazy". (options-menu-saved-forms): Made it save lazy-shot instead of lazy-lock in the options. @@ -1778,12 +1778,12 @@ * help.el (function-at-point): Use `function-at-point-function'. (function-at-point-function): New variable, formerly - `find-function-function'. + `find-function-function'. (describe-function): Use `function-at-point'. (where-is): Ditto. * find-func.el (find-function-read-function): Use - `function-at-point'. + `function-at-point'. * packages/info.el (Info-elisp-ref): Use `function-at-point'. @@ -1806,7 +1806,7 @@ * prim/packages.el (packages-find-packages-1): New argument: `user-package' non-nil when searching user packages. - Load any autoloads found in user packages. - + 1997-10-17 Karl M. Hegbloom * packages/info.el (Info-insert-dir): Also kill the localdir temp @@ -1817,7 +1817,7 @@ * utils/facemenu.el: autoload the `facemenu-keymap' properly. * mule/mule-cmds.el (read-language-name): Fix typo. - From Didier Verna + From Didier Verna 1997-10-15 Adrian Aichner @@ -1886,7 +1886,7 @@ From Hrvoje Niksic * prim/glyphs.el (init-glyphs): Use different logo for beta XEmacsen. - From Didier Verna + From Didier Verna 1997-10-15 Hrvoje Niksic @@ -1915,7 +1915,7 @@ * custom/wid-edit.el: (widget-glyph-insert-glyph): Use `widget-mouse-help' if necessary. - (widget-documentation-string-value-create): Don't coerce help-echo + (widget-documentation-string-value-create): Don't coerce help-echo WIDGET to widget. (widget-button-keymap): New keymap. (widget-specify-button): Use it. @@ -1985,7 +1985,7 @@ 1997-10-14 SL Baur * default.el: New file. - * site-start.el: New file. XEmacs starts faster if dummy versions + * site-start.el: New file. XEmacs starts faster if dummy versions of these files are found early in the `load-path'. Suggested by Kyle Jones @@ -2049,7 +2049,7 @@ * custom/cus-face.el (custom-face-attributes): Support inverse-video for TTY-s. - * prim/cmdloop.el (keyboard-escape-quit): Abort recursive edit, as + * prim/cmdloop.el (keyboard-escape-quit): Abort recursive edit, as documented. 1997-10-12 Hrvoje Niksic @@ -2103,7 +2103,7 @@ * '' Added toplevel block (when (fboundp 'load-gc) ...to init the Info-def..list from the environment variable INFOPATH at dump time. - + * prim/packages.el (packages-find-packages-1): append the list of packages info directories to `Info-default-directory-list' rather than prepending them. Don't add them if they're already in the @@ -2112,7 +2112,7 @@ * packages/info.el (Info-directory-list): various fixes to the directory list handling. * (Info-localdir-heading-regexp) added. - + * '' removed the unrequired defcustom of `Info-default-directory- list' @@ -2153,7 +2153,7 @@ * packages/bookmark.el: * packages/iswitchb.el: * utils/speedbar.el: - * utils/xemacs-build-report.el: + * utils/xemacs-build-report.el: - change Xemacs --> XEmacs 1997-10-09 Colin Rafferty @@ -2167,7 +2167,7 @@ (describe-function-arglist): Commented out -- seems unused. (find-function): ALL find-function stuff moved to "find-func.el" - * prim/find-func.el: new file created from functions previously in + * prim/find-func.el: new file created from functions previously in "help.el". 1997-10-09 SL Baur @@ -2203,7 +2203,7 @@ Fri Sep 26 23:30:58 1997 Barry A. Warsaw - * cc-mode/cc-menus.el: Patches to Imenu support given by + * cc-mode/cc-menus.el: Patches to Imenu support given by "Masatake (jet) YAMATO" . (Jan Dubois) jan.dubois@ibm.net @@ -2226,9 +2226,9 @@ * x11/x-menubar.el (file-menu-filter): Reverse sense of bounds test. - From: Didier Verna - - * prim/format.el (format-annotate-function): Reverse sync to Emacs + From: Didier Verna + + * prim/format.el (format-annotate-function): Reverse sync to Emacs 19. 1997-10-08 Hrvoje Niksic @@ -2316,7 +2316,7 @@ * mule/mule-cmds.el (read-input-method-name): Use a default if available. - From Didier Verna + From Didier Verna * prim/about.el (about-url-alist): Update jwz's home page. @@ -2346,7 +2346,7 @@ 1997-10-05 Hrvoje Niksic - * prim/simple.el: Minor docstring and comment changes. Customized + * prim/simple.el: Minor docstring and comment changes. Customized some more. 1997-10-04 Hrvoje Niksic @@ -2386,7 +2386,7 @@ * cl/cl-seq.el (remq): Reformat and add doc-string. Suggested by: Karl M. Hegbloom - + 1997-10-03 Karl M. Hegbloom * packages/func-menu.el: change the countups from message's to @@ -2432,7 +2432,7 @@ (custom-declare-face): Don't invoke init-face-from-resources explicitly. - * prim/profile.el (pretty-print-profiling-info): When interactive, + * prim/profile.el (pretty-print-profiling-info): When interactive, use a separate buffer instead of current-buffer. (pretty-print-profiling-info): Prettified output. @@ -2984,7 +2984,7 @@ (widget-text-keymap): Use it. (widget-princ-to-string): Use `with-current-buffer'. (widget-map-buttons): Ditto. - (widget-push-button-gui): Set to value of `widget-glyph-enable' by + (widget-push-button-gui): Set to value of `widget-glyph-enable' by default. (widget-push-button-value-create): Call `widget-specify-button'. @@ -3007,7 +3007,7 @@ * x11/x-menubar.el: Customized. - * custom/cus-face.el (face-spec-set-match-display): Use `warn' for + * custom/cus-face.el (face-spec-set-match-display): Use `warn' for warnings. * x11/x-font-menu.el: Customized. @@ -3123,7 +3123,7 @@ 1997-09-18 Jens-Ulrik Holger Petersen * prim/isearch-mode.el (isearch-message): Display-message as - progress (this way isearch message won't appear in the message + progress (this way isearch message won't appear in the message log). 1997-09-18 Jens-Ulrik Holger Petersen @@ -3149,7 +3149,7 @@ * prim/packages.el (locate-library): Simplify regexp for compression suffixes. Suggested by: Hrvoje Niksic - + 1997-09-17 Karl M. Hegbloom * ilisp/ilisp-out.el (ilisp-scroll-output): bind `scroll-in-place' @@ -3220,7 +3220,7 @@ I don't know if this breaks something else, because I can't figure out why it was commented out in the first place. - + * cc-mode/cc-langs.el: Define `/' in c-mode-base-map since all modes now support c-electric-slash. @@ -3389,7 +3389,7 @@ 1997-09-11 Jens-Ulrik Holger Petersen - * packages/vc.el (vc-default-init-version): Make the default value + * packages/vc.el (vc-default-init-version): Make the default value be `nil'. Improve the docstring. 1997-09-12 SL Baur @@ -3508,7 +3508,7 @@ 1997-09-09 Jens-Ulrik Holger Petersen - * packages/vc.el (vc-register): make the second option arg COMMENT + * packages/vc.el (vc-register): make the second option arg COMMENT do something * packages/vc.el (vc-register): Make the default initial @@ -3522,7 +3522,7 @@ 1997-09-07 Hrvoje Niksic - * utils/edmacro.el (edmacro-parse-word): Accept ^foo (would signal + * utils/edmacro.el (edmacro-parse-word): Accept ^foo (would signal error). (edmacro-format-1): Add SPC after ^. @@ -3535,7 +3535,7 @@ always has directories ending with trailing `/'s. * version.el (emacs-version): Preserve previous matching info. - From Didier Verna + From Didier Verna Wed Sep 3 13:53:10 1997 SL Baur @@ -3571,7 +3571,7 @@ 1997-09-01 SL Baur - * x11/x-menubar.el (default-menubar): Put tetris in the game menu, + * x11/x-menubar.el (default-menubar): Put tetris in the game menu, and move it and the mine game to the top of the menu. 1997-08-29 SL Baur @@ -3881,28 +3881,28 @@ * support for "dir" merging 'ala Emacs-19.34, with fallback to cheap localdir files in the secondary info directories. - + * changed default `Info-annotations-path' from ~/.infonotes to ~/.xemacs/info.notes - + * added `Info-additional-directory-list' - + * changed a call to w3-fetch to browse-url - + * added new variables and functions from GNU Emacs 19.34: `Info-dir-contents', `Info-dir-contents-directory', `Info-dir-file-attributes', and the function `Info-insert-dir' - + * rewrote `Info-suffixed-file' to a cond block rather than nested if's for aesthetic reasons. - + * made the top line get split if it's longer than 79 characters and tweaked fontification to handle that. - + * changed the look of the pop-up mouse menus by utilizing the "--:etchedThing" dividers. - + * several docstring reformats and typo fixes, a few comments deleted. @@ -4006,7 +4006,7 @@ 1997-07-24 SL Baur - * prim/make-docfile.el (docfile-out-of-date): Workaround for NEWOS + * prim/make-docfile.el (docfile-out-of-date): Workaround for NEWOS process exit handling bug. Suggested by Katsumi Yamaoka @@ -4036,7 +4036,7 @@ 1997-07-21 SL Baur - * prim/packages.el (locate-data-directory): New function to search + * prim/packages.el (locate-data-directory): New function to search for directories in the data-directory-list. 1997-07-21 Karl M. Hegbloom @@ -4079,7 +4079,7 @@ (speedbar-get-focus): Autoload. (speedbar): Autoload (correctly). - (speedbar-frame-width): Test liveness of frame + (speedbar-frame-width): Test liveness of frame too. (speedbar-frame-mode): Avoid some Emacs 20 code. From Markus Linnala @@ -4115,7 +4115,7 @@ 1997-07-16 Steven L Baur - * utils/crontab.el (crontab-get): Check for `no crontab for' as an + * utils/crontab.el (crontab-get): Check for `no crontab for' as an error return. Suggested by Jeff Miller @@ -4247,7 +4247,7 @@ * prim/files.el: Use `files' group. - * prim/disp-table.el (describe-display-table): Made it work; don't + * prim/disp-table.el (describe-display-table): Made it work; don't use `describe-vector'. * prim/gui.el: Customized. @@ -4273,7 +4273,7 @@ * packages/igrep.el: Don't insinuate XEmacs when loading. (igrep-insinuate): New function. - * packages/blink-cursor.el (blink-cursor-callback): Don't blink on + * packages/blink-cursor.el (blink-cursor-callback): Don't blink on TTY-s. * prim/console.el (resume-pid-console): Use `eql'. @@ -4342,7 +4342,7 @@ * packages/pending-del.el (pending-delete-pre-hook): Don't quote lambda. (pending-delete-pre-hook): Use `error-message-string'. - (pending-delete): Treat as minor mode; define the standard turn-on + (pending-delete): Treat as minor mode; define the standard turn-on and turn-off functions. (delete-active-region): Simplified. @@ -4353,10 +4353,10 @@ * packages/pending-del.el: Correct typo in Hrvoje's upgrade. * mel/mel-u.el (uuencode-external-decode-region): Force - buffer-read-only nil because it gets changed magically to t during + buffer-read-only nil because it gets changed magically to t during the call to `insert-file-contents'. - * tm/tm-image.el (mime-preview/filter-for-image): Comment out test + * tm/tm-image.el (mime-preview/filter-for-image): Comment out test for invalid glyph. It appears to be non-functional. * modes/lisp-mode.el (lisp-interaction-mode-popup-menu-1): Add @@ -4542,7 +4542,7 @@ * hypberbole/hact.el (action:commandp): Don't reference bytecode objects as vectors. (action:params): Ditto. - + * hyperbole/hypb.el (hypb:function-copy): Don't reference byte code objects as vectors. (hypb:function-symbol-replace): Document as broken. The @@ -4567,7 +4567,7 @@ * utils/easymenu.el (easy-menu-add): Oops, wrong sense in comparison. - * comint/gdb.el (gdb-mode-syntax-table): New variable. Initialize + * comint/gdb.el (gdb-mode-syntax-table): New variable. Initialize with the logic currently in CC Mode 5.11. (gdb-mode): Use it. @@ -4620,7 +4620,7 @@ * prim/cmdloop.el (errors-deactivate-region): Default to existing behavior. - * leim/quail.el (quail-mode): Correct addition of quail minor mode + * leim/quail.el (quail-mode): Correct addition of quail minor mode info to minor-mode-map-alist. (top-level): Ditto. @@ -4678,7 +4678,7 @@ make it look better (and will prevent some consing, but that's being anal). From Hrvoje Niksic - + * prim/simple.el (delete-key-deletes-forward): Mark docstring as an user option. From Gary D. Foster @@ -4688,10 +4688,10 @@ * efs/efs-ovwrt.el (efs-overwrite-fn): efs is manufacturing its own byte code. Whee. - * utils/advice.el (ad-interactive-form): Don't treat bytecode as a + * utils/advice.el (ad-interactive-form): Don't treat bytecode as a vector if it can be avoided. From Kyle Jones - + 1997-06-30 Steven L Baur * prim/files.el (auto-mode-alist): Don't set image-mode by default @@ -4699,7 +4699,7 @@ Sun Jun 29 20:57:15 1997 Kyle Jones - * prim/simple.el: bind inhibit-read-only to t before + * prim/simple.el: bind inhibit-read-only to t before trying to erase or otherwise modify the echo area buffer. 1997-07-01 MORIOKA Tomohiko @@ -4728,7 +4728,7 @@ * src/undo.c (record_extent): If the extent's object is a string, just return. We can't record undo information for strings, and it is - very bad to reference through a string pointer as if it + very bad to reference through a string pointer as if it were a buffer pointer. 1997-06-28 Steven L Baur @@ -4775,7 +4775,7 @@ * utils/autoload.el (batch-update-directory): Kill command line args when done. (autoload-save-customization): Print a warning message with the - offending symbol when we run across the elusive malformed property + offending symbol when we run across the elusive malformed property list ((0 0)). 1997-06-26 Hrvoje Niksic @@ -4784,7 +4784,7 @@ (pretty-print-profiling-info): Allow interactive calls. * prim/overlay.el: Make more FSF compatible. - + 1997-06-27 Steven L Baur * prim/loaddefs.el (debug-ignored-errors): Fix regexps. @@ -4893,7 +4893,7 @@ Mule menu because they bombed after recompilation. * packages/hyper-apropos.el - (hyper-apropos-toggle-programming-flag): Use `with-current-buffer' + (hyper-apropos-toggle-programming-flag): Use `with-current-buffer' instead of `eval-in-buffer'. * term/sun-mouse.el: Remove bogus redefinition of @@ -4904,7 +4904,7 @@ * prim/make-docfile.el: Use princ not print. Suggested by Hrvoje Niksic. - * packages/info.el (Info-select-node): Desensitive case search for + * packages/info.el (Info-select-node): Desensitive case search for Note:. (Info-next-reference): Ditto. * prim/simple.el (kill-region): Adjust endpoints of extent to @@ -4915,7 +4915,7 @@ * prim/subr.el (eval-in-buffer): Make obsolete. Suggested by Hrvoje Niksic. - * packages/hyper-apropos.el (hyper-apropos-faces): Change group to + * packages/hyper-apropos.el (hyper-apropos-faces): Change group to 'faces. Suggested by Per Abrahamsen. @@ -4926,7 +4926,7 @@ - Get keybinding before command is executed. Suggested by Kyle Jones and Steve Baur. - + 1997-06-24 Steven L Baur * packages/gnuserv.el: Make old symbols Obsolete. @@ -4936,7 +4936,7 @@ minibuffer. * prim/minibuf.el (minibuffer-keyboard-quit): Ditto. From Hrvoje Niksic - + * prim/help.el (help-mode-quit): Bury buffer when quitting. From Hrvoje Niksic @@ -4964,7 +4964,7 @@ 1997-06-23 Hrvoje Niksic - * packages/info.el (Info-next-reference): Fix up for M-TAB to work + * packages/info.el (Info-next-reference): Fix up for M-TAB to work correctly. * utils/live-icon.el (live-icon-one-frame): Don't set glyphs to @@ -4990,7 +4990,7 @@ 1997-06-22 Steven L Baur - * x11/x-menubar.el (default-menubar): Make `Jump to bookmark' menu + * x11/x-menubar.el (default-menubar): Make `Jump to bookmark' menu dynamic. From Gary D. Foster @@ -5061,7 +5061,7 @@ * prim/tabify.el (untabify): Return nil. From contributor name lost. - * prim/packages.el (packages-hardcoded-lisp): startup.elc needs to + * prim/packages.el (packages-hardcoded-lisp): startup.elc needs to be scanned for docstrings. 1997-06-21 Hrvoje Niksic @@ -5088,7 +5088,7 @@ 1997-06-20 Steven L Baur - * utils/autoload.el (fixup-autoload-buffer): New function. Insert + * utils/autoload.el (fixup-autoload-buffer): New function. Insert guards so a (load "auto-autoloads") works the same as require. (batch-update-directory): Use it. @@ -5142,11 +5142,11 @@ From Karl M. Hegbloom (archive-mode-map): Bind it to `q'. - * utils/autoload.el (cusload-file-name): Default to custom-load.el + * utils/autoload.el (cusload-file-name): Default to custom-load.el for each individual file. * prim/minibuf.el (minibuffer-max-depth-exceeded): Use - `custom-file' as a location for saving enable multiple minibuffers + `custom-file' as a location for saving enable multiple minibuffers option. * packages/man.el (manual-entry): Don't leave empty buffer if @@ -5168,14 +5168,14 @@ 1997-06-17 Steven L Baur - * prim/files.el (auto-mode-alist): Add /app-defaults/ as candidate + * prim/files.el (auto-mode-alist): Add /app-defaults/ as candidate for xrdb-mode. Suggested by Karl Hegbloom, Regexp by David Moore. - * version.el: Remove variables emacs-version, emacs-major-version, + * version.el: Remove variables emacs-version, emacs-major-version, and emacs-minor-version. - * tooltalk/tooltalk-load.el: Comment as obsolete and move contents + * tooltalk/tooltalk-load.el: Comment as obsolete and move contents to dumped-lisp.el. * prim/make-docfile.el: New file. @@ -5199,7 +5199,7 @@ * prim/dumped-lisp.el: New file. - * prim/update-elc.el (toplevel): Rework using a better function to + * prim/update-elc.el (toplevel): Rework using a better function to determine autoload file locations. * prim/packages.el: New file. @@ -5240,16 +5240,16 @@ as an option. Eliminate XEmacs specific autoloads. From Hrvoje Niksic - + * efs/dired.el (dired-save-excursion): Ebola cleanup. * packages/hyper-apropos.el: Massive cleanup, Customize. - From Hrvoje Niksic + From Hrvoje Niksic Fri Jun 13 13:20:39 1997 Kyle Jones * prim/syntax.el (symbol-near-point): - Check for bobp and avoid (char-syntax (char-before)) if + Check for bobp and avoid (char-syntax (char-before)) if there. 1997-06-13 Steven L Baur @@ -5267,7 +5267,7 @@ * modes/make-mode.el (makefile-browse): Shouldn't be interactive. From Hrvoje Niksic - * prim/files.el (interpreter-mode-alist): ksh-mode is obsoleted by + * prim/files.el (interpreter-mode-alist): ksh-mode is obsoleted by sh-script. From Hrvoje Niksic @@ -5276,7 +5276,7 @@ * prim/subr.el (with-current-buffer): New macro. (with-temp-file): Ditto. - * bytecomp/byte-optimize.el (byte-optimize-form-code-walker): Test + * bytecomp/byte-optimize.el (byte-optimize-form-code-walker): Test for `save-current-buffer'. * bytecomp/bytecomp.el: Recognize `save-current-buffer'. @@ -5358,7 +5358,7 @@ From Heiko Muenkel 1997-06-10 Gary D. Foster - + * modes/view-less.el: Changed \177 bindings to 'delete * modes/help.el: Changed \177 bindings to 'delete @@ -5378,7 +5378,7 @@ * modes/cc-mode.el: * modes/cperl-mode.el: Fixed references to delete functions to use the new names. - + 1997-06-11 Karl M Hegbloom * ilisp/ilisp-def.el (toplevel): Changed `ilisp-prefix' from @@ -5462,7 +5462,7 @@ Change usage of \177 to use keysym 'delete. From Gary D. Foster - * packages/etags.el (tags-loop-scan): Don't pass a straight string + * packages/etags.el (tags-loop-scan): Don't pass a straight string to error as a format string. Reported by Miles Duke @@ -5487,9 +5487,9 @@ 1997-06-04 Gary D. Foster - * modes/cc-mode.el: Modified `c-electric-delete' to honor the + * modes/cc-mode.el: Modified `c-electric-delete' to honor the desired delete direction in both normal and "hungry" modes. - * modes/cperl-mode.el: Modified `cperl-electric-backspace' to + * modes/cperl-mode.el: Modified `cperl-electric-backspace' to honor the desired delete direction. 1997-06-03 MORIOKA Tomohiko @@ -5512,9 +5512,9 @@ * modes/*.el: Removed conflicting \177 bindings. * modes/cc-mode.el: Modified `c-electric-delete' to use new delete bindings. - * modes/cperl-mode.el: Modified `cperl-electric-backspace' to + * modes/cperl-mode.el: Modified `cperl-electric-backspace' to use new delete bindings. - + 1997-06-03 MORIOKA Tomohiko * leim/quail.el: to sync with quail.el of Emacs-19.34.94-epsilon. @@ -5540,7 +5540,7 @@ * prim/about.el: Installed new version 2.1. From Hrvoje Niksic - + * prim/profile.el (pretty-print-profiling-info): Autoload don't dump. Clean up comments. @@ -5586,7 +5586,7 @@ as toolbar callbacks. From weiner@altrasoft.com - * prim/mouse.el (default-mouse-track-cleanup-extent): Correct test + * prim/mouse.el (default-mouse-track-cleanup-extent): Correct test on dead-func extent. * prim/help.el (view-emacs-news): outl-mouse turned off in @@ -5750,7 +5750,7 @@ `icomplete-max-delay-chars' - Maximum number of initial chars to apply icomplete compute delay. - + `icomplete-compute-delay' - Completions-computation stall, used only with large-number completions @@ -5802,7 +5802,7 @@ (insert-parentheses): Let a negative argument enclose preceding sexps. From Erik Naggum - + * prim/window-xemacs.el: New file, split from window.el with XEmacs-specific stuff. @@ -5814,12 +5814,12 @@ * prim/window.el (kill-buffer-and-window): New command. Bind it to C-x 4 0. From Richard Stallman - + * prim/window.el (split-window-vertically): Don't change point in old window if both the original point and the end of the buffer are visible after splitting, when split-window-keep-point is nil. From Noah Friedman - + * prim/files.el (revert-buffer-internal-hook): Declare. * utils/map-ynp.el: Synch with Emacs 19.34.94. @@ -5877,7 +5877,7 @@ standard-value for Custom-1.98. 1997-05-26 Steven L Baur - + * prim/help.el (view-lossage-key-count): New variable. (view-lossage-message-count): New variable. (view-lossage): Use them. @@ -5999,7 +5999,7 @@ Tue May 20 20:32:59 1997 Steven L Baur - * prim/subr.el (buffer-substring-no-properties): Clean out extents + * prim/subr.el (buffer-substring-no-properties): Clean out extents too. Mon May 19 19:48:35 1997 Steven L Baur @@ -6018,10 +6018,10 @@ * prim/files.el (revert-buffer): Add optional third parameter to preserve buffer modes (from Emacs 19.34.94). - (after-find-file): Add optional fifth parameter to preserve buffer + (after-find-file): Add optional fifth parameter to preserve buffer modes (from Emacs 19.34.94). - * packages/vc.el: Synch with Emacs 19.34.94 because our version was + * packages/vc.el: Synch with Emacs 19.34.94 because our version was hopeless. (vc-checkout): Autoload. (vc-find-binary): Ditto. @@ -6031,7 +6031,7 @@ Fri Apr 25 13:21:46 1997 Per Abrahamsen - * apropos.el (apropos): Add support for customization groups. + * apropos.el (apropos): Add support for customization groups. (apropos-print): Ditto. Sat May 17 19:56:31 1997 Glynn Clements @@ -6066,7 +6066,7 @@ * tm/tm-vm.el: Provide for vm-unsaved-message having been removed in recent versions of VM. - + Fri May 9 10:41:44 1997 Steven L Baur * iso/iso-acc.el (iso-accents-compose): Fix XEmacs 19.14 @@ -6085,10 +6085,10 @@ * hm--html-menus/hm--html.el: Define obsolete aliases for the previous function spellings. - * hm--html-menus/hm--html-keys.el: Define obsolete aliases for the + * hm--html-menus/hm--html-keys.el: Define obsolete aliases for the previous variable spellings. - * prim/obsolete.el (define-obsolete-variable-alias): Fix docstring + * prim/obsolete.el (define-obsolete-variable-alias): Fix docstring spelling. (define-compatible-variable-alias): Ditto. @@ -6128,7 +6128,7 @@ Tue Apr 29 18:51:31 1997 Steven L Baur - * mule/mule-files.el (buffer-file-coding-system-alist): Regexp for + * mule/mule-files.el (buffer-file-coding-system-alist): Regexp for handling info files didn't match the right pattern. Sun Apr 27 18:09:48 1997 Steven L Baur @@ -6142,7 +6142,7 @@ Fri Apr 25 08:39:50 1997 Steven L Baur - * modes/sh-script.el (sh-indent-line): Deal with pathological case + * modes/sh-script.el (sh-indent-line): Deal with pathological case of indenting a first line containing a `#' as first non-white space character. @@ -6333,12 +6333,12 @@ * packages/vc.el (vc-directory): Dired requires a list not a string of space separated names. - * utils/live-icon.el (live-icon-colour-name-from-face): `face' may + * utils/live-icon.el (live-icon-colour-name-from-face): `face' may be a list of faces since it is generated by `extent-face'. Fri Apr 11 21:12:57 1997 Steven L Baur - * packages/ispell.el: Don't attempt creation of the menubar unless + * packages/ispell.el: Don't attempt creation of the menubar unless XEmacs has been compiled with menubars. * prim/simple.el (yank-pop): mark-marker needs optional force @@ -6384,7 +6384,7 @@ Tue Apr 8 12:57:05 1997 Steven L Baur * modes/lisp-mode.el (eval-defun): Evaluate defcustom in defconst - style instead of defvar style (patch derived from Emacs 19.35/Lars + style instead of defvar style (patch derived from Emacs 19.35/Lars Magne Ingebrigtsen). Mon Apr 7 16:38:43 1997 Steven L Baur @@ -6402,7 +6402,7 @@ * x11/x-menubar.el (default-menubar): Use xmine not mine. - * prim/help.el (describe-variable): Some doc strings weren't being + * prim/help.el (describe-variable): Some doc strings weren't being terminated with a newline. Sat Apr 5 20:20:00 1997 Steven L Baur @@ -6411,7 +6411,7 @@ Sat Apr 5 13:18:05 1997 Tomasz J. Cholewo - * packages/etags.el (tags-query-replace): Fixed DELIMITED argument + * packages/etags.el (tags-query-replace): Fixed DELIMITED argument bug. `with-caps-disable-folding' moved to isearch-mode.el. * packages/info.el (Info-search): Use `with-caps-disable-folding'. @@ -6506,8 +6506,8 @@ (fancy-diary-display): Use modeline-buffer-identification. * calendar/appt.el (appt-diary-entries): Do not display diary. - (appt-check): Display diary buffer at midnight. - + (appt-check): Display diary buffer at midnight. + Fri Mar 21 19:16:46 1997 Steven L Baur * mule/mule-coding.el (enable-multibyte-characters): MULE @@ -6636,7 +6636,7 @@ * utils/eldoc.el (eldoc-pre-command-refresh-echo-area): Use eldoc-display-message-p, not eldoc-display-message-no-interference-p. - + Sat Mar 8 11:20:47 1997 Steven L Baur * prim/startup.el (startup-splash-frame-body): More text tweaking. @@ -6687,7 +6687,7 @@ * x11/x-menubar.el (default-menubar): Reorganize again undoing previous change. Customize submenu moved to top of options menu. Edit faces restored to edit-faces and renamed to Browse faces. - + Thu Mar 6 08:43:27 1997 Steven L Baur * x11/x-menubar.el (options-menu): New variable. @@ -6743,7 +6743,7 @@ * site-load.el: Move site-packages to the top level. Sun Mar 2 01:37:04 1997 Hrvoje Niksic - + * utils/mail-extr.el (all-top-level-domains): Added "hr" domain. * packages/ps-print.el (ps-print-color-p): Default to nil. @@ -7030,13 +7030,13 @@ Sat Feb 15 11:05:29 1997 Kyle Jones * utils/redo.el: made before and after status messages so that the user is aware if a long action is still being processed. - + rolled version number up to 1.00, since the package seems to be stable. cosmetic changes so the file could be included in the XEmacs distribution. - + Sat Feb 15 11:13:05 1997 Hrvoje Niksic * prim/simple.el (line-move-ignore-invisible): Change default to @@ -7172,7 +7172,7 @@ * packages/ps-print.el: Update maintainer address. Thu Feb 6 12:35:39 1997 Bill Dubuque - + * cl/cl-macs.el (cl-do-proclaim): Correct addition of bound variables to `byte-compile-bound-variables'. @@ -7222,7 +7222,7 @@ * x11/x-toolbar.el (toolbar-mail-commands-alist): Updated with a lot of new mailer possiblities. - + Fri Jan 31 09:28:49 1997 Martin Buchholz * x11/x-font-menu.el (reset-device-font-menus): Correct guard on @@ -7238,7 +7238,7 @@ * packages/compile.el: Speed up regexps. (compilation-parse-errors): replace re-search-forward with something faster. - + Thu Jan 30 20:33:56 1997 Hvoje Niksic * x11/x-toolbar.el @@ -7248,7 +7248,7 @@ (toolbar-mail-commands-alist): New variable. (toolbar-mail-reader): Ditto. (toolbar-mail): Use them. - + * x11/x-menubar.el: Shorten help menu item names. Thu Jan 30 17:22:15 1997 Alexandre Oliva @@ -7306,15 +7306,15 @@ (ps-print-version): Fix value. (cl lisp-float-type): Require them. (ps-number-of-columns ps-*-font-size): Try to select defaults - better suited when `ps-landscape-mode' is non-nil. + better suited when `ps-landscape-mode' is non-nil. (ps-*-faces): Change default for Font Lock mode faces when - `ps-print-color-p' is nil. + `ps-print-color-p' is nil. (ps-right-header): Replace `time-stamp-yy/mm/dd' - by `time-stamp-mon-dd-yyyy'. - (ps-end-file ps-begin-page): Fix bug in page count for Ghostview. + by `time-stamp-mon-dd-yyyy'. + (ps-end-file ps-begin-page): Fix bug in page count for Ghostview. (ps-generate-postscript-with-faces): Replace `ps-sorter' by - `car-less-than-car'. - (ps-plot ps-generate): Replace `%d' by `%3d'. + `car-less-than-car'. + (ps-plot ps-generate): Replace `%d' by `%3d'. Wed Jan 22 15:32:39 1997 Greg Klanderman @@ -7336,7 +7336,7 @@ * mule/mule-init.el (init-mule): Get Japanese man pages working. Fri Jan 17 17:22:54 1997 Hrvoje Niksic - + * man.el (Manual-mode): Don't mess with scrollbars if they aren't present. @@ -7806,7 +7806,7 @@ Let `buffers-menu-submenus-for-groups-p' be an integer : if there are more buffers than this value, use submenus, otherwise not. - + * packages/vc.el (vc-rename-this-file): New function (was missing, but referred to on the menubar). @@ -7871,7 +7871,7 @@ * electric/ebuff-menu.el (electric-buffer-menu-mode-map): Correct bad 19.34 synch patch. - + * utils/pretty-print.el: New File. Sun Dec 8 13:59:40 1996 Steven L Baur @@ -8029,7 +8029,7 @@ evaluated more than once. Comment formatting changes. - + * edebug/advise-eval-region.el: New File. Separate out advise for eval-region so it is only evaluated once. @@ -8037,7 +8037,7 @@ icomplete-exhibit needs to be called in the setup-hook. - * packages/apropos.el: Correct a typo in button binding. + * packages/apropos.el: Correct a typo in button binding. Fixes the bug where if apropos-label-face is actually defined as face, apropos bombs with an error @@ -8050,7 +8050,5 @@ Redefines the default faces for the various apropos faces so they come out in color by default (defaults are based on various standard font-lock faces). - + * version.el: Bumped up to b31. - - diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/abbrev.el --- a/lisp/abbrev.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/abbrev.el Mon Aug 13 11:16:07 2007 +0200 @@ -419,6 +419,17 @@ (write-region 1 (point-max) file) (erase-buffer))) +(defun abbrev-string-to-be-defined (arg) + "Return the string for which an abbrev will be defined. +ARG is the argument to `add-global-abbrev' or `add-mode-abbrev'." + (if (and (not arg) (region-active-p)) (setq arg 0) + (setq arg (prefix-numeric-value arg))) + (and (>= arg 0) + (buffer-substring + (point) + (if (= arg 0) (mark) + (save-excursion (forward-word (- arg)) (point)))))) + (defun add-mode-abbrev (arg) "Define mode-specific abbrev for last word(s) before point. Argument is how many words before point form the expansion; @@ -450,13 +461,7 @@ (defun add-abbrev (table type arg) ;; XEmacs change: - (if (and (not arg) (region-active-p)) (setq arg 0) - (setq arg (prefix-numeric-value arg))) - (let ((exp (and (>= arg 0) - (buffer-substring - (point) - (if (= arg 0) (mark) - (save-excursion (forward-word (- arg)) (point)))))) + (let ((exp (abbrev-string-to-be-defined arg)) name) (setq name (read-string (format (if exp "%s abbrev for \"%s\": " @@ -469,6 +474,14 @@ name (abbrev-expansion name table)))) (define-abbrev table (downcase name) exp)))) +(defun inverse-abbrev-string-to-be-defined (arg) + "Return the string for which an inverse abbrev will be defined. +ARG is the argument to `inverse-add-global-abbrev' or +`inverse-add-mode-abbrev'." + (save-excursion + (forward-word (- arg)) + (buffer-substring (point) (progn (forward-word 1) (point))))) + (defun inverse-add-mode-abbrev (arg) "Define last word before point as a mode-specific abbrev. With prefix argument N, defines the Nth word before point. diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/alist.el --- a/lisp/alist.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/alist.el Mon Aug 13 11:16:07 2007 +0200 @@ -22,7 +22,18 @@ ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. -;;; Code: + +;;;###autoload +(defun vassoc (key valist) + "Search VALIST for a vector whose first element is equal to KEY. +See also `assoc'." + ;; by Stig@hackvan.com + (let (el) + (catch 'done + (while (setq el (pop valist)) + (and (equal key (aref el 0)) + (throw 'done el)))))) + ;;;###autoload (defun put-alist (item value alist) diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/auto-autoloads.el --- a/lisp/auto-autoloads.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/auto-autoloads.el Mon Aug 13 11:16:07 2007 +0200 @@ -1,5 +1,5 @@ ;;; DO NOT MODIFY THIS FILE -(if (featurep 'Standard-autoloads) (error "Already loaded")) +(if (featurep 'lisp-autoloads) (error "Already loaded")) ;;;### (autoloads nil "abbrev" "lisp/abbrev.el") @@ -12,7 +12,11 @@ ;;;*** -;;;### (autoloads (set-modified-alist modify-alist remove-alist set-alist del-alist put-alist) "alist" "lisp/alist.el") +;;;### (autoloads (set-modified-alist modify-alist remove-alist set-alist del-alist put-alist vassoc) "alist" "lisp/alist.el") + +(autoload 'vassoc "alist" "\ +Search VALIST for a vector whose first element is equal to KEY. +See also `assoc'." nil nil) (autoload 'put-alist "alist" "\ Modify ALIST to set VALUE to ITEM. @@ -83,7 +87,7 @@ (autoload 'update-file-autoloads "autoload" "\ Update the autoloads for FILE in `generated-autoload-file' \(which FILE might bind in its local variables). -This functions refuses to update autoloads files." t nil) +This function refuses to update autoloads files." t nil) (autoload 'update-autoloads-here "autoload" "\ Update sections of the current buffer generated by `update-file-autoloads'." t nil) @@ -830,7 +834,7 @@ tag-mark-stack-max how many tags-based hops to remember" t nil) (autoload 'find-tag-other-window "etags" "\ -*Find tag whose name contains TAGNAME. +*Find tag whose name contains TAGNAME, in another window. Selects the buffer that the tag is contained in in another window and puts point at its definition. If TAGNAME is a null string, the expression in the buffer @@ -1205,9 +1209,15 @@ List of directories to search for Info documentation files. The first directory in this list, the \"dir\" file there will become -the (dir)Top node of the Info documentation tree. If you wish to -modify the info search path, use `M-x customize-variable, -Info-directory-list' to do so.") +the (dir)Top node of the Info documentation tree. + +Note: DO NOT use the `customize' interface to change the value of this +variable. Its value is created dynamically on each startup, depending +on XEmacs packages installed on the system. If you want to change the +search path, make the needed modifications on the variable's value +from .emacs. For instance: + + (setq Info-directory-list (cons \"~/info\" Info-directory-list))") (autoload 'info "info" "\ Enter Info, the documentation browser. @@ -1361,7 +1371,7 @@ be lexically ordered. It is debatable if it makes sense to have more than one version of a package available.") -(defcustom package-get-download-sites '(("xemacs.org" "ftp.xemacs.org" "pub/xemacs/packages") ("cso.uiuc.edu" "ftp.cso.uiuc.edu" "pub/packages/xemacs/packages") ("unicamp.br" "ftp.unicamp.br" "pub/xemacs/packages") ("sunsite.cnlab-switch.ch" "sunsite.cnlab-switch.ch" "mirror/xemacs/packages") ("tu-darmstadt.de" "ftp.tu-darmstadt.de" "pub/editors/xemacs/packages") ("sunsite.auc.dk" "sunsite.auc.dk" "pub/emacs/xemacs/packages") ("pasteur.fr" "ftp.pasteur.fr" "pub/computing/xemacs/packages") ("cenatls.cena.dgac.fr" "ftp.cenatls.cena.dgac.fr" "pub/Emacs/xemacs/packages") ("kfki.hu" "ftp.kfki.hu" "pub/packages/xemacs/packages") ("uniroma2.it" "ftp.uniroma2.it" "unix/misc/dist/XEMACS/packages") ("icm.edu.pl" "ftp.icm.edu.pl" "pub/unix/editors/xemacs/packages") ("sunet.se" "ftp.sunet.se" "pub/gnu/xemacs/packages") ("doc.ic.ac.uk" "sunsite.doc.ic.ac.uk" "packages/xemacs/packages") ("srcc.msu.su" "ftp1.srcc.msu.su" "mirror/ftp.xemacs.org/packages") ("usyd.edu.au" "ftp.usyd.edu.au" "pub/Xemacs/packages") ("netlab.is.tsukuba.ac.jp" "ftp.netlab.is.tsukuba.ac.jp" "pub/GNU/xemacs/packages") ("jaist.ac.jp" "ftp.jaist.ac.jp" "pub/GNU/xemacs/packages") ("ring.aist.go.jp" "ring.aist.go.jp" "pub/text/xemacs/packages") ("ring.asahi-net.or.jp" "ring.asahi-net.or.jp" "pub/text/xemacs/packages") ("SunSITE.sut.ac.jp" "SunSITE.sut.ac.jp" "pub/archives/packages/xemacs/packages") ("dti.ad.jp" "ftp.dti.ad.jp" "pub/unix/editor/xemacs/packages") ("kreonet.re.kr" "ftp.kreonet.re.kr" "pub/tools/emacs/xemacs/packages")) "*List of remote sites available for downloading packages.\nList format is '(site-description site-name directory-on-site).\nSITE-DESCRIPTION is a textual description of the site. SITE-NAME\nis the internet address of the download site. DIRECTORY-ON-SITE\nis the directory on the site in which packages may be found.\nThis variable is used to initialize `package-get-remote', the\nvariable actually used to specify package download sites." :tag "Package download sites" :type '(repeat (list hostname directory)) :group 'package-get) +(defcustom package-get-download-sites '(("xemacs.org" "ftp.xemacs.org" "pub/xemacs/packages") ("crc.ca (Canada)" "ftp.crc.ca" "pub/packages/editors/xemacs/packages") ("ualberta.ca (Canada)" "sunsite.ualberta.ca" "pub/Mirror/xemacs/packages") ("uiuc.edu (United States)" "uiarchive.uiuc.edu" "pub/packages/xemacs/packages") ("unc.edu (United States)" "metalab.unc.edu" "pub/packages/editors/xemacs/packages") ("utk.edu (United States)" "ftp.sunsite.utk.edu" "pub/xemacs/packages") ("unicamp.br (Brazil)" "ftp.unicamp.br" "pub/xemacs/packages") ("tuwien.ac.at (Austria)" "gd.tuwien.ac.at" "editors/xemacs/packages") ("auc.dk (Denmark)" "sunsite.auc.dk" "pub/emacs/xemacs/packages") ("doc.ic.ac.uk (England)" "sunsite.doc.ic.ac.uk" "packages/xemacs/packages") ("funet.fi (Finland)" "ftp.funet.fi" "pub/mirrors/ftp.xemacs.org/pub/tux/xemacs/packages") ("cenatls.cena.dgac.fr (France)" "ftp.cenatls.cena.dgac.fr" "Emacs/xemacs/packages") ("pasteur.fr (France)" "ftp.pasteur.fr" "pub/computing/xemacs/packages") ("tu-darmstadt.de (Germany)" "ftp.tu-darmstadt.de" "pub/editors/xemacs/packages") ("kfki.hu (Hungary)" "ftp.kfki.hu" "pub/packages/xemacs/packages") ("eunet.ie (Ireland)" "ftp.eunet.ie" "mirrors/ftp.xemacs.org/pub/xemacs/packages") ("uniroma2.it (Italy)" "ftp.uniroma2.it" "unix/misc/dist/XEMACS/packages") ("uio.no (Norway)" "sunsite.uio.no" "pub/xemacs/packages") ("icm.edu.pl (Poland)" "ftp.icm.edu.pl" "pub/unix/editors/xemacs/packages") ("srcc.msu.su (Russia)" "ftp.srcc.msu.su" "mirror/ftp.xemacs.org/packages") ("sunet.se (Sweden)" "ftp.sunet.se" "pub/gnu/xemacs/packages") ("cnlab-switch.ch (Switzerland)" "sunsite.cnlab-switch.ch" "mirror/xemacs/packages") ("aist.go.jp (Japan)" "ring.aist.go.jp" "pub/text/xemacs/packages") ("asahi-net.or.jp (Japan)" "ring.asahi-net.or.jp" "pub/text/xemacs/packages") ("dti.ad.jp (Japan)" "ftp.dti.ad.jp" "pub/unix/editor/xemacs/packages") ("jaist.ac.jp (Japan)" "ftp.jaist.ac.jp" "pub/GNU/xemacs/packages") ("nucba.ac.jp (Japan)" "mirror.nucba.ac.jp" "mirror/xemacs/packages") ("sut.ac.jp (Japan)" "sunsite.sut.ac.jp" "pub/archives/packages/xemacs/packages") ("tsukuba.ac.jp (Japan)" "ftp.netlab.is.tsukuba.ac.jp" "pub/GNU/xemacs/packages") ("kreonet.re.kr (Korea)" "ftp.kreonet.re.kr" "pub/tools/emacs/xemacs/packages") ("nctu.edu.tw (Taiwan)" "coda.nctu.edu.tw" "Editors/xemacs/packages") ("sun.ac.za (South Africa)" "ftp.sun.ac.za" "xemacs/packages") ("isu.net.sa (Saudi Arabia)" "ftp.isu.net.sa" "pub/mirrors/ftp.xemacs.org/packages") ("aarnet.edu.au (Australia)" "mirror.aarnet.edu.au" "pub/xemacs/packages")) "*List of remote sites available for downloading packages.\nList format is '(site-description site-name directory-on-site).\nSITE-DESCRIPTION is a textual description of the site. SITE-NAME\nis the internet address of the download site. DIRECTORY-ON-SITE\nis the directory on the site in which packages may be found.\nThis variable is used to initialize `package-get-remote', the\nvariable actually used to specify package download sites." :tag "Package download sites" :type '(repeat (list (string :tag "Name") host-name directory)) :group 'package-get) (autoload 'package-get-download-menu "package-get" "\ Build the `Add Download Site' menu." nil nil) @@ -1428,7 +1438,7 @@ INSTALL-DIR, if non-nil, specifies the package directory where fetched packages should be installed. -The value of `package-get-base' is used to determine what files should +The value of `package-get-base' is used to determine what files should be retrieved. The value of `package-get-remote' is used to determine where a package should be retrieved from. The sites are tried in order so one is better off listing easily reached sites first. @@ -1444,7 +1454,7 @@ (autoload 'package-get-package-provider "package-get" "\ Search for a package that provides SYM and return the name and version. Searches in `package-get-base' for SYM. If SYM is a - consp, then it must match a corresponding (provide (SYM VERSION)) from + consp, then it must match a corresponding (provide (SYM VERSION)) from the package. If FORCE-CURRENT is non-nil make sure the database is up to date. This might @@ -1540,18 +1550,7 @@ ;;;*** -;;;### (autoloads (clear-rectangle string-rectangle open-rectangle insert-rectangle yank-rectangle extract-rectangle delete-extract-rectangle delete-rectangle kill-rectangle) "rect" "lisp/rect.el") - -(defvar killed-rectangle nil "\ -Rectangle for `yank-rectangle' to insert.") - -(autoload 'kill-rectangle "rect" "\ -Delete the region-rectangle and save it as the last killed one. -You might prefer to use `delete-extract-rectangle' from a program. - -When called from a program, the rectangle's corners are START and END. -With a prefix (or FILL) argument, also fill lines where nothing has to be -deleted." t nil) +;;;### (autoloads (clear-rectangle string-rectangle open-rectangle insert-rectangle yank-rectangle kill-rectangle extract-rectangle delete-extract-rectangle delete-rectangle) "rect" "lisp/rect.el") (autoload 'delete-rectangle "rect" "\ Delete the text in the region-rectangle without saving it. @@ -1573,6 +1572,17 @@ Return the contents of the rectangle with corners at START and END, as a list of strings, one for each line of the rectangle." nil nil) +(defvar killed-rectangle nil "\ +Rectangle for `yank-rectangle' to insert.") + +(autoload 'kill-rectangle "rect" "\ +Delete the region-rectangle and save it as the last killed one. +You might prefer to use `delete-extract-rectangle' from a program. + +When called from a program, the rectangle's corners are START and END. +With a prefix (or FILL) argument, also fill lines where nothing has to be +deleted." t nil) + (autoload 'yank-rectangle "rect" "\ Yank the last killed rectangle with upper left corner at point." t nil) @@ -1593,8 +1603,10 @@ (autoload 'string-rectangle "rect" "\ Insert STRING on each line of the region-rectangle, shifting text right. -The left edge of the rectangle specifies the column for insertion. This -command does not delete or overwrite any existing text. +The left edge of the rectangle specifies the column for insertion. + +If `pending-delete-mode' is active the string replace the region. +Otherwise this command does not delete or overwrite any existing text. When called from a program, the rectangle's corners are START and END." t nil) @@ -1825,4 +1837,4 @@ ;;;*** -(provide 'Standard-autoloads) +(provide 'lisp-autoloads) diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/buff-menu.el --- a/lisp/buff-menu.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/buff-menu.el Mon Aug 13 11:16:07 2007 +0200 @@ -634,6 +634,11 @@ files-only)) buffer)) +(defun buffers-menu-omit-invisible-buffers (buf) + "For use as a value of `buffers-menu-omit-function'. +Omits normally invisible buffers (those whose name begins with a space)." + (not (null (string-match "\\` " (buffer-name buf))))) + (provide 'buff-menu) ;;; buff-menu.el ends here diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/buffer.el --- a/lisp/buffer.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/buffer.el Mon Aug 13 11:16:07 2007 +0200 @@ -60,10 +60,7 @@ (set-buffer-major-mode buf)))) (push-window-configuration) (set-buffer buf) - (set-window-buffer (if (eq (selected-window) (minibuffer-window)) - (next-window (minibuffer-window)) - (selected-window)) - buf norecord) + (set-window-buffer (last-nonminibuf-window) buf norecord) buf)) (defun pop-to-buffer (bufname &optional not-this-window-p on-frame) diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/build-report.el --- a/lisp/build-report.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/build-report.el Mon Aug 13 11:16:07 2007 +0200 @@ -138,7 +138,7 @@ ;; Bandaid (when (featurep 'mime-setup) ;; No (defvaralias ...) so far. Thanks to "Didier Verna" - ;; for reporting my incorrect defvaraliasing of + ;; for reporting my incorrect defvaraliasing of ;; `mime-editor/insert-tag'. ;; Thanks to Jens-Ulrik Holger Petersen ;; for suggesting the conditional @@ -213,7 +213,7 @@ (progn (mime-edit-insert-tag "text" - "plain" + "plain" (concat "\nContent-Disposition: attachment;" " filename=\"" @@ -229,7 +229,7 @@ (goto-char (point-min)) (delete-matching-lines (build-report-delete)) (goto-char (point-min)) - (insert "> Contents of " + (insert "> Contents of " build-report-make-output-file "\n> keeping lines matching\n> \"" (build-report-keep) @@ -239,7 +239,7 @@ (insert "> " build-report-make-output-file " does not exist!\n\n")) (buffer-string))) - + (defun build-report-insert-installation-file (where all) "Inserts the contents of the `build-report-installation-file' created by the XEmacs Beta configure process." @@ -258,7 +258,7 @@ (progn (mime-edit-insert-tag "text" - "plain" + "plain" (concat "\nContent-Disposition: attachment;" " filename=\"" diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/cl-macs.el --- a/lisp/cl-macs.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/cl-macs.el Mon Aug 13 11:16:07 2007 +0200 @@ -106,31 +106,6 @@ (run-hooks 'cl-hack-bytecomp-hook)) -;;; Symbols. - -(defvar *gensym-counter*) - -;;;###autoload -(defun gensym (&optional arg) - "Generate a new uninterned symbol. -The name is made by appending a number to PREFIX, default \"G\"." - (let ((prefix (if (stringp arg) arg "G")) - (num (if (integerp arg) arg - (prog1 *gensym-counter* - (setq *gensym-counter* (1+ *gensym-counter*)))))) - (make-symbol (format "%s%d" prefix num)))) - -;;;###autoload -(defun gentemp (&optional arg) - "Generate a new interned symbol with a unique name. -The name is made by appending a number to PREFIX, default \"G\"." - (let ((prefix (if (stringp arg) arg "G")) - name) - (while (intern-soft (setq name (format "%s%d" prefix *gensym-counter*))) - (setq *gensym-counter* (1+ *gensym-counter*))) - (intern name))) - - ;;; Program structure. ;;;###autoload diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/cl.el --- a/lisp/cl.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/cl.el Mon Aug 13 11:16:07 2007 +0200 @@ -317,6 +317,23 @@ (defvar *gensym-counter* (* (logand (cl-random-time) 1023) 100)) +(defun gensym (&optional arg) + "Generate a new uninterned symbol. +The name is made by appending a number to PREFIX, default \"G\"." + (let ((prefix (if (stringp arg) arg "G")) + (num (if (integerp arg) arg + (prog1 *gensym-counter* + (setq *gensym-counter* (1+ *gensym-counter*)))))) + (make-symbol (format "%s%d" prefix num)))) + +(defun gentemp (&optional arg) + "Generate a new interned symbol with a unique name. +The name is made by appending a number to PREFIX, default \"G\"." + (let ((prefix (if (stringp arg) arg "G")) + name) + (while (intern-soft (setq name (format "%s%d" prefix *gensym-counter*))) + (setq *gensym-counter* (1+ *gensym-counter*))) + (intern name))) ;;; Numbers. diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/coding.el --- a/lisp/coding.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/coding.el Mon Aug 13 11:16:07 2007 +0200 @@ -104,6 +104,9 @@ (interactive "zkeyboard-coding-system: ") (get-coding-system coding-system) ; correctness check (setq keyboard-coding-system coding-system) + (if (eq (device-type) 'tty) + (set-console-tty-input-coding-system + (device-console) keyboard-coding-system)) (redraw-modeline t)) (defsubst terminal-coding-system () @@ -117,7 +120,8 @@ (setq terminal-coding-system coding-system) ; #### should this affect all current tty consoles ? (if (eq (device-type) 'tty) - (set-console-tty-coding-system (device-console) terminal-coding-system)) + (set-console-tty-output-coding-system + (device-console) terminal-coding-system)) (redraw-modeline t)) (defun set-pathname-coding-system (coding-system) diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/custom-load.el --- a/lisp/custom-load.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/custom-load.el Mon Aug 13 11:16:07 2007 +0200 @@ -69,7 +69,7 @@ (custom-add-loads 'languages '("lisp-mode" "cus-edit" "font-lock")) (custom-add-loads 'fill '("simple" "fill")) (custom-add-loads 'custom-magic-faces '("cus-edit")) -(custom-add-loads 'display '("toolbar" "scrollbar" "gutter-items" "auto-show")) +(custom-add-loads 'display '("toolbar" "scrollbar" "auto-show")) (custom-add-loads 'faces '("faces" "cus-edit" "font-lock" "font" "hyper-apropos" "info" "wid-edit")) (custom-add-loads 'emacs '("faces" "help" "files" "cus-edit" "package-get")) (custom-add-loads 'processes '("process" "gnuserv")) @@ -83,7 +83,7 @@ (custom-add-loads 'matching '("simple" "isearch-mode" "hyper-apropos")) (custom-add-loads 'i18n '("cus-edit")) (custom-add-loads 'info '("toolbar-items" "info")) -(custom-add-loads 'x '("x-faces" "font-menu")) +(custom-add-loads 'x '("x-faces")) (custom-add-loads 'buffers-tab '("gutter-items")) ;;; custom-load.el ends here diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/custom.el --- a/lisp/custom.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/custom.el Mon Aug 13 11:16:07 2007 +0200 @@ -227,7 +227,7 @@ match one of the ITEM. The following REQ are defined: `type' (the value of `window-system') - Should be one of `x' or `tty'. + Should be one of `x', `mswindows', or `tty'. `class' (the frame's color support) Should be one of `color', `grayscale', or `mono'. diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/dialog.el --- a/lisp/dialog.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/dialog.el Mon Aug 13 11:16:07 2007 +0200 @@ -37,8 +37,8 @@ event) (popup-dialog-box ;; "Non-violent language please!" says Robin. - (cons prompt '(["Yes" yes t] ["No" no t] nil ["Cancel" abort t]))) -; (cons prompt '(["Yes" yes t] ["No" no t] nil ["Abort" abort t]))) + (cons prompt '(["%_Yes" yes t] ["%_No" no t] nil ["%_Cancel" abort t]))) +; (cons prompt '(["%_Yes" yes t] ["%_No" no t] nil ["A%_bort" abort t]))) (catch 'ynp-done (while t (setq event (next-command-event event)) @@ -138,7 +138,7 @@ nil) (let ((str (apply 'format fmt args))) (if (device-on-window-system-p) - (get-dialog-box-response nil (list str (cons "OK" t))) + (get-dialog-box-response nil (list str (cons "%_OK" t))) (display-message 'message str)) str))) diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/dumped-lisp.el --- a/lisp/dumped-lisp.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/dumped-lisp.el Mon Aug 13 11:16:07 2007 +0200 @@ -165,7 +165,7 @@ (when-feature (and (not infodock) (or x mswindows) menubar) "menubar-items") (when-feature (and infodock (or x mswindows) menubar) "id-menus") - (when-feature (and gutter menubar window-system) "gutter-items") + (when-feature (and gutter window-system) "gutter-items") (when-feature x "x-faces") (when-feature x "x-iso8859-1") (when-feature x "x-mouse") diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/files.el --- a/lisp/files.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/files.el Mon Aug 13 11:16:07 2007 +0200 @@ -1028,7 +1028,8 @@ (setq buf (current-buffer)))) (t (kill-buffer buf) - (signal (car data) (cdr data)))))) + (signal (car data) (cdr data)))) + )) buf))) ;; FSF has `insert-file-literally' and `find-file-literally' here. @@ -1193,7 +1194,9 @@ ("\\.lex\\'" . c-mode) ("\\.m\\'" . objc-mode) ("\\.oak\\'" . scheme-mode) - ("\\.s?html?\\'" . html-mode) + ("\\.[sj]?html?\\'" . html-mode) + ("\\.jsp\\'" . html-mode) + ("\\.xml\\'" . xml-mode) ("\\.htm?l?3\\'" . html3-mode) ("\\.\\(?:sgml?\\|dtd\\)\\'" . sgml-mode) ("\\.c?ps\\'" . postscript-mode) @@ -2459,7 +2462,7 @@ (recursive-edit) ;; Return nil to ask about BUF again. nil) - "display the current buffer")))) + "%_Display Buffer")))) (abbrevs-done (and save-abbrevs abbrevs-changed (progn diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/font-lock.el --- a/lisp/font-lock.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/font-lock.el Mon Aug 13 11:16:07 2007 +0200 @@ -584,11 +584,10 @@ font-lock-preprocessor-face font-lock-warning-face)) -;; #### There should be an emulation for the old font-lock-use-* -;; settings! - (defface font-lock-comment-face '((((class color) (background dark)) (:foreground "gray80")) + ;; blue4 is hardly different from black on windows. + (((class color) (background light) (type mswindows)) (:foreground "blue")) (((class color) (background light)) (:foreground "blue4")) (((class grayscale) (background light)) (:foreground "DimGray" :bold t :italic t)) @@ -620,6 +619,8 @@ (defface font-lock-keyword-face '((((class color) (background dark)) (:foreground "cyan")) + ;; red4 is hardly different from black on windows. + (((class color) (background light) (type mswindows)) (:foreground "red")) (((class color) (background light)) (:foreground "red4")) (((class grayscale) (background light)) (:foreground "LightGray" :bold t)) (((class grayscale) (background dark)) (:foreground "DimGray" :bold t)) @@ -629,6 +630,11 @@ (defface font-lock-function-name-face '((((class color) (background dark)) (:foreground "aquamarine")) + ;; brown4 is hardly different from black on windows. + ;; I changed it to red because IMO it's pointless and ugly to + ;; use a million slightly different colors for niggly syntactic + ;; differences. --ben + (((class color) (background light) (type mswindows)) (:foreground "red")) (((class color) (background light)) (:foreground "brown4")) (t (:bold t :underline t))) "Font Lock mode face used to highlight function names." @@ -834,8 +840,9 @@ ((or (null maximum-size) (<= (buffer-size) maximum-size)) (font-lock-fontify-buffer)) (font-lock-verbose - (lmessage 'command "Fontifying %s... buffer too big." - (buffer-name))))) + (lprogress-display 'font-lock + "Fontifying %s... buffer too big." 'abort + (buffer-name))))) (font-lock-fontified (setq font-lock-fontified nil) (remove-hook 'before-revert-hook 'font-lock-revert-setup t) @@ -996,7 +1003,7 @@ (condition-case nil (save-excursion (font-lock-fontify-region (point-min) (point-max))) - (quit + (t (setq aborted t))) (or was-on ; turn it off if it was off. @@ -1004,7 +1011,7 @@ (font-lock-mode 0))) (set (make-local-variable 'font-lock-fontified) t) (when (and aborted font-lock-verbose) - (lmessage 'command "Fontifying %s... aborted." (buffer-name)))) + (lprogress-display 'font-lock "Fontifying %s... aborted." 'abort (buffer-name)))) (run-hooks 'font-lock-after-fontify-buffer-hook)) (defun font-lock-default-unfontify-buffer () @@ -1043,7 +1050,7 @@ (defun font-lock-default-unfontify-region (beg end &optional maybe-loudly) (when (and maybe-loudly font-lock-verbose (>= (- end beg) font-lock-message-threshold)) - (lmessage 'progress "Fontifying %s..." (buffer-name))) + (lprogress-display 'font-lock "Fontifying %s..." 0 (buffer-name))) (let ((modified (buffer-modified-p)) (buffer-undo-list t) (inhibit-read-only t) buffer-file-name buffer-file-truename) @@ -1305,8 +1312,8 @@ nil (when (and font-lock-verbose (>= (- end start) font-lock-message-threshold)) - (lmessage 'progress "Fontifying %s... (syntactically...)" - (buffer-name))) + (lprogress-display 'font-lock "Fontifying %s... (syntactically)" 5 + (buffer-name))) (font-lock-unfontify-region start end loudly) (goto-char start) (if (> end (point-max)) (setq end (point-max))) @@ -1493,14 +1500,13 @@ (keywords (cdr (if (eq (car-safe font-lock-keywords) t) font-lock-keywords (font-lock-compile-keywords)))) - (bufname (buffer-name)) (count 0) + (bufname (buffer-name)) (count 5) keyword matcher highlights) ;; ;; Fontify each item in `font-lock-keywords' from `start' to `end'. (while keywords - (when loudly (lmessage 'progress "Fontifying %s... (regexps..%s)" - bufname - (make-string (setq count (1+ count)) ?.))) + (when loudly (lprogress-display 'font-lock "Fontifying %s... (regexps)" + (setq count (+ count 5)) bufname)) ;; ;; Find an occurrence of `matcher' from `start' to `end'. (setq keyword (car keywords) matcher (car keyword)) @@ -1523,7 +1529,7 @@ (font-lock-fontify-anchored-keywords (car highlights) end)) (setq highlights (cdr highlights)))) (setq keywords (cdr keywords)))) - (if loudly (lmessage 'progress "Fontifying %s... done." (buffer-name))))) + (if loudly (lprogress-display 'font-lock "Fontifying %s... " 100 (buffer-name))))) ;; Various functions. @@ -1548,17 +1554,26 @@ (lazy-lock-after-fontify-buffer)))) ;; If the buffer is about to be reverted, it won't be fontified afterward. -(defun font-lock-revert-setup () - (setq font-lock-fontified nil)) +;(defun font-lock-revert-setup () +; (setq font-lock-fontified nil)) ;; If the buffer has just been reverted, normally that turns off ;; Font Lock mode. So turn the mode back on if necessary. ;; sb 1999-03-03 -- The above comment no longer appears to be operative as ;; the first call to normal-mode *will* restore the font-lock state and ;; this call forces a second font-locking to occur when reverting a buffer, -;; which is wasteful at best. -;(defalias 'font-lock-revert-cleanup 'turn-on-font-lock) -(defun font-lock-revert-cleanup ()) +;; which is wasteful at best. +;;(defun font-lock-revert-cleanup ()) + +;; 12-10-99. This still does not work right, I think +;; after change functions will still get us. The simplest thing to do +;; is unconditionally turn-off font-lock before revert (and thus nuke +;; all hooks) and then turn it on again afterwards. This also happens +;; to be much faster because fontifying from scratch is better than +;; trying to do incremental changes for the whole buffer. + +(defalias 'font-lock-revert-cleanup 'turn-on-font-lock) +(defalias 'font-lock-revert-setup 'turn-off-font-lock) ;; Various functions. diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/font-menu.el --- a/lisp/font-menu.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/font-menu.el Mon Aug 13 11:16:07 2007 +0200 @@ -168,16 +168,6 @@ ((x) . 10))) t) "Scale factor used in defining font sizes.") -(defun vassoc (key valist) - "Search VALIST for a vector whose first element is equal to KEY. -See also `assoc'." - ;; by Stig@hackvan.com - (let (el) - (catch 'done - (while (setq el (pop valist)) - (and (equal key (aref el 0)) - (throw 'done el)))))) - ;; only call XListFonts (and parse) once per device. ;; ( (device . [parsed-list-fonts family-menu size-menu weight-menu]) ...) (defvar device-fonts-cache nil) @@ -207,12 +197,12 @@ (message "Getting list of fonts from server... done."))) (defun font-menu-split-long-menu (menu) - "Split MENU according to `font-menu-max-items'." + "Split MENU according to `font-menu-max-items' and add accelerator specs." (let ((len (length menu))) (if (or (null font-menu-max-items) (null (featurep 'lisp-float-type)) (<= len font-menu-max-items)) - menu + (submenu-generate-accelerator-spec menu) ;; Submenu is max 2 entries longer than menu, never shorter, number of ;; entries in submenus differ by at most one (with longer submenus first) (let* ((outer (floor (sqrt len))) @@ -231,14 +221,20 @@ (setq result (cons (cons (if (stringp font-menu-submenu-name-format) (format font-menu-submenu-name-format - (aref (car sub) 0) (aref to 0)) + (menu-item-strip-accelerator-spec + (aref (car sub) 0)) + (menu-item-strip-accelerator-spec + (aref to 0))) (funcall font-menu-submenu-name-format - (aref (car sub) 0) (aref to 0))) - sub) + (menu-item-strip-accelerator-spec + (aref (car sub) 0)) + (menu-item-strip-accelerator-spec + (aref to 0)))) + (submenu-generate-accelerator-spec sub)) result) rest (1+ rest)) (if (= rest outer) (setq inner (1+ inner))))) - result)))) + (submenu-generate-accelerator-spec result))))) ;;;###autoload (defun font-menu-family-constructor (ignored) @@ -261,7 +257,7 @@ (font-menu-split-long-menu (mapcar (lambda (item) - (setq f (aref item 0) + (setq f (menu-item-strip-accelerator-spec (aref item 0)) entry (vassoc f (aref dcache 0))) (if (and (or (member weight (aref entry 1)) ;; mswindows often allows any weight @@ -309,7 +305,7 @@ (select-toggle-menu-item item) (deselect-toggle-menu-item item)) item) - (aref dcache 2))))) + (submenu-generate-accelerator-spec (aref dcache 2)))))) ;;;###autoload (defun font-menu-weight-constructor (ignored) @@ -338,7 +334,7 @@ (select-toggle-menu-item item) (deselect-toggle-menu-item item)) item) - (aref dcache 3))))) + (submenu-generate-accelerator-spec (aref dcache 3)))))) ;;; Changing font sizes @@ -351,11 +347,10 @@ (font-data (font-menu-font-data 'default dcache)) (from-family (aref font-data 1)) (from-size (aref font-data 2)) - (from-weight (aref font-data 3)) + (from-weight (aref font-data 3)) (from-slant (aref font-data 4)) - (face-list-to-change (delq 'default (face-list))) - new-default-face-font - new-props) + (face-list-to-change (delq 'default (face-list))) + new-default-face-font) (unless from-family (signal 'error '("couldn't parse font name for default face"))) (when weight @@ -396,14 +391,14 @@ (and font-menu-this-frame-only-p (selected-frame))) ;; OK Let Customize do it. (custom-set-face-update-spec 'default - (list (list 'type (device-type))) - (list :family family - :size (concat - (int-to-string - (/ (or size from-size) - (specifier-instance font-menu-size-scaling - (selected-device)))) - "pt"))) + (list (list 'type (device-type))) + (list :family family + :size (concat + (int-to-string + (/ (or size from-size) + (specifier-instance font-menu-size-scaling + (selected-device)))) + "pt"))) (message "Font %s" (face-font-name 'default))))) diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/gutter-items.el --- a/lisp/gutter-items.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/gutter-items.el Mon Aug 13 11:16:07 2007 +0200 @@ -1,7 +1,7 @@ ;;; gutter-items.el --- Gutter content for XEmacs. ;; Copyright (C) 1999 Free Software Foundation, Inc. -;; Copyright (C) 1999 Andy Piper. +;; Copyright (C) 1999, 2000 Andy Piper. ;; Maintainer: XEmacs Development Team ;; Keywords: frames, extensions, internal, dumped @@ -30,26 +30,13 @@ "Input from the gutters." :group 'environment) -(defvar gutter-buffers-tab nil - "A tab widget in the gutter for displaying buffers. -Do not set this. Use `glyph-image-instance' and -`set-image-instance-property' to change the properties of the tab.") - -(defcustom gutter-visible-p - (specifier-instance default-gutter-visible-p) - "Whether the default gutter is globally visible. This option can be -customized through the options menu." - :group 'gutter - :type 'boolean - :set #'(lambda (var val) - (set-specifier default-gutter-visible-p val) - (setq gutter-visible-p val) - (when gutter-buffers-tab (update-tab-in-gutter)))) - +;; Although these customizations appear bogus, they are neccessary in +;; order to be able to save options through the options menu. (defcustom default-gutter-position (default-gutter-position) "The location of the default gutter. It can be 'top, 'bottom, 'left or -'right. This option can be customized through the options menu." +'right. This option should be customized through the options menu. +To set the gutter position explicitly use `set-default-gutter-position'" :group 'gutter :type '(choice (const :tag "top" top) (const :tag "bottom" bottom) @@ -57,8 +44,68 @@ (const :tag "right" right)) :set #'(lambda (var val) (set-default-gutter-position val) - (setq default-gutter-position val) - (when gutter-buffers-tab (update-tab-in-gutter)))) + (setq default-gutter-position val))) + +;;; Gutter helper functions + +;; called by Fset_default_gutter_position() +(defvar default-gutter-position-changed-hook nil + "Function or functions to be called when the gutter position is changed. +The value of this variable may be buffer-local.") + +;; called by set-gutter-element-visible-p +(defvar gutter-element-visibility-changed-hook nil + "Function or functions to be called when the visibility of an +element in the gutter changes. The value of this variable may be +buffer-local. The gutter element symbol is passed as an argument to +the hook, as is the visibility flag.") + +(defun set-gutter-element (gutter-specifier prop val &optional locale tag-set) + "Set GUTTER-SPECIFIER gutter element PROP to VAL in optional LOCALE. +This is a convenience function for setting gutter elements." + (map-extents #'(lambda (extent arg) + (set-extent-property extent 'duplicable t)) val) + (modify-specifier-instances gutter-specifier #'plist-put (list prop val) + 'force nil locale tag-set)) + +(defun remove-gutter-element (gutter-specifier prop &optional locale tag-set) + "Remove gutter element PROP from GUTTER-SPECIFIER in optional LOCALE. +This is a convenience function for removing gutter elements." + (modify-specifier-instances gutter-specifier #'plist-remprop (list prop) + 'force nil locale tag-set)) + +(defun set-gutter-element-visible-p (gutter-visible-specifier-p + prop &optional visible-p + locale tag-set) + "Change the visibility of gutter elements. +Set the visibility of element PROP to VISIBLE-P for +GUTTER-SPECIFIER-VISIBLE-P in optional LOCALE. +This is a convenience function for hiding and showing gutter elements." + (modify-specifier-instances + gutter-visible-specifier-p #'(lambda (spec prop visible-p) + (if (consp spec) + (if visible-p + (if (memq prop spec) spec + (cons prop spec)) + (delq prop spec)) + (if visible-p (list prop)))) + (list prop visible-p) + 'force nil locale tag-set) + (run-hook-with-args 'gutter-element-visibility-changed-hook prop visible-p)) + +(defun gutter-element-visible-p (gutter-visible-specifier-p + prop &optional domain) + "Determine whether a gutter element is visible. +Given GUTTER-VISIBLE-SPECIFIER-P and gutter element PROP, return +non-nil if it is visible in optional DOMAIN." + (let ((spec (specifier-instance gutter-visible-specifier-p domain))) + (or (and (listp spec) (memq 'buffers-tab spec)) + spec))) + +(defun init-gutter () + "Initialize the gutter." + ;; do nothing as yet. + ) ;;; The Buffers tab @@ -66,6 +113,21 @@ "Customization of `Buffers' tab." :group 'gutter) +(defvar gutter-buffers-tab nil + "A tab widget in the gutter for displaying buffers. +Do not set this. Use `glyph-image-instance' and +`set-image-instance-property' to change the properties of the tab.") + +(defcustom gutter-buffers-tab-visible-p + (gutter-element-visible-p default-gutter-visible-p 'buffers-tab) + "Whether the buffers tab is globally visible. +This option should be set through the options menu." + :group 'buffers-tab + :type 'boolean + :set #'(lambda (var val) + (set-gutter-element-visible-p default-gutter-visible-p 'buffers-tab val) + (setq gutter-buffers-tab-visible-p val))) + (defvar gutter-buffers-tab-orientation 'top "Where the buffers tab currently is. Do not set this.") @@ -109,6 +171,16 @@ function) :group 'buffers-tab) +(defcustom buffers-tab-sort-function nil + "*If non-nil, a function specifying the buffers to select from the +buffers tab. This is passed the buffer list and returns the list in the +order desired for the tab widget. The default value `nil' leaves the +list in `buffer-list' order (usual most-recently-selected-first)." + + :type '(choice (const :tag "None" nil) + function) + :group 'buffers-tab) + (make-face 'buffers-tab "Face for displaying the buffers tab.") (set-face-parent 'buffers-tab 'default) @@ -203,16 +275,37 @@ (buffer-name buffer)))) (defsubst build-buffers-tab-internal (buffers) - (let (line) + (let ((selected t)) (mapcar #'(lambda (buffer) - (setq line (funcall buffers-tab-format-buffer-line-function - buffer)) - (vector line (list buffers-tab-switch-to-buffer-function - (buffer-name buffer)))) + (prog1 + (vector + (funcall buffers-tab-format-buffer-line-function + buffer) + (list buffers-tab-switch-to-buffer-function + (buffer-name buffer)) + :selected selected) + (when selected (setq selected nil)))) buffers))) -(defun buffers-tab-items (&optional in-deletion frame) +;;; #### SJT I'd really like this function to have just two hooks: (1) the +;;; buffer filter list and (2) a sort function list. Both should be lists +;;; of functions. Each filter takes two arguments: a buffer and a model +;;; buffer. (The model buffer argument allows selecting according to the +;;; mode or directory of that buffer.) The filter returns t if the buffer +;;; should be listed and nil otherwise. Effectively the filter amounts to +;;; the conjuction of the filter list. (Optionally the filter could take a +;;; frame instead of a buffer or generalize to a locale as in a specifier?) +;;; The filtering is done this way to preserve the ordering imposed by +;;; `buffer-list'. In addition, the in-deletion argument will be used the +;;; same way as in the current design. +;;; The list is checked for length and pruned according to least-recently- +;;; selected. (Optionally there could be some kind of sort function here, +;;; too.) +;;; Finally the list is sorted to gutter display order, and the tab data +;;; structure is created and returned. +;;; #### Docstring isn't very well expressed. +(defun buffers-tab-items (&optional in-deletion frame force-selection) "This is the tab filter for the top-level buffers \"Buffers\" tab. It dynamically creates a list of buffers to use as the contents of the tab. Only the most-recently-used few buffers will be listed on the tab, for @@ -222,79 +315,107 @@ (save-match-data (let* ((buffers (delete-if buffers-tab-omit-function (buffer-list frame))) (first-buf (car buffers))) + ;; maybe force the selected window + (when (and force-selection + (not in-deletion) + (not (eq first-buf (window-buffer (selected-window frame))))) + (setq buffers (cons (window-buffer (selected-window frame)) + (delq first-buf buffers)))) ;; if we're in deletion ignore the current buffer (when in-deletion (setq buffers (delq (current-buffer) buffers)) (setq first-buf (car buffers))) - ;; group buffers by mode + ;; select buffers in group (default is by mode) (when buffers-tab-selection-function (delete-if-not #'(lambda (buf) (funcall buffers-tab-selection-function first-buf buf)) buffers)) + ;; maybe shorten list of buffers (and (integerp buffers-tab-max-size) (> buffers-tab-max-size 1) (> (length buffers) buffers-tab-max-size) - ;; shorten list of buffers (setcdr (nthcdr buffers-tab-max-size buffers) nil)) + ;; sort buffers in group (default is most-recently-selected) + (when buffers-tab-sort-function + (setq buffers (funcall buffers-tab-sort-function buffers))) + ;; convert list of buffers to list of structures used by tab widget (setq buffers (build-buffers-tab-internal buffers)) buffers))) (defun add-tab-to-gutter () "Put a tab control in the gutter area to hold the most recent buffers." (setq gutter-buffers-tab-orientation (default-gutter-position)) - (let ((gutter-string "")) + (let ((gutter-string "\n")) (unless gutter-buffers-tab-extent - (setq gutter-buffers-tab-extent (make-extent 0 0 gutter-string))) + (setq gutter-buffers-tab-extent (make-extent 0 1 gutter-string))) (set-extent-begin-glyph gutter-buffers-tab-extent (setq gutter-buffers-tab (make-glyph (vector 'tab-control :descriptor "Buffers" :face buffers-tab-face :orientation gutter-buffers-tab-orientation - :properties (list :items (buffers-tab-items)))))) - ;; This looks better than a 3d border - (mapcar '(lambda (x) - (when (valid-image-instantiator-format-p 'tab-control x) - (set-specifier default-gutter-border-width 0 'global x) - (set-specifier top-gutter nil 'global x) - (set-specifier bottom-gutter nil 'global x) - (set-specifier left-gutter nil 'global x) - (set-specifier right-gutter nil 'global x) - (set-specifier left-gutter-width 0 'global x) - (set-specifier right-gutter-width 0 'global x) - (cond ((eq gutter-buffers-tab-orientation 'top) - (set-specifier top-gutter gutter-string 'global x)) - ((eq gutter-buffers-tab-orientation 'bottom) - (set-specifier bottom-gutter gutter-string 'global x)) - ((eq gutter-buffers-tab-orientation 'left) - (set-specifier left-gutter gutter-string 'global x) - (set-specifier left-gutter-width - (glyph-width gutter-buffers-tab) - 'global x)) - ((eq gutter-buffers-tab-orientation 'right) - (set-specifier right-gutter gutter-string 'global x) - (set-specifier right-gutter-width - (glyph-width gutter-buffers-tab) - 'global x)) - ))) - (console-type-list)))) + (if (or (eq gutter-buffers-tab-orientation 'top) + (eq gutter-buffers-tab-orientation 'bottom)) + :pixel-width :pixel-height) + (if (or (eq gutter-buffers-tab-orientation 'top) + (eq gutter-buffers-tab-orientation 'bottom)) + '(gutter-pixel-width) '(gutter-pixel-height)) + :properties (list :items (buffers-tab-items nil nil t)))))) -(defun update-tab-in-gutter (&optional frame-or-buffer) + ;; Nuke all existing tabs + (remove-gutter-element top-gutter 'buffers-tab) + (remove-gutter-element bottom-gutter 'buffers-tab) + (remove-gutter-element left-gutter 'buffers-tab) + (remove-gutter-element right-gutter 'buffers-tab) + ;; Put tabs into all devices that will be able to display them + (mapcar + #'(lambda (x) + (when (valid-image-instantiator-format-p 'tab-control x) + (cond ((eq gutter-buffers-tab-orientation 'top) + ;; This looks better than a 3d border + (set-specifier top-gutter-border-width 0 'global x) + (set-gutter-element top-gutter 'buffers-tab + gutter-string 'global x)) + ((eq gutter-buffers-tab-orientation 'bottom) + (set-specifier bottom-gutter-border-width 0 'global x) + (set-gutter-element bottom-gutter 'buffers-tab + gutter-string 'global x)) + ((eq gutter-buffers-tab-orientation 'left) + (set-specifier left-gutter-border-width 0 'global x) + (set-gutter-element left-gutter 'buffers-tab + gutter-string 'global x) + (set-specifier left-gutter-width + (glyph-width gutter-buffers-tab) + 'global x)) + ((eq gutter-buffers-tab-orientation 'right) + (set-specifier right-gutter-border-width 0 'global x) + (set-gutter-element right-gutter 'buffers-tab + gutter-string 'global x) + (set-specifier right-gutter-width + (glyph-width gutter-buffers-tab) + 'global x)) + ))) + (console-type-list)))) + +(defun update-tab-in-gutter (&optional frame-or-buffer force-selection) "Update the tab control in the gutter area." (let ((locale (if (framep frame-or-buffer) frame-or-buffer))) - (when (specifier-instance default-gutter-visible-p locale) - (unless (and gutter-buffers-tab - (eq (default-gutter-position) - gutter-buffers-tab-orientation)) - (add-tab-to-gutter)) - (when (valid-image-instantiator-format-p 'tab-control locale) - (let ((inst (glyph-image-instance - gutter-buffers-tab - (when (framep frame-or-buffer) - (last-nonminibuf-window frame-or-buffer))))) - (set-image-instance-property inst :items - (buffers-tab-items - nil locale))))))) + ;; dedicated frames don't get tabs + (unless (and (framep locale) + (window-dedicated-p (frame-selected-window locale))) + (when (specifier-instance default-gutter-visible-p locale) + (unless (and gutter-buffers-tab + (eq (default-gutter-position) + gutter-buffers-tab-orientation)) + (add-tab-to-gutter)) + (when (valid-image-instantiator-format-p 'tab-control locale) + (let ((inst (glyph-image-instance + gutter-buffers-tab + (when (framep frame-or-buffer) + (last-nonminibuf-window frame-or-buffer))))) + (set-image-instance-property inst :items + (buffers-tab-items + nil locale force-selection)))))))) (defun remove-buffer-from-gutter-tab () "Remove the current buffer from the tab control in the gutter area." @@ -308,31 +429,52 @@ (get-buffer-create "*scratch*"))))) (set-image-instance-property inst :items buffers)))) +;; A myriad of different update hooks all doing slightly different things (add-hook 'kill-buffer-hook 'remove-buffer-from-gutter-tab) -(add-hook 'create-frame-hook 'update-tab-in-gutter) +(add-hook 'create-frame-hook + #'(lambda (frame) + (when gutter-buffers-tab (update-tab-in-gutter frame t)))) (add-hook 'record-buffer-hook 'update-tab-in-gutter) +(add-hook 'default-gutter-position-changed + #'(lambda (arg) + (when gutter-buffers-tab (update-tab-in-gutter arg)))) +(add-hook 'gutter-element-visibility-changed-hook + #'(lambda (prop visible-p) + (when (and (eq prop 'buffers-tab) visible-p) + (update-tab-in-gutter)))) ;; ;; progress display ;; ripped off from message display ;; +(defcustom progress-display-use-echo-area nil + "*Whether progress gauge display should display in the echo area. +If NIL then progress gauges will be displayed with whatever native widgets +are available on the current console. If non-NIL then progress display will be +textual and displayed in the echo area." + :type 'boolean + :group 'gutter) + (defvar progress-stack nil "An alist of label/string pairs representing active progress gauges. The first element in the list is currently displayed in the gutter area. -Do not modify this directly--use the `progress' or -`display-progress'/`clear-progress' functions.") +Do not modify this directly--use the `progress-display' or +`display-progress-display'/`clear-progress-display' functions.") (defvar progress-glyph-height 32 "Height of the gutter area for progress messages.") -(defvar progress-stop-callback 'progress-quit-function +(defvar progress-display-stop-callback 'progress-display-quit-function "Function to call to stop the progress operation.") -(defun progress-quit-function () +(defvar progress-display-popup-period 0.5 + "The time that the progress gauge should remain up after completion") + +(defun progress-display-quit-function () "Default function to call for the stop button in a progress gauge. This just removes the progress gauge and calls quit." (interactive) - (clear-progress) + (clear-progress-display) (keyboard-quit)) ;; private variables @@ -361,7 +503,7 @@ (vector 'button :pixel-height (- progress-glyph-height 8) :descriptor " Stop " - :callback '(funcall progress-stop-callback))))))))) + :callback '(funcall progress-display-stop-callback))))))))) (defvar progress-abort-glyph (make-glyph @@ -372,7 +514,7 @@ :pixel-height progress-glyph-height :orientation 'horizontal)))))) -(defvar progress-extent-text "") +(defvar progress-extent-text "\n") (defvar progress-extent nil) (defun progress-displayed-p (&optional return-string frame) @@ -387,8 +529,8 @@ ;;; Returns the string which remains in the echo area, or nil if none. ;;; If label is nil, the whole message stack is cleared. -(defun clear-progress (&optional label frame no-restore) - "Remove any progress gauge with the given LABEL from the progress gauge-stack, +(defun clear-progress-display (&optional label frame no-restore) + "Remove any progress gauge with LABEL from the progress gauge-stack, erasing it from the gutter area if it's currently displayed there. If a message remains at the head of the progress-stack and NO-RESTORE is nil, it will be displayed. The string which remains in the gutter @@ -397,23 +539,33 @@ Unless you need the return value or you need to specify a label, you should just use (progress nil)." - (or frame (setq frame (selected-frame))) - (remove-progress label frame) - (let ((inhibit-read-only t) - (zmacs-region-stays zmacs-region-stays)) ; preserve from change - (erase-buffer " *Echo Area*") - (erase-buffer (get-buffer-create " *Gutter Area*"))) - (if no-restore - nil ; just preparing to put another msg up - (if progress-stack - (let ((oldmsg (cdr (car progress-stack)))) - (raw-append-progress oldmsg frame) - oldmsg) - ;; nothing to display so get rid of the gauge - (set-specifier bottom-gutter-border-width 0 frame) - (set-specifier bottom-gutter-visible-p nil frame)))) + (if (or (not (valid-image-instantiator-format-p 'progress-gauge frame)) + progress-display-use-echo-area) + (clear-message label frame nil no-restore) + (or frame (setq frame (selected-frame))) + (remove-progress-display label frame) + (let ((inhibit-read-only t) + (zmacs-region-stays zmacs-region-stays)) ; preserve from change + (erase-buffer (get-buffer-create " *Gutter Area*"))) + (if no-restore + nil ; just preparing to put another msg up + (if progress-stack + (let ((oldmsg (cdr (car progress-stack)))) + (raw-append-progress-display oldmsg frame) + oldmsg) + ;; nothing to display so get rid of the gauge + (set-specifier bottom-gutter-border-width 0 frame) + (set-gutter-element-visible-p bottom-gutter-visible-p + 'progress nil frame))))) -(defun remove-progress (&optional label frame) +(defun progress-display-clear-when-idle (&optional label) + (add-hook 'pre-idle-hook + (defun progress-display-clear-pre-idle-hook () + (clear-progress-display label) + (remove-hook 'pre-idle-hook + 'progress-display-clear-pre-idle-hook)))) + +(defun remove-progress-display (&optional label frame) ;; If label is nil, we want to remove all matching progress gauges. (while (and progress-stack (or (null label) ; null label means clear whole stack @@ -427,7 +579,7 @@ (setcdr s (cdr (cdr s)))) (setq s (cdr s))))))) -(defun append-progress (label message &optional value frame) +(defun append-progress-display (label message &optional value frame) (or frame (setq frame (selected-frame))) ;; Add a new entry to the message-stack, or modify an existing one (let* ((top (car progress-stack)) @@ -435,141 +587,149 @@ (if (eq label (car top)) (progn (setcdr top message) - (if (eq tmsg message) + (if (equal tmsg message) (set-image-instance-property (glyph-image-instance progress-gauge-glyph) :percent value) - (raw-append-progress message value frame)) - (redisplay-gutter-area) - (when (input-pending-p) - (dispatch-event (next-command-event)))) + (raw-append-progress-display message value frame)) + (redisplay-gutter-area)) (push (cons label message) progress-stack) - (raw-append-progress message value frame)) - (when (eq value 100) - (sit-for 0.5 nil) - (clear-progress label)))) + (raw-append-progress-display message value frame)) + (dispatch-non-command-events) + ;; either get command events or sit waiting for them + (if (not (eq value 100)) + (when (input-pending-p) + (dispatch-event (next-command-event))) + (sit-for progress-display-popup-period nil) + (clear-progress-display label)))) -(defun abort-progress (label message &optional frame) - (or frame (setq frame (selected-frame))) - ;; Add a new entry to the message-stack, or modify an existing one - (let* ((top (car progress-stack)) - (inhibit-read-only t) - (zmacs-region-stays zmacs-region-stays)) - (if (eq label (car top)) - (setcdr top message) - (push (cons label message) progress-stack)) - (unless (equal message "") - (insert-string message (get-buffer-create " *Gutter Area*")) - ;; Do what the device is able to cope with. - (if (not (valid-image-instantiator-format-p 'progress-gauge frame)) - (progn - (insert-string message " *Echo Area*") - (if (not executing-kbd-macro) - (redisplay-echo-area))) +(defun abort-progress-display (label message &optional frame) + (if (or (not (valid-image-instantiator-format-p 'progress-gauge frame)) + progress-display-use-echo-area) + (display-message label (concat message "aborted.") frame) + (or frame (setq frame (selected-frame))) + ;; Add a new entry to the message-stack, or modify an existing one + (let* ((top (car progress-stack)) + (inhibit-read-only t) + (zmacs-region-stays zmacs-region-stays)) + (if (eq label (car top)) + (setcdr top message) + (push (cons label message) progress-stack)) + (unless (equal message "") + (insert-string message (get-buffer-create " *Gutter Area*")) + ;; Do what the device is able to cope with. ;; do some funky display here. (unless progress-extent - (setq progress-extent (make-extent 0 0 progress-extent-text))) + (setq progress-extent (make-extent 0 1 progress-extent-text))) (let ((bglyph (extent-begin-glyph progress-extent))) (set-extent-begin-glyph progress-extent progress-abort-glyph) ;; fixup the gutter specifiers - (set-specifier bottom-gutter progress-extent-text frame) + (set-gutter-element bottom-gutter + 'progress progress-extent-text frame) (set-specifier bottom-gutter-border-width 2 frame) (set-image-instance-property (glyph-image-instance progress-text-glyph) :data message) (set-specifier bottom-gutter-height 'autodetect frame) - (set-specifier bottom-gutter-visible-p t frame) + (set-gutter-element-visible-p bottom-gutter-visible-p + 'progress t frame) ;; we have to do this so redisplay is up-to-date and so ;; redisplay-gutter-area performs optimally. (redisplay-gutter-area) - (sit-for 0.5 nil) - (clear-progress label) + (sit-for progress-display-popup-period nil) + (clear-progress-display label) (set-extent-begin-glyph progress-extent bglyph) ))))) -(defun raw-append-progress (message &optional value frame) +(defun raw-append-progress-display (message &optional value frame) (unless (equal message "") (let ((inhibit-read-only t) (zmacs-region-stays zmacs-region-stays) - (val (or value 0))) ; preserve from change + (val (or value 0))) (insert-string message (get-buffer-create " *Gutter Area*")) - ;; Do what the device is able to cope with. - (if (not (valid-image-instantiator-format-p 'progress-gauge frame)) + ;; do some funky display here. + (unless progress-extent + (setq progress-extent (make-extent 0 1 progress-extent-text)) + (set-extent-begin-glyph progress-extent progress-layout-glyph)) + ;; fixup the gutter specifiers + (set-gutter-element bottom-gutter 'progress progress-extent-text frame) + (set-specifier bottom-gutter-border-width 2 frame) + (set-image-instance-property + (glyph-image-instance progress-gauge-glyph) :percent val) + (set-image-instance-property + (glyph-image-instance progress-text-glyph) :data message) + (if (and (eq (specifier-instance bottom-gutter-height frame) + 'autodetect) + (gutter-element-visible-p bottom-gutter-visible-p + 'progress frame)) (progn - (insert-string - (concat message (if (eq val 100) "done.") - (make-string (/ val 5) ?.)) - " *Echo Area*") - (if (not executing-kbd-macro) - (redisplay-echo-area))) - ;; do some funky display here. - (unless progress-extent - (setq progress-extent (make-extent 0 0 progress-extent-text)) - (set-extent-begin-glyph progress-extent progress-layout-glyph)) - ;; fixup the gutter specifiers - (set-specifier bottom-gutter progress-extent-text frame) - (set-specifier bottom-gutter-border-width 2 frame) - (set-image-instance-property - (glyph-image-instance progress-gauge-glyph) :percent val) - (set-image-instance-property - (glyph-image-instance progress-text-glyph) :data message) - (if (and (eq (specifier-instance bottom-gutter-height frame) - 'autodetect) - (specifier-instance bottom-gutter-visible-p frame)) - (progn - ;; if the gauge is already visible then just draw the gutter - ;; checking for user events - (redisplay-gutter-area) - (when (input-pending-p) - (dispatch-event (next-command-event)))) - ;; otherwise make the gutter visible and redraw the frame - (set-specifier bottom-gutter-height 'autodetect frame) - (set-specifier bottom-gutter-visible-p t frame) - ;; we have to do this so redisplay is up-to-date and so - ;; redisplay-gutter-area performs optimally. - (redisplay-frame) - ))))) + ;; if the gauge is already visible then just draw the gutter + ;; checking for user events + (redisplay-gutter-area) + (dispatch-non-command-events) + (when (input-pending-p) + (dispatch-event (next-command-event)))) + ;; otherwise make the gutter visible and redraw the frame + (set-specifier bottom-gutter-height 'autodetect frame) + (set-gutter-element-visible-p bottom-gutter-visible-p + 'progress t frame) + ;; we have to do this so redisplay is up-to-date and so + ;; redisplay-gutter-area performs optimally. This may also + ;; make sure the frame geometry looks ok. + (dispatch-non-command-events) + (redisplay-frame) + )))) -(defun display-progress (label message &optional value frame) +(defun display-progress-display (label message &optional value frame) "Display a progress gauge and message in the bottom gutter area. First argument LABEL is an identifier for this message. MESSAGE is -the string to display. Use `clear-progress' to remove a labelled +the string to display. Use `clear-progress-display' to remove a labelled message." - (clear-progress label frame t) - (if (eq value 'abort) - (abort-progress label message frame) - (append-progress label message value frame))) + (cond ((eq value 'abort) + (abort-progress-display label message frame)) + ((or (not (valid-image-instantiator-format-p 'progress-gauge frame)) + progress-display-use-echo-area) + (display-message label + (concat message (if (eq value 100) "done." + (make-string (/ value 5) ?.))) + frame)) + (t + (append-progress-display label message value frame)))) -(defun current-progress (&optional frame) +(defun current-progress-display (&optional frame) "Return the current progress gauge in the gutter area, or nil. The FRAME argument is currently unused." (cdr (car progress-stack))) ;;; may eventually be frame-dependent -(defun current-progress-label (&optional frame) +(defun current-progress-display-label (&optional frame) (car (car progress-stack))) -(defun progress (fmt &optional value &rest args) +(defun progress-display (fmt &optional value &rest args) "Print a progress gauge and message in the bottom gutter area of the frame. The arguments are the same as to `format'. If the only argument is nil, clear any existing progress gauge." - (if (and (null fmt) (null args)) - (prog1 nil - (clear-progress nil)) - (let ((str (apply 'format fmt args))) - (display-progress 'progress str value) - str))) + (save-excursion + (if (and (null fmt) (null args)) + (prog1 nil + (clear-progress-display nil)) + (let ((str (apply 'format fmt args))) + (display-progress-display 'progress str value) + str)))) -(defun lprogress (label fmt &optional value &rest args) +(defun lprogress-display (label fmt &optional value &rest args) "Print a progress gauge and message in the bottom gutter area of the frame. First argument LABEL is an identifier for this progress gauge. The rest of the arguments are the same as to `format'." - (if (and (null fmt) (null args)) - (prog1 nil - (clear-progress label nil)) - (let ((str (apply 'format fmt args))) - (display-progress label str value) - str))) + ;; #### sometimes the buffer gets changed temporarily. I don't know + ;; why this is, so protect against it. + (save-excursion + (if (and (null fmt) (null args)) + (prog1 nil + (clear-progress-display label nil)) + (let ((str (apply 'format fmt args))) + (display-progress-display label str value) + str)))) (provide 'gutter-items) ;;; gutter-items.el ends here. diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/info.el --- a/lisp/info.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/info.el Mon Aug 13 11:16:07 2007 +0200 @@ -22,7 +22,7 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the +;; along with XEmacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. @@ -308,7 +308,7 @@ ;; contain none or when it has become older than info files in the same ;; directory. -;; Modified 1998-09-23 by Didier Verna +;; Modified 1998-09-23 by Didier Verna ;; ;; Use the new macro `with-search-caps-disable-folding' @@ -402,10 +402,10 @@ `always' auto-generate a directory listing ignoring existing `dir' and `localdir' files `if-missing', the default, auto-generates a directory listing - if no `dir' or `localdir' file is present. Otherwise the + if no `dir' or `localdir' file is present. Otherwise the contents of any of these files is used instead. `if-outdated' auto-generates a directory listing if the `dir' - and `localdir' are either inexistent or outdated (touched + and `localdir' are either inexistent or outdated (touched less recently than an info file in the same directory)." :type '(choice (const :tag "never" never) (const :tag "always" always) @@ -416,12 +416,12 @@ (defcustom Info-save-auto-generated-dir 'never "*Whether an auto-generated info directory listing should be saved. Possible values are: -nil or `never', the default, auto-generated info directory +nil or `never', the default, auto-generated info directory information will never be saved. `always', auto-generated info directory information will be saved to a `dir' file in the same directory overwriting it if it exists `conservative', auto-generated info directory information will be saved - to a `dir' file in the same directory but the user is asked before + to a `dir' file in the same directory but the user is asked before overwriting any existing file." :type '(choice (const :tag "never" never) (const :tag "always" always) @@ -463,7 +463,7 @@ :group 'info-faces) ;; Is this right for NT? .zip, with -c for to stdout, right? -(defvar Info-suffix-list '( ("" . nil) +(defvar Info-suffix-list '( ("" . nil) (".info" . nil) (".info.bz2" . "bzip2 -dc %s") (".info.gz" . "gzip -dc %s") @@ -537,7 +537,7 @@ looking at that node, which is (dir)Top.  File: dir Node: Top This is the top of the INFO tree - This (the Directory node) gives a menu of major topics. + This (the Directory node) gives a menu of major topics. * Menu: The list of major topics begins on the next line. @@ -607,7 +607,7 @@ (Info-find-file-node nil nodename no-going-back tryfile line)) ;; Convert filename to lower case if not found as specified. ;; Expand it, look harder... - ((let (temp temp-downcase found + ((let (temp temp-downcase found (fname (substitute-in-file-name filename))) (let ((dirs (cond ((string-match "^\\./" fname) ; If specified name starts with `./' @@ -628,7 +628,7 @@ ;; Try downcasing, appending a suffix, or both. (setq found (Info-suffixed-file temp temp-downcase)) (setq dirs (cdr dirs))) - (if found + (if found (progn (setq filename (expand-file-name found)) t)))) (Info-find-file-node filename nodename no-going-back tryfile line)) @@ -870,7 +870,7 @@ (if (string-match "localdir" file) "localdir" "info dir")))) - (if (not buf) + (if (not buf) (insert-file-contents file)) (if (string-match "localdir" (buffer-name)) (setq lbuffers (cons (current-buffer) lbuffers)) @@ -881,13 +881,13 @@ Info-dir-file-attributes))))))) (or (cdr dirs) (setq Info-dir-contents-directory (car dirs))) (setq dirs (cdr dirs)))) - + ;; ensure that the localdir files are inserted last, and reverse ;; the list of them so that when they get pushed in, they appear ;; in the same order they got specified in the path, from top to ;; bottom. (nconc buffers (reverse lbuffers)) - + (or buffers (error "Can't find the Info directory node")) ;; Distinguish the dir file that comes with Emacs from all the @@ -956,7 +956,7 @@ (setq end (point)) (setq nodes (cons (list nodename other beg end) nodes)))))) (setq others (cdr others)))) - + ;; Add to the main menu a menu item for each other node. (re-search-forward "^\\* Menu:" nil t) (forward-line 1) @@ -1016,7 +1016,7 @@ (if (not (find-buffer-visiting file)) (if (not (file-exists-p file)) (if (or (eq Info-auto-generate-directory 'always) - (eq Info-auto-generate-directory 'if-missing)) + (eq Info-auto-generate-directory 'if-missing)) (Info-build-dir-anew (file-name-directory file))) (if (or (eq Info-auto-generate-directory 'always) (and (eq Info-auto-generate-directory 'if-outdated) @@ -1034,7 +1034,7 @@ f-mod-time newer) (setq Info-dir-newer-info-files nil) - (mapcar + (mapcar #'(lambda (f) (prog2 (setq f-mod-time (nth 5 (file-attributes f))) @@ -1043,7 +1043,7 @@ (> (car (cdr f-mod-time)) (car (cdr dir-mod-time)))))) (if (and (file-readable-p f) newer) - (setq Info-dir-newer-info-files + (setq Info-dir-newer-info-files (cons f Info-dir-newer-info-files))))) (directory-files (file-name-directory file) 'fullname @@ -1082,12 +1082,12 @@ (match-string 1) (downcase (or (match-string 3) (match-string 1))))) - (setq entry - (cons (nreverse - (cdr - (nreverse - (split-string - (buffer-substring + (setq entry + (cons (nreverse + (cdr + (nreverse + (split-string + (buffer-substring (re-search-forward "[ \t]*" nil t) (or (and (re-search-forward "^[^ \t]" nil t) (goto-char (match-beginning 0))) @@ -1108,7 +1108,7 @@ (if (> len description-col) (setq description-col len))) entries) - (setq description-col (+ 5 description-col)) + (setq description-col (+ 5 description-col)) (mapcar #'(lambda (e) (setq e (cdr e)) ; Drop filename (insert "* " (car e) ":" (car (cdr e))) @@ -1123,7 +1123,7 @@ (defun Info-build-dir-anew (directory) "Build info directory information for DIRECTORY. -The generated directory listing may be saved to a `dir' according +The generated directory listing may be saved to a `dir' according to the value of `Info-save-auto-generated-dir'" (save-excursion (let* ((dirfile (expand-file-name "dir" directory)) @@ -1131,7 +1131,7 @@ (eq Info-save-auto-generated-dir 'never) (and (not (file-writable-p dirfile)) (message "File not writable %s. Using temporary." dirfile)))) - (info-files + (info-files (directory-files directory 'fullname ".*\\.info\\(.gz\\|.Z\\|-z\\|.zip\\)?$" @@ -1145,13 +1145,13 @@ (erase-buffer) (insert Info-dir-prologue "Info files in " directory ":\n\n") - (Info-dump-dir-entries - (mapcar + (Info-dump-dir-entries + (mapcar #'(lambda (f) (or (Info-extract-dir-entry-from f) (list 'dummy - (progn - (string-match "\\(.*\\)\\.info\\(.gz\\|.Z\\|-z\\|.zip\\)?$" + (progn + (string-match "\\(.*\\)\\.info\\(.gz\\|.Z\\|-z\\|.zip\\)?$" (file-name-nondirectory f)) (capitalize (match-string 1 (file-name-nondirectory f)))) ":" @@ -1167,10 +1167,10 @@ (defun Info-rebuild-dir (file) "Build info directory information in the directory of dir FILE. -Description of info files are merged from the info files in the +Description of info files are merged from the info files in the directory and the contents of FILE with the description in info files -taking precedence over descriptions in FILE. -The generated directory listing may be saved to a `dir' according to +taking precedence over descriptions in FILE. +The generated directory listing may be saved to a `dir' according to the value of `Info-save-auto-generated-dir' " (save-excursion (save-restriction @@ -1179,7 +1179,7 @@ file-dir-entry mark next-section not-first-section - (to-temp + (to-temp (or (null Info-save-auto-generated-dir) (eq Info-save-auto-generated-dir 'never) (and (eq Info-save-auto-generated-dir 'always) @@ -1188,8 +1188,8 @@ (and (eq Info-save-auto-generated-dir 'conservative) (or (and (not (file-writable-p file)) (message "File not writable %s. Using temporary." file)) - (not (y-or-n-p - (message "%s is outdated. Overwrite ? " + (not (y-or-n-p + (message "%s is outdated. Overwrite ? " file)))))))) (set-buffer (find-file-noselect file t)) (setq buffer-read-only nil) @@ -1232,12 +1232,12 @@ (if file-dir-entry (setq dir-section-contents (cons file-dir-entry dir-section-contents)) - (setq dir-section-contents + (setq dir-section-contents (cons (list 'dummy (capitalize (file-name-sans-extension (file-name-nondirectory file))) ":" - (list Info-no-description-string)) + (list Info-no-description-string)) dir-section-contents)))))) Info-dir-newer-info-files) (delete-region (point-min) (point-max)) @@ -1259,7 +1259,7 @@ (save-buffer) (message "Rebuilding %s...done" file)))))) -;;;###autoload +;;;###autoload (defun Info-batch-rebuild-dir () "(Re)build info `dir' files in the directories remaining on the command line. Use this from the command line, with `-batch'; @@ -1279,7 +1279,7 @@ (car command-line-args-left)) (setq dir (expand-file-name "dir" (car command-line-args-left))) (setq localdir (expand-file-name "localdir" (car command-line-args-left))) - (cond + (cond ((file-exists-p dir) (Info-rebuild-dir dir)) ((file-exists-p localdir) @@ -1587,7 +1587,7 @@ (forward-line 1) (if (re-search-backward "Node: *\\([^,\n]*\\) *[,\n\t]" beg t) - (setq compl + (setq compl (cons (list (buffer-substring (match-beginning 1) (match-end 1))) compl)))))))) @@ -1667,7 +1667,7 @@ (Info-history-add ofile onode opoint))))) ;; Extract the value of the node-pointer named NAME. -;; If there is none, use ERRORNAME in the error message; +;; If there is none, use ERRORNAME in the error message; ;; if ERRORNAME is nil, just return nil. (defun Info-extract-pointer (name &optional errorname) (save-excursion @@ -1943,7 +1943,7 @@ ;; there is a problem here in that if several menu items have the same ;; name you can only go to the node of the first with this command. (Info-goto-node (Info-extract-menu-item menu-item) nil t)) - + (defun Info-extract-menu-item (menu-item &optional noerror) (save-excursion (goto-char (point-min)) @@ -2292,7 +2292,7 @@ "Look up an Emacs Lisp function in the Elisp manual in the Info system. This command is designed to be used whether you are already in Info or not." (interactive (let ((fn (function-at-point)) - (enable-recursive-minibuffers t) + (enable-recursive-minibuffers t) val) (setq val (completing-read (format "Look up Emacs Lisp function%s: " @@ -2999,7 +2999,7 @@ Used to construct the menubar submenu and popup menu." (or event (setq event (point))) (let ((case-fold-search t) - (xref-regexp (concat "\\*" + (xref-regexp (concat "\\*" (regexp-quote Info-footnote-tag) "[ \n\t]*\\([^:]*\\):")) up-p prev-p next-p menu xrefs subnodes in) diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/keydefs.el --- a/lisp/keydefs.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/keydefs.el Mon Aug 13 11:16:07 2007 +0200 @@ -1,6 +1,7 @@ ;;; keydefs.el --- Define standard keybindings. ;; Copyright (C) 1992-4, 1997 Free Software Foundation, Inc. +;; Copyright (C) 2000 Ben Wing. ;; Maintainer: XEmacs Development Team ;; Keywords: internal, dumped @@ -106,9 +107,6 @@ (define-key global-map "\C-e" 'end-of-line) (define-key global-map "\C-f" 'forward-char-command) (define-key global-map "\C-d" 'delete-char) -(define-key global-map 'delete 'backward-or-forward-delete-char) -(define-key global-map '(meta delete) 'backward-or-forward-kill-word) -(define-key global-map [(control x) (delete)] 'backward-or-forward-kill-sentence) ;; FSFmacs files.el @@ -240,6 +238,7 @@ (define-key global-map '(control meta -) 'negative-argument) (define-key global-map "\C-k" 'kill-line) +(define-key global-map '(control K) 'historical-kill-line) (define-key global-map "\C-w" 'kill-region) (define-key global-map "\M-w" 'kill-ring-save) (define-key global-map "\M-\C-w" 'append-next-kill) @@ -305,9 +304,6 @@ (define-key global-map "\M-\)" 'move-past-close-and-reindent) (define-key global-map "\M-\t" 'lisp-complete-symbol) -(define-key global-map '(control meta backspace) 'backward-kill-sexp) -(define-key global-map '(control meta delete) 'backward-or-forward-kill-sexp) - (define-key global-map "\C-x/" 'point-to-register) (define-key global-map "\C-xj" 'jump-to-register) @@ -510,74 +506,71 @@ ;; movement by units (define-key global-map 'left 'backward-char-command) +(define-key global-map 'right 'forward-char-command) (define-key global-map 'up 'previous-line) -(define-key global-map 'right 'forward-char-command) (define-key global-map 'down 'next-line) +(define-key global-map 'kp-left 'backward-char-command) +(define-key global-map 'kp-right 'forward-char-command) +(define-key global-map 'kp-up 'previous-line) +(define-key global-map 'kp-down 'next-line) ;; movement by pages (define-key global-map 'prior 'scroll-down-command) (define-key global-map 'next 'scroll-up-command) - -;; movement to the limits -(define-key global-map 'home 'beginning-of-line) -(define-key global-map 'end 'end-of-line) - -;;; Miscellaneous key bindings -(define-key global-map 'again 'repeat-complex-command) -(define-key global-map 'insert 'overwrite-mode) - -;;; These aren't bound to kbd macros like "\C-b" so that they have the -;; expected behavior even in, for example, vi-mode. - -;; We use here symbolic names, assuming that the corresponding keys will -;; generate these keysyms. This is not true on Suns, but x-win-sun.el -;; fixes that. If it turns out that the semantics of these keys should -;; differ from server to server, this should be moved into server-specific -;; files, but these appear to be the standard Motif and PC bindings. - -;; potential R6isms -(define-key global-map 'kp-left 'backward-char-command) -(define-key global-map 'kp-up 'previous-line) -(define-key global-map 'kp-right 'forward-char-command) -(define-key global-map 'kp-down 'next-line) - - -;; movement by larger blocks -(define-key global-map '(control left) 'backward-word) -(define-key global-map '(control up) #'(lambda () - (interactive "_") - (forward-line -6))) -(define-key global-map '(control right) 'forward-word) -(define-key global-map '(control down) #'(lambda () - (interactive "_") - (forward-line 6))) - -;; context-sensitive movement -(define-key global-map '(meta left) 'backward-sexp) -(define-key global-map '(meta right) 'forward-sexp) -(define-key global-map '(meta up) 'backward-paragraph) -(define-key global-map '(meta down) 'forward-paragraph) - -;; movement by pages (define-key global-map '(control prior) 'scroll-right) (define-key global-map '(control next) 'scroll-left) -;; potential R6isms (define-key global-map 'kp-prior 'scroll-down-command) (define-key global-map 'kp-next 'scroll-up-command) (define-key global-map '(control kp-prior) 'scroll-right) (define-key global-map '(control kp-next) 'scroll-left) - ;; movement to the limits +(define-key global-map 'home 'beginning-of-line) +(define-key global-map 'end 'end-of-line) (define-key global-map '(control home) 'beginning-of-buffer) (define-key global-map '(control end) 'end-of-buffer) +(define-key global-map 'kp-home 'beginning-of-line) +(define-key global-map 'kp-end 'end-of-line) +(define-key global-map '(control kp-home) 'beginning-of-buffer) +(define-key global-map '(control kp-end) 'end-of-buffer) + +;; on which systems do these exist? (define-key global-map 'begin 'beginning-of-line) (define-key global-map '(control begin) 'beginning-of-buffer) -;; potential R6isms -(define-key global-map 'kp-home 'beginning-of-line) -(define-key global-map '(control kp-home) 'beginning-of-buffer) -(define-key global-map 'kp-end 'end-of-line) -(define-key global-map '(control kp-end) 'end-of-buffer) + +;; movement by larger blocks +(define-key global-map '(control left) 'backward-word) +(define-key global-map '(control right) 'forward-word) +(define-key global-map '(control up) 'backward-block-of-lines) +(define-key global-map '(control down) 'forward-block-of-lines) +(define-key global-map '(control kp-left) 'backward-word) +(define-key global-map '(control kp-right) 'forward-word) +(define-key global-map '(control kp-up) 'backward-block-of-lines) +(define-key global-map '(control kp-down) 'forward-block-of-lines) + +;; context-sensitive movement +;; (meta control left/right) should be reserved for bindings that +;; switch between buffers/web pages/etc. +(define-key global-map '(meta left) 'backward-sexp) +(define-key global-map '(meta right) 'forward-sexp) +(define-key global-map '(meta up) 'backward-sentence) +(define-key global-map '(meta down) 'forward-sentence) +(define-key global-map '(meta control up) 'backward-paragraph) +(define-key global-map '(meta control down) 'forward-paragraph) +(define-key global-map '(meta control home) 'beginning-of-defun) +(define-key global-map '(meta control end) 'end-of-defun) +(define-key global-map '(meta control prior) 'backward-page) +(define-key global-map '(meta control next) 'forward-page) +(define-key global-map '(meta kp-left) 'backward-sexp) +(define-key global-map '(meta kp-right) 'forward-sexp) +(define-key global-map '(meta kp-up) 'backward-sentence) +(define-key global-map '(meta kp-down) 'forward-sentence) +(define-key global-map '(meta control kp-up) 'backward-paragraph) +(define-key global-map '(meta control kp-down) 'forward-paragraph) +(define-key global-map '(meta control kp-home) 'beginning-of-defun) +(define-key global-map '(meta control kp-end) 'end-of-defun) +(define-key global-map '(meta control kp-prior) 'backward-page) +(define-key global-map '(meta control kp-next) 'forward-page) ;; movement between windows (define-key global-map '(control tab) 'other-window) @@ -588,16 +581,33 @@ (define-key global-map '(meta prior) 'scroll-other-window-down) (define-key global-map '(meta home) 'beginning-of-buffer-other-window) (define-key global-map '(meta end) 'end-of-buffer-other-window) -;; potential R6isms (define-key global-map '(meta kp-next) 'scroll-other-window) (define-key global-map '(meta kp-prior) 'scroll-other-window-down) (define-key global-map '(meta kp-home) 'beginning-of-buffer-other-window) (define-key global-map '(meta kp-end) 'end-of-buffer-other-window) -;; potential R6isms +;; the infamous delete key +(define-key global-map 'delete 'backward-or-forward-delete-char) +(define-key global-map '(meta delete) 'backward-or-forward-kill-word) +(define-key global-map [(control x) (delete)] + 'backward-or-forward-kill-sentence) +(define-key global-map 'kp-delete 'backward-or-forward-delete-char) +(define-key global-map '(meta kp-delete) 'backward-or-forward-kill-word) +(define-key global-map [(control x) (kp-delete)] + 'backward-or-forward-kill-sentence) + +;; don't try this one at home, kids. +(define-key global-map '(control meta delete) 'backward-or-forward-kill-sexp) +(define-key global-map '(control meta kp-delete) 'backward-or-forward-kill-sexp) +;; or this one, either, on Linux. +(define-key global-map '(control meta backspace) 'backward-kill-sexp) + + +;;; Miscellaneous key bindings +(define-key global-map 'insert 'overwrite-mode) +(define-key global-map 'kp-insert 'overwrite-mode) +(define-key global-map 'again 'repeat-complex-command) (define-key global-map 'redo 'repeat-complex-command) -(define-key global-map 'kp-insert 'overwrite-mode) -(define-key global-map 'kp-delete 'backward-delete-char-untabify) (define-key global-map 'kp-enter [return]) ; do whatever RET does now (define-key global-map 'kp-tab [tab]) diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/lisp-mode.el --- a/lisp/lisp-mode.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/lisp-mode.el Mon Aug 13 11:16:07 2007 +0200 @@ -1,7 +1,7 @@ ;;; lisp-mode.el --- Lisp mode, and its idiosyncratic commands. ;; Copyright (C) 1985, 1996, 1997 Free Software Foundation, Inc. -;; Copyright (C) 1995 Tinker Systems +;; Copyright (C) 1995 Tinker Systems. ;; Maintainer: FSF ;; Keywords: lisp, languages, dumped @@ -32,8 +32,6 @@ ;; The base major mode for editing Lisp code (used also for Emacs Lisp). ;; This mode is documented in the Emacs manual -;; July/05/97 slb Converted to use easymenu. - ;;; Code: (defgroup lisp nil @@ -46,55 +44,57 @@ (defvar lisp-mode-abbrev-table nil) ;; XEmacs change -(defvar lisp-interaction-mode-popup-menu nil) -(defvar lisp-interaction-mode-popup-menu-1 +(defvar lisp-interaction-mode-popup-menu (purecopy '("Lisp-Interaction" - ["Evaluate Last S-expression" eval-last-sexp] - ["Evaluate Entire Buffer" eval-current-buffer] - ["Evaluate Region" eval-region + ["Evaluate Last %_S-expression" eval-last-sexp] + ["Evaluate %_Whole Buffer" eval-current-buffer] + ["Evaluate Re%_gion" eval-region :active (region-exists-p)] "---" - ["Evaluate This Defun" eval-defun] - ;; FSF says "Instrument Function for Debugging" - ["Debug This Defun" edebug-defun] + ["%_Evaluate This Defun" eval-defun] + ["%_Instrument This Defun for Debugging" edebug-defun] "---" - ["Trace a Function" trace-function-background] - ["Untrace All Functions" untrace-all + ["Find %_Function Source..." find-function + :active (fboundp 'find-function)] + ["Find %_Variable Source..." find-variable + :active (fboundp 'find-variable)] + ["%_Trace Function..." trace-function-background] + ["%_Untrace All Functions" untrace-all :active (fboundp 'untrace-all)] "---" - ["Comment Out Region" comment-region + ["%_Comment Out Region" comment-region :active (region-exists-p)] - ["Indent Region" indent-region - :active (region-exists-p)] - ["Indent Line" lisp-indent-line] "---" - ["Debug On Error" (setq debug-on-error (not debug-on-error)) - :style toggle :selected debug-on-error] - ["Debug On Quit" (setq debug-on-quit (not debug-on-quit)) - :style toggle :selected debug-on-quit] - ["Debug on Signal" (setq debug-on-signal (not debug-on-signal)) - :style toggle :selected debug-on-signal] + ["Indent %_Line or Region" + (if (region-exists-p) + (call-interactively 'indent-region) + (call-interactively 'lisp-indent-line))] + ["Indent B%_alanced Expression" indent-sexp] + ["Indent %_Defun" + (progn + (beginning-of-defun) + (indent-sexp))] + "---" + "Look for debug-on-error under Options->General" ))) -(defvar emacs-lisp-mode-popup-menu nil) -(defvar emacs-lisp-mode-popup-menu-1 +(defvar emacs-lisp-mode-popup-menu (purecopy (nconc '("Emacs-Lisp" - ["Byte-compile This File" emacs-lisp-byte-compile] - ["Byte-compile/load This" emacs-lisp-byte-compile-and-load] - ["Byte-recompile Directory..." byte-recompile-directory] + ["%_Byte-Compile This File" emacs-lisp-byte-compile] + ["B%_yte-Compile/Load This File" emacs-lisp-byte-compile-and-load] + ["Byte-%_Recompile Directory..." byte-recompile-directory] "---") - (cdr lisp-interaction-mode-popup-menu-1)))) + (cdr lisp-interaction-mode-popup-menu)))) ;Don't have a menubar entry in Lisp Interaction mode. Otherwise, the ;*scratch* buffer has a Lisp menubar item! Very confusing. ;(defvar lisp-interaction-mode-menubar-menu ; (purecopy (cons "Lisp" (cdr lisp-interaction-mode-popup-menu)))) -(defvar emacs-lisp-mode-menubar-menu nil) -(defvar emacs-lisp-mode-menubar-menu-1 - (purecopy (cons "Lisp" (cdr emacs-lisp-mode-popup-menu-1)))) +(defvar emacs-lisp-mode-menubar-menu + (purecopy (cons "%_Lisp" (cdr emacs-lisp-mode-popup-menu)))) (if (not emacs-lisp-mode-syntax-table) (let ((i 0)) @@ -274,19 +274,15 @@ (set-syntax-table emacs-lisp-mode-syntax-table) ;; XEmacs changes (setq major-mode 'emacs-lisp-mode - ;; mode-popup-menu emacs-lisp-mode-popup-menu + mode-popup-menu emacs-lisp-mode-popup-menu mode-name "Emacs-Lisp") - ;; (if (and (featurep 'menubar) - ;; current-menubar) - ;; (progn + (if (and (featurep 'menubar) + current-menubar) + (progn ;; make a local copy of the menubar, so our modes don't ;; change the global menubar - ;; (set-buffer-menubar current-menubar) - ;; (add-submenu nil emacs-lisp-mode-menubar-menu))) - (unless emacs-lisp-mode-popup-menu - (easy-menu-define emacs-lisp-mode-popup-menu emacs-lisp-mode-map "" - emacs-lisp-mode-popup-menu-1)) - (easy-menu-add emacs-lisp-mode-popup-menu) + (set-buffer-menubar current-menubar) + (add-submenu nil emacs-lisp-mode-menubar-menu))) (lisp-mode-variables nil) (run-hooks 'emacs-lisp-mode-hook)) @@ -366,14 +362,7 @@ (use-local-map lisp-interaction-mode-map) (setq major-mode 'lisp-interaction-mode) (setq mode-name "Lisp Interaction") - ;; XEmacs change - ;; (setq mode-popup-menu lisp-interaction-mode-popup-menu) - (unless lisp-interaction-mode-popup-menu - (easy-menu-define lisp-interaction-mode-popup-menu - lisp-interaction-mode-map - "" - lisp-interaction-mode-popup-menu-1)) - (easy-menu-add lisp-interaction-mode-popup-menu) + (setq mode-popup-menu lisp-interaction-mode-popup-menu) (set-syntax-table emacs-lisp-mode-syntax-table) (lisp-mode-variables nil) @@ -760,6 +749,7 @@ (put 'let 'lisp-indent-function 1) (put 'let* 'lisp-indent-function 1) (put 'let-specifier 'lisp-indent-function 1) +(put 'flet 'lisp-indent-function 1) (put 'while 'lisp-indent-function 1) (put 'if 'lisp-indent-function 2) (put 'catch 'lisp-indent-function 1) diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/list-mode.el --- a/lisp/list-mode.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/list-mode.el Mon Aug 13 11:16:07 2007 +0200 @@ -1,7 +1,7 @@ ;;; list-mode.el --- Major mode for buffers containing lists of items ;; Copyright (C) 1992-4, 1997 Free Software Foundation, Inc. -;; Copyright (C) 1996 Ben Wing. +;; Copyright (C) 1996, 2000 Ben Wing. ;; Maintainer: XEmacs Development Team ;; Keywords: extensions, dumped @@ -63,6 +63,32 @@ (dolist (key '(kp-left left (control ?b))) (define-key map key 'previous-list-mode-item)))) +;; #### We make list-mode-hook, as well as completion-setup-hook and +;; minibuffer-setup-hook, permanent-local so that it's possible to create +;; buffers in these modes and then set up some buffer-specific +;; customizations without resorting to awful kludges. (The problem here +;; is that when you switch a buffer into a mode, reset-buffer is usually +;; called, which destroys all buffer-local settings that you carefully +;; tried to set up when you created the buffer. Therefore, the only way +;; to set these variables is to use the setup hooks -- but if they are +;; not declared permanent local, then any local hook functions that you +;; put on them (which is exactly what you want to do) also get removed, +;; so you would have to resort to putting a global hook function on the +;; setup hook, and then making sure it gets removed later. I actually +;; added some support for doing this with one-shot hooks, but this is +;; clearly not the correct way to do things, and it fails in some cases, +;; particularly when the buffer gets put into the mode more than once, +;; which typically happens with completion buffers, for example.) In +;; fact, all setup hooks should be made permanent local, but I didn't +;; feel like making a global change like this quite yet. The proper way +;; to do it would be to declare new def-style forms, such as defhook and +;; define-local-setup-hook, which are used to initialize hooks in place +;; of the current generic defvars. --ben + +(put 'list-mode-hook 'permanent-local t) +(defvar list-mode-hook nil + "Normal hook run when entering List mode.") + (defun list-mode () "Major mode for buffer containing lists of items." (interactive) @@ -70,12 +96,9 @@ (use-local-map list-mode-map) (setq mode-name "List") (setq major-mode 'list-mode) - (make-local-hook 'post-command-hook) - (add-hook 'post-command-hook 'set-list-mode-extent nil t) - (make-local-hook 'pre-command-hook) - (add-hook 'pre-command-hook 'list-mode-extent-pre-hook nil t) - (make-local-variable 'next-line-add-newlines) - (setq next-line-add-newlines nil) + (add-local-hook 'post-command-hook 'set-list-mode-extent) + (add-local-hook 'pre-command-hook 'list-mode-extent-pre-hook) + (set (make-local-variable 'next-line-add-newlines) nil) (setq list-mode-extent nil) ;; It is visually disconcerting to have the text cursor disappear within list ;; buffers, especially when moving from window to window, so leave it @@ -226,8 +249,11 @@ If the variable in not t or nil, the string is taken as a regexp to match for end of highlight") +;; see comment at list-mode-hook. +(put 'completion-setup-hook 'permanent-local t) (defvar completion-setup-hook nil - "Normal hook run at the end of setting up the text of a completion buffer.") + "Normal hook run at the end of setting up the text of a completion buffer. +When run, the completion buffer is the current buffer.") ; Unnecessary FSFmacs crock. We frob the extents directly in ; display-completion-list, so no "heuristics" like this are necessary. @@ -265,6 +291,9 @@ :window-width If non-nil, width to use in displaying the list, instead of the actual window's width. + :window-height + If non-nil, use no more than this many lines, and extend line width as + necessary. :help-string (default is the value of `completion-default-help-string') Form to evaluate to get a string to insert at the beginning of the completion list buffer. This is evaluated when that buffer @@ -288,7 +317,8 @@ :reference-buffer (:help-string completion-default-help-string) (:completion-string "Possible completions are:") - :window-width) + :window-width + :window-height) () (let ((old-buffer (current-buffer)) (bufferp (bufferp standard-output))) @@ -315,7 +345,8 @@ (selected-frame))) 80)))) (let ((count 0) - (max-width 0)) + (max-width 0) + old-max-width) ;; Find longest completion (let ((tail completions)) (while tail @@ -336,6 +367,7 @@ tail (cdr tail))))) (setq max-width (+ 2 max-width)) ; at least two chars between cols + (setq old-max-width max-width) (let ((rows (let ((cols (min (/ win-width max-width) count))) (if (<= cols 1) count @@ -345,8 +377,15 @@ (if (/= (% count cols) 0) ; want ceiling... (1+ (/ count cols)) (/ count cols))))))) - (if (stringp cl-completion-string) - (princ (gettext cl-completion-string))) + (when + (and cl-window-height + (> rows cl-window-height)) + (setq max-width old-max-width) + (setq rows cl-window-height)) + (when (and (stringp cl-completion-string) + (> (length cl-completion-string) 0)) + (princ (gettext cl-completion-string)) + (terpri)) (let ((tail completions) (r 0) (regexp-string @@ -355,7 +394,7 @@ "[ \t]" completion-highlight-first-word-only))) (while (< r rows) - (terpri) + (and (> r 0) (terpri)) (let ((indent 0) (column 0) (tail2 tail)) @@ -425,7 +464,9 @@ ;; (put-text-property beg (point) 'list-mode-item t) ;; (goto-char end))))) )) - (run-hooks 'completion-setup-hook))) + (save-excursion + (set-buffer standard-output) + (run-hooks 'completion-setup-hook)))) (defvar completion-display-completion-list-function 'display-completion-list "Function to set up the list of completions in the completion buffer. diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/loaddefs.el --- a/lisp/loaddefs.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/loaddefs.el Mon Aug 13 11:16:07 2007 +0200 @@ -87,7 +87,8 @@ (setq completion-ignored-extensions (mapcar 'purecopy '(".o" ".elc" "~" ".bin" ".lbin" ".fasl" - ".dvi" ".toc" ".log" ".aux" ".a" ".ln" + ".dvi" ".toc" ;".log" + ".aux" ".a" ".ln" ".lof" ".blg" ".bbl" ".glo" ".idx" ".lot" ".fmt" ".diff" ".oi" ".class"))) diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/map-ynp.el --- a/lisp/map-ynp.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/map-ynp.el Mon Aug 13 11:16:07 2007 +0200 @@ -104,7 +104,7 @@ ;; (objects (capitalize (or (nth 1 help) "objects"))) ;; (action (capitalize (or (nth 2 help) "act on"))) ) - (setq map `(("Yes" . act) ("No" . skip) + (setq map `(("%_Yes" . act) ("%_No" . skip) ; bogus crap. --ben ; ((, (if help ; (capitalize @@ -119,9 +119,9 @@ ; ((, (capitalize ; (or (and help (nth 5 help)) "Quit"))) ; . exit) - ("Yes All" . automatic) - ("No All" . exit) - ("Cancel" . quit) + ("Yes %_All" . automatic) + ("No A%_ll" . exit) + ("%_Cancel" . quit) ,@(mapcar #'(lambda (elt) (cons (capitalize (nth 2 elt)) (vector (nth 1 elt)))) @@ -231,7 +231,8 @@ (lambda (elt) (format "%c to %s" (nth 0 elt) - (nth 2 elt)))) + (normalize-menu-item-name + (nth 2 elt))))) action-alist ";\n") (if action-alist ";\n") diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/menubar-items.el --- a/lisp/menubar-items.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/menubar-items.el Mon Aug 13 11:16:07 2007 +0200 @@ -3,7 +3,7 @@ ;; Copyright (C) 1991-1995, 1997-1998 Free Software Foundation, Inc. ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp. ;; Copyright (C) 1995 Sun Microsystems. -;; Copyright (C) 1995, 1996 Ben Wing. +;; Copyright (C) 1995, 1996, 2000 Ben Wing. ;; Copyright (C) 1997 MORIOKA Tomohiko ;; Maintainer: XEmacs Development Team @@ -41,60 +41,115 @@ (defvar current-language-environment) (defvar tutorial-supported-languages)) +(defun menu-truncate-list (list n) + (if (<= (length list) n) + list + (butlast list (- (length list) n)))) + +(defun submenu-generate-accelerator-spec (list &optional omit-chars-list) + "Add auto-generated accelerator specifications to a submenu. +This can be used to add accelerators to the return value of a menu filter +function. It correctly ignores unselectable items. It will destructively +modify the list passed to it. If an item already has an auto-generated +accelerator spec, this will be removed before the new one is added, making +this function idempotent. + +If OMIT-CHARS-LIST is given, it should be a list of lowercase characters, +which will not be used as accelerators." + (let ((n 0)) + (dolist (item list list) + (cond + ((vectorp item) + (setq n (1+ n)) + (aset item 0 + (concat + (menu-item-generate-accelerator-spec n omit-chars-list) + (menu-item-strip-accelerator-spec (aref item 0))))) + ((consp item) + (setq n (1+ n)) + (setcar item + (concat + (menu-item-generate-accelerator-spec n omit-chars-list) + (menu-item-strip-accelerator-spec (car item))))))))) + +(defun menu-item-strip-accelerator-spec (item) + "Strip an auto-generated accelerator spec off of ITEM. +ITEM should be a string. This removes specs added by +`menu-item-generate-accelerator-spec' and `submenu-generate-accelerator-spec'." + (if (string-match "%_. " item) + (substring item 4) + item)) + +(defun menu-item-generate-accelerator-spec (n &optional omit-chars-list) + "Return an accelerator specification for use with auto-generated menus. +This should be concat'd onto the beginning of each menu line. The spec +allows the Nth line to be selected by the number N. '0' is used for the +10th line, and 'a' through 'z' are used for the following 26 lines. + +If OMIT-CHARS-LIST is given, it should be a list of lowercase characters, +which will not be used as accelerators." + (cond ((< n 10) (concat "%_" (int-to-string n) " ")) + ((= n 10) "%_0 ") + ((<= n 36) + (setq n (- n 10)) + (let ((m 0)) + (while (> n 0) + (setq m (1+ m)) + (while (memq (int-to-char (+ m (- (char-to-int ?a) 1))) + omit-chars-list) + (setq m (1+ m))) + (setq n (1- n))) + (if (<= m 26) + (concat + "%_" + (char-to-string (int-to-char (+ m (- (char-to-int ?a) 1)))) + " ") + ""))) + (t ""))) + (defconst default-menubar (purecopy-menubar ;; note backquote. `( - ("File" - ["Open..." find-file] - ["Open in Other Window..." find-file-other-window] - ["Open in New Frame..." find-file-other-frame] - ["Insert File..." insert-file] - ["View File..." view-file] + ("%_File" + ["%_Open..." find-file] + ["Open in Other %_Window..." find-file-other-window] + ["Open in New %_Frame..." find-file-other-frame] + ["%_Hex Edit File..." hexl-find-file + :active (fboundp 'hexl-find-file)] + ["%_Insert File..." insert-file] + ["%_View File..." view-file] "------" - ["Save" save-buffer + ["%_Save" save-buffer :active (buffer-modified-p) :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] - ["Save As..." write-file] - ["Save Some Buffers" save-some-buffers] + ["Save %_As..." write-file] + ["Save So%_me Buffers" save-some-buffers] "-----" - ["Print Buffer" lpr-buffer + ["%_Print Buffer" lpr-buffer :active (fboundp 'lpr-buffer) :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] - ["Pretty-Print Buffer" ps-print-buffer-with-faces + ["Prett%_y-Print Buffer" ps-print-buffer-with-faces :active (fboundp 'ps-print-buffer-with-faces) :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] "-----" - ["New Frame" make-frame] - ["Frame on Other Display..." make-frame-on-display] - ["Delete Frame" delete-frame - :active (not (eq (next-frame (selected-frame) 'nomini 'window-system) - (selected-frame)))] - "-----" - ["Split Window" split-window-vertically] - ["Un-Split (Keep This)" delete-other-windows - :active (not (one-window-p t))] - ["Un-Split (Keep Others)" delete-window - :active (not (one-window-p t))] - "-----" - ["Revert Buffer" revert-buffer + ["%_Revert Buffer" revert-buffer :active (or buffer-file-name revert-buffer-function) :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] - ["Delete Buffer" kill-this-buffer - :active t - :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] + ["Re%_cover File..." recover-file] + ["Recover S%_ession..." recover-session] "-----" - ["Exit XEmacs" save-buffers-kill-emacs] + ["E%_xit XEmacs" save-buffers-kill-emacs] ) - ("Edit" - ["Undo" advertised-undo + ("%_Edit" + ["%_Undo" advertised-undo :active (and (not (eq buffer-undo-list t)) (or buffer-undo-list pending-undo-list)) :suffix (if (or (eq last-command 'undo) (eq last-command 'advertised-undo)) "More" "")] - ["Redo" redo + ["%_Redo" redo :included (fboundp 'redo) :active (not (or (eq buffer-undo-list t) (eq last-buffer-undo-list nil) @@ -105,274 +160,615 @@ (or (eq buffer-undo-list pending-undo-list) (eq (cdr buffer-undo-list) pending-undo-list)))) :suffix (if (eq last-command 'redo) "More" "")] - ["Cut" kill-primary-selection - :active (selection-owner-p)] - ["Copy" copy-primary-selection + "----" + ["Cu%_t" kill-primary-selection :active (selection-owner-p)] - ["Paste" yank-clipboard-selection + ["%_Copy" copy-primary-selection + :active (selection-owner-p)] + ["%_Paste" yank-clipboard-selection :active (selection-exists-p 'CLIPBOARD)] - ["Clear" delete-primary-selection + ["%_Delete" delete-primary-selection :active (selection-owner-p)] "----" - ["Search..." isearch-forward] - ["Search Backward..." isearch-backward] - ["Replace..." query-replace] + ["Select %_All" mark-whole-buffer] + ["Select %_Page" mark-page] "----" - ["Search (Regexp)..." isearch-forward-regexp] - ["Search Backward (Regexp)..." isearch-backward-regexp] - ["Replace (Regexp)..." query-replace-regexp] - "----" - ["Goto Line..." goto-line] - ["What Line" what-line] - ("Bookmarks" - :filter bookmark-menu-filter) + ["%_1 Search..." isearch-forward] + ["%_2 Search Backward..." isearch-backward] + ["%_3 Replace..." query-replace] "----" - ["Start Macro Recording" start-kbd-macro - :active (not defining-kbd-macro)] - ["End Macro Recording" end-kbd-macro - :active defining-kbd-macro] - ["Execute Last Macro" call-last-kbd-macro - :active last-kbd-macro] - "----" - ["Show Message Log" show-message-log] - ) + ["%_4 Search (Regexp)..." isearch-forward-regexp] + ["%_5 Search Backward (Regexp)..." isearch-backward-regexp] + ["%_6 Replace (Regexp)..." query-replace-regexp] - ,@(when (featurep 'mule) - '(("Mule" - ("Describe language support") - ("Set language environment") + ,@(when (featurep 'mule) + '("----" + ("%_Multilingual (\"Mule\")" + ("%_Describe Language Support") + ("%_Set Language Environment") "--" - ["Toggle input method" toggle-input-method] - ["Select input method" set-input-method] - ["Describe input method" describe-input-method] + ["T%_oggle Input Method" toggle-input-method] + ["Select %_Input Method" set-input-method] + ["D%_escribe Input Method" describe-input-method] "--" - ["Describe current coding systems" + ["Describe Current %_Coding Systems" describe-current-coding-system] - ["Set coding system of buffer file" + ["Set Coding System of %_Buffer File..." set-buffer-file-coding-system] ;; not implemented yet - ["Set coding system of terminal" + ["Set Coding System of %_Terminal..." set-terminal-coding-system :active nil] ;; not implemented yet - ["Set coding system of keyboard" + ["Set Coding System of %_Keyboard..." set-keyboard-coding-system :active nil] - ["Set coding system of process" + ["Set Coding System of %_Process..." set-buffer-process-coding-system :active (get-buffer-process (current-buffer))] "--" - ["Show character table" view-charset-by-menu] + ["Show Cha%_racter Table" view-charset-by-menu] ;; not implemented yet - ["Show diagnosis for MULE" mule-diag :active nil] - ["Show many languages" view-hello-file]))) + ["Show Dia%_gnosis for MULE" mule-diag :active nil] + ["Show \"%_hello\" in Many Languages" view-hello-file])) + ) + ) + + ("%_View" + ["%_New Frame" make-frame] + ["Frame on Other Displa%_y..." make-frame-on-display] + ["%_Delete Frame" delete-frame + :active (not (eq (next-frame (selected-frame) 'nomini 'window-system) + (selected-frame)))] + "-----" + ["%_Split Window" split-window-vertically] + ["S%_plit Window (Side by Side)" split-window-horizontally] + ["%_Un-Split (Keep This)" delete-other-windows + :active (not (one-window-p t))] + ["Un-Split (Keep %_Others)" delete-window + :active (not (one-window-p t))] + "----" + ("N%_arrow" + ["%_Narrow to Region" narrow-to-region :active (region-exists-p)] + ["Narrow to %_Page" narrow-to-page] + ["Narrow to %_Defun" narrow-to-defun] + "----" + ["%_Widen" widen :active (or (/= (point-min) 1) + (/= (point-max) (1+ (buffer-size))))] + ) + "----" + ["Show Message %_Log" show-message-log] + "----" + ["%_Goto Line..." goto-line] + ["%_What Line" what-line] + ("%_Bookmarks" + :filter bookmark-menu-filter) + "----" + ["%_Jump to Previous Mark" (set-mark-command t) + :active (mark t)] + ) - ("Apps" - ["Read Mail (VM)..." vm - :active (fboundp 'vm)] - ["Read Mail (MH)..." (mh-rmail t) - :active (fboundp 'mh-rmail)] - ["Send mail..." compose-mail - :active (fboundp 'compose-mail)] - ["Usenet News" gnus - :active (fboundp 'gnus)] - ["Browse the Web" w3 - :active (fboundp 'w3)] + ("C%_mds" + ["Repeat %_Last Complex Command..." repeat-complex-command] + ["E%_valuate Lisp Expression..." eval-expression] + ["Execute %_Named Command..." execute-extended-command] + "----" + ["Start %_Macro Recording" start-kbd-macro + :included (not defining-kbd-macro)] + ["End %_Macro Recording" end-kbd-macro + :included defining-kbd-macro] + ["E%_xecute Last Macro" call-last-kbd-macro + :active last-kbd-macro] + ("%_Other Macro" + ["%_Append to Last Macro" (start-kbd-macro t) + :active (and (not defining-kbd-macro) last-kbd-macro)] + ["%_Query User During Macro" kbd-macro-query + :active defining-kbd-macro] + ["Enter %_Recursive Edit During Macro" (kbd-macro-query t) + :active defining-kbd-macro] + "---" + ["E%_xecute Last Macro on Region Lines" + :active (and last-kbd-macro (region-exists-p))] + "---" + ["%_Name Last Macro..." name-last-kbd-macro + :active last-kbd-macro] + ["Assign Last Macro to %_Key..." assign-last-kbd-macro-to-key + :active (and last-kbd-macro + (fboundp 'assign-last-kbd-macro-to-key))] + "---" + ["%_Edit Macro..." edit-kbd-macro] + ["Edit %_Last Macro" edit-last-kbd-macro + :active last-kbd-macro] + "---" + ["%_Insert Named Macro into Buffer..." insert-kbd-macro] + ["Read Macro from Re%_gion" read-kbd-macro + :active (region-exists-p)] + ) "----" - ["Spell-Check Buffer" ispell-buffer - :active (fboundp 'ispell-buffer)] - ["Toggle VI emulation" toggle-viper-mode - :active (fboundp 'toggle-viper-mode)] + ("%_Abbrev" + ["D%_ynamic Abbrev Expand" dabbrev-expand] + ["Dynamic Abbrev %_Complete" dabbrev-completion] + ["Dynamic Abbrev Complete in %_All Buffers" (dabbrev-completion 16)] + "----" + "----" + ["%_Define Global Abbrev for " add-global-abbrev + :suffix (abbrev-string-to-be-defined nil) + :active abbrev-mode] + ["Define %_Mode-Specific Abbrev for " add-mode-abbrev + :suffix (abbrev-string-to-be-defined nil) + :active abbrev-mode] + ["Define Global Ex%_pansion for " inverse-add-global-abbrev + :suffix (inverse-abbrev-string-to-be-defined 1) + :active abbrev-mode] + ["Define Mode-Specific Expa%_nsion for " inverse-add-mode-abbrev + :suffix (inverse-abbrev-string-to-be-defined 1) + :active abbrev-mode] + "---" + ["E%_xpand Abbrev" expand-abbrev] + ["Expand Abbrevs in Re%_gion" expand-region-abbrevs + :active (region-exists-p)] + ["%_Unexpand Last Abbrev" unexpand-abbrev + :active (and (stringp last-abbrev-text) + (> last-abbrev-location 0))] + "---" + ["%_Kill All Abbrevs" kill-all-abbrevs] + ["%_Insert All Abbrevs into Buffer" insert-abbrevs] + ["%_List Abbrevs" list-abbrevs] + "---" + ["%_Edit Abbrevs" edit-abbrevs] + ["%_Redefine Abbrevs from Buffer" edit-abbrevs-redefine + :active (eq major-mode 'edit-abbrevs-mode)] + "---" + ["%_Save Abbrevs As..." write-abbrev-file] + ["L%_oad Abbrevs..." read-abbrev-file] + ) + ("%_Register" + ["%_Copy to Register..." copy-to-register :active (region-exists-p)] + ["%_Paste Register..." insert-register] + "---" + ["%_Save Point to Register" point-to-register] + ["%_Jump to Register" register-to-point] + ) + ("R%_ectangles" + ["%_Kill Rectangle" kill-rectangle] + ["%_Yank Rectangle" yank-rectangle] + ["Rectangle %_to Register" copy-rectangle-to-register] + ["Rectangle %_from Register" insert-register] + ["%_Clear Rectangle" clear-rectangle] + ["%_Open Rectangle" open-rectangle] + ["%_Prefix Rectangle..." string-rectangle] + ["Rectangle %_Mousing" + (customize-set-variable + mouse-track-rectangle-p (not mouse-track-rectangle-p)) + :style toggle :selected mouse-track-rectangle-p] + ) + ("%_Sort" + ["%_Lines" sort-lines :active (region-exists-p)] + ["%_Paragraphs" sort-paragraphs :active (region-exists-p)] + ["P%_ages" sort-pages :active (region-exists-p)] + ["%_Columns" sort-columns :active (region-exists-p)] + ["%_Regexp..." sort-regexp-fields :active (region-exists-p)] + ) + ("%_Center" + ["%_Line" center-line] + ["%_Paragraph" center-paragraph] + ["%_Region" center-region :active (region-exists-p)] + ) + ("%_Indent" + ["%_As Previous Line" indent-relative] + ["%_To Column..." indent-to-column] + "---" + ["%_Region" indent-region :active (region-exists-p)] + ["%_Balanced Expression" indent-sexp] + ["%_C Expression" indent-c-exp] + ) + ("S%_pell-Check" + ["%_Buffer" ispell-buffer + :active (fboundp 'ispell-buffer)] + "---" + ["%_Word" ispell-word] + ["%_Complete Word" ispell-complete-word] + ["%_Region" ispell-region] + ) + ) + + ("%_Tools" + ("%_Internet" + ["Read Mail %_1 (VM)..." vm + :active (fboundp 'vm)] + ["Read Mail %_2 (MH)..." (mh-rmail t) + :active (fboundp 'mh-rmail)] + ["Send %_Mail..." compose-mail + :active (fboundp 'compose-mail)] + ["Usenet %_News" gnus + :active (fboundp 'gnus)] + ["Browse the %_Web" w3 + :active (fboundp 'w3)]) + "---" + ("%_Grep" + :filter + (lambda (menu) + (if (or (not (boundp 'grep-history)) (null grep-history)) + menu + (let ((items + (submenu-generate-accelerator-spec + (mapcar #'(lambda (string) + (vector string + (list 'grep string))) + (menu-truncate-list grep-history 10))))) + (append menu '("---") items)))) + ["%_Grep..." grep :active (fboundp 'grep)] + ["%_Repeat Grep" recompile :active (fboundp 'recompile)] + ["%_Kill Grep" kill-compilation + :active (and (fboundp 'kill-compilation) + (fboundp 'compilation-find-buffer) + (let ((buffer (condition-case nil + (compilation-find-buffer) + (error nil)))) + (and buffer (get-buffer-process buffer))))] + "---" + ["Grep %_All Files in Current Directory..." + (progn + (require 'compile) + (let ((grep-command + (cons (concat grep-command " *") (length grep-command)))) + (call-interactively 'grep))) + :active (fboundp 'grep)] + ["Grep %_C Files in Current Directory..." + (progn + (require 'compile) + (let ((grep-command + (cons (concat grep-command " *.[ch]") (length grep-command)))) + (call-interactively 'grep))) + :active (fboundp 'grep)] + ["Grep %_E-Lisp Files in Current Directory..." + (progn + (require 'compile) + (let ((grep-command + (cons (concat grep-command " *.el") (length grep-command)))) + (call-interactively 'grep))) + :active (fboundp 'grep)] + "---" + ["%_Next Match" next-error + :active (and (fboundp 'compilation-errors-exist-p) + (compilation-errors-exist-p))] + ["%_Previous Match" previous-error + :active (and (fboundp 'compilation-errors-exist-p) + (compilation-errors-exist-p))] + ["%_First Match" first-error + :active (and (fboundp 'compilation-errors-exist-p) + (compilation-errors-exist-p))] + ["G%_oto Match" compile-goto-error + :active (and (fboundp 'compilation-errors-exist-p) + (compilation-errors-exist-p))] + "---" + ["%_Set Grep Command..." + (progn + (require 'compile) + (customize-set-variable + 'grep-command + (read-shell-command "Default Grep Command: " grep-command))) + :active (fboundp 'grep) + ] + ) + ("%_Compile" + :filter + (lambda (menu) + (if (or (not (boundp 'compile-history)) (null compile-history)) + menu + (let ((items + (submenu-generate-accelerator-spec + (mapcar #'(lambda (string) + (vector string + (list 'compile string))) + (menu-truncate-list compile-history 10))))) + (append menu '("---") items)))) + ["%_Compile..." compile :active (fboundp 'compile)] + ["%_Repeat Compilation" recompile :active (fboundp 'recompile)] + ["%_Kill Compilation" kill-compilation + :active (and (fboundp 'kill-compilation) + (fboundp 'compilation-find-buffer) + (let ((buffer (condition-case nil + (compilation-find-buffer) + (error nil)))) + (and buffer (get-buffer-process buffer))))] + "---" + ["%_Next Error" next-error + :active (and (fboundp 'compilation-errors-exist-p) + (compilation-errors-exist-p))] + ["%_Previous Error" previous-error + :active (and (fboundp 'compilation-errors-exist-p) + (compilation-errors-exist-p))] + ["%_First Error" first-error + :active (and (fboundp 'compilation-errors-exist-p) + (compilation-errors-exist-p))] + ["G%_oto Error" compile-goto-error + :active (and (fboundp 'compilation-errors-exist-p) + (compilation-errors-exist-p))] + ) + ("%_Debug" + ["%_GDB..." gdb + :active (fboundp 'gdb)] + ["%_DBX..." dbx + :active (fboundp 'dbx)]) + ("%_Shell" + ["%_Shell" shell + :active (fboundp 'shell)] + ["S%_hell Command..." shell-command + :active (fboundp 'shell-command)] + ["Shell Command on %_Region..." shell-command-on-region + :active (and (fboundp 'shell-command-on-region) (region-exists-p))]) + + ("%_Tags" + ["%_Find Tag..." find-tag] + ["Find %_Other Window..." find-tag-other-window] + ["%_Next Tag..." (find-tag nil)] + ["N%_ext Other Window..." (find-tag-other-window nil)] + ["Next %_File" next-file] + "-----" + ["Tags %_Search..." tags-search] + ["Tags %_Replace..." tags-query-replace] + ["%_Continue Search/Replace" tags-loop-continue] + "-----" + ["%_Pop stack" pop-tag-mark] + ["%_Apropos..." tags-apropos] + "-----" + ["%_Set Tags Table File..." visit-tags-table] + ) + "----" - ("Calendar" - ["3-Month Calendar" calendar + + ("Ca%_lendar" + ["%_3-Month Calendar" calendar :active (fboundp 'calendar)] - ["Diary" diary + ["%_Diary" diary :active (fboundp 'diary)] - ["Holidays" holidays + ["%_Holidays" holidays :active (fboundp 'holidays)] ;; we're all pagans at heart ... - ["Phases of the Moon" phases-of-moon + ["%_Phases of the Moon" phases-of-moon :active (fboundp 'phases-of-moon)] - ["Sunrise/Sunset" sunrise-sunset + ["%_Sunrise/Sunset" sunrise-sunset :active (fboundp 'sunrise-sunset)]) - ("Games" - ["Mine Game" xmine + ("Ga%_mes" + ["%_Mine Game" xmine :active (fboundp 'xmine)] - ["Tetris" tetris + ["%_Tetris" tetris :active (fboundp 'tetris)] - ["Sokoban" sokoban + ["%_Sokoban" sokoban :active (fboundp 'sokoban)] - ["Quote from Zippy" yow + ["Quote from %_Zippy" yow :active (fboundp 'yow)] - ["Psychoanalyst" doctor + ["%_Psychoanalyst" doctor :active (fboundp 'doctor)] - ["Psychoanalyze Zippy!" psychoanalyze-pinhead + ["Ps%_ychoanalyze Zippy!" psychoanalyze-pinhead :active (fboundp 'psychoanalyze-pinhead)] - ["Random Flames" flame + ["%_Random Flames" flame :active (fboundp 'flame)] - ["Dunnet (Adventure)" dunnet + ["%_Dunnet (Adventure)" dunnet :active (fboundp 'dunnet)] - ["Towers of Hanoi" hanoi + ["Towers of %_Hanoi" hanoi :active (fboundp 'hanoi)] - ["Game of Life" life + ["Game of %_Life" life :active (fboundp 'life)] - ["Multiplication Puzzle" mpuz - :active (fboundp 'mpuz)])) + ["M%_ultiplication Puzzle" mpuz + :active (fboundp 'mpuz)]) + + "----" + ) - ("Options" - ("Customize" - ("Emacs" :filter (lambda (&rest junk) - (cdr (custom-menu-create 'emacs)))) - ["Group..." customize-group] - ["Variable..." customize-variable] - ["Face..." customize-face] - ["Saved..." customize-saved] - ["Set..." customize-customized] - ["Apropos..." customize-apropos] - ["Browse..." customize-browse]) - - ("Manage Packages" - ("Add Download Site" + ("%_Options" + ("%_Advanced (Customize)" + ("%_Emacs" :filter (lambda (&rest junk) + (cdr (custom-menu-create 'emacs)))) + ["%_Group..." customize-group] + ["%_Variable..." customize-variable] + ["%_Face..." customize-face] + ["%_Saved..." customize-saved] + ["Se%_t..." customize-customized] + ["%_Apropos..." customize-apropos] + ["%_Browse..." customize-browse]) + ("Manage %_Packages" + ("%_Add Download Site" :filter (lambda (&rest junk) - (package-get-download-menu))) - ["Update Package Index" package-get-update-base] - ["List & Install" pui-list-packages] - ["Update Installed Packages" package-get-update-all] + (submenu-generate-accelerator-spec + (package-get-download-menu)))) + ["%_Update Package Index" package-get-update-base] + ["%_List and Install" pui-list-packages] + ["U%_pdate Installed Packages" package-get-update-all] ;; hack-o-matic, we can't force a load of package-base here ;; since it triggers dialog box interactions which we can't ;; deal with while using a menu - ("Using Custom" + ("Using %_Custom" :filter (lambda (&rest junk) (if package-get-base - (cdr (custom-menu-create 'packages)) - '(["Please load Package Index" (lamda (&rest junk) ()) nil])))) + (submenu-generate-accelerator-spec + (cdr (custom-menu-create 'packages))) + '(["Please load Package Index" + (lamda (&rest junk) ()) nil])))) - ["Help" (Info-goto-node "(xemacs)Packages")]) - + ["%_Help" (Info-goto-node "(xemacs)Packages")]) "---" - - ("Editing Options" - ["Overstrike" + ("%_Keyboard and Mouse" + ["%_Abbrev Mode" + (customize-set-variable 'abbrev-mode + (not (default-value 'abbrev-mode))) + :style toggle + :selected (default-value 'abbrev-mode)] + ["%_Delete Key Deletes Selection" + (customize-set-variable 'pending-delete-mode (not pending-delete-mode)) + :style toggle + :selected (and (boundp 'pending-delete-mode) pending-delete-mode) + :active (boundp 'pending-delete-mode)] + ["%_Yank/Kill Interact With Clipboard" + (if (eq interprogram-cut-function 'own-clipboard) + (progn + (customize-set-variable 'interprogram-cut-function nil) + (customize-set-variable 'interprogram-paste-function nil)) + (customize-set-variable 'interprogram-cut-function 'own-clipboard) + (customize-set-variable 'interprogram-paste-function 'get-clipboard)) + :style toggle + :selected (eq interprogram-cut-function 'own-clipboard)] + ["%_Overstrike" (progn (setq overwrite-mode (if overwrite-mode nil 'overwrite-mode-textual)) (customize-set-variable 'overwrite-mode overwrite-mode)) :style toggle :selected overwrite-mode] - ["Case Sensitive Search" + ("`%_kill-line' Behavior..." + ["Kill %_Whole Line" + (customize-set-variable 'kill-whole-line 'always) + :style radio :selected (eq kill-whole-line 'always)] + ["Kill to %_End of Line" + (customize-set-variable 'kill-whole-line nil) + :style radio :selected (eq kill-whole-line nil)] + ["Kill Whole Line at %_Beg, Otherwise to End" + (customize-set-variable 'kill-whole-line t) + :style radio :selected (eq kill-whole-line t)]) + ["Size for %_Block-Movement Commands..." + (customize-set-variable 'block-movement-size + (read-number "Block Movement Size: " + t block-movement-size))] + ["%_VI Emulation" + (progn + (toggle-viper-mode) + (customize-set-variable 'viper-mode viper-mode)) + :style toggle :selected (and (boundp 'viper-mode) viper-mode) + :active (fboundp 'toggle-viper-mode)] + ["Active Re%_gions" + (customize-set-variable 'zmacs-regions (not zmacs-regions)) + :style toggle :selected zmacs-regions] + "----" + ["%_Set Key..." global-set-key] + ["%_Unset Key..." global-unset-key] + "---" + ["%_Case Sensitive Search" (customize-set-variable 'case-fold-search (setq case-fold-search (not case-fold-search))) :style toggle :selected (not case-fold-search)] - ["Case Matching Replace" + ["Case Matching %_Replace" (customize-set-variable 'case-replace (not case-replace)) :style toggle :selected case-replace] - ["Auto Delete Selection" - (customize-set-variable 'pending-delete-mode (not pending-delete-mode)) - :style toggle - :selected (and (boundp 'pending-delete-mode) pending-delete-mode) - :active (boundp 'pending-delete-mode)] - ["Active Regions" - (customize-set-variable 'zmacs-regions (not zmacs-regions)) - :style toggle :selected zmacs-regions] - ["Mouse Paste At Text Cursor" - (customize-set-variable 'mouse-yank-at-point (not mouse-yank-at-point)) - :style toggle :selected mouse-yank-at-point] - ("Newline at end of file..." - ["Don't require" + "---" + ("%_Newline at End of File..." + ["%_Don't Require" (customize-set-variable 'require-final-newline nil) :style radio :selected (not require-final-newline)] - ["Require" + ["%_Require" (customize-set-variable 'require-final-newline t) :style radio :selected (eq require-final-newline t)] - ["Ask" + ["%_Ask" (customize-set-variable 'require-final-newline 'ask) :style radio :selected (and require-final-newline (not (eq require-final-newline t)))]) - ["Add Newline When Moving Past End" + ["Add Newline When Moving Past %_End" (customize-set-variable 'next-line-add-newlines (not next-line-add-newlines)) :style toggle :selected next-line-add-newlines] + "---" + ["%_Mouse Paste at Text Cursor" + (customize-set-variable 'mouse-yank-at-point (not mouse-yank-at-point)) + :style toggle :selected mouse-yank-at-point] + ["A%_void Text..." + (customize-set-variable 'mouse-avoidance-mode + (if mouse-avoidance-mode nil 'banish)) + :style toggle + :selected (and (boundp 'mouse-avoidance-mode) mouse-avoidance-mode) + :active (and (boundp 'mouse-avoidance-mode) + (device-on-window-system-p))] + ["%_Strokes Mode" + (customize-set-variable 'strokes-mode (not strokes-mode)) + :style toggle + :selected (and (boundp 'strokes-mode) strokes-mode) + :active (and (boundp 'strokes-mode) + (device-on-window-system-p))] ) - ("General Options" - ["Teach Extended Commands" + ("%_General" + ["This Buffer %_Read Only" (toggle-read-only) + :style toggle :selected buffer-read-only] + ["%_Teach Extended Commands" (customize-set-variable 'teach-extended-commands-p (not teach-extended-commands-p)) :style toggle :selected teach-extended-commands-p] - ["Debug On Error" + ["Debug on %_Error" (customize-set-variable 'debug-on-error (not debug-on-error)) :style toggle :selected debug-on-error] - ["Debug On Quit" + ["Debug on %_Quit" (customize-set-variable 'debug-on-quit (not debug-on-quit)) :style toggle :selected debug-on-quit] + ["Debug on %_Signal" + (customize-set-variable 'debug-on-signal (not debug-on-signal)) + :style toggle :selected debug-on-signal] ) - ("Printing Options" - ["Command-Line Switches for `lpr'/`lp'..." + + ("%_Printing" + ["Command-Line %_Switches for `lpr'/`lp'..." ;; better to directly open a customization buffer, since the value ;; must be a list of strings, which is somewhat complex to prompt for. (customize-variable 'lpr-switches) (boundp 'lpr-switches)] - ("Pretty-Print Paper Size" - ["Letter" + ("%_Pretty-Print Paper Size" + ["%_Letter" (customize-set-variable 'ps-paper-type 'letter) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'letter)) :active (boundp 'ps-paper-type)] - ["Letter-small" + ["Lette%_r-Small" (customize-set-variable 'ps-paper-type 'letter-small) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'letter-small)) :active (boundp 'ps-paper-type)] - ["Legal" + ["Le%_gal" (customize-set-variable 'ps-paper-type 'legal) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'legal)) :active (boundp 'ps-paper-type)] - ["Statement" + ["%_Statement" (customize-set-variable 'ps-paper-type 'statement) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'statement)) :active (boundp 'ps-paper-type)] - ["Executive" + ["%_Executive" (customize-set-variable 'ps-paper-type 'executive) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'executive)) :active (boundp 'ps-paper-type)] - ["Tabloid" + ["%_Tabloid" (customize-set-variable 'ps-paper-type 'tabloid) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'tabloid)) :active (boundp 'ps-paper-type)] - ["Ledger" + ["Le%_dger" (customize-set-variable 'ps-paper-type 'ledger) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'ledger)) :active (boundp 'ps-paper-type)] - ["A3" + ["A%_3" (customize-set-variable 'ps-paper-type 'a3) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'a3)) :active (boundp 'ps-paper-type)] - ["A4" + ["%_A4" (customize-set-variable 'ps-paper-type 'a4) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'a4)) :active (boundp 'ps-paper-type)] - ["A4small" + ["A4s%_mall" (customize-set-variable 'ps-paper-type 'a4small) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'a4small)) :active (boundp 'ps-paper-type)] - ["B4" + ["B%_4" (customize-set-variable 'ps-paper-type 'b4) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'b4)) :active (boundp 'ps-paper-type)] - ["B5" + ["%_B5" (customize-set-variable 'ps-paper-type 'b5) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'b5)) :active (boundp 'ps-paper-type)] ) - ["Color Printing" + ["%_Color Printing" (cond (ps-print-color-p (customize-set-variable 'ps-print-color-p nil) ;; I'm wondering whether all this muck is useful. @@ -387,67 +783,370 @@ :style toggle :selected (and (boundp 'ps-print-color-p) ps-print-color-p) :active (boundp 'ps-print-color-p)]) - ("\"Other Window\" Location" - ["Always in Same Frame" + ("%_Internet" + ("%_Compose Mail With" + ["Default Emacs Mailer" + (customize-set-variable 'mail-user-agent 'sendmail-user-agent) + :style radio + :selected (eq mail-user-agent 'sendmail-user-agent)] + ["MH" + (customize-set-variable 'mail-user-agent 'mh-e-user-agent) + :style radio + :selected (eq mail-user-agent 'mh-e-user-agent) + :active (get 'mh-e-user-agent 'composefunc)] + ["GNUS" + (customize-set-variable 'mail-user-agent 'message-user-agent) + :style radio + :selected (eq mail-user-agent 'message-user-agent) + :active (get 'message-user-agent 'composefunc)] + ) + ["Set My %_Email Address..." + (customize-set-variable + 'user-mail-address + (read-string "Set email address: " user-mail-address))] + ["Set %_Machine Email Name..." (customize-set-variable - 'get-frame-for-buffer-default-instance-limit nil) - :style radio - :selected (null get-frame-for-buffer-default-instance-limit)] - ["Other Frame (2 Frames Max)" - (customize-set-variable 'get-frame-for-buffer-default-instance-limit 2) + 'mail-host-address + (read-string "Set machine email name: " mail-host-address))] + "---" + ("%_Open URLs With" + ["%_Emacs-W3" + (customize-set-variable 'browse-url-browser-function 'browse-url-w3) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-w3)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-w3) + (fboundp 'w3-fetch))] + ["%_Netscape" + (customize-set-variable 'browse-url-browser-function + 'browse-url-netscape) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-netscape)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-netscape))] + ["%_Mosaic" + (customize-set-variable 'browse-url-browser-function + 'browse-url-mosaic) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-mosaic)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-mosaic))] + ["Mosaic (%_CCI)" + (customize-set-variable 'browse-url-browser-function 'browse-url-cci) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-cci)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-cci))] + ["%_IXI Mosaic" + (customize-set-variable 'browse-url-browser-function + 'browse-url-iximosaic) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-iximosaic)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-iximosaic))] + ["%_Lynx (xterm)" + (customize-set-variable 'browse-url-browser-function + 'browse-url-lynx-xterm) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-lynx-xterm)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-lynx-xterm))] + ["L%_ynx (xemacs)" + (customize-set-variable 'browse-url-browser-function + 'browse-url-lynx-emacs) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-lynx-emacs)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-lynx-emacs))] + ["%_Grail" + (customize-set-variable 'browse-url-browser-function + 'browse-url-grail) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-grail)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-grail))] + ["%_Kfm" + (customize-set-variable 'browse-url-browser-function + 'browse-url-kfm) + :style radio + :selected (and (boundp 'browse-url-browser-function) + (eq browse-url-browser-function 'browse-url-kfm)) + :active (and (boundp 'browse-url-browser-function) + (fboundp 'browse-url-kfm))] + )) + + + "-----" + ("Display" + ,@(if (featurep 'scrollbar) + '(["%_Scrollbars" + (customize-set-variable 'scrollbars-visible-p + (not scrollbars-visible-p)) + :style toggle + :selected scrollbars-visible-p])) + ;; I don't think this is of any interest. - dverna apr. 98 + ;; #### I beg to differ! Many FSFmacs converts hate the 3D + ;; modeline, and it was perfectly fine to be able to turn them + ;; off through the Options menu. I would have uncommented this + ;; source, but the code for saving options would not save the + ;; modeline 3D-ness. Grrr. --hniksic + ;; ["%_3D Modeline" + ;; (progn + ;; (if (zerop (specifier-instance modeline-shadow-thickness)) + ;; (set-specifier modeline-shadow-thickness 2) + ;; (set-specifier modeline-shadow-thickness 0)) + ;; (redraw-modeline t)) + ;; :style toggle + ;; :selected (let ((thickness + ;; (specifier-instance modeline-shadow-thickness))) + ;; (and (integerp thickness) + ;; (> thickness 0)))] + ["%_Truncate Lines" + (progn;; becomes buffer-local + (setq truncate-lines (not truncate-lines)) + (customize-set-variable 'truncate-lines truncate-lines)) + :style toggle + :selected truncate-lines] + ["%_Blinking Cursor" + (customize-set-variable 'blink-cursor-mode (not blink-cursor-mode)) + :style toggle + :selected (and (boundp 'blink-cursor-mode) blink-cursor-mode) + :active (boundp 'blink-cursor-mode)] + "-----" + ["Bl%_ock Cursor" + (progn + (customize-set-variable 'bar-cursor nil) + (force-cursor-redisplay)) :style radio - :selected (eq 2 get-frame-for-buffer-default-instance-limit)] - ["Other Frame (3 Frames Max)" - (customize-set-variable 'get-frame-for-buffer-default-instance-limit 3) + :selected (null bar-cursor)] + ["Bar Cursor (%_1 Pixel)" + (progn + (customize-set-variable 'bar-cursor t) + (force-cursor-redisplay)) :style radio - :selected (eq 3 get-frame-for-buffer-default-instance-limit)] - ["Other Frame (4 Frames Max)" - (customize-set-variable 'get-frame-for-buffer-default-instance-limit 4) - :style radio - :selected (eq 4 get-frame-for-buffer-default-instance-limit)] - ["Other Frame (5 Frames Max)" - (customize-set-variable 'get-frame-for-buffer-default-instance-limit 5) + :selected (eq bar-cursor t)] + ["Bar Cursor (%_2 Pixels)" + (progn + (customize-set-variable 'bar-cursor 2) + (force-cursor-redisplay)) :style radio - :selected (eq 5 get-frame-for-buffer-default-instance-limit)] - ["Always Create New Frame" - (customize-set-variable 'get-frame-for-buffer-default-instance-limit 0) - :style radio - :selected (eq 0 get-frame-for-buffer-default-instance-limit)] - "-----" - ["Temp Buffers Always in Same Frame" - (customize-set-variable 'temp-buffer-show-function - 'show-temp-buffer-in-current-frame) - :style radio - :selected (eq temp-buffer-show-function - 'show-temp-buffer-in-current-frame)] - ["Temp Buffers Like Other Buffers" - (customize-set-variable 'temp-buffer-show-function nil) - :style radio - :selected (null temp-buffer-show-function)] - "-----" - ["Make current frame gnuserv target" - (customize-set-variable 'gnuserv-frame (if (eq gnuserv-frame t) nil t)) + :selected (and bar-cursor (not (eq bar-cursor t)))] + "------" + ["%_Line Numbers" + (progn + (customize-set-variable 'line-number-mode (not line-number-mode)) + (redraw-modeline)) + :style toggle :selected line-number-mode] + ["%_Column Numbers" + (progn + (customize-set-variable 'column-number-mode + (not column-number-mode)) + (redraw-modeline)) + :style toggle :selected column-number-mode] + + ("\"Other %_Window\" Location" + ["%_Always in Same Frame" + (customize-set-variable + 'get-frame-for-buffer-default-instance-limit nil) + :style radio + :selected (null get-frame-for-buffer-default-instance-limit)] + ["Other Frame (%_2 Frames Max)" + (customize-set-variable 'get-frame-for-buffer-default-instance-limit 2) + :style radio + :selected (eq 2 get-frame-for-buffer-default-instance-limit)] + ["Other Frame (%_3 Frames Max)" + (customize-set-variable 'get-frame-for-buffer-default-instance-limit 3) + :style radio + :selected (eq 3 get-frame-for-buffer-default-instance-limit)] + ["Other Frame (%_4 Frames Max)" + (customize-set-variable 'get-frame-for-buffer-default-instance-limit 4) + :style radio + :selected (eq 4 get-frame-for-buffer-default-instance-limit)] + ["Other Frame (%_5 Frames Max)" + (customize-set-variable 'get-frame-for-buffer-default-instance-limit 5) + :style radio + :selected (eq 5 get-frame-for-buffer-default-instance-limit)] + ["Always Create %_New Frame" + (customize-set-variable 'get-frame-for-buffer-default-instance-limit 0) + :style radio + :selected (eq 0 get-frame-for-buffer-default-instance-limit)] + "-----" + ["%_Temp Buffers Always in Same Frame" + (customize-set-variable 'temp-buffer-show-function + 'show-temp-buffer-in-current-frame) + :style radio + :selected (eq temp-buffer-show-function + 'show-temp-buffer-in-current-frame)] + ["Temp Buffers %_Like Other Buffers" + (customize-set-variable 'temp-buffer-show-function nil) + :style radio + :selected (null temp-buffer-show-function)] + "-----" + ["%_Make Current Frame Gnuserv Target" + (customize-set-variable 'gnuserv-frame (if (eq gnuserv-frame t) nil t)) + :style toggle + :selected (and (boundp 'gnuserv-frame) (eq gnuserv-frame t)) + :active (boundp 'gnuserv-frame)] + ) + ) + ("%_Menubars" + ["%_Frame-Local Font Menu" + (customize-set-variable 'font-menu-this-frame-only-p + (not font-menu-this-frame-only-p)) + :style toggle + :selected (and (boundp 'font-menu-this-frame-only-p) + font-menu-this-frame-only-p)] + ["%_Alt/Meta Selects Menu Items" + (if (eq menu-accelerator-enabled 'menu-force) + (customize-set-variable 'menu-accelerator-enabled nil) + (customize-set-variable 'menu-accelerator-enabled 'menu-force)) + :style toggle + :selected (eq menu-accelerator-enabled 'menu-force)] + "----" + ["Buffers Menu %_Length..." + (customize-set-variable + 'buffers-menu-max-size + ;; would it be better to open a customization buffer ? + (let ((val + (read-number + "Enter number of buffers to display (or 0 for unlimited): "))) + (if (eq val 0) nil val)))] + ["%_Multi-Operation Buffers Sub-Menus" + (customize-set-variable 'complex-buffers-menu-p + (not complex-buffers-menu-p)) + :style toggle + :selected complex-buffers-menu-p] + ["S%_ubmenus for Buffer Groups" + (customize-set-variable 'buffers-menu-submenus-for-groups-p + (not buffers-menu-submenus-for-groups-p)) :style toggle - :selected (and (boundp 'gnuserv-frame) (eq gnuserv-frame t)) - :active (boundp 'gnuserv-frame)] + :selected buffers-menu-submenus-for-groups-p] + ["%_Verbose Buffer Menu Entries" + (if (eq buffers-menu-format-buffer-line-function + 'slow-format-buffers-menu-line) + (customize-set-variable 'buffers-menu-format-buffer-line-function + 'format-buffers-menu-line) + (customize-set-variable 'buffers-menu-format-buffer-line-function + 'slow-format-buffers-menu-line)) + :style toggle + :selected (eq buffers-menu-format-buffer-line-function + 'slow-format-buffers-menu-line)] + ("Buffers Menu %_Sorting" + ["%_Most Recently Used" + (progn + (customize-set-variable 'buffers-menu-sort-function nil) + (customize-set-variable 'buffers-menu-grouping-function nil)) + :style radio + :selected (null buffers-menu-sort-function)] + ["%_Alphabetically" + (progn + (customize-set-variable 'buffers-menu-sort-function + 'sort-buffers-menu-alphabetically) + (customize-set-variable 'buffers-menu-grouping-function nil)) + :style radio + :selected (eq 'sort-buffers-menu-alphabetically + buffers-menu-sort-function)] + ["%_By Major Mode, Then Alphabetically" + (progn + (customize-set-variable + 'buffers-menu-sort-function + 'sort-buffers-menu-by-mode-then-alphabetically) + (customize-set-variable + 'buffers-menu-grouping-function + 'group-buffers-menu-by-mode-then-alphabetically)) + :style radio + :selected (eq 'sort-buffers-menu-by-mode-then-alphabetically + buffers-menu-sort-function)]) + "---" + ["%_Ignore Scaled Fonts" + (customize-set-variable 'font-menu-ignore-scaled-fonts + (not font-menu-ignore-scaled-fonts)) + :style toggle + :selected (and (boundp 'font-menu-ignore-scaled-fonts) + font-menu-ignore-scaled-fonts)] ) + ,@(if (featurep 'toolbar) + '(("%_Toolbars" + ["%_Visible" + (customize-set-variable 'toolbar-visible-p + (not toolbar-visible-p)) + :style toggle + :selected toolbar-visible-p] + ["%_Captioned" + (customize-set-variable 'toolbar-captioned-p + (not toolbar-captioned-p)) + :style toggle + :selected toolbar-captioned-p] + ("%_Default Location" + ["%_Top" + (customize-set-variable 'default-toolbar-position 'top) + :style radio + :selected (eq default-toolbar-position 'top)] + ["%_Bottom" + (customize-set-variable 'default-toolbar-position 'bottom) + :style radio + :selected (eq default-toolbar-position 'bottom)] + ["%_Left" + (customize-set-variable 'default-toolbar-position 'left) + :style radio + :selected (eq default-toolbar-position 'left)] + ["%_Right" + (customize-set-variable 'default-toolbar-position 'right) + :style radio + :selected (eq default-toolbar-position 'right)] + ) + ))) + ,@(if (featurep 'gutter) + '(("G%_utters" + ["Buffers Tab %_Visible" + (customize-set-variable 'gutter-buffers-tab-visible-p + (not gutter-buffers-tab-visible-p)) + :style toggle + :selected gutter-buffers-tab-visible-p] + ("%_Default Location" + ["%_Top" + (customize-set-variable 'default-gutter-position 'top) + :style radio + :selected (eq default-gutter-position 'top)] + ["%_Bottom" + (customize-set-variable 'default-gutter-position 'bottom) + :style radio + :selected (eq default-gutter-position 'bottom)] + ["%_Left" + (customize-set-variable 'default-gutter-position 'left) + :style radio + :selected (eq default-gutter-position 'left)] + ["%_Right" + (customize-set-variable 'default-gutter-position 'right) + :style radio + :selected (eq default-gutter-position 'right)] + ) + ))) "-----" - ("Syntax Highlighting" - ["In This Buffer" - (progn ;; becomes buffer local + ("S%_yntax Highlighting" + ["%_In This Buffer" + (progn;; becomes buffer local (font-lock-mode) (customize-set-variable 'font-lock-mode font-lock-mode)) :style toggle :selected (and (boundp 'font-lock-mode) font-lock-mode) :active (boundp 'font-lock-mode)] - ["Automatic" + ["%_Automatic" (customize-set-variable 'font-lock-auto-fontify (not font-lock-auto-fontify)) :style toggle :selected (and (boundp 'font-lock-auto-fontify) font-lock-auto-fontify) :active (fboundp 'font-lock-mode)] "-----" - ["Fonts" + ["%_Fonts" (progn (require 'font-lock) (font-lock-use-default-fonts) @@ -457,7 +1156,7 @@ :style radio :selected (and (boundp 'font-lock-use-fonts) font-lock-use-fonts) :active (fboundp 'font-lock-mode)] - ["Colors" + ["%_Colors" (progn (require 'font-lock) (font-lock-use-default-colors) @@ -468,7 +1167,7 @@ :selected (and (boundp 'font-lock-use-colors) font-lock-use-colors) :active (boundp 'font-lock-mode)] "-----" - ["Least" + ["%_Least" (progn (require 'font-lock) (if (or (and (not (integerp font-lock-maximum-decoration)) @@ -485,7 +1184,7 @@ (not (eq t font-lock-maximum-decoration))) (and (integerp font-lock-maximum-decoration) (<= font-lock-maximum-decoration 0))))] - ["More" + ["M%_ore" (progn (require 'font-lock) (if (and (integerp font-lock-maximum-decoration) @@ -498,7 +1197,7 @@ :selected (and (boundp 'font-lock-maximium-decoration) (integerp font-lock-maximum-decoration) (= 1 font-lock-maximum-decoration))] - ["Even More" + ["%_Even More" (progn (require 'font-lock) (if (and (integerp font-lock-maximum-decoration) @@ -511,7 +1210,7 @@ :selected (and (boundp 'font-lock-maximum-decoration) (integerp font-lock-maximum-decoration) (= 2 font-lock-maximum-decoration))] - ["Most" + ["%_Most" (progn (require 'font-lock) (if (or (eq font-lock-maximum-decoration t) @@ -527,8 +1226,8 @@ (and (integerp font-lock-maximum-decoration) (>= font-lock-maximum-decoration 3))))] "-----" - ["Lazy" - (progn ;; becomes buffer local + ["La%_zy" + (progn;; becomes buffer local (lazy-shot-mode) (customize-set-variable 'lazy-shot-mode lazy-shot-mode) ;; this shouldn't be necessary so there has to @@ -539,8 +1238,8 @@ font-lock-mode) :style toggle :selected (and (boundp 'lazy-shot-mode) lazy-shot-mode)] - ["Caching" - (progn ;; becomes buffer local + ["Cac%_hing" + (progn;; becomes buffer local (fast-lock-mode) (customize-set-variable 'fast-lock-mode fast-lock-mode) ;; this shouldn't be necessary so there has to @@ -552,453 +1251,164 @@ :style toggle :selected (and (boundp 'fast-lock-mode) fast-lock-mode)] ) - ("Paren Highlighting" - ["None" + ("Pa%_ren Highlighting" + ["%_None" (customize-set-variable 'paren-mode nil) :style radio :selected (and (boundp 'paren-mode) (not paren-mode)) :active (boundp 'paren-mode)] - ["Blinking Paren" + ["%_Blinking Paren" (customize-set-variable 'paren-mode 'blink-paren) :style radio :selected (and (boundp 'paren-mode) (eq paren-mode 'blink-paren)) :active (boundp 'paren-mode)] - ["Steady Paren" + ["%_Steady Paren" (customize-set-variable 'paren-mode 'paren) :style radio :selected (and (boundp 'paren-mode) (eq paren-mode 'paren)) :active (boundp 'paren-mode)] - ["Expression" + ["%_Expression" (customize-set-variable 'paren-mode 'sexp) :style radio :selected (and (boundp 'paren-mode) (eq paren-mode 'sexp)) :active (boundp 'paren-mode)] -;; ["Nested Shading" -;; (customize-set-variable 'paren-mode 'nested) -;; :style radio -;; :selected (and (boundp 'paren-mode) (eq paren-mode 'nested)) -;; :active (boundp 'paren-mode)] + ;; ["Nes%_ted Shading" + ;; (customize-set-variable 'paren-mode 'nested) + ;; :style radio + ;; :selected (and (boundp 'paren-mode) (eq paren-mode 'nested)) + ;; :active (boundp 'paren-mode)] ) "-----" - ("Frame Appearance" - ["Frame-Local Font Menu" - (customize-set-variable 'font-menu-this-frame-only-p - (not font-menu-this-frame-only-p)) - :style toggle - :selected (and (boundp 'font-menu-this-frame-only-p) - font-menu-this-frame-only-p)] - ,@(if (featurep 'scrollbar) - '(["Scrollbars" - (customize-set-variable 'scrollbars-visible-p - (not scrollbars-visible-p)) - :style toggle - :selected scrollbars-visible-p])) - ;; I don't think this is of any interest. - dverna apr. 98 - ;; #### I beg to differ! Many FSFmacs converts hate the 3D - ;; modeline, and it was perfectly fine to be able to turn them - ;; off through the Options menu. I would have uncommented this - ;; source, but the code for saving options would not save the - ;; modeline 3D-ness. Grrr. --hniksic -;; ["3D Modeline" -;; (progn -;; (if (zerop (specifier-instance modeline-shadow-thickness)) -;; (set-specifier modeline-shadow-thickness 2) -;; (set-specifier modeline-shadow-thickness 0)) -;; (redraw-modeline t)) -;; :style toggle -;; :selected (let ((thickness -;; (specifier-instance modeline-shadow-thickness))) -;; (and (integerp thickness) -;; (> thickness 0)))] - ["Truncate Lines" - (progn ;; becomes buffer-local - (setq truncate-lines (not truncate-lines)) - (customize-set-variable 'truncate-lines truncate-lines)) - :style toggle - :selected truncate-lines] - ["Blinking Cursor" - (customize-set-variable 'blink-cursor-mode (not blink-cursor-mode)) - :style toggle - :selected (and (boundp 'blink-cursor-mode) blink-cursor-mode) - :active (boundp 'blink-cursor-mode)] - "-----" - ["Block cursor" - (progn - (customize-set-variable 'bar-cursor nil) - (force-cursor-redisplay)) - :style radio - :selected (null bar-cursor)] - ["Bar cursor (1 pixel)" - (progn - (customize-set-variable 'bar-cursor t) - (force-cursor-redisplay)) - :style radio - :selected (eq bar-cursor t)] - ["Bar cursor (2 pixels)" - (progn - (customize-set-variable 'bar-cursor 2) - (force-cursor-redisplay)) - :style radio - :selected (and bar-cursor (not (eq bar-cursor t)))] - "------" - ["Line Numbers" - (progn - (customize-set-variable 'line-number-mode (not line-number-mode)) - (redraw-modeline)) - :style toggle :selected line-number-mode] - ["Column Numbers" - (progn - (customize-set-variable 'column-number-mode - (not column-number-mode)) - (redraw-modeline)) - :style toggle :selected column-number-mode] - ) - ("Menubar Appearance" - ["Buffers Menu Length..." - (customize-set-variable - 'buffers-menu-max-size - ;; would it be better to open a customization buffer ? - (let ((val - (read-number - "Enter number of buffers to display (or 0 for unlimited): "))) - (if (eq val 0) nil val)))] - ["Multi-Operation Buffers Sub-Menus" - (customize-set-variable 'complex-buffers-menu-p - (not complex-buffers-menu-p)) - :style toggle - :selected complex-buffers-menu-p] - ("Buffers Menu Sorting" - ["Most Recently Used" - (progn - (customize-set-variable 'buffers-menu-sort-function nil) - (customize-set-variable 'buffers-menu-grouping-function nil)) - :style radio - :selected (null buffers-menu-sort-function)] - ["Alphabetically" - (progn - (customize-set-variable 'buffers-menu-sort-function - 'sort-buffers-menu-alphabetically) - (customize-set-variable 'buffers-menu-grouping-function nil)) - :style radio - :selected (eq 'sort-buffers-menu-alphabetically - buffers-menu-sort-function)] - ["By Major Mode, Then Alphabetically" - (progn - (customize-set-variable - 'buffers-menu-sort-function - 'sort-buffers-menu-by-mode-then-alphabetically) - (customize-set-variable - 'buffers-menu-grouping-function - 'group-buffers-menu-by-mode-then-alphabetically)) - :style radio - :selected (eq 'sort-buffers-menu-by-mode-then-alphabetically - buffers-menu-sort-function)]) - ["Submenus for Buffer Groups" - (customize-set-variable 'buffers-menu-submenus-for-groups-p - (not buffers-menu-submenus-for-groups-p)) - :style toggle - :selected buffers-menu-submenus-for-groups-p] - "---" - ["Ignore Scaled Fonts" - (customize-set-variable 'font-menu-ignore-scaled-fonts - (not font-menu-ignore-scaled-fonts)) - :style toggle - :selected (and (boundp 'font-menu-ignore-scaled-fonts) - font-menu-ignore-scaled-fonts)] - ) - ,@(if (featurep 'toolbar) - '(("Toolbar Appearance" - ["Visible" - (customize-set-variable 'toolbar-visible-p - (not toolbar-visible-p)) - :style toggle - :selected toolbar-visible-p] - ["Captioned" - (customize-set-variable 'toolbar-captioned-p - (not toolbar-captioned-p)) - :style toggle - :selected toolbar-captioned-p] - ("Default Location" - ["Top" - (customize-set-variable 'default-toolbar-position 'top) - :style radio - :selected (eq default-toolbar-position 'top)] - ["Bottom" - (customize-set-variable 'default-toolbar-position 'bottom) - :style radio - :selected (eq default-toolbar-position 'bottom)] - ["Left" - (customize-set-variable 'default-toolbar-position 'left) - :style radio - :selected (eq default-toolbar-position 'left)] - ["Right" - (customize-set-variable 'default-toolbar-position 'right) - :style radio - :selected (eq default-toolbar-position 'right)] - ) - ))) - ,@(if (featurep 'gutter) - '(("Gutter Appearance" - ["Visible" - (customize-set-variable 'gutter-visible-p - (not gutter-visible-p)) - :style toggle - :selected gutter-visible-p] - ("Default Location" - ["Top" - (customize-set-variable 'default-gutter-position 'top) - :style radio - :selected (eq default-gutter-position 'top)] - ["Bottom" - (customize-set-variable 'default-gutter-position 'bottom) - :style radio - :selected (eq default-gutter-position 'bottom)] - ["Left" - (customize-set-variable 'default-gutter-position 'left) - :style radio - :selected (eq default-gutter-position 'left)] - ["Right" - (customize-set-variable 'default-gutter-position 'right) - :style radio - :selected (eq default-gutter-position 'right)] - ) - ))) - ("Mouse" - ["Avoid Text..." - (customize-set-variable 'mouse-avoidance-mode - (if mouse-avoidance-mode nil 'banish)) - :style toggle - :selected (and (boundp 'mouse-avoidance-mode) mouse-avoidance-mode) - :active (and (boundp 'mouse-avoidance-mode) - (device-on-window-system-p))] - ["strokes-mode" - (customize-set-variable 'strokes-mode (not strokes-mode)) - :style toggle - :selected (and (boundp 'strokes-mode) strokes-mode) - :active (and (boundp 'strokes-mode) - (device-on-window-system-p))] - ) - ("Open URLs With" - ["Emacs-W3" - (customize-set-variable 'browse-url-browser-function 'browse-url-w3) - :style radio - :selected (and (boundp 'browse-url-browser-function) - (eq browse-url-browser-function 'browse-url-w3)) - :active (and (boundp 'browse-url-browser-function) - (fboundp 'browse-url-w3) - (fboundp 'w3-fetch))] - ["Netscape" - (customize-set-variable 'browse-url-browser-function - 'browse-url-netscape) - :style radio - :selected (and (boundp 'browse-url-browser-function) - (eq browse-url-browser-function 'browse-url-netscape)) - :active (and (boundp 'browse-url-browser-function) - (fboundp 'browse-url-netscape))] - ["Mosaic" - (customize-set-variable 'browse-url-browser-function - 'browse-url-mosaic) - :style radio - :selected (and (boundp 'browse-url-browser-function) - (eq browse-url-browser-function 'browse-url-mosaic)) - :active (and (boundp 'browse-url-browser-function) - (fboundp 'browse-url-mosaic))] - ["Mosaic (CCI)" - (customize-set-variable 'browse-url-browser-function 'browse-url-cci) - :style radio - :selected (and (boundp 'browse-url-browser-function) - (eq browse-url-browser-function 'browse-url-cci)) - :active (and (boundp 'browse-url-browser-function) - (fboundp 'browse-url-cci))] - ["IXI Mosaic" - (customize-set-variable 'browse-url-browser-function - 'browse-url-iximosaic) - :style radio - :selected (and (boundp 'browse-url-browser-function) - (eq browse-url-browser-function 'browse-url-iximosaic)) - :active (and (boundp 'browse-url-browser-function) - (fboundp 'browse-url-iximosaic))] - ["Lynx (xterm)" - (customize-set-variable 'browse-url-browser-function - 'browse-url-lynx-xterm) - :style radio - :selected (and (boundp 'browse-url-browser-function) - (eq browse-url-browser-function 'browse-url-lynx-xterm)) - :active (and (boundp 'browse-url-browser-function) - (fboundp 'browse-url-lynx-xterm))] - ["Lynx (xemacs)" - (customize-set-variable 'browse-url-browser-function - 'browse-url-lynx-emacs) - :style radio - :selected (and (boundp 'browse-url-browser-function) - (eq browse-url-browser-function 'browse-url-lynx-emacs)) - :active (and (boundp 'browse-url-browser-function) - (fboundp 'browse-url-lynx-emacs))] - ["Grail" - (customize-set-variable 'browse-url-browser-function - 'browse-url-grail) - :style radio - :selected (and (boundp 'browse-url-browser-function) - (eq browse-url-browser-function 'browse-url-grail)) - :active (and (boundp 'browse-url-browser-function) - (fboundp 'browse-url-grail))] - ["Kfm" - (customize-set-variable 'browse-url-browser-function - 'browse-url-kfm) - :style radio - :selected (and (boundp 'browse-url-browser-function) - (eq browse-url-browser-function 'browse-url-kfm)) - :active (and (boundp 'browse-url-browser-function) - (fboundp 'browse-url-kfm))] - ) + ["Edit Fa%_ces..." (customize-face nil)] + ("Fo%_nt" :filter font-menu-family-constructor) + ("Si%_ze" :filter font-menu-size-constructor) + ;; ("Weig%_ht" :filter font-menu-weight-constructor) "-----" - ["Edit Faces..." (customize-face nil)] - ("Font" :filter font-menu-family-constructor) - ("Size" :filter font-menu-size-constructor) -; ("Weight" :filter font-menu-weight-constructor) - "-----" - ["Save Options" customize-save-customized] + ["%_Edit Init (.emacs) File" + ;; #### there should be something that holds the name that the init + ;; file should be created as, when it's not present. + (progn (find-file (or user-init-file "~/.emacs")) + (emacs-lisp-mode))] + ["%_Save Options to .emacs File" customize-save-customized] ) - ("Buffers" + ("%_Buffers" :filter buffers-menu-filter - ["Read Only" (toggle-read-only) - :style toggle :selected buffer-read-only] - ["List All Buffers" list-buffers] - "--" + ["Go To %_Previous Buffer" switch-to-other-buffer] + ["Go To %_Buffer..." switch-to-buffer] + "----" + ["%_List All Buffers" list-buffers] + ["%_Delete Buffer" kill-this-buffer + :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] + "----" ) - ("Tools" - ["Grep..." grep - :active (fboundp 'grep)] - ["Compile..." compile - :active (fboundp 'compile)] - ["Shell" shell - :active (fboundp 'shell)] - ["Shell Command..." shell-command - :active (fboundp 'shell-command)] - ["Shell Command on Region..." shell-command-on-region - :active (and (fboundp 'shell-command-on-region) (region-exists-p))] - ["Debug (GDB)..." gdb - :active (fboundp 'gdb)] - ["Debug (DBX)..." dbx - :active (fboundp 'dbx)] - "-----" - ("Tags" - ["Find Tag..." find-tag] - ["Find Other Window..." find-tag-other-window] - ["Next Tag..." (find-tag nil)] - ["Next Other Window..." (find-tag-other-window nil)] - ["Next File" next-file] - "-----" - ["Tags Search..." tags-search] - ["Tags Replace..." tags-query-replace] - ["Continue Search/Replace" tags-loop-continue] - "-----" - ["Pop stack" pop-tag-mark] - ["Apropos..." tags-apropos] - "-----" - ["Set Tags Table File..." visit-tags-table] - )) + nil ; the partition: menus after this are flushright - nil ; the partition: menus after this are flushright - - ("Help" - ["About XEmacs..." about-xemacs] - ("Basics" - ["Installation" describe-installation + ("%_Help" + ["%_About XEmacs..." about-xemacs] + ("%_Basics" + ["%_Installation" describe-installation :active (boundp 'Installation-string)] ;; Tutorials. ,(if (featurep 'mule) ;; Mule tutorials. - (let ((lang language-info-alist) + (let ((lang language-info-alist) (n 0) submenu tut) (while lang + (setq n (1+ n)) (and (setq tut (assq 'tutorial (car lang))) (not (string= (caar lang) "ASCII")) (setq submenu (cons - `[,(caar lang) (help-with-tutorial nil ,(cdr tut))] + `[,(concat (menu-item-generate-accelerator-spec n) + (caar lang)) + (help-with-tutorial nil ,(cdr tut))] submenu))) (setq lang (cdr lang))) - (append `("Tutorials" + (append `("%_Tutorials" :filter tutorials-menu-filter - ["Default" help-with-tutorial t + ["%_Default" help-with-tutorial t ,(concat "(" current-language-environment ")")]) submenu)) ;; Non mule tutorials. (let ((lang tutorial-supported-languages) + (n 0) submenu) (while lang + (setq n (1+ n)) (setq submenu (cons - `[,(caar lang) + `[,(concat (menu-item-generate-accelerator-spec n) + (caar lang)) (help-with-tutorial ,(format "TUTORIAL.%s" (cadr (car lang))))] submenu)) (setq lang (cdr lang))) - (append '("Tutorials" - ["English" help-with-tutorial]) + (append '("%_Tutorials" + ["%_English" help-with-tutorial]) submenu))) - ["News" view-emacs-news] - ["Packages" finder-by-keyword] - ["Splash" xemacs-splash-buffer]) + ["%_News" view-emacs-news] + ["%_Packages" finder-by-keyword] + ["%_Splash" xemacs-splash-buffer]) "-----" - ("XEmacs FAQ" - ["FAQ (local)" xemacs-local-faq] - ["FAQ via WWW" xemacs-www-faq (boundp 'browse-url-browser-function)] - ["Home Page" xemacs-www-page (boundp 'browse-url-browser-function)]) - ("Samples" - ["Sample .emacs" (find-file (locate-data-file "sample.emacs")) (locate-data-file "sample.emacs")] - ["Sample .Xdefaults" (find-file (locate-data-file "sample.Xdefaults")) (locate-data-file "sample.Xdefaults")] - ["Sample enriched" (find-file (locate-data-file "enriched.doc")) (locate-data-file "enriched.doc")]) + ("XEmacs %_FAQ" + ["%_FAQ (local)" xemacs-local-faq] + ["FAQ via %_WWW" xemacs-www-faq (boundp 'browse-url-browser-function)] + ["%_Home Page" xemacs-www-page (boundp 'browse-url-browser-function)]) + ("%_Samples" + ["Sample .%_emacs" (find-file (locate-data-file "sample.emacs")) (locate-data-file "sample.emacs")] + ["Sample .%_Xdefaults" (find-file (locate-data-file "sample.Xdefaults")) (locate-data-file "sample.Xdefaults")] + ["Sample e%_nriched" (find-file (locate-data-file "enriched.doc")) (locate-data-file "enriched.doc")]) "-----" - ("Lookup in Info" - ["Key Binding..." Info-goto-emacs-key-command-node] - ["Command..." Info-goto-emacs-command-node] - ["Function..." Info-elisp-ref] - ["Topic..." Info-query]) - ("Manuals" - ["Info" info] - ["Unix Manual..." manual-entry]) - ("Commands & Keys" - ["Mode" describe-mode] - ["Apropos..." hyper-apropos] - ["Apropos Docs..." apropos-documentation] + ("Lookup in %_Info" + ["%_Key Binding..." Info-goto-emacs-key-command-node] + ["%_Command..." Info-goto-emacs-command-node] + ["%_Function..." Info-elisp-ref] + ["%_Topic..." Info-query]) + ("%_Manuals" + ["%_Info" info] + ["%_Unix Manual..." manual-entry]) + ("%_Commands & Keys" + ["%_Mode" describe-mode] + ["%_Apropos..." hyper-apropos] + ["Apropos %_Docs..." apropos-documentation] "-----" - ["Key..." describe-key] - ["Bindings" describe-bindings] - ["Mouse Bindings" describe-pointer] - ["Recent Keys" view-lossage] + ["%_Key..." describe-key] + ["%_Bindings" describe-bindings] + ["%_Mouse Bindings" describe-pointer] + ["%_Recent Keys" view-lossage] "-----" - ["Function..." describe-function] - ["Variable..." describe-variable] - ["Locate Command..." where-is]) + ["%_Function..." describe-function] + ["%_Variable..." describe-variable] + ["%_Locate Command..." where-is]) "-----" - ["Recent Messages" view-lossage] - ("Misc" - ["No Warranty" describe-no-warranty] - ["XEmacs License" describe-copying] - ["The Latest Version" describe-distribution]) - ["Send Bug Report..." report-emacs-bug + ["%_Recent Messages" view-lossage] + ("%_Misc" + ["%_No Warranty" describe-no-warranty] + ["XEmacs %_License" describe-copying] + ["The Latest %_Version" describe-distribution]) + ["%_Send Bug Report..." report-emacs-bug :active (fboundp 'report-emacs-bug)])))) (defun maybe-add-init-button () "Don't call this. Adds `Load .emacs' button to menubar when starting up with -q." - ;; by Stig@hackvan.com - (cond - (load-user-init-file-p nil) - ((file-exists-p (expand-file-name ".emacs" "~")) - (add-menu-button nil - ["Load .emacs" - (progn (delete-menu-item '("Load .emacs")) - (load-user-init-file)) - ] - "Help")) - (t nil))) + (when (and (not load-user-init-file-p) + (file-exists-p (expand-file-name ".emacs" "~"))) + (add-menu-button + nil + ["%_Load .emacs" + (progn + (mapc #'(lambda (buf) + (with-current-buffer buf + (delete-menu-item '("Load .emacs")))) + (buffer-list)) + (load-user-init-file)) + ] + "Help"))) (add-hook 'before-init-hook 'maybe-add-init-button) @@ -1015,34 +1425,34 @@ bookmark-alist t))) `(,(if definedp - '("Jump to Bookmark" + '("%_Jump to Bookmark" :filter (lambda (&rest junk) (mapcar #'(lambda (bmk) `[,bmk (bookmark-jump ',bmk)]) (bookmark-all-names)))) - ["Jump to Bookmark" nil nil]) - ["Set bookmark" bookmark-set + ["%_Jump to Bookmark" nil nil]) + ["Set %_Bookmark" bookmark-set :active (fboundp 'bookmark-set)] "---" - ["Insert contents" bookmark-menu-insert + ["Insert %_Contents" bookmark-menu-insert :active (fboundp 'bookmark-menu-insert)] - ["Insert location" bookmark-menu-locate + ["Insert L%_ocation" bookmark-menu-locate :active (fboundp 'bookmark-menu-locate)] "---" - ["Rename bookmark" bookmark-menu-rename + ["%_Rename Bookmark" bookmark-menu-rename :active (fboundp 'bookmark-menu-rename)] ,(if definedp - '("Delete Bookmark" + '("%_Delete Bookmark" :filter (lambda (&rest junk) (mapcar #'(lambda (bmk) `[,bmk (bookmark-delete ',bmk)]) (bookmark-all-names)))) - ["Delete Bookmark" nil nil]) - ["Edit Bookmark List" bookmark-bmenu-list ,definedp] + ["%_Delete Bookmark" nil nil]) + ["%_Edit Bookmark List" bookmark-bmenu-list ,definedp] "---" - ["Save bookmarks" bookmark-save ,definedp] - ["Save bookmarks as..." bookmark-write ,definedp] - ["Load a bookmark file" bookmark-load + ["%_Save Bookmarks" bookmark-save ,definedp] + ["Save Bookmarks %_As..." bookmark-write ,definedp] + ["%_Load a Bookmark File" bookmark-load :active (fboundp 'bookmark-load)]))) ;;; The Buffers menu @@ -1051,6 +1461,8 @@ "Customization of `Buffers' menu." :group 'menu) +(defvar buffers-menu-omit-chars-list '(?b ?p ?l)) + (defcustom buffers-menu-max-size 25 "*Maximum number of entries which may appear on the \"Buffers\" menu. If this is 10, then only the ten most-recently-selected buffers will be @@ -1096,11 +1508,22 @@ :group 'buffers-menu) (defcustom buffers-menu-format-buffer-line-function 'format-buffers-menu-line - "*The function to call to return a string to represent a buffer in the -buffers menu. The function is passed a buffer and should return a string. -The default value `format-buffers-menu-line' just returns the name of -the buffer. Also check out `slow-format-buffers-menu-line' which -returns a whole bunch of info about a buffer." + "*The function to call to return a string to represent a buffer in +the buffers menu. The function is passed a buffer and a number +(starting with 1) indicating which buffer line in the menu is being +processed and should return a string containing an accelerator +spec. (Check out `menu-item-generate-accelerator-spec' as a convenient +way of generating the accelerator specs.) The default value +`format-buffers-menu-line' just returns the name of the buffer and +uses the number as the accelerator. Also check out +`slow-format-buffers-menu-line' which returns a whole bunch of info +about a buffer. + +Note: Gross Compatibility Hack: Older versions of this function prototype +only expected one argument, not two. We deal gracefully with such +functions by simply calling them with one argument and leaving out the +line number. However, this may go away at any time, so make sure to +update all of your functions of this type." :type 'function :group 'buffers-menu) @@ -1131,11 +1554,6 @@ function) :group 'buffers-menu) -(defun buffers-menu-omit-invisible-buffers (buf) - "For use as a value of `buffers-menu-omit-function'. -Omits normally invisible buffers (those whose name begins with a space)." - (not (null (string-match "\\` " (buffer-name buf))))) - (defun sort-buffers-menu-alphabetically (buf1 buf2) "For use as a value of `buffers-menu-sort-function'. Sorts the buffers in alphabetical order by name, but puts buffers beginning @@ -1178,21 +1596,25 @@ (string-lessp nam1 nam2))))) ;; this version is too slow on some machines. -(defun slow-format-buffers-menu-line (buffer) +;; (vintage 1990, that is) +(defun slow-format-buffers-menu-line (buffer n) "For use as a value of `buffers-menu-format-buffer-line-function'. This returns a string containing a bunch of info about the buffer." - (format "%s%s %-19s %6s %-15s %s" - (if (buffer-modified-p buffer) "*" " ") - (if (symbol-value-in-buffer 'buffer-read-only buffer) "%" " ") - (buffer-name buffer) - (buffer-size buffer) - (symbol-value-in-buffer 'mode-name buffer) - (or (buffer-file-name buffer) ""))) + (concat (menu-item-generate-accelerator-spec n buffers-menu-omit-chars-list) + (format "%s%s %-19s %6s %-15s %s" + (if (buffer-modified-p buffer) "*" " ") + (if (symbol-value-in-buffer 'buffer-read-only buffer) + "%" " ") + (buffer-name buffer) + (buffer-size buffer) + (symbol-value-in-buffer 'mode-name buffer) + (or (buffer-file-name buffer) "")))) -(defun format-buffers-menu-line (buffer) +(defun format-buffers-menu-line (buffer n) "For use as a value of `buffers-menu-format-buffer-line-function'. This just returns the buffer's name." - (buffer-name buffer)) + (concat (menu-item-generate-accelerator-spec n buffers-menu-omit-chars-list) + (buffer-name buffer))) (defun group-buffers-menu-by-mode-then-alphabetically (buf1 buf2) "For use as a value of `buffers-menu-grouping-function'. @@ -1221,36 +1643,41 @@ (buffer-name (current-buffer))))))) (defsubst build-buffers-menu-internal (buffers) - (let (name line) + (let (name line (n 0)) (mapcar #'(lambda (buffer) (if (eq buffer t) "---" - (setq line (funcall buffers-menu-format-buffer-line-function - buffer)) + (setq n (1+ n)) + (setq line + ; #### a truly Kyle-friendly hack. + (let ((fn buffers-menu-format-buffer-line-function)) + (if (= (function-max-args fn) 1) + (funcall fn buffer) + (funcall fn buffer n)))) (if complex-buffers-menu-p (delq nil (list line - (vector "Switch to Buffer" + (vector "S%_witch to Buffer" (list buffers-menu-switch-to-buffer-function (setq name (buffer-name buffer))) t) (if (eq buffers-menu-switch-to-buffer-function 'switch-to-buffer) - (vector "Switch to Buffer, Other Frame" + (vector "Switch to Buffer, Other %_Frame" (list 'switch-to-buffer-other-frame (setq name (buffer-name buffer))) t) nil) (if (and (buffer-modified-p buffer) (buffer-file-name buffer)) - (vector "Save Buffer" + (vector "%_Save Buffer" (list 'buffer-menu-save-buffer name) t) - ["Save Buffer" nil nil] + ["%_Save Buffer" nil nil] ) - (vector "Save As..." + (vector "Save %_As..." (list 'buffer-menu-write-file name) t) - (vector "Delete Buffer" (list 'kill-buffer name) + (vector "%_Delete Buffer" (list 'kill-buffer name) t))) ;; #### We don't want buffer names to be translated, ;; #### so we put the buffer name in the suffix. @@ -1323,10 +1750,13 @@ (defun language-environment-menu-filter (menu) "This is the menu filter for the \"Language Environment\" submenu." - (mapcar (lambda (env-sym) - `[ ,(capitalize (symbol-name env-sym)) - (set-language-environment ',env-sym)]) - language-environment-list)) + (let ((n 0)) + (mapcar (lambda (env-sym) + (setq n (1+ n)) + `[ ,(concat (menu-item-generate-accelerator-spec n) + (capitalize (symbol-name env-sym))) + (set-language-environment ',env-sym)]) + language-environment-list))) ;;; The Options menu @@ -1385,24 +1815,24 @@ (defconst default-popup-menu '("XEmacs Commands" - ["Undo" advertised-undo + ["%_Undo" advertised-undo :active (and (not (eq buffer-undo-list t)) (or buffer-undo-list pending-undo-list)) :suffix (if (or (eq last-command 'undo) (eq last-command 'advertised-undo)) "More" "")] - ["Cut" kill-primary-selection + ["Cu%_t" kill-primary-selection :active (selection-owner-p)] - ["Copy" copy-primary-selection + ["%_Copy" copy-primary-selection :active (selection-owner-p)] - ["Paste" yank-clipboard-selection + ["%_Paste" yank-clipboard-selection :active (selection-exists-p 'CLIPBOARD)] - ["Clear" delete-primary-selection + ["%_Delete" delete-primary-selection :active (selection-owner-p)] "-----" - ["Select Block" mark-paragraph] - ["Split Window" split-window-vertically] - ["Unsplit Window" delete-other-windows] + ["Select %_Block" mark-paragraph] + ["Sp%_lit Window" split-window-vertically] + ["U%_nsplit Window" delete-other-windows] )) (defvar global-popup-menu nil @@ -1469,9 +1899,9 @@ (error "Pointer must be in a normal window")) (select-window window) (if current-menubar - (setq bmenu (assoc "Buffers" current-menubar))) + (setq bmenu (assoc "%_Buffers" current-menubar))) (if (null bmenu) - (setq bmenu (assoc "Buffers" default-menubar))) + (setq bmenu (assoc "%_Buffers" default-menubar))) (if (null bmenu) (error "Can't find the Buffers menu")) (popup-menu bmenu))) @@ -1486,12 +1916,12 @@ (error "Pointer must be in a normal window")) (select-window window) (and current-menubar (run-hooks 'activate-menubar-hook)) - ;; ##### Instead of having to copy this just to safely get rid of + ;; #### Instead of having to copy this just to safely get rid of ;; any nil what we should really do is fix up the internal menubar ;; code to just ignore nil if generating a popup menu (setq popup-menubar (delete nil (copy-sequence (or current-menubar default-menubar)))) - (popup-menu (cons "Menubar Menu" popup-menubar)) + (popup-menu (cons "%_Menubar Menu" popup-menubar)) )) (global-set-key 'button3 'popup-mode-menu) diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/menubar.el --- a/lisp/menubar.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/menubar.el Mon Aug 13 11:16:07 2007 +0200 @@ -128,19 +128,6 @@ menuitem))) (setq plistp (or (>= L 5) (and (> L 2) (keywordp (aref menuitem 2))))) - (or (stringp (aref menuitem 0)) - (signal 'error - (list - "first element of a button must be a string (the label)" - menuitem))) - (or plistp - (< L 4) - (null (aref menuitem 3)) - (stringp (aref menuitem 3)) - (signal 'error - (list - "fourth element of a button must be a string (the label suffix)" - menuitem))) (if plistp (let ((i 2) selp diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/minibuf.el --- a/lisp/minibuf.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/minibuf.el Mon Aug 13 11:16:07 2007 +0200 @@ -1,8 +1,8 @@ ;;; minibuf.el --- Minibuffer functions for XEmacs ;; Copyright (C) 1992, 1993, 1994, 1997 Free Software Foundation, Inc. -;; Copyright (C) 1995 Tinker Systems -;; Copyright (C) 1995, 1996 Ben Wing +;; Copyright (C) 1995 Tinker Systems. +;; Copyright (C) 1995, 1996, 2000 Ben Wing. ;; Author: Richard Mlynarik ;; Created: 2-Oct-92 @@ -111,8 +111,12 @@ ;(defvar minibuffer-setup-hook nil ; "Normal hook run just after entry to minibuffer.") +;; see comment at list-mode-hook. +(put 'minibuffer-setup-hook 'permanent-local t) + (defvar minibuffer-exit-hook nil "Normal hook run just after exit from minibuffer.") +(put 'minibuffer-exit-hook 'permanent-local t) (defvar minibuffer-help-form nil "Value that `help-form' takes on inside the minibuffer.") @@ -608,7 +612,7 @@ ;; Used by minibuffer-do-completion -(defvar last-exact-completion) +(defvar last-exact-completion nil) (defun temp-minibuffer-message (m) (let ((savemax (point-max))) @@ -1446,7 +1450,10 @@ Prompts with PROMPT. By default, return DEFAULT-VALUE. A user variable is one whose documentation starts with a `*' character." (intern (completing-read prompt obarray 'user-variable-p t nil - 'variable-history default-value))) + 'variable-history + (if (symbolp default-value) + (symbol-name default-value) + default-value)))) (defun read-buffer (prompt &optional default require-match) "Read the name of a buffer and return as a string. @@ -1638,30 +1645,24 @@ ;; this calls read-file-name-2 (mouse-read-file-name-1 history prompt dir default must-match initial-contents completer) - (let ((rfhookfun - (lambda () - ;; #### SCREAM! Create a `file-system-ignore-case' - ;; function, so this kind of stuff is generalized! - (and (eq system-type 'windows-nt) - (set (make-local-variable 'completion-ignore-case) t)) - (set - (make-local-variable - 'completion-display-completion-list-function) - #'(lambda (completions) - (display-completion-list - completions - :user-data (not (eq completer 'read-file-name-internal)) - :activate-callback - 'read-file-name-activate-callback))) - ;; kludge! - (remove-hook 'minibuffer-setup-hook rfhookfun) - ))) - (unwind-protect - (progn - (add-hook 'minibuffer-setup-hook rfhookfun) - (read-file-name-2 history prompt dir default must-match - initial-contents completer)) - (remove-hook 'minibuffer-setup-hook rfhookfun))))) + (add-one-shot-hook + 'minibuffer-setup-hook + (lambda () + ;; #### SCREAM! Create a `file-system-ignore-case' + ;; function, so this kind of stuff is generalized! + (and (eq system-type 'windows-nt) + (set (make-local-variable 'completion-ignore-case) t)) + (set + (make-local-variable + 'completion-display-completion-list-function) + #'(lambda (completions) + (display-completion-list + completions + :user-data (not (eq completer 'read-file-name-internal)) + :activate-callback + 'read-file-name-activate-callback))))) + (read-file-name-2 history prompt dir default must-match + initial-contents completer))) (defun read-file-name (prompt &optional dir default must-match initial-contents @@ -1925,18 +1926,38 @@ result) (t file)))) +(defun mouse-rfn-setup-vars (prompt) + ;; a specifier would be nice. + (set (make-local-variable 'frame-title-format) + (capitalize-string-as-title + ;; Delete ": " off the end. There must be an easier way! + (let ((end-pos (length prompt))) + (if (and (> end-pos 0) (eq (aref prompt (1- end-pos)) ? )) + (setq end-pos (1- end-pos))) + (if (and (> end-pos 0) (eq (aref prompt (1- end-pos)) ?:)) + (setq end-pos (1- end-pos))) + (substring prompt 0 end-pos)))) + ;; ensure that killing the frame works right, + ;; instead of leaving us in the minibuffer. + (add-local-hook 'delete-frame-hook + #'(lambda (frame) + (abort-recursive-edit)))) + (defun mouse-file-display-completion-list (window dir minibuf user-data) (let ((standard-output (window-buffer window))) (condition-case nil (display-completion-list (directory-files dir nil nil nil t) - :window-width (* 2 (window-width window)) + :window-width (window-width window) + :window-height (window-text-area-height window) + :completion-string "" :activate-callback 'mouse-read-file-name-activate-callback :user-data user-data :reference-buffer minibuf :help-string "") - (t nil)))) + (t nil)) + )) (defun mouse-directory-display-completion-list (window dir minibuf user-data) (let ((standard-output (window-buffer window))) @@ -1944,21 +1965,25 @@ (display-completion-list (delete "." (directory-files dir nil nil nil 1)) :window-width (window-width window) + :window-height (window-text-area-height window) + :completion-string "" :activate-callback 'mouse-read-file-name-activate-callback :user-data user-data :reference-buffer minibuf :help-string "") - (t nil)))) + (t nil)) + )) (defun mouse-read-file-name-activate-callback (event extent user-data) (let* ((file (extent-string extent)) (minibuf (symbol-value-in-buffer 'completion-reference-buffer (extent-object extent))) - (in-dir (buffer-substring nil nil minibuf)) + (ministring (buffer-substring nil nil minibuf)) + (in-dir (file-name-directory ministring)) (full (expand-file-name file in-dir)) (filebuf (nth 0 user-data)) - (dirbuff (nth 1 user-data)) + (dirbuf (nth 1 user-data)) (filewin (nth 2 user-data)) (dirwin (nth 3 user-data))) (if (file-regular-p full) @@ -1967,29 +1992,34 @@ (insert-string (file-name-as-directory (abbreviate-file-name full t)) minibuf) (reset-buffer filebuf) - (if (not dirbuff) + (if (not dirbuf) (mouse-directory-display-completion-list filewin full minibuf user-data) (mouse-file-display-completion-list filewin full minibuf user-data) - (reset-buffer dirbuff) + (reset-buffer dirbuf) (mouse-directory-display-completion-list dirwin full minibuf user-data))))) -;; this is rather cheesified but gets the job done. +;; our cheesy but god-awful time consuming file dialog box implementation. +;; this will be replaced with use of the native file dialog box (when +;; available). (defun mouse-read-file-name-1 (history prompt dir default - must-match initial-contents - completer) + must-match initial-contents + completer) + ;; file-p is t if we're reading files, nil if directories. (let* ((file-p (eq 'read-file-name-internal completer)) (filebuf (get-buffer-create "*Completions*")) - (dirbuff (and file-p (generate-new-buffer " *mouse-read-file*"))) - (butbuff (generate-new-buffer " *mouse-read-file*")) + (dirbuf (and file-p (generate-new-buffer " *mouse-read-file*"))) + (butbuf (generate-new-buffer " *mouse-read-file*")) (frame (make-dialog-frame)) filewin dirwin user-data) (unwind-protect (progn (reset-buffer filebuf) - (select-frame frame) + + ;; set up the frame. + (focus-frame frame) (let ((window-min-height 1)) ;; #### should be 2 not 3, but that causes ;; "window too small to split" errors for some @@ -2002,16 +2032,80 @@ (setq filewin (frame-rightmost-window frame) dirwin (frame-leftmost-window frame)) (set-window-buffer filewin filebuf) - (set-window-buffer dirwin dirbuff)) + (set-window-buffer dirwin dirbuf)) (setq filewin (frame-highest-window frame)) (set-window-buffer filewin filebuf)) - (setq user-data (list filebuf dirbuff filewin dirwin)) - (set-window-buffer (frame-lowest-window frame) butbuff) - (set-buffer butbuff) + (setq user-data (list filebuf dirbuf filewin dirwin)) + (set-window-buffer (frame-lowest-window frame) butbuf) + + ;; set up completion buffers. + (let ((rfcshookfun + ;; kludge! + ;; #### I really need to flesh out the object + ;; hierarchy better to avoid these kludges. + ;; (?? I wrote this comment above some time ago, + ;; and I don't understand what I'm referring to + ;; any more. --ben + (lambda () + (mouse-rfn-setup-vars prompt) + (when (featurep 'scrollbar) + (set-specifier scrollbar-width 0 (current-buffer))) + (setq truncate-lines t)))) + + (set-buffer filebuf) + (add-local-hook 'completion-setup-hook rfcshookfun) + (when file-p + (set-buffer dirbuf) + (add-local-hook 'completion-setup-hook rfcshookfun))) + + ;; set up minibuffer. + (add-one-shot-hook + 'minibuffer-setup-hook + (lambda () + (if (not file-p) + (mouse-directory-display-completion-list + filewin dir (current-buffer) user-data) + (mouse-file-display-completion-list + filewin dir (current-buffer) user-data) + (mouse-directory-display-completion-list + dirwin dir (current-buffer) user-data)) + (set + (make-local-variable + 'completion-display-completion-list-function) + (lambda (completions) + (display-completion-list + completions + :help-string "" + :window-width (window-width filewin) + :window-height (window-text-area-height filewin) + :completion-string "" + :activate-callback + 'mouse-read-file-name-activate-callback + :user-data user-data))) + (mouse-rfn-setup-vars prompt) + (save-selected-window + ;; kludge to ensure the frame title is correct. + ;; the minibuffer leaves the frame title the way + ;; it was before (i.e. of the selected window before + ;; the dialog box was opened), so to get it correct + ;; we have to be tricky. + (select-window filewin) + (redisplay-frame nil t) + ;; #### another kludge. sometimes the focus ends up + ;; back in the main window, not the dialog box. it + ;; occurs randomly and it's not possible to reliably + ;; reproduce. We try to fix it by draining non-user + ;; events and then setting the focus back on the frame. + (sit-for 0 t) + (focus-frame frame)))) + + ;; set up button buffer. + (set-buffer butbuf) + (mouse-rfn-setup-vars prompt) (when dir (setq default-directory dir)) (when (featurep 'scrollbar) - (set-specifier scrollbar-width 0 butbuff)) + (set-specifier scrollbar-width 0 butbuf)) (insert " ") (insert-gui-button (make-gui-button "OK" (lambda (foo) @@ -2020,51 +2114,20 @@ (insert-gui-button (make-gui-button "Cancel" (lambda (foo) (abort-recursive-edit)))) - (let ((rfhookfun - (lambda () - (if (not file-p) - (mouse-directory-display-completion-list - filewin dir (current-buffer) user-data) - (mouse-file-display-completion-list filewin dir - (current-buffer) - user-data) - (mouse-directory-display-completion-list dirwin dir - (current-buffer) - user-data)) - (set - (make-local-variable - 'completion-display-completion-list-function) - #'(lambda (completions) - (display-completion-list - completions - :help-string "" - :activate-callback - 'mouse-read-file-name-activate-callback - :user-data user-data))) - ;; kludge! - (remove-hook 'minibuffer-setup-hook rfhookfun) - )) - (rfcshookfun - ;; kludge! - ;; #### I really need to flesh out the object - ;; hierarchy better to avoid these kludges. - (lambda () - (save-excursion - (set-buffer standard-output) - (setq truncate-lines t))))) - (unwind-protect - (progn - (add-hook 'minibuffer-setup-hook rfhookfun) - (add-hook 'completion-setup-hook rfcshookfun) - (read-file-name-2 history prompt dir default - must-match initial-contents - completer)) - (remove-hook 'minibuffer-setup-hook rfhookfun) - (remove-hook 'completion-setup-hook rfcshookfun)))) + + ;; now start reading filename. + (read-file-name-2 history prompt dir default + must-match initial-contents + completer)) + + ;; always clean up. + ;; get rid of our hook that calls abort-recursive-edit -- not a good + ;; idea here. + (kill-local-variable 'delete-frame-hook) (delete-frame frame) (kill-buffer filebuf) - (kill-buffer butbuff) - (and dirbuff (kill-buffer dirbuff))))) + (kill-buffer butbuf) + (and dirbuf (kill-buffer dirbuf))))) (defun read-face (prompt &optional must-match) "Read the name of a face from the minibuffer and return it as a symbol." diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/msw-glyphs.el --- a/lisp/msw-glyphs.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/msw-glyphs.el Mon Aug 13 11:16:07 2007 +0200 @@ -30,11 +30,24 @@ ;; Initialization code for MS Windows glyphs. ;; This file is dumped with XEmacs (when MS Windows support is -;; compiled in). +;; compiled in). Make sure this is the first of msw-*.el files +;; dumped. ;;; Code: +(defun msgdi-device-p (&optional device) + "Return non-nil if DEVICE is a GDI device, that is 'mswindows or 'msprinter. +MS GDI devices are mutuially WYSIWIG-compatible, so that many common glyph, +color and font properties apply to them equally. + +This function is also a predicate for 'msgdi device tag, matching this +device class." + (memq (device-type device) '(mswindows msprinter))) + (progn + + (define-specifier-tag 'msgdi (function msgdi-device-p)) + (set-console-type-image-conversion-list 'mswindows `(("\\.bmp\\'" [bmp :file nil] 2) @@ -59,11 +72,14 @@ ;; strings are not allowed so they will be ignored. ("" [nothing]))) + (set-console-type-image-conversion-list + 'msprinter (console-type-image-conversion-list 'mswindows)) + (set-face-font 'border-glyph "WingDings:Regular:11::Symbol" - 'global 'mswindows) - (set-glyph-image continuation-glyph "\xC3" 'global 'mswindows) - (set-glyph-image truncation-glyph "\xF0" 'global 'mswindows) - (set-glyph-image hscroll-glyph "\xEF" 'global 'mswindows) + 'global 'msgdi) + (set-glyph-image continuation-glyph "\xC3" 'global 'msgdi) + (set-glyph-image truncation-glyph "\xF0" 'global 'msgdi) + (set-glyph-image hscroll-glyph "\xEF" 'global 'msgdi) (set-glyph-image octal-escape-glyph "\\") (set-glyph-image control-arrow-glyph "^") @@ -78,11 +94,11 @@ (if emacs-beta-version "xemacs-beta.xpm" "xemacs.xpm")) - 'global 'mswindows)) + 'global 'msgdi)) (t (set-glyph-image xemacs-logo "XEmacs " - 'global 'mswindows))) + 'global 'msgdi))) ) ;;; msw-glyphs.el ends here diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/msw-init.el --- a/lisp/msw-init.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/msw-init.el Mon Aug 13 11:16:07 2007 +0200 @@ -47,6 +47,7 @@ (if (featurep 'infodock) (require 'id-x-toolbar) (init-x-toolbar))) + (if (featurep 'gutter) (init-gutter)) (add-hook 'zmacs-deactivate-region-hook (lambda () (if (console-on-window-system-p) @@ -61,13 +62,15 @@ (activate-region-as-selection)))) ;; Old-style mswindows bindings. The new-style mswindows bindings ;; (namely Ctrl-X, Ctrl-C and Ctrl-V) are already spoken for by XEmacs. - (define-key global-map '(shift delete) 'kill-primary-selection) - (define-key global-map '(control delete) 'delete-primary-selection) - (define-key global-map '(shift insert) 'yank-clipboard-selection) - (define-key global-map '(control insert) 'copy-primary-selection) + (global-set-key '(shift delete) 'kill-primary-selection) + (global-set-key '(control delete) 'delete-primary-selection) + (global-set-key '(shift insert) 'yank-clipboard-selection) + (global-set-key '(control insert) 'copy-primary-selection) + + (global-set-key '(meta f4) 'save-buffers-kill-emacs) ;; Random stuff - (define-key global-map 'menu 'popup-mode-menu) + (global-set-key 'menu 'popup-mode-menu) (setq mswindows-post-win-initted t))) diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/mule/auto-autoloads.el --- a/lisp/mule/auto-autoloads.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/mule/auto-autoloads.el Mon Aug 13 11:16:07 2007 +0200 @@ -4,7 +4,7 @@ ;;;### (autoloads (ccl-execute-with-args check-ccl-program define-ccl-program declare-ccl-program ccl-dump ccl-compile ccl-program-p) "mule-ccl" "mule/mule-ccl.el") (autoload 'ccl-program-p "mule-ccl" "\ -T if OBJECT is a valid CCL compiled code." nil nil) +Return t if OBJECT is a valid CCL compiled code." nil nil) (autoload 'ccl-compile "mule-ccl" "\ Return a compiled code of CCL-PROGRAM as a vector of integer." nil nil) diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/mule/mule-charset.el --- a/lisp/mule/mule-charset.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/mule/mule-charset.el Mon Aug 13 11:16:07 2007 +0200 @@ -249,4 +249,13 @@ (defalias 'charset-plist 'object-plist) (defalias 'set-charset-plist 'setplist) +;; Setup auto-fill-chars for charsets that should invoke auto-filling. +;; SPACE and NEWLIE are already set. +(let ((l '(katakana-jisx0201 + japanese-jisx0208 japanese-jisx0212 + chinese-gb2312 chinese-big5-1 chinese-big5-2))) + (while l + (put-char-table (car l) t auto-fill-chars) + (setq l (cdr l)))) + ;;; mule-charset.el ends here diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/mule/mule-cmds.el --- a/lisp/mule/mule-cmds.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/mule/mule-cmds.el Mon Aug 13 11:16:07 2007 +0200 @@ -162,9 +162,9 @@ ;; that they could reset the terminal coding system. ;; (unless (and (eq window-system 'pc) coding-system) ;; (setq default-terminal-coding-system coding-system)) - (setq terminal-coding-system coding-system) + (set-terminal-coding-system coding-system) ;;(setq default-keyboard-coding-system coding-system) - (setq keyboard-coding-system coding-system) + (set-keyboard-coding-system coding-system) ;;(setq default-process-coding-system (cons coding-system coding-system)) ;; Refer to coding-system-for-read and coding-system-for-write ;; so that C-x RET c works. diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/multicast.el --- a/lisp/multicast.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/multicast.el Mon Aug 13 11:16:07 2007 +0200 @@ -1,25 +1,25 @@ ;;; multicast.el --- lisp frontend for multicast connections in XEmacs -;; Copyright (C) 1997-1998 Didier Verna. +;; Copyright (C) 1997-2000 Didier Verna. -;; Author: Didier Verna -;; Maintainer: Didier Verna -;; Created: Thu Dec 4 16:37:39 1997 +;; Author: Didier Verna +;; Maintainer: Didier Verna +;; Created: Thu Dec 4 16:37:39 1997 ;; Last Revision: Mon Jan 19 19:10:50 1998 ;; Current Version: 0.4 ;; Keywords: dumped comm processes -;; This file is part of XEmacs. +;; This file is part of XEmacs. ;; XEmacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2 of the License, or -;; (at your option) any later version. +;; (at your option) any later version. ;; XEmacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. +;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software @@ -60,7 +60,7 @@ ttl is the time-to-live (15 for site, 63 for region and 127 for world). WARNING: it is *strongly* recommended to avoid using groups beginning with - 224 or 239. Such groups are considered 'admin' groups, and may + 224 or 239. Such groups are considered 'admin' groups, and may behave in a surprising way ..." (let (dest port ttl) ;; We check only the general form of the multicast address. @@ -77,5 +77,5 @@ (error "invalid ttl specification.")) (open-multicast-group-internal name buffer dest port ttl) )) - + ;;; multicast.el ends here diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/package-get.el --- a/lisp/package-get.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/package-get.el Mon Aug 13 11:16:07 2007 +0200 @@ -68,7 +68,7 @@ ;; vm - a mail reader ;; [] Always install ;; [] Needs updating -;; [] Required by other [packages] +;; [] Required by other [packages] ;; ;; Where `[]' indicates a toggle box ;; @@ -79,7 +79,7 @@ ;; - "Required by other" means some other packages are going to force ;; this to be installed. Clicking on [packages] gives a list ;; of packages that require this. -;; +;; ;; The `package-get-base' should be installed in a file in ;; `data-directory'. The `package-get-here' should be installed in ;; site-lisp. Both are then read at run time. @@ -113,7 +113,7 @@ :prefix "package-get" :group 'package-tools) -;;;###autoload +;;;###autoload (defvar package-get-base nil "List of packages that are installed at this site. For each element in the alist, car is the package name and the cdr is @@ -288,7 +288,8 @@ `(if (member (quote ,(cdr site)) package-get-remote) (setq package-get-remote - (delete (quote ,(cdr site)) package-get-remote)) + (delete (quote ,(cdr site)) + package-get-remote)) (package-ui-add-site (quote ,(cdr site)))) :style 'toggle :selected `(member (quote ,(cdr site)) @@ -373,7 +374,7 @@ (setq location package-get-user-index-filename)) (when (y-or-n-p (concat "Update package index in " location "? ")) (write-file location)))))) - + ;;;###autoload (defun package-get-update-base (&optional db-file force-current) @@ -515,19 +516,18 @@ a symbol instead of a string if PACKAGE-SYMBOL is non-nil. The return value is suitable for direct passing to `interactive'." (package-get-require-base t) - (let ( (table (mapcar '(lambda (item) - (let ( (name (symbol-name (car item))) ) - (cons name name) - )) - package-get-base)) - package package-symbol default-version version) + (let ((table (mapcar #'(lambda (item) + (let ((name (symbol-name (car item)))) + (cons name name))) + package-get-base)) + package package-symbol default-version version) (save-window-excursion (setq package (completing-read "Package: " table nil t)) (setq package-symbol (intern package)) (if get-version (progn - (setq default-version - (package-get-info-prop + (setq default-version + (package-get-info-prop (package-get-info-version (package-get-info-find-package package-get-base package-symbol) nil) @@ -542,8 +542,7 @@ ) (if package-symbol (list package-symbol) - (list package))) - ))) + (list package)))))) ;;;###autoload (defun package-get-delete-package (package &optional pkg-topdir) @@ -706,7 +705,7 @@ INSTALL-DIR, if non-nil, specifies the package directory where fetched packages should be installed. -The value of `package-get-base' is used to determine what files should +The value of `package-get-base' is used to determine what files should be retrieved. The value of `package-get-remote' is used to determine where a package should be retrieved from. The sites are tried in order so one is better off listing easily reached sites first. @@ -814,7 +813,7 @@ current-dir-entry current-filename)) ;; Get it (setq full-package-filename dest-filename) - (message "Retrieving package `%s' ..." + (message "Retrieving package `%s' ..." current-filename) (sit-for 0) (copy-file (package-get-remote-filename current-dir-entry @@ -900,7 +899,7 @@ To access fields returned from this, use `package-get-info-version' to return information about particular a -version. Use `package-get-info-find-prop' to find particular property +version. Use `package-get-info-find-prop' to find particular property from a version returned by `package-get-info-version'." (interactive "xPackage list: \nsPackage Name: ") (if which @@ -912,7 +911,7 @@ (defun package-get-info-version (package version) "In PACKAGE, return the plist associated with a particular VERSION of the package. PACKAGE is typically as returned by - `package-get-info-find-package'. If VERSION is nil, then return the + `package-get-info-find-package'. If VERSION is nil, then return the first (aka most recent) version. Use `package-get-info-find-prop' to retrieve a particular property from the value returned by this." (interactive (package-get-interactive-package-query t t)) @@ -989,7 +988,7 @@ (defun package-get-installedp (package version) "Determine if PACKAGE with VERSION has already been installed. -I'm not sure if I want to do this by searching directories or checking +I'm not sure if I want to do this by searching directories or checking some built in variables. For now, use packages-package-list." ;; Use packages-package-list which contains name and version (equal (plist-get @@ -1001,7 +1000,7 @@ (defun package-get-package-provider (sym &optional force-current) "Search for a package that provides SYM and return the name and version. Searches in `package-get-base' for SYM. If SYM is a - consp, then it must match a corresponding (provide (SYM VERSION)) from + consp, then it must match a corresponding (provide (SYM VERSION)) from the package. If FORCE-CURRENT is non-nil make sure the database is up to date. This might @@ -1054,10 +1053,10 @@ (defun package-get-ever-installed-p (pkg &optional notused) (string-match "-package$" (symbol-name pkg)) - (custom-initialize-set - pkg - (if (package-get-info-find-package - packages-package-list + (custom-initialize-set + pkg + (if (package-get-info-find-package + packages-package-list (intern (substring (symbol-name pkg) 0 (match-beginning 0)))) t))) diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/package-ui.el --- a/lisp/package-ui.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/package-ui.el Mon Aug 13 11:16:07 2007 +0200 @@ -140,12 +140,12 @@ (defun pui-directory-exists (dir) "Check to see if DIR exists in `package-get-remote'." (let (found) - (mapcar '(lambda (item) - (if (and (null (car item)) - (string-equal (file-name-as-directory (car (cdr item))) - (file-name-as-directory dir))) - (setq found t)) - ) package-get-remote) + (mapcar #'(lambda (item) + (if (and (null (car item)) + (string-equal (file-name-as-directory (car (cdr item))) + (file-name-as-directory dir))) + (setq found t))) + package-get-remote) found )) @@ -358,11 +358,8 @@ (save-window-excursion (with-output-to-temp-buffer tmpbuf (display-completion-list (sort - (mapcar '(lambda (pkg) - (symbol-name pkg) - ) - pui-deleted-packages) - 'string<) + (mapcar #'symbol-name pui-deleted-packages) + #'string<) :activate-callback nil :help-string "Packages selected for removal:\n" :completion-string t @@ -389,16 +386,12 @@ ;; errors occur, which would normally be caused by display-buffer). (save-window-excursion (with-output-to-temp-buffer tmpbuf - (display-completion-list (sort - (mapcar '(lambda (pkg) - (symbol-name pkg) - ) - pui-selected-packages) - 'string<) - :activate-callback nil - :help-string "Packages selected for installation:\n" - :completion-string t - )) + (display-completion-list + (sort (mapcar #'symbol-name pui-selected-packages) #'string<) + :activate-callback nil + :help-string "Packages selected for installation:\n" + :completion-string t + )) (setq tmpbuf (get-buffer-create tmpbuf)) (display-buffer tmpbuf) (setq do-install (y-or-n-p "Install these packages? ")) @@ -618,67 +611,66 @@ ")) (insert sep-string) (setq start (point)) - (mapcar '(lambda (pkg) - (let (pkg-sym info version desc - b e extent current-vers disp) - (setq pkg-sym (car pkg) - info (package-get-info-version (cdr pkg) nil)) - (setq version (package-get-info-prop info 'version) - desc (package-get-info-prop info 'description)) + (mapcar + #'(lambda (pkg) + (let (pkg-sym info version desc + b e extent current-vers disp) + (setq pkg-sym (car pkg) + info (package-get-info-version (cdr pkg) nil)) + (setq version (package-get-info-prop info 'version) + desc (package-get-info-prop info 'description)) - (setq disp (pui-package-symbol-char pkg-sym - version)) - (setq b (point)) - (if pui-list-verbose - (progn - (setq current-vers (package-get-key pkg-sym :version)) - (cond - ( (not current-vers) - (setq current-vers "-----") ) - ( (stringp current-vers) - (setq current-vers - (format "%.2f" - (string-to-number current-vers))) ) - ( (numberp current-vers) - (setq current-vers (format "%.2f" current-vers)) ) - ) - (insert - (format "%s %-15s %-5.2f %-5s %s\n" - (car disp) pkg-sym - (if (stringp version) - (string-to-number version) - version) - current-vers desc)) -;; (insert -;; (format "\t\t %-12s %s\n" -;; (package-get-info-prop info 'author-version) -;; (package-get-info-prop info 'date) -;; )) - ) - (insert (format "%s %-15s %-5s %s\n" - (car disp) - pkg-sym version desc))) - (save-excursion - (setq e (progn - (forward-line -1) - (end-of-line) - (point))) - ) - (setq extent (make-extent b e)) - (if (car (cdr disp)) - (set-extent-face extent (get-face (car (cdr disp)))) - (set-extent-face extent (get-face 'default))) - (set-extent-property extent 'highlight t) - (set-extent-property extent 'pui t) - (set-extent-property extent 'pui-package pkg-sym) - (set-extent-property extent 'pui-info info) - (set-extent-property extent 'help-echo 'pui-help-echo) - (set-extent-property extent 'keymap pui-package-keymap) - )) (sort (copy-sequence package-get-base) - '(lambda (a b) - (string< (symbol-name (car a)) - (symbol-name (car b))) - ))) + (setq disp (pui-package-symbol-char pkg-sym + version)) + (setq b (point)) + (if pui-list-verbose + (progn + (setq current-vers (package-get-key pkg-sym :version)) + (cond + ( (not current-vers) + (setq current-vers "-----") ) + ( (stringp current-vers) + (setq current-vers + (format "%.2f" + (string-to-number current-vers))) ) + ( (numberp current-vers) + (setq current-vers (format "%.2f" current-vers)) ) + ) + (insert + (format "%s %-15s %-5.2f %-5s %s\n" + (car disp) pkg-sym + (if (stringp version) + (string-to-number version) + version) + current-vers desc)) + ;; (insert + ;; (format "\t\t %-12s %s\n" + ;; (package-get-info-prop info 'author-version) + ;; (package-get-info-prop info 'date))) + ) + (insert (format "%s %-15s %-5s %s\n" + (car disp) + pkg-sym version desc))) + (save-excursion + (setq e (progn + (forward-line -1) + (end-of-line) + (point)))) + (setq extent (make-extent b e)) + (if (car (cdr disp)) + (set-extent-face extent (get-face (car (cdr disp)))) + (set-extent-face extent (get-face 'default))) + (set-extent-property extent 'highlight t) + (set-extent-property extent 'pui t) + (set-extent-property extent 'pui-package pkg-sym) + (set-extent-property extent 'pui-info info) + (set-extent-property extent 'help-echo 'pui-help-echo) + (set-extent-property extent 'keymap pui-package-keymap) + )) + (sort (copy-sequence package-get-base) + #'(lambda (a b) + (string< (symbol-name (car a)) + (symbol-name (car b)))))) (insert sep-string) (insert (documentation 'list-packages-mode)) (set-buffer-modified-p nil) @@ -693,7 +685,7 @@ (add-submenu '() pui-menu) (setq mode-popup-menu pui-menu)) (clear-message) -; (message (substitute-command-keys "Press `\\[pui-help]' for help.")) + ;; (message (substitute-command-keys "Press `\\[pui-help]' for help.")) )) ;;;###autoload diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/rect.el --- a/lisp/rect.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/rect.el Mon Aug 13 11:16:07 2007 +0200 @@ -1,8 +1,8 @@ ;;; rect.el --- rectangle functions for XEmacs. -;; Copyright (C) 1985, 1993, 1994, 1999 Free Software Foundation, Inc. +;; Copyright (C) 1985-2000 Free Software Foundation, Inc. -;; Maintainer: Didier Verna +;; Maintainer: Didier Verna ;; Keywords: internal ;; This file is part of XEmacs. @@ -30,7 +30,7 @@ ;; in the XEmacs Reference Manual. ;; #### NOTE: this file has been almost completely rewritten by Didier Verna -;; , Jul 99. The purpose of this rewrite is to be less +;; , Jul 99. The purpose of this rewrite is to be less ;; intrusive and fill lines with whitespaces only when needed. A few functions ;; are untouched though, as noted above their definition. @@ -111,44 +111,17 @@ (forward-line 1))) )) -;; I love ascii art ;-) -(defconst spaces-strings '["" - " " - " " - " " - " " - " " - " " - " " - " "]) - -;; This function is untouched --dv -(defun spaces-string (n) - (if (<= n 8) (aref spaces-strings n) - (let ((val "")) - (while (> n 8) - (setq val (concat " " val) - n (- n 8))) - (concat val (aref spaces-strings n))))) - -;;;###autoload -(defvar killed-rectangle nil - "Rectangle for `yank-rectangle' to insert.") - -;;;###autoload -(defun kill-rectangle (start end &optional fill) - "Delete the region-rectangle and save it as the last killed one. -You might prefer to use `delete-extract-rectangle' from a program. - -When called from a program, the rectangle's corners are START and END. -With a prefix (or FILL) argument, also fill lines where nothing has to be -deleted." - (interactive "*r\nP") - (when buffer-read-only - (setq killed-rectangle (extract-rectangle start end)) - (barf-if-buffer-read-only)) - (setq killed-rectangle (delete-extract-rectangle start end fill))) +(defun delete-rectangle-line (startcol endcol fill) + (let ((pt (point-at-eol))) + (when (= (move-to-column startcol (or fill 'coerce)) startcol) + (if (and (not fill) (<= pt endcol)) + (delete-region (point) pt) + ;; else + (setq pt (point)) + (move-to-column endcol t) + (delete-region pt (point)))) + )) ;;;###autoload (defun delete-rectangle (start end &optional fill) @@ -162,27 +135,27 @@ (interactive "*r\nP") (apply-on-rectangle 'delete-rectangle-line start end fill)) -(defun delete-rectangle-line (startcol endcol fill) - (let ((pt (point-at-eol))) - (when (= (move-to-column startcol (or fill 'coerce)) startcol) - (if (and (not fill) (<= pt endcol)) - (delete-region (point) pt) - ;; else - (setq pt (point)) - (move-to-column endcol t) - (delete-region pt (point)))) - )) -;;;###autoload -(defun delete-extract-rectangle (start end &optional fill) - "Delete the contents of the rectangle with corners at START and END, and -return it as a list of strings, one for each line of the rectangle. +;; I love ascii art ;-) +(defconst spaces-strings '["" + " " + " " + " " + " " + " " + " " + " " + " "]) -With an optional FILL argument, also fill lines where nothing has to be -deleted." - (let ((lines (list nil))) - (apply-on-rectangle 'delete-extract-rectangle-line start end lines fill) - (nreverse (cdr lines)))) +;; This function is untouched --dv +(defun spaces-string (n) + (if (<= n 8) (aref spaces-strings n) + (let ((val "")) + (while (> n 8) + (setq val (concat " " val) + n (- n 8))) + (concat val (aref spaces-strings n))))) + (defun delete-extract-rectangle-line (startcol endcol lines fill) (let ((pt (point-at-eol))) @@ -197,13 +170,17 @@ )) ;;;###autoload -(defun extract-rectangle (start end) - "Return the contents of the rectangle with corners at START and END, -as a list of strings, one for each line of the rectangle." +(defun delete-extract-rectangle (start end &optional fill) + "Delete the contents of the rectangle with corners at START and END, and +return it as a list of strings, one for each line of the rectangle. + +With an optional FILL argument, also fill lines where nothing has to be +deleted." (let ((lines (list nil))) - (apply-on-rectangle 'extract-rectangle-line start end lines) + (apply-on-rectangle 'delete-extract-rectangle-line start end lines fill) (nreverse (cdr lines)))) + ;; #### NOTE: this is actually the only function that needs to do complicated ;; stuff like what's happening in `operate-on-rectangle', because the buffer ;; might be read-only. --dv @@ -236,6 +213,33 @@ (spaces-string endextra)))) (setcdr lines (cons line (cdr lines))))) +;;;###autoload +(defun extract-rectangle (start end) + "Return the contents of the rectangle with corners at START and END, +as a list of strings, one for each line of the rectangle." + (let ((lines (list nil))) + (apply-on-rectangle 'extract-rectangle-line start end lines) + (nreverse (cdr lines)))) + + +;;;###autoload +(defvar killed-rectangle nil + "Rectangle for `yank-rectangle' to insert.") + +;;;###autoload +(defun kill-rectangle (start end &optional fill) + "Delete the region-rectangle and save it as the last killed one. +You might prefer to use `delete-extract-rectangle' from a program. + +When called from a program, the rectangle's corners are START and END. +With a prefix (or FILL) argument, also fill lines where nothing has to be +deleted." + (interactive "*r\nP") + (when buffer-read-only + (setq killed-rectangle (extract-rectangle start end)) + (barf-if-buffer-read-only)) + (setq killed-rectangle (delete-extract-rectangle start end fill))) + ;; This function is untouched --dv ;;;###autoload (defun yank-rectangle () @@ -243,6 +247,7 @@ (interactive "*") (insert-rectangle killed-rectangle)) + ;; This function is untouched --dv ;;;###autoload (defun insert-rectangle (rectangle) @@ -266,6 +271,15 @@ (insert (car lines)) (setq lines (cdr lines))))) + +(defun open-rectangle-line (startcol endcol fill) + (let (spaces) + (when (= (move-to-column startcol (or fill 'coerce)) startcol) + (unless (and (not fill) + (= (point) (point-at-eol))) + (indent-to endcol))) + )) + ;;;###autoload (defun open-rectangle (start end &optional fill) "Blank out the region-rectangle, shifting text right. @@ -277,38 +291,32 @@ (apply-on-rectangle 'open-rectangle-line start end fill) (goto-char start)) -(defun open-rectangle-line (startcol endcol fill) - (let (spaces) - (when (= (move-to-column startcol (or fill 'coerce)) startcol) - (unless (and (not fill) - (= (point) (point-at-eol))) - (indent-to endcol))) - )) + +(defun string-rectangle-line (startcol endcol string delete) + (move-to-column startcol t) + (if delete + (delete-rectangle-line startcol endcol nil)) + (insert string)) ;;;###autoload (defun string-rectangle (start end string) "Insert STRING on each line of the region-rectangle, shifting text right. -The left edge of the rectangle specifies the column for insertion. This -command does not delete or overwrite any existing text. +The left edge of the rectangle specifies the column for insertion. + +If `pending-delete-mode' is active the string replace the region. +Otherwise this command does not delete or overwrite any existing text. When called from a program, the rectangle's corners are START and END." (interactive "*r\nsString rectangle: ") - (apply-on-rectangle 'string-rectangle-line start end string)) - -(defun string-rectangle-line (startcol endcol string) - (move-to-column startcol t) - (insert string)) + (apply-on-rectangle 'string-rectangle-line start end string + (and (boundp 'pending-delete-mode) pending-delete-mode))) -;;;###autoload -(defun clear-rectangle (start end &optional fill) - "Blank out the region-rectangle. -The text previously in the region is overwritten with blanks. +(defun replace-rectangle (start end string) + "Like `string-rectangle', but unconditionally replace the original region, +as if `pending-delete-mode' were active." + (interactive "*r\nsString rectangle: ") + (apply-on-rectangle 'string-rectangle-line start end string t)) -When called from a program, the rectangle's corners are START and END. -With a prefix (or FILL) argument, also fill with blanks the parts of the -rectangle which were empty." - (interactive "*r\nP") - (apply-on-rectangle 'clear-rectangle-line start end fill)) (defun clear-rectangle-line (startcol endcol fill) (let ((pt (point-at-eol)) @@ -325,6 +333,18 @@ (indent-to (+ (current-column) spaces)))) )) +;;;###autoload +(defun clear-rectangle (start end &optional fill) + "Blank out the region-rectangle. +The text previously in the region is overwritten with blanks. + +When called from a program, the rectangle's corners are START and END. +With a prefix (or FILL) argument, also fill with blanks the parts of the +rectangle which were empty." + (interactive "*r\nP") + (apply-on-rectangle 'clear-rectangle-line start end fill)) + + (provide 'rect) ;;; rect.el ends here diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/select.el --- a/lisp/select.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/select.el Mon Aug 13 11:16:07 2007 +0200 @@ -83,14 +83,14 @@ This will do nothing under anything other than X.") (defun get-selection-no-error (&optional type data-type) - "Return the value of a Windows selection. + "Return the value of a window-system selection. The argument TYPE (default `PRIMARY') says which selection, and the argument DATA-TYPE (default `STRING', or `COMPOUND_TEXT' under Mule) says how to convert the data. Returns NIL if there is no selection" (condition-case err (get-selection type data-type) (t nil))) (defun get-selection (&optional type data-type) - "Return the value of a Windows selection. + "Return the value of a window-system selection. The argument TYPE (default `PRIMARY') says which selection, and the argument DATA-TYPE (default `STRING', or `COMPOUND_TEXT' under Mule) says how to convert the data. If there is no selection an error is signalled." @@ -112,12 +112,13 @@ text)) ;; FSFmacs calls this `x-set-selection', and reverses the -;; arguments (duh ...). This order is more logical. -(defun own-selection (data &optional type) - "Make an Windows selection of type TYPE and value DATA. +;; first two arguments (duh ...). This order is more logical. +(defun own-selection (data &optional type append) + "Make a window-system selection of type TYPE and value DATA. The argument TYPE (default `PRIMARY') says which selection, and DATA specifies the contents. DATA may be a string, a symbol, an integer (or a cons of two integers or list of two integers). +If APPEND is non-nil, append the data to the existing selection data. The selection may also be a cons of two markers pointing to the same buffer, or an overlay. In these cases, the selection is considered to be the text @@ -131,36 +132,51 @@ (interactive (if (not current-prefix-arg) (list (read-string "Store text for pasting: ")) (list (substring (region-beginning) (region-end))))) - ;FSFmacs huh?? It says: - ;; "This is for temporary compatibility with pre-release Emacs 19." - ;(if (stringp type) - ; (setq type (intern type))) - (or (valid-simple-selection-p data) - (and (vectorp data) - (let ((valid t) - (i (1- (length data)))) - (while (>= i 0) - (or (valid-simple-selection-p (aref data i)) - (setq valid nil)) - (setq i (1- i))) - valid)) - (signal 'error (list "invalid selection" data))) - (or type (setq type 'PRIMARY)) - (if (null data) - (disown-selection-internal type) - (own-selection-internal type data) - (when (and (eq type 'PRIMARY) - selection-sets-clipboard) - (own-selection-internal 'CLIPBOARD data))) - (cond ((eq type 'PRIMARY) - (setq primary-selection-extent - (select-make-extent-for-selection - data primary-selection-extent))) - ((eq type 'SECONDARY) - (setq secondary-selection-extent - (select-make-extent-for-selection - data secondary-selection-extent)))) - (setq zmacs-region-stays t) + ;; calling own-selection-internal will mess this up, so preserve it. + (let ((zmacs-region-stays zmacs-region-stays)) + ;FSFmacs huh?? It says: + ;; "This is for temporary compatibility with pre-release Emacs 19." + ;(if (stringp type) + ; (setq type (intern type))) + (or (valid-simple-selection-p data) + (and (vectorp data) + (let ((valid t) + (i (1- (length data)))) + (while (>= i 0) + (or (valid-simple-selection-p (aref data i)) + (setq valid nil)) + (setq i (1- i))) + valid)) + (signal 'error (list "invalid selection" data))) + (or type (setq type 'PRIMARY)) + (flet ((own-selection-1 + (type data append) + (when append + (unless (stringp data) + ;; kludge! + (setq data (select-convert-to-text type 'STRING data)) + (if (stringp data) + (setq data (concat (get-selection type) data))))) + (own-selection-internal type data))) + (if (null data) + (disown-selection-internal type) + (own-selection-1 type data append) + (when (and (eq type 'PRIMARY) + selection-sets-clipboard) + (own-selection-internal 'CLIPBOARD data append)))) + (cond ((eq type 'PRIMARY) + (setq primary-selection-extent + (select-make-extent-for-selection + data primary-selection-extent))) + ((eq type 'SECONDARY) + (setq secondary-selection-extent + (select-make-extent-for-selection + data secondary-selection-extent))))) + ;; zmacs-region-stays is for commands, not low-level functions. + ;; when behaving as the latter, we better not set it, or we will + ;; cause unwanted sticky-region behavior in kill-region and friends. + (if (interactive-p) + (setq zmacs-region-stays t)) data) (defun dehilight-selection (selection) @@ -184,8 +200,9 @@ (setq lost-selection-hooks 'dehilight-selection) -(defun own-clipboard (string) - "Paste the given string to the window system Clipboard." +(defun own-clipboard (string &optional append) + "Paste the given string to the window system Clipboard. +If APPEND is non-nil, append the string to the existing contents." (own-selection string 'CLIPBOARD)) (defun disown-selection (&optional secondary-p) diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/simple.el --- a/lisp/simple.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/simple.el Mon Aug 13 11:16:07 2007 +0200 @@ -2,6 +2,7 @@ ;; Copyright (C) 1985-7, 1993-5, 1997 Free Software Foundation, Inc. ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp. +;; Copyright (C) 2000 Ben Wing. ;; Maintainer: XEmacs Development Team ;; Keywords: lisp, extensions, internal, dumped @@ -1087,22 +1088,50 @@ (skip-chars-forward " \t")) (defcustom kill-whole-line nil - "*If non-nil, `kill-line' with no arg at beg of line kills the whole line." - :type 'boolean + "*Control when and whether `kill-line' removes entire lines. +Note: This only applies when `kill-line' is called interactively; +otherwise, it behaves \"historically\". + +If `always', `kill-line' with no arg always kills the whole line, +wherever point is in the line. (If you want to just kill to the end +of the line, use \\[historical-kill-line].) + +If not `always' but non-nil, `kill-line' with no arg kills the whole +line if point is at the beginning, and otherwise behaves historically. + +If nil, `kill-line' behaves historically." + :type '(radio (const :tag "Kill to end of line" nil) + (const :tag "Kill whole line" always) + (const + :tag "Kill whole line at beginning, otherwise end of line" t)) :group 'killing) +(defun historical-kill-line (&optional arg) + "Same as `kill-line' but ignores value of `kill-whole-line'." + (interactive "*P") + (let ((kill-whole-line nil)) + (if (interactive-p) + (call-interactively 'kill-line) + (kill-line arg)))) + (defun kill-line (&optional arg) - "Kill the rest of the current line; if no nonblanks there, kill thru newline. + "Kill the rest of the current line, or the entire line. +If no nonblanks there, kill thru newline. +If called interactively, may kill the entire line; see `kill-whole-line'. +when given no argument at the beginning of a line. With prefix argument, kill that many lines from point. Negative arguments kill lines backward. When calling from a program, nil means \"no arg\", -a number counts as a prefix arg. - -If `kill-whole-line' is non-nil, then kill the whole line -when given no argument at the beginning of a line." +a number counts as a prefix arg." (interactive "*P") - (kill-region (point) + (kill-region (if (and (interactive-p) + (not arg) + (eq kill-whole-line 'always)) + (save-excursion + (beginning-of-line) + (point)) + (point)) ;; Don't shift point before doing the delete; that way, ;; undo will record the right position of point. ;; FSF @@ -1117,7 +1146,10 @@ (forward-line (prefix-numeric-value arg)) (if (eobp) (signal 'end-of-buffer nil)) - (if (or (looking-at "[ \t]*$") (and kill-whole-line (bolp))) + (if (or (looking-at "[ \t]*$") + (and (interactive-p) + (or (eq kill-whole-line 'always) + (and kill-whole-line (bolp))))) (forward-line 1) (end-of-line))) (point)))) @@ -1154,7 +1186,7 @@ ;;; the cut buffers. I'm afraid to change interface of `kill-hooks', ;;; so I add it. (1997-11-03 by MORIOKA Tomohiko) -(defvar interprogram-cut-function nil +(defcustom interprogram-cut-function 'own-clipboard "Function to call to make a killed region available to other programs. Most window systems provide some sort of facility for cutting and @@ -1167,9 +1199,15 @@ The first argument, TEXT, is a string containing the text which should be made available. The second, PUSH, if non-nil means this is a \"new\" kill; -nil means appending to an \"old\" kill.") - -(defvar interprogram-paste-function nil +nil means appending to an \"old\" kill." + :type '(radio (function-item :tag "Send to Clipboard" + :format "%t\n" + own-clipboard) + (const :tag "None" nil) + (function :tag "Other")) + :group 'killing) + +(defcustom interprogram-paste-function 'get-clipboard "Function to call to get text cut from other programs. Most window systems provide some sort of facility for cutting and @@ -1187,7 +1225,13 @@ most recent string, the function should return nil. If it is difficult to tell whether Emacs or some other program provided the current string, it is probably good enough to return nil if the string -is equal (according to `string=') to the last text Emacs provided.") +is equal (according to `string=') to the last text Emacs provided." + :type '(radio (function-item :tag "Get from Clipboard" + :format "%t\n" + get-clipboard) + (const :tag "None" nil) + (function :tag "Other")) + :group 'killing) ;;;; The kill ring data structure. @@ -1804,6 +1848,53 @@ :type 'boolean :group 'editing-basics) +(defcustom shifted-motion-keys-select-region t + "*If non-nil, shifted motion keys select text, like in MS Windows. +See also `unshifted-motion-keys-deselect-region'." + :type 'boolean + :group 'editing-basics) + +(defcustom unshifted-motion-keys-deselect-region t + "*If non-nil, unshifted motion keys deselect a shifted-motion region. +This only occurs after a region has been selected using shifted motion keys +(not when using the traditional set-mark-then-move method), and has no effect +if `shifted-motion-keys-select-region' is nil." + :type 'boolean + :group 'editing-basics) + +(defun handle-pre-motion-command-current-command-is-motion () + (and (key-press-event-p last-input-event) + (memq (event-key last-input-event) + '(left right up down home end prior next + kp-left kp-right kp-up kp-down + kp-home kp-end kp-prior kp-next)))) + +(defun handle-pre-motion-command () + (if + (and + (handle-pre-motion-command-current-command-is-motion) + zmacs-regions + shifted-motion-keys-select-region + (not (region-active-p)) + (memq 'shift (event-modifiers last-input-event))) + (push-mark nil nil t))) + +(defun handle-post-motion-command () + (if + (and + (handle-pre-motion-command-current-command-is-motion) + zmacs-regions + (region-active-p)) + (cond ((memq 'shift (event-modifiers last-input-event)) + (if shifted-motion-keys-select-region + (putf this-command-properties 'shifted-motion-command t)) + (setq zmacs-region-stays t)) + ((and (getf last-command-properties 'shifted-motion-command) + unshifted-motion-keys-deselect-region) + (setq zmacs-region-stays nil)) + (t + (setq zmacs-region-stays t))))) + (defun forward-char-command (&optional arg buffer) "Move point right ARG characters (left if ARG negative) in BUFFER. On attempt to pass end of buffer, stop and signal `end-of-buffer'. @@ -1889,7 +1980,7 @@ If you are thinking of using this in a Lisp program, consider using `forward-line' instead. It is usually easier to use and more reliable (no dependence on goal column, etc.)." - (interactive "_p") ; XEmacs + (interactive "_p") (if (and next-line-add-newlines (= arg 1)) (let ((opoint (point))) (end-of-line) @@ -1920,7 +2011,7 @@ If you are thinking of using this in a Lisp program, consider using `forward-line' with a negative argument instead. It is usually easier to use and more reliable (no dependence on goal column, etc.)." - (interactive "_p") ; XEmacs + (interactive "_p") (if (interactive-p) (condition-case nil (line-move (- arg)) @@ -1930,6 +2021,25 @@ (line-move (- arg))) nil) +(defcustom block-movement-size 6 + "*Number of lines that \"block movement\" commands (\\[forward-block-of-lines], \\[backward-block-of-lines]) move by." + :type 'integer + :group 'editing-basics) + +(defun backward-block-of-lines () + "Move backward by one \"block\" of lines. +The number of lines that make up a block is controlled by +`block-movement-size', which defaults to 6." + (interactive "_") + (forward-line (- block-movement-size))) + +(defun forward-block-of-lines () + "Move forward by one \"block\" of lines. +The number of lines that make up a block is controlled by +`block-movement-size', which defaults to 6." + (interactive "_") + (forward-line block-movement-size)) + (defcustom track-eol nil "*Non-nil means vertical motion starting at end of line keeps to ends of lines. This means moving to the end of each line moved onto. @@ -3418,6 +3528,43 @@ (downcase-region (region-beginning) (region-end)) (downcase-word arg))) +;; #### not localized +(defvar uncapitalized-title-words + '("the" "a" "an" "in" "of" "for" "to" "and" "but" "at" "on" "as" "by")) + +(defvar uncapitalized-title-word-regexp + (concat "[ \t]*\\(" (mapconcat #'identity uncapitalized-title-words "\\|") + "\\)\\>")) + +(defun capitalize-string-as-title (string) + "Capitalize the words in the string, except for small words (as in titles). +The words not capitalized are specified in `uncapitalized-title-words'." + (let ((buffer (get-buffer-create " *capitalize-string-as-title*"))) + (unwind-protect + (progn + (insert-string string buffer) + (capitalize-region-as-title 1 (point-max buffer) buffer) + (buffer-string buffer)) + (kill-buffer buffer)))) + +(defun capitalize-region-as-title (b e &optional buffer) + "Capitalize the words in the region, except for small words (as in titles). +The words not capitalized are specified in `uncapitalized-title-words'." + (interactive "r") + (save-excursion + (and buffer + (set-buffer buffer)) + (save-restriction + (narrow-to-region b e) + (goto-char (point-min)) + (let ((first t)) + (while (< (point) (point-max)) + (if (or first + (not (looking-at uncapitalized-title-word-regexp))) + (capitalize-word 1) + (forward-word 1)) + (setq first nil)))))) + ;; Most of the zmacs code is now in elisp. The only thing left in C ;; are the variables zmacs-regions, zmacs-region-active-p and ;; zmacs-region-stays plus the function zmacs_update_region which @@ -4097,5 +4244,5 @@ (cond ((featurep 'infodock) "InfoDock") ((featurep 'xemacs) "XEmacs") (t "Emacs"))) - + ;;; simple.el ends here diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/specifier.el --- a/lisp/specifier.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/specifier.el Mon Aug 13 11:16:07 2007 +0200 @@ -403,6 +403,40 @@ how-to-add)))) value) +(defun modify-specifier-instances (specifier func &optional args force default + locale tag-set) + "Modify all specifications that match LOCALE and TAG-SET by FUNC. + +For each specification that exists for SPECIFIER, in locale LOCALE +that matches TAG-SET, call the function FUNC with the instance as its +first argument and with optional arguments ARGS. The result is then +used as the new value of the instantiator. + +If there is no specification in the domain LOCALE matching TAG-SET and +FORCE is non-nil, an explicit one is created from the matching +specifier instance if that exists or DEFAULT otherwise. If LOCALE is +not a domain (i.e. a buffer), DEFAULT is always used. FUNC is then +applied like above and the resulting specification is added." + + (let ((spec-list (specifier-spec-list specifier locale tag-set))) + (cond + (spec-list + ;; Destructively edit the spec-list + (mapc #'(lambda (spec) + (mapc #'(lambda (inst-pair) + (setcdr inst-pair + (apply func (cdr inst-pair) args))) + (cdr spec))) + spec-list) + (add-spec-list-to-specifier specifier spec-list)) + (force + (set-specifier specifier + (apply func + (or (and (valid-specifier-domain-p locale) + (specifier-instance specifier)) + default) args) + locale tag-set))))) + (defmacro let-specifier (specifier-list &rest body) "Add specifier specs, evaluate forms in BODY and restore the specifiers. \(let-specifier SPECIFIER-LIST BODY...) diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/startup.el --- a/lisp/startup.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/startup.el Mon Aug 13 11:16:07 2007 +0200 @@ -20,7 +20,7 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the +;; along with XEmacs; see the file COPYING. If not, write to the ;; Free Software Foundation, 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. @@ -649,9 +649,9 @@ (defun load-user-init-file () "This function actually reads the init file, .emacs." - (if (not user-init-file) - (setq user-init-file (find-user-init-file))) - (load user-init-file t t t) + (if (or user-init-file + (setq user-init-file (find-user-init-file))) + (load user-init-file t t t)) (unless inhibit-default-init (let ((inhibit-startup-message nil)) ;; Users are supposed to be told their rights. @@ -777,7 +777,7 @@ (file-count 0) (line nil) (end-of-options nil) - first-file-buffer file-p arg tem) + file-p arg tem) (while command-line-args-left (setq arg (pop command-line-args-left)) (cond @@ -804,8 +804,8 @@ (incf file-count) (setq arg (expand-file-name arg dir)) (cond - ((= file-count 1) (setq first-file-buffer - (progn (find-file arg) (current-buffer)))) + ((= file-count 1) + (find-file arg)) (noninteractive (find-file arg)) (t (find-file-other-window arg))) (when line diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/subr.el --- a/lisp/subr.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/subr.el Mon Aug 13 11:16:07 2007 +0200 @@ -3,6 +3,7 @@ ;; Copyright (C) 1985, 1986, 1992, 1994-5, 1997 Free Software Foundation, Inc. ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp. ;; Copyright (C) 1995 Sun Microsystems. +;; Copyright (C) 2000 Ben Wing. ;; Maintainer: XEmacs Development Team ;; Keywords: extensions, dumped @@ -117,7 +118,9 @@ This function does nothing if HOOK is already local in the current buffer. -Do not use `make-local-variable' to make a hook variable buffer-local." +Do not use `make-local-variable' to make a hook variable buffer-local. + +See also `add-local-hook' and `remove-local-hook'." (if (local-variable-p hook (current-buffer)) ; XEmacs nil (or (boundp hook) (set hook nil)) @@ -139,7 +142,11 @@ HOOK should be a symbol, and FUNCTION may be any valid function. If HOOK is void, it is first set to nil. If HOOK's value is a single -function, it is changed to a list of functions." +function, it is changed to a list of functions. + +You can remove this hook yourself using `remove-hook'. + +See also `add-local-hook' and `add-one-shot-hook'." (or (boundp hook) (set hook nil)) (or (default-boundp hook) (set-default hook nil)) ;; If the hook value is a single function, turn it into a list. @@ -185,25 +192,114 @@ (null (symbol-value hook)) ;value is nil, or (null function)) ;function is nil, then nil ;Do nothing. - (if (or local - ;; Detect the case where make-local-variable was used on a hook - ;; and do what we used to do. - (and (local-variable-p hook (current-buffer)) - (not (memq t (symbol-value hook))))) - (let ((hook-value (symbol-value hook))) - (if (and (consp hook-value) (not (functionp hook-value))) - (if (member function hook-value) - (setq hook-value (delete function (copy-sequence hook-value)))) - (if (equal hook-value function) - (setq hook-value nil))) - (set hook hook-value)) - (let ((hook-value (default-value hook))) - (if (and (consp hook-value) (not (functionp hook-value))) - (if (member function hook-value) - (setq hook-value (delete function (copy-sequence hook-value)))) - (if (equal hook-value function) - (setq hook-value nil))) - (set-default hook hook-value))))) + (flet ((hook-remove + (function hook-value) + (flet ((hook-test + (fn hel) + (or (equal fn hel) + (and (symbolp hel) + (equal fn + (get hel 'one-shot-hook-fun)))))) + (if (and (consp hook-value) + (not (functionp hook-value))) + (if (member* function hook-value :test 'hook-test) + (setq hook-value + (delete* function (copy-sequence hook-value) + :test 'hook-test))) + (if (equal hook-value function) + (setq hook-value nil))) + hook-value))) + (if (or local + ;; Detect the case where make-local-variable was used on a hook + ;; and do what we used to do. + (and (local-variable-p hook (current-buffer)) + (not (memq t (symbol-value hook))))) + (set hook (hook-remove function (symbol-value hook))) + (set-default hook (hook-remove function (default-value hook))))))) + +;; XEmacs addition +;; #### we need a coherent scheme for indicating compatibility info, +;; so that it can be programmatically retrieved. +(defun add-local-hook (hook function &optional append) + "Add to the local value of HOOK the function FUNCTION. +This modifies only the buffer-local value for the hook (which is +automatically make buffer-local, if necessary), not its default value. +FUNCTION is not added if already present. +FUNCTION is added (if necessary) at the beginning of the hook list +unless the optional argument APPEND is non-nil, in which case +FUNCTION is added at the end. + +HOOK should be a symbol, and FUNCTION may be any valid function. If +HOOK is void, it is first set to nil. If HOOK's value is a single +function, it is changed to a list of functions. + +You can remove this hook yourself using `remove-local-hook'. + +See also `add-hook' and `make-local-hook'." + (make-local-hook hook) + (add-hook hook function append t)) + +;; XEmacs addition +(defun remove-local-hook (hook function) + "Remove from the local value of HOOK the function FUNCTION. +This modifies only the buffer-local value for the hook, not its default +value. (Nothing happens if the hook is not buffer-local.) +HOOK should be a symbol, and FUNCTION may be any valid function. If +FUNCTION isn't the value of HOOK, or, if FUNCTION doesn't appear in the +list of hooks to run in HOOK, then nothing is done. See `add-hook'. + +See also `add-local-hook' and `make-local-hook'." + (if (local-variable-p hook (current-buffer)) + (remove-hook hook function t))) + +(defun add-one-shot-hook (hook function &optional append local) + "Add to the value of HOOK the one-shot function FUNCTION. +FUNCTION will automatically be removed from the hook the first time +after it runs (whether to completion or to an error). +FUNCTION is not added if already present. +FUNCTION is added (if necessary) at the beginning of the hook list +unless the optional argument APPEND is non-nil, in which case +FUNCTION is added at the end. + +HOOK should be a symbol, and FUNCTION may be any valid function. If +HOOK is void, it is first set to nil. If HOOK's value is a single +function, it is changed to a list of functions. + +You can remove this hook yourself using `remove-hook'. + +See also `add-hook', `add-local-hook', and `add-local-one-shot-hook'." + (let ((sym (gensym))) + (fset sym `(lambda (&rest args) + (unwind-protect + (apply ',function args) + (remove-hook ',hook ',sym ',local)))) + (put sym 'one-shot-hook-fun function) + (add-hook hook sym append local))) + +(defun add-local-one-shot-hook (hook function &optional append) + "Add to the local value of HOOK the one-shot function FUNCTION. +FUNCTION will automatically be removed from the hook the first time +after it runs (whether to completion or to an error). +FUNCTION is not added if already present. +FUNCTION is added (if necessary) at the beginning of the hook list +unless the optional argument APPEND is non-nil, in which case +FUNCTION is added at the end. + +The optional fourth argument, LOCAL, if non-nil, says to modify +the hook's buffer-local value rather than its default value. +This makes no difference if the hook is not buffer-local. +To make a hook variable buffer-local, always use +`make-local-hook', not `make-local-variable'. + +HOOK should be a symbol, and FUNCTION may be any valid function. If +HOOK is void, it is first set to nil. If HOOK's value is a single +function, it is changed to a list of functions. + +You can remove this hook yourself using `remove-local-hook'. + +See also `add-hook', `add-local-hook', and `add-local-one-shot-hook'." + (make-local-hook hook) + (add-one-shot-hook hook function append t)) (defun add-to-list (list-var element) "Add to the value of LIST-VAR the element ELEMENT if it isn't there yet. @@ -345,7 +441,8 @@ "Collect output to `standard-output' while evaluating FORMS and return it as a string." ;; by "William G. Dubuque" w/ mods from Stig - `(with-current-buffer (get-buffer-create " *string-output*") + `(with-current-buffer (get-buffer-create + (generate-new-buffer-name " *string-output*")) (setq buffer-read-only nil) (buffer-disable-undo (current-buffer)) (erase-buffer) @@ -399,16 +496,10 @@ "With the contents of the current buffer being STR, run BODY. Returns the new contents of the buffer, as modified by BODY. The original current buffer is restored afterwards." - `(let ((tempbuf (get-buffer-create " *string-as-buffer-contents*"))) - (with-current-buffer tempbuf - (unwind-protect - (progn - (buffer-disable-undo (current-buffer)) - (erase-buffer) - (insert ,str) - ,@body - (buffer-string)) - (erase-buffer tempbuf))))) + `(with-temp-buffer + (insert ,str) + ,@body + (buffer-string))) (defun insert-face (string face) "Insert STRING and highlight with FACE. Return the extent created." diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/window.el --- a/lisp/window.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/window.el Mon Aug 13 11:16:07 2007 +0200 @@ -351,5 +351,4 @@ minibuf all-frames device) wins)) - ;;; window.el ends here diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/winnt.el --- a/lisp/winnt.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/winnt.el Mon Aug 13 11:16:07 2007 +0200 @@ -1,4 +1,4 @@ -;;; winnt.el --- Lisp routines for Windows NT. +;;; winnt.el --- Lisp routines for MS Windows. ;; Copyright (C) 1994 Free Software Foundation, Inc. diff -r 9f011ab08d48 -r 2f8bb876ab1d lisp/x-init.el --- a/lisp/x-init.el Mon Aug 13 11:15:00 2007 +0200 +++ b/lisp/x-init.el Mon Aug 13 11:16:07 2007 +0200 @@ -305,8 +305,8 @@ (init-x-toolbar)) (if (and (featurep 'infodock) (featurep 'toolbar)) (require 'id-x-toolbar)) - (if (featurep 'mule) - (init-mule-x-win)) + (if (featurep 'gutter) (init-gutter)) + (if (featurep 'mule) (init-mule-x-win)) ;; these are only ever called if zmacs-regions is true. (add-hook 'zmacs-deactivate-region-hook (lambda () diff -r 9f011ab08d48 -r 2f8bb876ab1d lwlib/ChangeLog --- a/lwlib/ChangeLog Mon Aug 13 11:15:00 2007 +0200 +++ b/lwlib/ChangeLog Mon Aug 13 11:16:07 2007 +0200 @@ -1,3 +1,17 @@ +2000-03-20 Martin Buchholz + + * XEmacs 21.2.32 is released. + +2000-03-14 Ben Wing + + * xlwmenu.c (massage_resource_name): Handle %_ and %%. + +2000-02-20 Gunnar Evermann + + * xlwscrollbar.c (get_gc): Always check for XmUNSPECIFIED_PIXMAP + even if we are only 'compatible' with the Motif resources. + (XmUNSPECIFIED_PIXMAP): Define unconditionally. + 2000-02-23 Martin Buchholz * XEmacs 21.2.31 is released. @@ -126,7 +140,7 @@ 1999-12-12 Daniel Pittman - * lwlib-Xaw.c: + * lwlib-Xaw.c: * xlwcheckbox.c: * xlwgauge.h: * xlwgaugeP.h: @@ -241,11 +255,11 @@ Include to get prototype for atoi(). (GaugeSelect): Call GaugeExpose with the right number of args. (GaugeLoseSel): Call GaugeExpose with the right number of args. - (GaugeConvert): This is a XtConvertSelectionProc, + (GaugeConvert): This is a XtConvertSelectionProc, so 5th parameter must be of type XtPointer, not XPointer. - (GaugeGetValue): This is a XtTimerCallbackProc, + (GaugeGetValue): This is a XtTimerCallbackProc, so 2nd parameter must be of type XtIntervalId *, not XtIntervalId. - + 1999-09-01 Martin Buchholz @@ -281,7 +295,7 @@ * xlwradio.c: * xlwcheckbox.c: * xlwgauge.c: Fix for losing systems without Xmu. - + 1999-08-31 Andy Piper * lwlib-Xm.c (xm_update_one_widget): fix for AIX compiler lossage. @@ -413,7 +427,7 @@ * XEmacs 21.2.18 is released -1999-07-05 Didier Verna +1999-07-05 Didier Verna * lwlib-Xm.c (xm_update_one_widget): add missing #ifdefs around call to xm_update_label. diff -r 9f011ab08d48 -r 2f8bb876ab1d lwlib/xlwmenu.c --- a/lwlib/xlwmenu.c Mon Aug 13 11:15:00 2007 +0200 +++ b/lwlib/xlwmenu.c Mon Aug 13 11:16:07 2007 +0200 @@ -479,16 +479,26 @@ Boolean firstp = True; while (*in) { - char ch = massaged_resource_char[(unsigned char) *in++]; - if (ch) + if (*in == '%' && *(in + 1) == '_') + in += 2; + else { - int int_ch = (int) (unsigned char) ch; - *out++ = firstp ? tolower (int_ch) : toupper (int_ch); - firstp = False; - while ((ch = massaged_resource_char[(unsigned char) *in++]) != '\0') - *out++ = ch; - if (!*(in-1)) /* Overshot the NULL byte? */ - break; + char ch; + + if (*in == '%' && *(in + 1) == '%') + in++; + ch = massaged_resource_char[(unsigned char) *in++]; + if (ch) + { + int int_ch = (int) (unsigned char) ch; + *out++ = firstp ? tolower (int_ch) : toupper (int_ch); + firstp = False; + while ((ch = massaged_resource_char[(unsigned char) *in++]) + != '\0') + *out++ = ch; + if (!*(in-1)) /* Overshot the NULL byte? */ + break; + } } } *out = 0; diff -r 9f011ab08d48 -r 2f8bb876ab1d lwlib/xlwscrollbar.c --- a/lwlib/xlwscrollbar.c Mon Aug 13 11:15:00 2007 +0200 +++ b/lwlib/xlwscrollbar.c Mon Aug 13 11:16:07 2007 +0200 @@ -485,11 +485,9 @@ } /*-------------------------- GC and Pixel allocation --------------------*/ -#ifdef NEED_MOTIF #ifndef XmUNSPECIFIED_PIXMAP #define XmUNSPECIFIED_PIXMAP 2 #endif -#endif /* NEED_MOTIF */ static GC get_gc (XlwScrollBarWidget w, Pixel fg, Pixel bg, Pixmap pm) @@ -514,14 +512,10 @@ values.stipple = pm; /* mask = GCForeground | GCBackground | (pm == None ? 0 : GCStipple | GCFillStyle); gtb */ -#ifdef NEED_MOTIF if (pm != None && pm != 0 && pm != XmUNSPECIFIED_PIXMAP) values.stipple = pm; else values.stipple = None; -#else - values.stipple = pm; -#endif /* NEED_MOTIF */ mask = GCForeground | GCBackground | (values.stipple == None ? 0 : GCStipple | GCFillStyle); diff -r 9f011ab08d48 -r 2f8bb876ab1d man/ChangeLog --- a/man/ChangeLog Mon Aug 13 11:15:00 2007 +0200 +++ b/man/ChangeLog Mon Aug 13 11:16:07 2007 +0200 @@ -1,3 +1,81 @@ +2000-03-20 Martin Buchholz + + * XEmacs 21.2.32 is released. + +2000-03-15 SL Baur + + * lispref/postgresql.texi (Unimplemented libpq Functions): Update + documentation to reflect the latest code. + +2000-03-07 SL Baur + + * lispref/postgresql.texi (PostgreSQL Support): New File. + + * lispref/ldap.texi: Insert PostgreSQL/libpq chapter. + * lispref/lispref.texi (Top): Ditto. + * lispref/internationalization.texi: Ditto. + +2000-03-07 Yoshiki Hayashi + + * lispref/glyphs.texi (Image Specifiers): Remove parenthesis. + +2000-03-06 Yoshiki Hayashi + + * xemacs-faq.texi: Put node before section. + +2000-03-05 Jonathan Harris + + * xemacs-faq.texi (Macintosh port): Made texinfmt-friendly. + +2000-03-01 Sandra Wambold + + * xemacs-faq.texi: Added 6.4.1. XEmacs won't start on Windows + +2000-01-25 Yoshiki Hayashi + + * xemacs/xemacs.texi: Detailed menu update. + +2000-01-28 Yoshiki Hayashi + + * xemacs/help.texi: Synch with FSF 20.5. Update. + +2000-02-21 Yoshiki Hayashi + + * lispref/minibuf.texi: Add default argument documentation. + +2000-02-27 Martin Buchholz + + * internals/internals.texi (lrecords): Update docs for new lisp + object representation. + +2000-02-25 Martin Buchholz + + * internals/internals.texi (Techniques for XEmacs Developers): + Document INLINE_HEADER and how to create macros and inline functions. + Cleanup entire section. + +2000-02-17 Stephen J. Turnbull + + * man/lispref/gutter.texi: New file describing gutter API. + + * man/lispref/lispref.texi, man/lispref/scrollbars.texi, + + * man/lispref/toolbar.texi: Fixup links to new node Gutter. + +2000-02-17 Stephen J. Turnbull + + * man/lispref/frames.texi, man/xemacs/custom.texi, + man/xemacs/frame.texi, man/xemacs/glossary.texi: Mention menubars, + toolbars, and gutters as optional components of frames, with + pointers to descriptions. + +2000-02-17 Stephen J. Turnbull + + * man/lispref/mule.texi: Substantial reorganization and + revision for style of descriptions of character sets, + encodings, and coding systems. Addition of a complete table + of coding systems as of XEmacs 21.2.19. + 2000-02-23 Martin Buchholz * XEmacs 21.2.31 is released. @@ -32,7 +110,7 @@ 2000-02-09 Martin Buchholz - * lispref/symbols.texi (Object Plists): + * lispref/symbols.texi (Object Plists): Document `object-plist'. Document `remprop'. Rework all plist frobbing docs for accuracy. @@ -90,7 +168,7 @@ 2000-01-25 Yoshiki Hayashi * xemacs-faq.texi: Untabify. - + 2000-01-22 Martin Buchholz * internals/internals.texi (General Coding Rules): Document why we @@ -99,7 +177,7 @@ 2000-01-21 Yoshiki Hayashi * xemacs-faq.texi: Change ' -- ' to '---'. - + 2000-01-19 Yoshiki Hayashi * lispref/faces.texi (Face Properties): Document @@ -203,7 +281,7 @@ 1999-12-18 Martin Buchholz - * lispref/functions.texi (Mapping Functions): + * lispref/functions.texi (Mapping Functions): Warn about mapping functions modifying their sequences. 1999-12-15 Sandra Wambold @@ -217,7 +295,7 @@ 1999-12-07 Gunnar Evermann * xemacs/startup.texi (Startup Paths): fix typo: EMACSPACKAGEPATH - instead of PACKAGEPATH + instead of PACKAGEPATH From Marcus Harnisch 1999-12-07 Martin Buchholz @@ -230,9 +308,9 @@ 1999-11-29 Martin Buchholz - * info.texi (Top): + * info.texi (Top): Remove @ifnottex, which gives old makeinfos indigestion. - * texinfo.texi (Top): + * texinfo.texi (Top): Revert to pre-texinfo-4.0 version, plus small changes to make texinfo-3.12, texinfo-3.12f, texinfo-4.0, and TeX happy. @@ -262,7 +340,7 @@ 1999-11-15 Martin Buchholz * xemacs/programs.texi: Upgrade to etags Version 13.32 - + * Makefile: - Make sure the default target is `info' instead of cl.info. - Use $(INFODIR) consistently where appropriate. @@ -369,7 +447,7 @@ * packages.texi: Reword a sentence, fixing @item Decide where to install ... -1999-07-19 Didier Verna +1999-07-19 Didier Verna * custom.texi (Wishlist): removed the Custom Comments wishlist entry. They are implemented. diff -r 9f011ab08d48 -r 2f8bb876ab1d man/internals/internals.texi --- a/man/internals/internals.texi Mon Aug 13 11:15:00 2007 +0200 +++ b/man/internals/internals.texi Mon Aug 13 11:16:07 2007 +0200 @@ -1626,11 +1626,11 @@ A tag of 00 is used for all pointer object types, a tag of 10 is used for characters, and the other two tags 01 and 11 are joined together to -form the integer object type. This representation gives us 31 bits -integers, 30 bits characters and pointers are represented directly -without any bit masking. This representation, though, assumes that -pointers to structs are always aligned to multiples of 4, so the lower 2 -bits are always zero. +form the integer object type. This representation gives us 31 bit +integers and 30 bit characters, while pointers are represented directly +without any bit masking or shifting. This representation, though, +assumes that pointers to structs are always aligned to multiples of 4, +so the lower 2 bits are always zero. Lisp objects use the typedef @code{Lisp_Object}, but the actual C type used for the Lisp object can vary. It can be either a simple type @@ -1641,24 +1641,24 @@ machine word to represent the object (some compilers will use more general and less efficient code for unions and structs even if they can fit in a machine word). The union type, however, has the advantage of -stricter type checking (if you accidentally pass an integer where a Lisp -object is desired, you get a compile error), and it makes it easier to -decode Lisp objects when debugging. The choice of which type to use is -determined by the preprocessor constant @code{USE_UNION_TYPE} which is -defined via the @code{--use-union-type} option to @code{configure}. - -Various macros are used to construct Lisp objects and extract the -components. Macros of the form @code{XINT()}, @code{XCHAR()}, -@code{XSTRING()}, @code{XSYMBOL()}, etc. shift out the tag field if -needed cast it to the appropriate type. @code{XINT()} needs to be a bit -tricky so that negative numbers are properly sign-extended. Since +stricter type checking. If you accidentally pass an integer where a Lisp +object is desired, you get a compile error. The choice of which type +to use is determined by the preprocessor constant @code{USE_UNION_TYPE} +which is defined via the @code{--use-union-type} option to +@code{configure}. + +Various macros are used to convert between Lisp_Objects and the +corresponding C type. Macros of the form @code{XINT()}, @code{XCHAR()}, +@code{XSTRING()}, @code{XSYMBOL()}, do any required bit shifting and/or +masking and cast it to the appropriate type. @code{XINT()} needs to be +a bit tricky so that negative numbers are properly sign-extended. Since integers are stored left-shifted, if the right-shift operator does an arithmetic shift (i.e. it leaves the most-significant bit as-is rather than shifting in a zero, so that it mimics a divide-by-two even for negative numbers) the shift to remove the tag bit is enough. This is the case on all the systems we support. -Note that when @code{ERROR_CHECK_TYPECHECK} is defined, the extractor +Note that when @code{ERROR_CHECK_TYPECHECK} is defined, the converter macros become more complicated---they check the tag bits and/or the type field in the first four bytes of a record type to ensure that the object is really of the correct type. This is great for catching places @@ -1668,25 +1668,29 @@ There are similar @code{XSET@var{TYPE}()} macros that construct a Lisp object. These macros are of the form @code{XSET@var{TYPE} -(@var{lvalue}, @var{result})}, -i.e. they have to be a statement rather than just used in an expression. -The reason for this is that standard C doesn't let you ``construct'' a -structure (but GCC does). Granted, this sometimes isn't too convenient; -for the case of integers, at least, you can use the function -@code{make_int()}, which constructs and @emph{returns} an integer -Lisp object. Note that the @code{XSET@var{TYPE}()} macros are also -affected by @code{ERROR_CHECK_TYPECHECK} and make sure that the -structure is of the right type in the case of record types, where the -type is contained in the structure. +(@var{lvalue}, @var{result})}, i.e. they have to be a statement rather +than just used in an expression. The reason for this is that standard C +doesn't let you ``construct'' a structure (but GCC does). Granted, this +sometimes isn't too convenient; for the case of integers, at least, you +can use the function @code{make_int()}, which constructs and +@emph{returns} an integer Lisp object. Note that the +@code{XSET@var{TYPE}()} macros are also affected by +@code{ERROR_CHECK_TYPECHECK} and make sure that the structure is of the +right type in the case of record types, where the type is contained in +the structure. The C programmer is responsible for @strong{guaranteeing} that a -Lisp_Object is is the correct type before using the @code{X@var{TYPE}} +Lisp_Object is the correct type before using the @code{X@var{TYPE}} macros. This is especially important in the case of lists. Use @code{XCAR} and @code{XCDR} if a Lisp_Object is certainly a cons cell, else use @code{Fcar()} and @code{Fcdr()}. Trust other C code, but not Lisp code. On the other hand, if XEmacs has an internal logic error, -it's better to crash immediately, so sprinkle ``unreachable'' -@code{abort()}s liberally about the source code. +it's better to crash immediately, so sprinkle @code{assert()}s and +``unreachable'' @code{abort()}s liberally about the source code. Where +performance is an issue, use @code{type_checking_assert}, +@code{bufpos_checking_assert}, and @code{gc_checking_assert}, which do +nothing unless the corresponding configure error checking flag was +specified. @node Rules When Writing New C Code, A Summary of the Various XEmacs Modules, How Lisp Objects Are Represented in C, Top @chapter Rules When Writing New C Code @@ -1740,13 +1744,14 @@ @file{s/} and @file{m/} files work out correctly. When including header files, always use angle brackets, not double -quotes, except when the file to be included is in the same directory as -the including file. If either file is a generated file, then that is -not likely to be the case. In order to understand why we have this -rule, imagine what happens when you do a build in the source directory -using @samp{./configure} and another build in another directory using -@samp{../work/configure}. There will be two different @file{config.h} -files. Which one will be used if you @samp{#include "config.h"}? +quotes, except when the file to be included is always in the same +directory as the including file. If either file is a generated file, +then that is not likely to be the case. In order to understand why we +have this rule, imagine what happens when you do a build in the source +directory using @samp{./configure} and another build in another +directory using @samp{../work/configure}. There will be two different +@file{config.h} files. Which one will be used if you @samp{#include +"config.h"}? @strong{All global and static variables that are to be modifiable must be declared uninitialized.} This means that you may not use the @@ -1791,7 +1796,7 @@ macro style is: @example -#define FOO(var, value) do @{ \ +#define FOO(var, value) do @{ \ Lisp_Object FOO_value = (value); \ ... /* compute using FOO_value */ \ (var) = bar; \ @@ -2597,13 +2602,19 @@ @node Techniques for XEmacs Developers, , Coding for Mule, Rules When Writing New C Code @section Techniques for XEmacs Developers +To make a purified XEmacs, do: @code{make puremacs}. To make a quantified XEmacs, do: @code{make quantmacs}. -You simply can't dump Quantified and Purified images. Run the image -like so: @code{quantmacs -batch -l loadup.el run-temacs @var{xemacs-args...}}. +You simply can't dump Quantified and Purified images (unless using the +portable dumper). Purify gets confused when xemacs frees memory in one +process that was allocated in a @emph{different} process on a different +machine!. Run it like so: +@example +temacs -batch -l loadup.el run-temacs @var{xemacs-args...} +@end example Before you go through the trouble, are you compiling with all -debugging and error-checking off? If not try that first. Be warned +debugging and error-checking off? If not, try that first. Be warned that while Quantify is directly responsible for quite a few optimizations which have been made to XEmacs, doing a run which generates results which can be acted upon is not necessarily a trivial @@ -2642,14 +2653,116 @@ calls in elisp are especially expensive. Iterating over a long list is going to be 30 times faster implemented in C than in Elisp. +Heavily used small code fragments need to be fast. The traditional way +to implement such code fragments in C is with macros. But macros in C +are known to be broken. + +Macro arguments that are repeatedly evaluated may suffer from repeated +side effects or suboptimal performance. + +Variable names used in macros may collide with caller's variables, +causing (at least) unwanted compiler warnings. + +In order to solve these problems, and maintain statement semantics, one +should use the @code{do @{ ... @} while (0)} trick while trying to +reference macro arguments exactly once using local variables. + +Let's take a look at this poor macro definition: + +@example +#define MARK_OBJECT(obj) \ + if (!marked_p (obj)) mark_object (obj), did_mark = 1 +@end example + +This macro evaluates its argument twice, and also fails if used like this: +@example + if (flag) MARK_OBJECT (obj); else do_something(); +@end example + +A much better definition is + +@example +#define MARK_OBJECT(obj) do @{ \ + Lisp_Object mo_obj = (obj); \ + if (!marked_p (mo_obj)) \ + @{ \ + mark_object (mo_obj); \ + did_mark = 1; \ + @} \ +@} while (0) +@end example + +Notice the elimination of double evaluation by using the local variable +with the obscure name. Writing safe and efficient macros requires great +care. The one problem with macros that cannot be portably worked around +is, since a C block has no value, a macro used as an expression rather +than a statement cannot use the techniques just described to avoid +multiple evaluation. + +In most cases where a macro has function semantics, an inline function +is a better implementation technique. Modern compiler optimizers tend +to inline functions even if they have no @code{inline} keyword, and +configure magic ensures that the @code{inline} keyword can be safely +used as an additional compiler hint. Inline functions used in a single +.c files are easy. The function must already be defined to be +@code{static}. Just add another @code{inline} keyword to the +definition. + +@example +inline static int +heavily_used_small_function (int arg) +@{ + ... +@} +@end example + +Inline functions in header files are trickier, because we would like to +make the following optimization if the function is @emph{not} inlined +(for example, because we're compiling for debugging). We would like the +function to be defined externally exactly once, and each calling +translation unit would create an external reference to the function, +instead of including a definition of the inline function in the object +code of every translation unit that uses it. This optimization is +currently only available for gcc. But you don't have to worry about the +trickiness; just define your inline functions in header files using this +pattern: + +@example +INLINE_HEADER int +i_used_to_be_a_crufty_macro_but_look_at_me_now (int arg); +INLINE_HEADER int +i_used_to_be_a_crufty_macro_but_look_at_me_now (int arg) +@{ + ... +@} +@end example + +The declaration right before the definition is to prevent warnings when +compiling with @code{gcc -Wmissing-declarations}. I consider issuing +this warning for inline functions a gcc bug, but the gcc maintainers disagree. + +Every header which contains inline functions, either directly by using +@code{INLINE_HEADER} or indirectly by using @code{DECLARE_LRECORD} must +be added to @file{inline.c}'s includes to make the optimization +described above work. (Optimization note: if all INLINE_HEADER +functions are in fact inlined in all translation units, then the linker +can just discard @code{inline.o}, since it contains only unreferenced code). + To get started debugging XEmacs, take a look at the @file{.gdbinit} and -@file{.dbxrc} files in the @file{src} directory. -@xref{Q2.1.15 - How to Debug an XEmacs problem with a debugger,,, -xemacs-faq, XEmacs FAQ}. +@file{.dbxrc} files in the @file{src} directory. See the section in the +XEmacs FAQ on How to Debug an XEmacs problem with a debugger. After making source code changes, run @code{make check} to ensure that -you haven't introduced any regressions. If you're feeling ambitious, -you can try to improve the test suite in @file{tests/automated}. +you haven't introduced any regressions. If you want to make xemacs more +reliable, please improve the test suite in @file{tests/automated}. + +Did you make sure you didn't introduce any new compiler warnings? + +Before submitting a patch, please try compiling at least once with + +@example +configure --with-mule --with-union-type --error-checking=all +@end example Here are things to know when you create a new source file: @@ -2676,23 +2789,6 @@ @code{"lisp.h"}. It is the responsibility of the @file{.c} files that use it to do so. -@item -If the header uses @code{INLINE}, either directly or through -@code{DECLARE_LRECORD}, then it must be added to @file{inline.c}'s -includes. - -@item -Try compiling at least once with - -@example -gcc --with-mule --with-union-type --error-checking=all -@end example - -@item -Did I mention that you should run the test suite? -@example -make check -@end example @end itemize Here is a checklist of things to do when creating a new lisp object type @@ -2704,17 +2800,20 @@ @item create @var{foo}.c @item -add definitions of syms_of_@var{foo}, etc. to @var{foo}.c -@item -add declarations of syms_of_@var{foo}, etc. to symsinit.h -@item -add calls to syms_of_@var{foo}, etc. to emacs.c(main_1) -@item -add definitions of macros like CHECK_FOO and FOOP to @var{foo}.h -@item -add the new type index to enum lrecord_type -@item -add DEFINE_LRECORD_IMPLEMENTATION call to @var{foo}.c +add definitions of @code{syms_of_@var{foo}}, etc. to @file{@var{foo}.c} +@item +add declarations of @code{syms_of_@var{foo}}, etc. to @file{symsinit.h} +@item +add calls to @code{syms_of_@var{foo}}, etc. to @file{emacs.c} +@item +add definitions of macros like @code{CHECK_@var{FOO}} and +@code{@var{FOO}P} to @file{@var{foo}.h} +@item +add the new type index to @code{enum lrecord_type} +@item +add a DEFINE_LRECORD_IMPLEMENTATION call to @file{@var{foo}.c} +@item +add an INIT_LRECORD_IMPLEMENTATION call to @code{syms_of_@var{foo}.c} @end enumerate @node A Summary of the Various XEmacs Modules, Allocation of Objects in XEmacs Lisp, Rules When Writing New C Code, Top @@ -5166,7 +5265,9 @@ All lrecords have at the beginning of their structure a @code{struct lrecord_header}. This just contains a type number and some flags, -including the mark bit. The type number, thru the +including the mark bit. All builtin type numbers are defined as +constants in @code{enum lrecord_type}, to allow the compiler to generate +more efficient code for @code{@var{type}P}. The type number, thru the @code{lrecord_implementation_table}, gives access to a @code{struct lrecord_implementation}, which is a structure containing method pointers and such. There is one of these for each type, and it is a global, @@ -5201,21 +5302,21 @@ Whenever you create an lrecord, you need to call either @code{DEFINE_LRECORD_IMPLEMENTATION()} or @code{DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION()}. This needs to be -specified in a C file, at the top level. What this actually does is -define and initialize the implementation structure for the lrecord. (And -possibly declares a function @code{error_check_foo()} that implements -the @code{XFOO()} macro when error-checking is enabled.) The arguments -to the macros are the actual type name (this is used to construct the C -variable name of the lrecord implementation structure and related -structures using the @samp{##} macro concatenation operator), a string -that names the type on the Lisp level (this may not be the same as the C -type name; typically, the C type name has underscores, while the Lisp -string has dashes), various method pointers, and the name of the C -structure that contains the object. The methods are used to encapsulate -type-specific information about the object, such as how to print it or -mark it for garbage collection, so that it's easy to add new object -types without having to add a specific case for each new type in a bunch -of different places. +specified in a @file{.c} file, at the top level. What this actually +does is define and initialize the implementation structure for the +lrecord. (And possibly declares a function @code{error_check_foo()} that +implements the @code{XFOO()} macro when error-checking is enabled.) The +arguments to the macros are the actual type name (this is used to +construct the C variable name of the lrecord implementation structure +and related structures using the @samp{##} macro concatenation +operator), a string that names the type on the Lisp level (this may not +be the same as the C type name; typically, the C type name has +underscores, while the Lisp string has dashes), various method pointers, +and the name of the C structure that contains the object. The methods +are used to encapsulate type-specific information about the object, such +as how to print it or mark it for garbage collection, so that it's easy +to add new object types without having to add a specific case for each +new type in a bunch of different places. The difference between @code{DEFINE_LRECORD_IMPLEMENTATION()} and @code{DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION()} is that the former is @@ -5229,21 +5330,20 @@ For the purpose of keeping allocation statistics, the allocation engine keeps a list of all the different types that exist. Note that, since @code{DEFINE_LRECORD_IMPLEMENTATION()} is a macro that is -specified at top-level, there is no way for it to add to the list of all -existing types. What happens instead is that each implementation -structure contains in it a dynamically assigned number that is -particular to that type. (Or rather, it contains a pointer to another -structure that contains this number. This evasiveness is done so that -the implementation structure can be declared const.) In the sweep stage -of garbage collection, each lrecord is examined to see if its -implementation structure has its dynamically-assigned number set. If -not, it must be a new type, and it is added to the list of known types -and a new number assigned. The number is used to index into an array -holding the number of objects of each type and the total memory -allocated for objects of that type. The statistics in this array are -also computed during the sweep stage. These statistics are returned by -the call to @code{garbage-collect} and are printed out at the end of the -loadup phase. +specified at top-level, there is no way for it to initialize the global +data structures containing type information, like +@code{lrecord_implementations_table}. For this reason a call to +@code{INIT_LRECORD_IMPLEMENTATION} must be added to the same source file +containing @code{DEFINE_LRECORD_IMPLEMENTATION}, but instead of to the +top level, to one of the init functions, typically +@code{syms_of_@var{foo}.c}. @code{INIT_LRECORD_IMPLEMENTATION} must be +called before an object of this type is used. + +The type number is also used to index into an array holding the number +of objects of each type and the total memory allocated for objects of +that type. The statistics in this array are computed during the sweep +stage. These statistics are returned by the call to +@code{garbage-collect}. Note that for every type defined with a @code{DEFINE_LRECORD_*()} macro, there needs to be a @code{DECLARE_LRECORD_IMPLEMENTATION()} @@ -5449,16 +5549,15 @@ (On some systems, the memory warnings are not functional.) Allocated memory that is going to be used to make a Lisp object -is created using @code{allocate_lisp_storage()}. This calls @code{xmalloc()} -but also verifies that the pointer to the memory can fit into -a Lisp word (remember that some bits are taken away for a type -tag and a mark bit). If not, an error is issued through @code{memory_full()}. -@code{allocate_lisp_storage()} is called by @code{alloc_lcrecord()}, -@code{ALLOCATE_FIXED_TYPE()}, and the vector and bit-vector creation -routines. These routines also call @code{INCREMENT_CONS_COUNTER()} at the -appropriate times; this keeps statistics on how much memory is -allocated, so that garbage-collection can be invoked when the -threshold is reached. +is created using @code{allocate_lisp_storage()}. This just calls +@code{xmalloc()}. It used to verify that the pointer to the memory can +fit into a Lisp word, before the current Lisp object representation was +introduced. @code{allocate_lisp_storage()} is called by +@code{alloc_lcrecord()}, @code{ALLOCATE_FIXED_TYPE()}, and the vector +and bit-vector creation routines. These routines also call +@code{INCREMENT_CONS_COUNTER()} at the appropriate times; this keeps +statistics on how much memory is allocated, so that garbage-collection +can be invoked when the threshold is reached. @node Cons, Vector, Low-level allocation, Allocation of Objects in XEmacs Lisp @section Cons @@ -8798,4 +8897,3 @@ @c That's all @bye - diff -r 9f011ab08d48 -r 2f8bb876ab1d man/lispref/frames.texi --- a/man/lispref/frames.texi Mon Aug 13 11:15:00 2007 +0200 +++ b/man/lispref/frames.texi Mon Aug 13 11:16:07 2007 +0200 @@ -9,9 +9,19 @@ @cindex frame A @var{frame} is a rectangle on the screen that contains one or more -XEmacs windows. A frame initially contains a single main window (plus -perhaps a minibuffer window), which you can subdivide vertically or -horizontally into smaller windows. +XEmacs windows (@pxref{Windows}). A frame initially contains a single +main window (plus perhaps an echo area), which you can subdivide +vertically or horizontally into smaller windows. Each window is +associated with a modeline (@pxref{Modeline Format}), and optionally two +scrollbars (@pxref{Scrollbars}). By default the vertical scrollbar is +on, the horizontal scrollbar is off. + + The frame may also contain menubars (@pxref{Menubar}), toolbars +(@pxref{Toolbar Intro}), and gutters (@pxref{Gutter Intro}). By default +there is one of each at the top of the frame, with menubar topmost, +toolbar next, and gutter lowest, immediately above the windows. +(Warning: the gutter is a new, experimental, and unstable feature of +XEmacs version 21.2.) @cindex terminal frame @cindex X window frame diff -r 9f011ab08d48 -r 2f8bb876ab1d man/lispref/glyphs.texi --- a/man/lispref/glyphs.texi Mon Aug 13 11:15:00 2007 +0200 +++ b/man/lispref/glyphs.texi Mon Aug 13 11:16:07 2007 +0200 @@ -462,65 +462,64 @@ @table @code @item nothing -(Don't display anything; no keywords are valid for this. Can only be -instanced as @code{nothing}.) +Don't display anything; no keywords are valid for this. Can only be +instanced as @code{nothing}. @item string -(Display this image as a text string. Can only be instanced +Display this image as a text string. Can only be instanced as @code{text}, although support for instancing as @code{mono-pixmap} -should be added.) +should be added. @item formatted-string -(Display this image as a text string with replaceable fields, -similar to a modeline format string; not currently implemented.) +Display this image as a text string with replaceable fields, +similar to a modeline format string; not currently implemented. @item xbm -(An X bitmap; only if X support was compiled into this XEmacs. Can be +An X bitmap; only if X support was compiled into this XEmacs. Can be instanced as @code{mono-pixmap}, @code{color-pixmap}, or -@code{pointer}.) +@code{pointer}. @item xpm -(An XPM pixmap; only if XPM support was compiled into this XEmacs. Can +An XPM pixmap; only if XPM support was compiled into this XEmacs. Can be instanced as @code{color-pixmap}, @code{mono-pixmap}, or @code{pointer}. XPM is an add-on library for X that was designed to rectify the shortcomings of the XBM format. Most implementations of X include the XPM library as a standard part. If your vendor does not, it is highly recommended that you download it and install it. You can get -it from the standard XEmacs FTP site, among other places.) +it from the standard XEmacs FTP site, among other places. @item xface -(An X-Face bitmap, used to encode people's faces in e-mail messages; +An X-Face bitmap, used to encode people's faces in e-mail messages; only if X-Face support was compiled into this XEmacs. Can be instanced -as @code{mono-pixmap}, @code{color-pixmap}, or @code{pointer}.) +as @code{mono-pixmap}, @code{color-pixmap}, or @code{pointer}. @item gif -(A GIF87 or GIF89 image; only if GIF support was compiled into this +A GIF87 or GIF89 image; only if GIF support was compiled into this XEmacs. Can be instanced as @code{color-pixmap}. Note that XEmacs includes GIF decoding functions as a standard part of it, so if you have X support, you will normally have GIF support, unless you explicitly -disable it at configure time.) +disable it at configure time. @item jpeg -(A JPEG-format image; only if JPEG support was compiled into this +A JPEG-format image; only if JPEG support was compiled into this XEmacs. Can be instanced as @code{color-pixmap}. If you have the JPEG libraries present on your system when XEmacs is built, XEmacs will automatically detect this and use them, unless you explicitly disable it -at configure time.) +at configure time. @item png -(A PNG/GIF24 image; only if PNG support was compiled into this XEmacs. -Can be instanced as @code{color-pixmap}.) +A PNG/GIF24 image; only if PNG support was compiled into this XEmacs. +Can be instanced as @code{color-pixmap}. @item tiff -(A TIFF-format image; only if TIFF support was compiled into this XEmacs. -Not currently implemented.) +A TIFF-format image; only if TIFF support was compiled into this XEmacs. @item cursor-font -(One of the standard cursor-font names, such as @samp{watch} or +One of the standard cursor-font names, such as @samp{watch} or @samp{right_ptr} under X. Under X, this is, more specifically, any of the standard cursor names from appendix B of the Xlib manual [also known as the file @file{}] minus the @samp{XC_} prefix. On other window systems, the valid names will be specific to the type of -window system. Can only be instanced as @code{pointer}.) +window system. Can only be instanced as @code{pointer}. @item font -(A glyph from a font; i.e. the name of a font, and glyph index into it +A glyph from a font; i.e. the name of a font, and glyph index into it of the form @samp{@var{font} fontname index [[mask-font] mask-index]}. Only if X support was compiled into this XEmacs. Currently can only be -instanced as @code{pointer}, although this should probably be fixed.) +instanced as @code{pointer}, although this should probably be fixed. @item subwindow -(An embedded X window; not currently implemented.) +An embedded X window; not currently implemented. @item autodetect -(XEmacs tries to guess what format the data is in. If X support exists, +XEmacs tries to guess what format the data is in. If X support exists, the data string will be checked to see if it names a filename. If so, and this filename contains XBM or XPM data, the appropriate sort of pixmap or pointer will be created. [This includes picking up any @@ -528,66 +527,66 @@ is one of the allowable image-instance types and the string names a valid cursor-font name, the image will be created as a pointer. Otherwise, the image will be displayed as text. If no X support exists, -the image will always be displayed as text.) +the image will always be displayed as text. @end table The valid keywords are: @table @code @item :data -(Inline data. For most formats above, this should be a string. For +Inline data. For most formats above, this should be a string. For XBM images, this should be a list of three elements: width, height, and a string of bit data. This keyword is not valid for instantiator -format @code{nothing}.) +format @code{nothing}. @item :file -(Data is contained in a file. The value is the name of this file. If +Data is contained in a file. The value is the name of this file. If both @code{:data} and @code{:file} are specified, the image is created from what is specified in @code{:data} and the string in @code{:file} becomes the value of the @code{image-instance-file-name} function when applied to the resulting image-instance. This keyword is not valid for instantiator formats @code{nothing}, @code{string}, @code{formatted-string}, @code{cursor-font}, @code{font}, and -@code{autodetect}.) +@code{autodetect}. @item :foreground @itemx :background -(For @code{xbm}, @code{xface}, @code{cursor-font}, and @code{font}. +For @code{xbm}, @code{xface}, @code{cursor-font}, and @code{font}. These keywords allow you to explicitly specify foreground and background colors. The argument should be anything acceptable to @code{make-color-instance}. This will cause what would be a @code{mono-pixmap} to instead be colorized as a two-color color-pixmap, and specifies the foreground and/or background colors for a pointer -instead of black and white.) +instead of black and white. @item :mask-data -(For @code{xbm} and @code{xface}. This specifies a mask to be used with the +For @code{xbm} and @code{xface}. This specifies a mask to be used with the bitmap. The format is a list of width, height, and bits, like for -@code{:data}.) +@code{:data}. @item :mask-file -(For @code{xbm} and @code{xface}. This specifies a file containing the +For @code{xbm} and @code{xface}. This specifies a file containing the mask data. If neither a mask file nor inline mask data is given for an XBM image, and the XBM image comes from a file, XEmacs will look for a mask file with the same name as the image file but with @samp{Mask} or @samp{msk} appended. For example, if you specify the XBM file @file{left_ptr} [usually located in @file{/usr/include/X11/bitmaps}], the associated mask file @file{left_ptrmsk} will automatically be picked -up.) +up. @item :hotspot-x @itemx :hotspot-y -(For @code{xbm} and @code{xface}. These keywords specify a hotspot if +For @code{xbm} and @code{xface}. These keywords specify a hotspot if the image is instantiated as a @code{pointer}. Note that if the XBM image file specifies a hotspot, it will automatically be picked up if no -explicit hotspot is given.) +explicit hotspot is given. @item :color-symbols -(Only for @code{xpm}. This specifies an alist that maps strings that +Only for @code{xpm}. This specifies an alist that maps strings that specify symbolic color names to the actual color to be used for that symbolic color (in the form of a string or a color-specifier object). If this is not specified, the contents of @code{xpm-color-symbols} are -used to generate the alist.) +used to generate the alist. @end table If instead of a vector, the instantiator is a string, it will be diff -r 9f011ab08d48 -r 2f8bb876ab1d man/lispref/gutter.texi --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/man/lispref/gutter.texi Mon Aug 13 11:16:07 2007 +0200 @@ -0,0 +1,395 @@ +@c -*-texinfo-*- +@c This is part of the XEmacs Lisp Reference Manual. +@c Copyright (C) 1994, 1995 Ben Wing. +@c Copyright (C) 1999 Andy Piper. +@c Copyright (C) 1999 Stephen J. Turnbull. +@c See the file lispref.texi for copying conditions. +@setfilename ../../info/gutter.info +@node Gutter, Scrollbars, Toolbar, top +@chapter Gutter +@cindex gutter + + A gutter is a rectangle displayed along one edge of a frame. It +can contain arbitrary text or graphics. + +@menu +* Gutter Intro:: An introduction. +* Gutter Descriptor Format:: How to create a gutter. +* Specifying a Gutter:: Setting a gutter's contents. +* Other Gutter Variables:: Controlling the size of gutters. +* Common Gutter Widgets:: Things to put in gutters. +@end menu + +@node Gutter Intro, Gutter Descriptor Format, , Gutter +@section Gutter Intro + + A @dfn{gutter} is a rectangle displayed along one edge of a frame. It +can contain arbitrary text or graphics. It could be considered a +generalization of a toolbar, although toolbars are not currently +implemented using gutters. + + In XEmacs, a gutter can be displayed along any of the four edges +of the frame, and two or more different edges can be displaying +gutters simultaneously. The contents, thickness, and visibility of +the gutters can be controlled separately, and the values can +be per-buffer, per-frame, etc., using specifiers (@pxref{Specifiers}). + + Normally, there is one gutter displayed in a frame. Usually, this is +the default gutter, containing buffer tabs, but modes cab override this +and substitute their own gutter. This default gutter is usually +positioned along the top of the frame, but this can be changed using +@code{set-default-gutter-position}. + + Note that, for each of the gutter properties (contents, thickness, +and visibility), there is a separate specifier for each of the four +gutter positions (top, bottom, left, and right), and an additional +specifier for the ``default'' gutter, i.e. the gutter whose +position is controlled by @code{set-default-gutter-position}. The +way this works is that @code{set-default-gutter-position} arranges +things so that the appropriate position-specific specifiers for the +default position inherit from the corresponding default specifiers. +That way, if the position-specific specifier does not give a value +(which it usually doesn't), then the value from the default +specifier applies. If you want to control the default gutter, you +just change the default specifiers, and everything works. A package +such as VM that wants to put its own gutter in a different location +from the default just sets the position-specific specifiers, and if +the user sets the default gutter to the same position, it will just +not be visible. + +@node Gutter Descriptor Format, Specifying a Gutter, Gutter Intro, Gutter +@section Gutter Descriptor Format + + The contents of a gutter are specified using a @dfn{gutter descriptor}. +The format of a gutter descriptor is a list of @dfn{gutter button +descriptors}. Each gutter button descriptor is a vector in one of the +following formats: + +@itemize @bullet +@item +@code{[@var{glyph-list} @var{function} @var{enabled-p} @var{help}]} +@item +@code{[:style @var{2d-or-3d}]} +@item +@code{[:style @var{2d-or-3d} :size @var{width-or-height}]} +@item +@code{[:size @var{width-or-height} :style @var{2d-or-3d}]} +@end itemize + + Optionally, one of the gutter button descriptors may be @code{nil} +instead of a vector; this signifies the division between the gutter +buttons that are to be displayed flush-left, and the buttons to be +displayed flush-right. + + The first vector format above specifies a normal gutter button; +the others specify blank areas in the gutter. + + For the first vector format: + +@itemize @bullet +@item +@var{glyph-list} should be a list of one to six glyphs (as created by +@code{make-glyph}) or a symbol whose value is such a list. The first +glyph, which must be provided, is the glyph used to display the gutter +button when it is in the ``up'' (not pressed) state. The optional +second glyph is for displaying the button when it is in the ``down'' +(pressed) state. The optional third glyph is for when the button is +disabled. The last three glyphs are for displaying the button in the +``up'', ``down'', and ``disabled'' states, respectively, but are used +when the user has called for captioned gutter buttons (using +@code{gutter-buttons-captioned-p}). The function +@code{gutter-make-button-list} is useful in creating these glyph lists. + +@item +Even if you do not provide separate down-state and disabled-state +glyphs, the user will still get visual feedback to indicate which +state the button is in. Buttons in the up-state are displayed +with a shadowed border that gives a raised appearance to the +button. Buttons in the down-state are displayed with shadows that +give a recessed appearance. Buttons in the disabled state are +displayed with no shadows, giving a 2-d effect. + +@item +If some of the gutter glyphs are not provided, they inherit as follows: + +@example + UP: up + DOWN: down -> up + DISABLED: disabled -> up + CAP-UP: cap-up -> up + CAP-DOWN: cap-down -> cap-up -> down -> up + CAP-DISABLED: cap-disabled -> cap-up -> disabled -> up +@end example + +@item +The second element @var{function} is a function to be called when the +gutter button is activated (i.e. when the mouse is released over the +gutter button, if the press occurred in the gutter). It can be any +form accepted by @code{call-interactively}, since this is how it is +invoked. + +@item +The third element @var{enabled-p} specifies whether the gutter button +is enabled (disabled buttons do nothing when they are activated, and are +displayed differently; see above). It should be either a boolean or a +form that evaluates to a boolean. + +@item +The fourth element @var{help}, if non-@code{nil}, should be a string. +This string is displayed in the echo area when the mouse passes over the +gutter button. +@end itemize + + For the other vector formats (specifying blank areas of the gutter): + +@itemize @bullet +@item +@var{2d-or-3d} should be one of the symbols @code{2d} or @code{3d}, +indicating whether the area is displayed with shadows (giving it a +raised, 3-d appearance) or without shadows (giving it a flat +appearance). + +@item +@var{width-or-height} specifies the length, in pixels, of the blank +area. If omitted, it defaults to a device-specific value (8 pixels for +X devices). +@end itemize + +@defun gutter-make-button-list up &optional down disabled cap-up cap-down cap-disabled +This function calls @code{make-glyph} on each arg and returns a list of +the results. This is useful for setting the first argument of a gutter +button descriptor (typically, the result of this function is assigned +to a symbol, which is specified as the first argument of the gutter +button descriptor). +@end defun + +@defun check-gutter-button-syntax button &optional noerror +Verify the syntax of entry @var{button} in a gutter description list. +If you want to verify the syntax of a gutter description list as a +whole, use @code{check-valid-instantiator} with a specifier type of +@code{gutter}. +@end defun + +@node Specifying a Gutter, Other Gutter Variables, Gutter Descriptor Format, Gutter +@section Specifying a Gutter + + In order to specify the contents of a gutter, set one of the specifier +variables @code{default-gutter}, @code{top-gutter}, +@code{bottom-gutter}, @code{left-gutter}, or @code{right-gutter}. +These are specifiers, which means you set them with @code{set-specifier} +and query them with @code{specifier-specs} or @code{specifier-instance}. +You will get an error if you try to set them using @code{setq}. The +valid instantiators for these specifiers are gutter descriptors, as +described above. @xref{Specifiers}, for more information. + + Most of the time, you will set @code{default-gutter}, which allows +the user to choose where the gutter should go. + +@defvr Specifier default-gutter +The position of this gutter is specified in the function +@code{default-gutter-position}. If the corresponding +position-specific gutter (e.g. @code{top-gutter} if +@code{default-gutter-position} is @code{top}) does not specify a +gutter in a particular domain, then the value of @code{default-gutter} +in that domain, of any, will be used instead. +@end defvr + + Note that the gutter at any particular position will not be displayed +unless its thickness (width or height, depending on orientation) is +non-zero and its visibility status is true. The thickness is controlled +by the specifiers @code{top-gutter-height}, +@code{bottom-gutter-height}, @code{left-gutter-width}, and +@code{right-gutter-width}, and the visibility status is controlled by +the specifiers @code{top-gutter-visible-p}, +@code{bottom-gutter-visible-p}, @code{left-gutter-visible-p}, and +@code{right-gutter-visible-p} (@pxref{Other Gutter Variables}). + +@defun set-default-gutter-position position +This function sets the position that the @code{default-gutter} will be +displayed at. Valid positions are the symbols @code{top}, +@code{bottom}, @code{left} and @code{right}. What this actually does is +set the fallback specifier for the position-specific specifier +corresponding to the given position to @code{default-gutter}, and set +the fallbacks for the other position-specific specifiers to @code{nil}. +It also does the same thing for the position-specific thickness and +visibility specifiers, which inherit from one of +@code{default-gutter-height} or @code{default-gutter-width}, and from +@code{default-gutter-visible-p}, respectively (@pxref{Other Gutter +Variables}). +@end defun + +@defun default-gutter-position +This function returns the position that the @code{default-gutter} will +be displayed at. +@end defun + + You can also explicitly set a gutter at a particular position. When +redisplay determines what to display at a particular position in a +particular domain (i.e. window), it first consults the position-specific +gutter. If that does not yield a gutter descriptor, the +@code{default-gutter} is consulted if @code{default-gutter-position} +indicates this position. + +@defvr Specifier top-gutter +Specifier for the gutter at the top of the frame. +@end defvr + +@defvr Specifier bottom-gutter +Specifier for the gutter at the bottom of the frame. +@end defvr + +@defvr Specifier left-gutter +Specifier for the gutter at the left edge of the frame. +@end defvr + +@defvr Specifier right-gutter +Specifier for the gutter at the right edge of the frame. +@end defvr + +@defun gutter-specifier-p object +This function returns non-nil if @var{object} is a gutter specifier. +Gutter specifiers are the actual objects contained in the gutter +variables described above, and their valid instantiators are +gutter descriptors (@pxref{Gutter Descriptor Format}). +@end defun + +@node Other Gutter Variables, Common Gutter Widgets, Specifying a Gutter, Gutter +@section Other Gutter Variables + + The variables to control the gutter thickness, visibility status, and +captioned status are all specifiers. @xref{Specifiers}. + +@defvr Specifier default-gutter-height +This specifies the height of the default gutter, if it's oriented +horizontally. The position of the default gutter is specified by the +function @code{set-default-gutter-position}. If the corresponding +position-specific gutter thickness specifier +(e.g. @code{top-gutter-height} if @code{default-gutter-position} is +@code{top}) does not specify a thickness in a particular domain (a +window or a frame), then the value of @code{default-gutter-height} or +@code{default-gutter-width} (depending on the gutter orientation) in +that domain, if any, will be used instead. +@end defvr + +@defvr Specifier default-gutter-width +This specifies the width of the default gutter, if it's oriented +vertically. This behaves like @code{default-gutter-height}. +@end defvr + + Note that @code{default-gutter-height} is only used when +@code{default-gutter-position} is @code{top} or @code{bottom}, and +@code{default-gutter-width} is only used when +@code{default-gutter-position} is @code{left} or @code{right}. + +@defvr Specifier top-gutter-height +This specifies the height of the top gutter. +@end defvr + +@defvr Specifier bottom-gutter-height +This specifies the height of the bottom gutter. +@end defvr + +@defvr Specifier left-gutter-width +This specifies the width of the left gutter. +@end defvr + +@defvr Specifier right-gutter-width +This specifies the width of the right gutter. +@end defvr + + Note that all of the position-specific gutter thickness specifiers +have a fallback value of zero when they do not correspond to the +default gutter. Therefore, you will have to set a non-zero thickness +value if you want a position-specific gutter to be displayed. + +@defvr Specifier default-gutter-visible-p +This specifies whether the default gutter is visible. The position of +the default gutter is specified by the function +@code{set-default-gutter-position}. If the corresponding position-specific +gutter visibility specifier (e.g. @code{top-gutter-visible-p} if +@code{default-gutter-position} is @code{top}) does not specify a +visible-p value in a particular domain (a window or a frame), then the +value of @code{default-gutter-visible-p} in that domain, if any, will +be used instead. +@end defvr + +@defvr Specifier top-gutter-visible-p +This specifies whether the top gutter is visible. +@end defvr + +@defvr Specifier bottom-gutter-visible-p +This specifies whether the bottom gutter is visible. +@end defvr + +@defvr Specifier left-gutter-visible-p +This specifies whether the left gutter is visible. +@end defvr + +@defvr Specifier right-gutter-visible-p +This specifies whether the right gutter is visible. +@end defvr + +@code{default-gutter-visible-p} and all of the position-specific +gutter visibility specifiers have a fallback value of true. + + Internally, gutter thickness and visibility specifiers are instantiated +in both window and frame domains, for different purposes. The value in +the domain of a frame's selected window specifies the actual gutter +thickness or visibility that you will see in that frame. The value in +the domain of a frame itself specifies the gutter thickness or +visibility that is used in frame geometry calculations. + + Thus, for example, if you set the frame width to 80 characters and the +left gutter width for that frame to 68 pixels, then the frame will be +sized to fit 80 characters plus a 68-pixel left gutter. If you then +set the left gutter width to 0 for a particular buffer (or if that +buffer does not specify a left gutter or has a nil value specified for +@code{left-gutter-visible-p}), you will find that, when that buffer is +displayed in the selected window, the window will have a width of 86 or +87 characters -- the frame is sized for a 68-pixel left gutter but the +selected window specifies that the left gutter is not visible, so it is +expanded to take up the slack. + +@defvr Specifier gutter-buttons-captioned-p +Whether gutter buttons are captioned. This affects which glyphs from a +gutter button descriptor are chosen. @xref{Gutter Descriptor Format}. +@end defvr + + You can also reset the gutter to what it was when XEmacs started up. + +@defvr Constant initial-gutter-spec +The gutter descriptor used to initialize @code{default-gutter} at +startup. +@end defvr + +@node Common Gutter Widgets, , Other Gutter Variables, Gutter +@section Common Gutter Widgets + + A gutter can contain arbitrary text. So, for example, in an Info +buffer you could put the title of the current node in the top gutter, +and it would not scroll out of view in a long node. (This is an +artificial example, since usually the node name is sufficiently +descriptive, and Info puts that in the mode line.) + + A more common use for the gutter is to hold some kind of active +widget. The buffer-tab facility, available in all XEmacs frames, +creates an array of file-folder-like tabs, which the user can click with +the mouse to switch buffers. W3 uses a progress-bar widget in the +bottom gutter to give a visual indication of the progress of +time-consuming operations like downloading. + +@menu +* Buffer Tabs:: Tabbed divider index metaphor for switching buffers. +* Progress Bars:: Visual indication of operation progress. +@end menu + +@node Buffer Tabs, Progress Bars, , Common Gutter Widgets +@section Buffer Tabs + + Not documented yet. + +@node Progress Bars, , Buffer Tabs, Common Gutter Widgets +@section Progress Bars + + Not documented yet. + diff -r 9f011ab08d48 -r 2f8bb876ab1d man/lispref/internationalization.texi --- a/man/lispref/internationalization.texi Mon Aug 13 11:15:00 2007 +0200 +++ b/man/lispref/internationalization.texi Mon Aug 13 11:16:07 2007 +0200 @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc. @c See the file lispref.texi for copying conditions. @setfilename ../../info/internationalization.info -@node Internationalization, MULE, LDAP Support, top +@node Internationalization, MULE, PostgreSQL Support, top @chapter Internationalization @menu diff -r 9f011ab08d48 -r 2f8bb876ab1d man/lispref/ldap.texi --- a/man/lispref/ldap.texi Mon Aug 13 11:15:00 2007 +0200 +++ b/man/lispref/ldap.texi Mon Aug 13 11:16:07 2007 +0200 @@ -3,7 +3,7 @@ @c Copyright (C) 1998 Free Software Foundation, Inc. @c See the file lispref.texi for copying conditions. @setfilename ../../info/ldap.info -@node LDAP Support, Internationalization, ToolTalk Support, top +@node LDAP Support, PostgreSQL Support, ToolTalk Support, top @chapter LDAP Support @cindex LDAP diff -r 9f011ab08d48 -r 2f8bb876ab1d man/lispref/lispref.texi --- a/man/lispref/lispref.texi Mon Aug 13 11:15:00 2007 +0200 +++ b/man/lispref/lispref.texi Mon Aug 13 11:16:07 2007 +0200 @@ -159,6 +159,7 @@ * Menus:: Defining pull-down and pop-up menus. * Dialog Boxes:: Creating dialog boxes. * Toolbar:: Controlling the toolbar. +* Gutter:: Controlling the gutter. * Scrollbars:: Controlling the scrollbars. * Drag and Drop:: Generic API to inter-application communication via specific protocols. @@ -204,6 +205,7 @@ * ToolTalk Support:: Interfacing with the ToolTalk message service. * LDAP Support:: Interfacing with the Lightweight Directory Access Protocol. +* PostgreSQL Support:: Interfacing to the PostgreSQL libpq library. * Internationalization:: How Emacs supports different languages and cultural conventions. * MULE:: Specifics of the Asian-language support. @@ -623,6 +625,8 @@ * Specifying the Toolbar:: Setting a toolbar. * Other Toolbar Variables:: Controlling the size of toolbars. +Gutter + Scrollbars Major and Minor Modes @@ -1163,6 +1167,7 @@ @include menus.texi @include dialog.texi @include toolbar.texi +@include gutter.texi @include scrollbars.texi @include dragndrop.texi @include modes.texi @@ -1199,6 +1204,7 @@ @include x-windows.texi @include tooltalk.texi @include ldap.texi +@include postgresql.texi @include internationalization.texi @include mule.texi diff -r 9f011ab08d48 -r 2f8bb876ab1d man/lispref/minibuf.texi --- a/man/lispref/minibuf.texi Mon Aug 13 11:15:00 2007 +0200 +++ b/man/lispref/minibuf.texi Mon Aug 13 11:16:07 2007 +0200 @@ -150,23 +150,26 @@ default value, @var{initial-contents} may be preferred. @end defun -@defun read-string prompt &optional initial history +@defun read-string prompt &optional initial history default-value This function reads a string from the minibuffer and returns it. The arguments @var{prompt} and @var{initial} are used as in @code{read-from-minibuffer}. The keymap used is @code{minibuffer-local-map}. The optional argument @var{history}, if non-nil, specifies a history -list and optionally the initial position in the list. +list and optionally the initial position in the list. The optional +argument @var{default} specifies a default value to return if the user +enters null input; it should be a string. This function is a simplified interface to the @code{read-from-minibuffer} function: @smallexample @group -(read-string @var{prompt} @var{initial}) +(read-string @var{prompt} @var{initial} @var{history} @var{default}) @equiv{} -(read-from-minibuffer @var{prompt} @var{initial} nil nil nil) +(read-from-minibuffer @var{prompt} @var{initial} nil nil + @var{history} nil @var{default}))) @end group @end smallexample @end defun @@ -205,19 +208,25 @@ This section describes functions for reading Lisp objects with the minibuffer. -@defun read-minibuffer prompt &optional initial +@defun read-expression prompt &optional initial history default-value This function reads a Lisp object using the minibuffer, and returns it without evaluating it. The arguments @var{prompt} and @var{initial} are used as in @code{read-from-minibuffer}. +The optional argument @var{history}, if non-nil, specifies a history +list and optionally the initial position in the list. The optional +argument @var{default-value} specifies a default value to return if the +user enters null input; it should be a string. + This is a simplified interface to the @code{read-from-minibuffer} function: @smallexample @group -(read-minibuffer @var{prompt} @var{initial}) +(read-expression @var{prompt} @var{initial} @var{history} @var{default-value}) @equiv{} -(read-from-minibuffer @var{prompt} @var{initial} nil t) +(read-from-minibuffer @var{prompt} @var{initial} nil t + @var{history} nil @var{default-value}) @end group @end smallexample @@ -226,7 +235,7 @@ @smallexample @group -(read-minibuffer +(read-expression "Enter an expression: " (format "%s" '(testing))) ;; @r{Here is how the minibuffer is displayed:} @@ -244,27 +253,38 @@ default, or can edit the input. @end defun -@defun eval-minibuffer prompt &optional initial +@defun read-minibuffer prompt &optional initial history default-value + +This is a FSF Emacs compatible function. Use @code{read-expression} +instead. +@end defun + +@defun eval-minibuffer prompt &optional initial history default-value This function reads a Lisp expression using the minibuffer, evaluates it, then returns the result. The arguments @var{prompt} and @var{initial} are used as in @code{read-from-minibuffer}. +The optional argument @var{history}, if non-nil, specifies a history +list and optionally the initial position in the list. The optional +argument @var{default-value} specifies a default value to return if the +user enters null input; it should be a string. + This function simply evaluates the result of a call to -@code{read-minibuffer}: +@code{read-expression}: @smallexample @group (eval-minibuffer @var{prompt} @var{initial}) @equiv{} -(eval (read-minibuffer @var{prompt} @var{initial})) +(eval (read-expression @var{prompt} @var{initial})) @end group @end smallexample @end defun -@defun edit-and-eval-command prompt form +@defun edit-and-eval-command prompt command &optional history This function reads a Lisp expression in the minibuffer, and then evaluates it. The difference between this command and -@code{eval-minibuffer} is that here the initial @var{form} is not +@code{eval-minibuffer} is that here the initial @var{command} is not optional and it is treated as a Lisp object to be converted to printed representation rather than as a string of text. It is printed with @code{prin1}, so if it is a string, double-quote characters (@samp{"}) @@ -605,7 +625,7 @@ is included in @var{collection}. The function @code{completing-read} works by calling -@code{read-minibuffer}. It uses @code{minibuffer-local-completion-map} +@code{read-expression}. It uses @code{minibuffer-local-completion-map} as the keymap if @var{require-match} is @code{nil}, and uses @code{minibuffer-local-must-match-map} if @var{require-match} is non-@code{nil}. @xref{Completion Commands}. @@ -755,7 +775,7 @@ @samp{*Completions*}. @end deffn -@defun display-completion-list completions +@defun display-completion-list completions &rest cl-keys This function displays @var{completions} to the stream in @code{standard-output}, usually a buffer. (@xref{Read and Print}, for more information about streams.) The argument @var{completions} is normally @@ -832,13 +852,19 @@ @end example @end defun -@defun read-command prompt +@defun read-command prompt &optinal default-value This function reads the name of a command and returns it as a Lisp symbol. The argument @var{prompt} is used as in @code{read-from-minibuffer}. Recall that a command is anything for which @code{commandp} returns @code{t}, and a command name is a symbol for which @code{commandp} returns @code{t}. @xref{Interactive Call}. +The argument @var{default-value} specifies what to return if the user +enters null input. It can be a symbol or a string; if it is a string, +@code{read-command} interns it before returning it. If @var{default} is +@code{nil}, that means no default has been specified; then if the user +enters null input, the return value is @code{nil}. + @example (read-command "Command name? ") @@ -874,10 +900,16 @@ @end example @end defun -@defun read-variable prompt +@defun read-variable prompt &optional default-value This function reads the name of a user variable and returns it as a symbol. +The argument @var{default-value} specifies what to return if the user +enters null input. It can be a symbol or a string; if it is a string, +@code{read-variable} interns it before returning it. If @var{default} +is @code{nil}, that means no default has been specified; then if the +user enters null input, the return value is @code{nil}. + @example @group (read-variable "Variable name? ") @@ -920,7 +952,7 @@ file name. It provides special features including automatic insertion of the default directory. -@defun read-file-name prompt &optional directory default existing initial +@defun read-file-name prompt &optional directory default existing initial history This function reads a file name in the minibuffer, prompting with @var{prompt} and providing completion. If @var{default} is non-@code{nil}, then the function returns @var{default} if the user just diff -r 9f011ab08d48 -r 2f8bb876ab1d man/lispref/mule.texi --- a/man/lispref/mule.texi Mon Aug 13 11:15:00 2007 +0200 +++ b/man/lispref/mule.texi Mon Aug 13 11:16:07 2007 +0200 @@ -6,13 +6,13 @@ @node MULE, Tips, Internationalization, top @chapter MULE -@dfn{MULE} is the name originally given to the version of GNU Emacs + @dfn{MULE} is the name originally given to the version of GNU Emacs extended for multi-lingual (and in particular Asian-language) support. -``MULE'' is short for ``MUlti-Lingual Emacs''. It was originally called -Nemacs (``Nihon Emacs'' where ``Nihon'' is the Japanese word for -``Japan''), when it only provided support for Japanese. XEmacs -refers to its multi-lingual support as @dfn{MULE support} since it -is based on @dfn{MULE}. +``MULE'' is short for ``MUlti-Lingual Emacs''. It is an extension and +complete rewrite of Nemacs (``Nihon Emacs'' where ``Nihon'' is the +Japanese word for ``Japan''), which only provided support for Japanese. +XEmacs refers to its multi-lingual support as @dfn{MULE support} since +it is based on @dfn{MULE}. @menu * Internationalization Terminology:: @@ -20,25 +20,40 @@ * Charsets:: Sets of related characters. * MULE Characters:: Working with characters in XEmacs/MULE. * Composite Characters:: Making new characters by overstriking other ones. -* ISO 2022:: An international standard for charsets and encodings. * Coding Systems:: Ways of representing a string of chars using integers. * CCL:: A special language for writing fast converters. * Category Tables:: Subdividing charsets into groups. @end menu -@node Internationalization Terminology +@node Internationalization Terminology, Charsets, , MULE @section Internationalization Terminology - In internationalization terminology, a string of text is divided up + In internationalization terminology, a string of text is divided up into @dfn{characters}, which are the printable units that make up the text. A single character is (for example) a capital @samp{A}, the -number @samp{2}, a Katakana character, a Kanji ideograph (an -@dfn{ideograph} is a ``picture'' character, such as is used in Japanese -Kanji, Chinese Hanzi, and Korean Hangul; typically there are thousands -of such ideographs in each language), etc. The basic property of a -character is its shape. Note that the same character may be drawn by -two different people (or in two different fonts) in slightly different -ways, although the basic shape will be the same. +number @samp{2}, a Katakana character, a Hangul character, a Kanji +ideograph (an @dfn{ideograph} is a ``picture'' character, such as is +used in Japanese Kanji, Chinese Hanzi, and Korean Hanja; typically there +are thousands of such ideographs in each language), etc. The basic +property of a character is that it is the smallest unit of text with +semantic significance in text processing. + + Human beings normally process text visually, so to a first approximation +a character may be identified with its shape. Note that the same +character may be drawn by two different people (or in two different +fonts) in slightly different ways, although the "basic shape" will be the +same. But consider the works of Scott Kim; human beings can recognize +hugely variant shapes as the "same" character. Sometimes, especially +where characters are extremely complicated to write, completely +different shapes may be defined as the "same" character in national +standards. The Taiwanese variant of Hanzi is generally the most +complicated; over the centuries, the Japanese, Koreans, and the People's +Republic of China have adopted simplifications of the shape, but the +line of descent from the original shape is recorded, and the meanings +and pronunciation of different forms of the same character are +considered to be identical within each language. (Of course, it may +take a specialist to recognize the related form; the point is that the +relations are standardized, despite the differing shapes.) In some cases, the differences will be significant enough that it is actually possible to identify two or more distinct shapes that both @@ -57,87 +72,122 @@ Note that @dfn{character} and @dfn{glyph} are used differently here than elsewhere in XEmacs. - A @dfn{character set} is simply a set of related characters. ASCII, + A @dfn{character set} is essentially a set of related characters. ASCII, for example, is a set of 94 characters (or 128, if you count non-printing characters). Other character sets are ISO8859-1 (ASCII plus various accented characters and other international symbols), -JISX0201 (ASCII, more or less, plus half-width Katakana), JISX0208 -(Japanese Kanji), JISX0212 (a second set of less-used Japanese Kanji), +JIS X 0201 (ASCII, more or less, plus half-width Katakana), JIS X 0208 +(Japanese Kanji), JIS X 0212 (a second set of less-used Japanese Kanji), GB2312 (Mainland Chinese Hanzi), etc. - Every character set has one or more @dfn{orderings}, which can be -viewed as a way of assigning a number (or set of numbers) to each -character in the set. For most character sets, there is a standard -ordering, and in fact all of the character sets mentioned above define a -particular ordering. ASCII, for example, places letters in their -``natural'' order, puts uppercase letters before lowercase letters, -numbers before letters, etc. Note that for many of the Asian character -sets, there is no natural ordering of the characters. The actual -orderings are based on one or more salient characteristic, of which -there are many to choose from---e.g. number of strokes, common -radicals, phonetic ordering, etc. + The definition of a character set will implicitly or explicitly give +it an @dfn{ordering}, a way of assigning a number to each character in +the set. For many character sets, there is a natural ordering, for +example the ``ABC'' ordering of the Roman letters. But it is not clear +whether digits should come before or after the letters, and in fact +different European languages treat the ordering of accented characters +differently. It is useful to use the natural order where available, of +course. The number assigned to any particular character is called the +character's @dfn{code point}. (Within a given character set, each +character has a unique code point. Thus the word "set" is ill-chosen; +different orderings of the same characters are different character sets. +Identifying characters is simple enough for alphabetic character sets, +but the difference in ordering can cause great headaches when the same +thousands of characters are used by different cultures as in the Hanzi.) - The set of numbers assigned to any particular character are called -the character's @dfn{position codes}. The number of position codes -required to index a particular character in a character set is called -the @dfn{dimension} of the character set. ASCII, being a relatively -small character set, is of dimension one, and each character in the -set is indexed using a single position code, in the range 0 through -127 (if non-printing characters are included) or 33 through 126 -(if only the printing characters are considered). JISX0208, i.e. -Japanese Kanji, has thousands of characters, and is of dimension two -- -every character is indexed by two position codes, each in the range -33 through 126. (Note that the choice of the range here is somewhat -arbitrary. Although a character set such as JISX0208 defines an -@emph{ordering} of all its characters, it does not define the actual -mapping between numbers and characters. You could just as easily -index the characters in JISX0208 using numbers in the range 0 through -93, 1 through 94, 2 through 95, etc. The reason for the actual range -chosen is so that the position codes match up with the actual values -used in the common encodings.) + A code point may be broken into a number of @dfn{position codes}. The +number of position codes required to index a particular character in a +character set is called the @dfn{dimension} of the character set. For +practical purposes, a position code may be thought of as a byte-sized +index. The printing characters of ASCII, being a relatively small +character set, is of dimension one, and each character in the set is +indexed using a single position code, in the range 1 through 94. Use of +this unusual range, rather than the familiar 33 through 126, is an +intentional abstraction; to understand the programming issues you must +break the equation between character sets and encodings. + + JIS X 0208, i.e. Japanese Kanji, has thousands of characters, and is +of dimension two -- every character is indexed by two position codes, +each in the range 1 through 94. (This number ``94'' is not a +coincidence; we shall see that the JIS position codes were chosen so +that JIS kanji could be encoded without using codes that in ASCII are +associated with device control functions.) Note that the choice of the +range here is somewhat arbitrary. You could just as easily index the +printing characters in ASCII using numbers in the range 0 through 93, 2 +through 95, 3 through 96, etc. In fact, the standardized +@emph{encoding} for the ASCII @emph{character set} uses the range 33 +through 126. An @dfn{encoding} is a way of numerically representing characters from one or more character sets into a stream of like-sized numerical values called @dfn{words}; typically these are 8-bit, 16-bit, or 32-bit quantities. If an encoding encompasses only one character set, then the position codes for the characters in that character set could be used -directly. (This is the case with ASCII, and as a result, most people do -not understand the difference between a character set and an encoding.) -This is not possible, however, if more than one character set is to be -used in the encoding. For example, printed Japanese text typically -requires characters from multiple character sets---ASCII, JISX0208, and -JISX0212, to be specific. Each of these is indexed using one or more -position codes in the range 33 through 126, so the position codes could -not be used directly or there would be no way to tell which character -was meant. Different Japanese encodings handle this differently---JIS -uses special escape characters to denote different character sets; EUC -sets the high bit of the position codes for JISX0208 and JISX0212, and -puts a special extra byte before each JISX0212 character; etc. (JIS, -EUC, and most of the other encodings you will encounter are 7-bit or -8-bit encodings. There is one common 16-bit encoding, which is Unicode; -this strives to represent all the world's characters in a single large -character set. 32-bit encodings are generally used internally in -programs to simplify the code that manipulates them; however, they are -not much used externally because they are not very space-efficient.) +directly. (This is the case with the trivial cipher used by children, +assigning 1 to `A', 2 to `B', and so on.) However, even with ASCII, +other considerations intrude. For example, why are the upper- and +lowercase alphabets separated by 8 characters? Why do the digits start +with `0' being assigned the code 48? In both cases because semantically +interesting operations (case conversion and numerical value extraction) +become convenient masking operations. Other artificial aspects (the +control characters being assigned to codes 0--31 and 127) are historical +accidents. (The use of 127 for @samp{DEL} is an artifact of the "punch +once" nature of paper tape, for example.) + + Naive use of the position code is not possible, however, if more than +one character set is to be used in the encoding. For example, printed +Japanese text typically requires characters from multiple character sets +-- ASCII, JIS X 0208, and JIS X 0212, to be specific. Each of these is +indexed using one or more position codes in the range 1 through 94, so +the position codes could not be used directly or there would be no way +to tell which character was meant. Different Japanese encodings handle +this differently -- JIS uses special escape characters to denote +different character sets; EUC sets the high bit of the position codes +for JIS X 0208 and JIS X 0212, and puts a special extra byte before each +JIS X 0212 character; etc. (JIS, EUC, and most of the other encodings +you will encounter in files are 7-bit or 8-bit encodings. There is one +common 16-bit encoding, which is Unicode; this strives to represent all +the world's characters in a single large character set. 32-bit +encodings are often used internally in programs, such as XEmacs with +MULE support, to simplify the code that manipulates them; however, they +are not used externally because they are not very space-efficient.) + + A general method of handling text using multiple character sets +(whether for multilingual text, or simply text in an extremely +complicated single language like Japanese) is defined in the +international standard ISO 2022. ISO 2022 will be discussed in more +detail later (@pxref{ISO 2022}), but for now suffice it to say that text +needs control functions (at least spacing), and if escape sequences are +to be used, an escape sequence introducer. It was decided to make all +text streams compatible with ASCII in the sense that the codes 0--31 +(and 128-159) would always be control codes, never graphic characters, +and where defined by the character set the @samp{SPC} character would be +assigned code 32, and @samp{DEL} would be assigned 127. Thus there are +94 code points remaining if 7 bits are used. This is the reason that +most character sets are defined using position codes in the range 1 +through 94. Then ISO 2022 compatible encodings are produced by shifting +the position codes 1 to 94 into character codes 33 to 126, or (if 8 bit +codes are available) into character codes 161 to 254. Encodings are classified as either @dfn{modal} or @dfn{non-modal}. In -a @dfn{modal encoding}, there are multiple states that the encoding can be in, -and the interpretation of the values in the stream depends on the +a @dfn{modal encoding}, there are multiple states that the encoding can +be in, and the interpretation of the values in the stream depends on the current global state of the encoding. Special values in the encoding, called @dfn{escape sequences}, are used to change the global state. JIS, for example, is a modal encoding. The bytes @samp{ESC $ B} indicate that, from then on, bytes are to be interpreted as position -codes for JISX0208, rather than as ASCII. This effect is cancelled +codes for JIS X 0208, rather than as ASCII. This effect is cancelled using the bytes @samp{ESC ( B}, which mean ``switch from whatever the -current state is to ASCII''. To switch to JISX0212, the escape sequence -@samp{ESC $ ( D}. (Note that here, as is common, the escape sequences do -in fact begin with @samp{ESC}. This is not necessarily the case, -however.) +current state is to ASCII''. To switch to JIS X 0212, the escape +sequence @samp{ESC $ ( D}. (Note that here, as is common, the escape +sequences do in fact begin with @samp{ESC}. This is not necessarily the +case, however. Some encodings use control characters called "locking +shifts" (effect persists until cancelled) to switch character sets.) -A @dfn{non-modal encoding} has no global state that extends past the + A @dfn{non-modal encoding} has no global state that extends past the character currently being interpreted. EUC, for example, is a -non-modal encoding. Characters in JISX0208 are encoded by setting -the high bit of the position codes, and characters in JISX0212 are +non-modal encoding. Characters in JIS X 0208 are encoded by setting +the high bit of the position codes, and characters in JIS X 0212 are encoded by doing the same but also prefixing the character with the byte 0x8F. @@ -148,10 +198,11 @@ if it is not being processed in a sequential manner. In the non-modal EUC encoding, for example, the byte 0x41 always refers to the letter @samp{A}; whereas in JIS, it could either be the letter @samp{A}, or -one of the two position codes in a JISX0208 character, or one of the -two position codes in a JISX0212 character. Determining exactly which +one of the two position codes in a JIS X 0208 character, or one of the +two position codes in a JIS X 0212 character. Determining exactly which one is meant could be difficult and time-consuming if the previous -bytes in the string have not already been processed. +bytes in the string have not already been processed, or impossible if +they are drawn from an external stream that cannot be rewound. Non-modal encodings are further divided into @dfn{fixed-width} and @dfn{variable-width} formats. A fixed-width encoding always uses @@ -163,14 +214,18 @@ an encoding with a larger word size. The advantages of fixed-width encodings should be obvious. The advantages of variable-width encodings are that they are generally more space-efficient and allow -for compatibility with existing 8-bit encodings such as ASCII. +for compatibility with existing 8-bit encodings such as ASCII. (For +example, in Unicode ASCII characters are simply promoted to a 16-bit +representation. That means that every ASCII character contains a +@samp{NUL} byte; evidently all of the standard string manipulation +functions will lose badly in a fixed-width Unicode environment.) - Note that the bytes in an 8-bit encoding are often referred to -as @dfn{octets} rather than simply as bytes. This terminology -dates back to the days before 8-bit bytes were universal, when -some computers had 9-bit bytes, others had 10-bit bytes, etc. + The bytes in an 8-bit encoding are often referred to as @dfn{octets} +rather than simply as bytes. This terminology dates back to the days +before 8-bit bytes were universal, when some computers had 9-bit bytes, +others had 10-bit bytes, etc. -@node Charsets +@node Charsets, MULE Characters, Internationalization Terminology, MULE @section Charsets A @dfn{charset} in MULE is an object that encapsulates a @@ -189,7 +244,7 @@ * Predefined Charsets:: Predefined charset objects. @end menu -@node Charset Properties +@node Charset Properties, Basic Charset Functions, , Charsets @subsection Charset Properties Charsets have the following properties: @@ -261,7 +316,7 @@ then passed through the CCL program, with the resulting values used to index the font. -This is used, for example, in the Big5 character set (used in Taiwan). + This is used, for example, in the Big5 character set (used in Taiwan). This character set is not ISO-2022-compliant, and its size (94x157) does not fit within the maximum 96x96 size of ISO-2022-compliant character sets. As a result, XEmacs/MULE splits it (in a rather complex fashion, @@ -272,10 +327,11 @@ from a Big5 font. @end table -Most of the above properties can only be changed when the charset -is created. @xref{Charset Property Functions}. + Most of the above properties can only be set when the charset is +initialized, and cannot be changed later. +@xref{Charset Property Functions}. -@node Basic Charset Functions +@node Basic Charset Functions, Charset Property Functions, Charset Properties, Charsets @subsection Basic Charset Functions @defun find-charset charset-or-name @@ -298,7 +354,7 @@ @defun make-charset name doc-string props This function defines a new character set. This function is for use -with Mule support. @var{name} is a symbol, the name by which the +with MULE support. @var{name} is a symbol, the name by which the character set is normally referred. @var{doc-string} is a string describing the character set. @var{props} is a property list, describing the specific nature of the character set. The recognized @@ -326,17 +382,17 @@ displayed in the opposite direction. @end defun -@node Charset Property Functions +@node Charset Property Functions, Predefined Charsets, Basic Charset Functions, Charsets @subsection Charset Property Functions -All of these functions accept either a charset name or charset object. + All of these functions accept either a charset name or charset object. @defun charset-property charset prop This function returns property @var{prop} of @var{charset}. @xref{Charset Properties}. @end defun -Convenience functions are also provided for retrieving individual + Convenience functions are also provided for retrieving individual properties of a charset. @defun charset-name charset @@ -386,7 +442,7 @@ position codes of characters in @var{charset} into font indices. @end defun -The only property of a charset that can currently be set after + The only property of a charset that can currently be set after the charset has been created is the CCL program. @defun set-charset-ccl-program charset ccl-program @@ -394,10 +450,10 @@ @var{ccl-program}. @end defun -@node Predefined Charsets +@node Predefined Charsets, , Charset Property Functions, Charsets @subsection Predefined Charsets -The following charsets are predefined in the C code. + The following charsets are predefined in the C code. @example Name Type Fi Gr Dir Registry @@ -428,7 +484,7 @@ composite 96x96 0 l2r --- @end example -The following charsets are predefined in the Lisp code. + The following charsets are predefined in the Lisp code. @example Name Type Fi Gr Dir Registry @@ -452,11 +508,11 @@ For all of the above charsets, the dimension and number of columns are the same. -Note that ASCII, Control-1, and Composite are handled specially. + Note that ASCII, Control-1, and Composite are handled specially. This is why some of the fields are blank; and some of the filled-in fields (e.g. the type) are not really accurate. -@node MULE Characters +@node MULE Characters, Composite Characters, Charsets, MULE @section MULE Characters @defun make-char charset arg1 &optional arg2 @@ -483,10 +539,10 @@ This function returns a list of the charsets in @var{string}. @end defun -@node Composite Characters +@node Composite Characters, Coding Systems, MULE Characters, MULE @section Composite Characters -Composite characters are not yet completely implemented. + Composite characters are not yet completely implemented. @defun make-composite-char string This function converts a string into a single composite character. The @@ -514,70 +570,259 @@ left as-is. @var{buffer} defaults to the current buffer if omitted. @end defun -@node ISO 2022 -@section ISO 2022 +@node Coding Systems, CCL, Composite Characters, MULE +@section Coding Systems + + A coding system is an object that defines how text containing multiple +character sets is encoded into a stream of (typically 8-bit) bytes. The +coding system is used to decode the stream into a series of characters +(which may be from multiple charsets) when the text is read from a file +or process, and is used to encode the text back into the same format +when it is written out to a file or process. + + For example, many ISO-2022-compliant coding systems (such as Compound +Text, which is used for inter-client data under the X Window System) use +escape sequences to switch between different charsets -- Japanese Kanji, +for example, is invoked with @samp{ESC $ ( B}; ASCII is invoked with +@samp{ESC ( B}; and Cyrillic is invoked with @samp{ESC - L}. See +@code{make-coding-system} for more information. + + Coding systems are normally identified using a symbol, and the symbol is +accepted in place of the actual coding system object whenever a coding +system is called for. (This is similar to how faces and charsets work.) + +@defun coding-system-p object +This function returns non-@code{nil} if @var{object} is a coding system. +@end defun -This section briefly describes the ISO 2022 encoding standard. For more -thorough understanding, please refer to the original document of ISO -2022. +@menu +* Coding System Types:: Classifying coding systems. +* ISO 2022:: An international standard for + charsets and encodings. +* EOL Conversion:: Dealing with different ways of denoting + the end of a line. +* Coding System Properties:: Properties of a coding system. +* Basic Coding System Functions:: Working with coding systems. +* Coding System Property Functions:: Retrieving a coding system's properties. +* Encoding and Decoding Text:: Encoding and decoding text. +* Detection of Textual Encoding:: Determining how text is encoded. +* Big5 and Shift-JIS Functions:: Special functions for these non-standard + encodings. +* Predefined Coding Systems:: Coding systems implemented by MULE. +@end menu -Character sets (@dfn{charsets}) are classified into the following four -categories, according to the number of characters of charset: -94-charset, 96-charset, 94x94-charset, and 96x96-charset. +@node Coding System Types, ISO 2022, , Coding Systems +@subsection Coding System Types + + The coding system type determines the basic algorithm XEmacs will use to +decode or encode a data stream. Character encodings will be converted +to the MULE encoding, escape sequences processed, and newline sequences +converted to XEmacs's internal representation. There are three basic +classes of coding system type: no-conversion, ISO-2022, and special. + + No conversion allows you to look at the file's internal representation. +Since XEmacs is basically a text editor, "no conversion" does convert +newline conventions by default. (Use the 'binary coding-system if this +is not desired.) -@need 1000 -@table @asis -@item 94-charset - ASCII(B), left(J) and right(I) half of JISX0201, ... -@item 96-charset - Latin-1(A), Latin-2(B), Latin-3(C), ... -@item 94x94-charset - GB2312(A), JISX0208(B), KSC5601(C), ... -@item 96x96-charset - none for the moment + ISO 2022 (@pxref{ISO 2022}) is the basic international standard regulating +use of "coded character sets for the exchange of data", ie, text +streams. ISO 2022 contains functions that make it possible to encode +text streams to comply with restrictions of the Internet mail system and +de facto restrictions of most file systems (eg, use of the separator +character in file names). Coding systems which are not ISO 2022 +conformant can be difficult to handle. Perhaps more important, they are +not adaptable to multilingual information interchange, with the obvious +exception of ISO 10646 (Unicode). (Unicode is partially supported by +XEmacs with the addition of the Lisp package ucs-conv.) + + The special class of coding systems includes automatic detection, CCL (a +"little language" embedded as an interpreter, useful for translating +between variants of a single character set), non-ISO-2022-conformant +encodings like Unicode, Shift JIS, and Big5, and MULE internal coding. +(NB: this list is based on XEmacs 21.2. Terminology may vary slightly +for other versions of XEmacs and for GNU Emacs 20.) + +@table @code +@item no-conversion +No conversion, for binary files, and a few special cases of non-ISO-2022 +coding systems where conversion is done by hook functions (usually +implemented in CCL). On output, graphic characters that are not in +ASCII or Latin-1 will be replaced by a @samp{?}. (For a +no-conversion-encoded buffer, these characters will only be present if +you explicitly insert them.) +@item iso2022 +Any ISO-2022-compliant encoding. Among others, this includes JIS (the +Japanese encoding commonly used for e-mail), national variants of EUC +(the standard Unix encoding for Japanese and other languages), and +Compound Text (an encoding used in X11). You can specify more specific +information about the conversion with the @var{flags} argument. +@item ucs-4 +ISO 10646 UCS-4 encoding. A 31-bit fixed-width superset of Unicode. +@item utf-8 +ISO 10646 UTF-8 encoding. A ``file system safe'' transformation format +that can be used with both UCS-4 and Unicode. +@item undecided +Automatic conversion. XEmacs attempts to detect the coding system used +in the file. +@item shift-jis +Shift-JIS (a Japanese encoding commonly used in PC operating systems). +@item big5 +Big5 (the encoding commonly used for Taiwanese). +@item ccl +The conversion is performed using a user-written pseudo-code program. +CCL (Code Conversion Language) is the name of this pseudo-code. For +example, CCL is used to map KOI8-R characters (an encoding for Russian +Cyrillic) to ISO8859-5 (the form used internally by MULE). +@item internal +Write out or read in the raw contents of the memory representing the +buffer's text. This is primarily useful for debugging purposes, and is +only enabled when XEmacs has been compiled with @code{DEBUG_XEMACS} set +(the @samp{--debug} configure option). @strong{Warning}: Reading in a +file using @code{internal} conversion can result in an internal +inconsistency in the memory representing a buffer's text, which will +produce unpredictable results and may cause XEmacs to crash. Under +normal circumstances you should never use @code{internal} conversion. @end table -The character in parentheses after the name of each charset -is the @dfn{final character} @var{F}, which can be regarded as -the identifier of the charset. ECMA allocates @var{F} to each -charset. @var{F} is in the range of 0x30..0x7F, but 0x30..0x3F -are only for private use. +@node ISO 2022, EOL Conversion, Coding System Types, Coding Systems +@section ISO 2022 + + This section briefly describes the ISO 2022 encoding standard. A more +thorough treatment is available in the original document of ISO +2022 as well as various national standards (such as JIS X 0202). -Note: @dfn{ECMA} = European Computer Manufacturers Association + Character sets (@dfn{charsets}) are classified into the following four +categories, according to the number of characters in the charset: +94-charset, 96-charset, 94x94-charset, and 96x96-charset. This means +that although an ISO 2022 coding system may have variable width +characters, each charset used is fixed-width (in contrast to the MULE +character set and UTF-8, for example). + + ISO 2022 provides for switching between character sets via escape +sequences. This switching is somewhat complicated, because ISO 2022 +provides for both legacy applications like Internet mail that accept +only 7 significant bits in some contexts (RFC 822 headers, for example), +and more modern "8-bit clean" applications. It also provides for +compact and transparent representation of languages like Japanese which +mix ASCII and a national script (even outside of computer programs). -There are four @dfn{registers of charsets}, called G0 thru G3. -You can designate (or assign) any charset to one of these -registers. + First, ISO 2022 codified prevailing practice by dividing the code space +into "control" and "graphic" regions. The code points 0x00-0x1F and +0x80-0x9F are reserved for "control characters", while "graphic +characters" must be assigned to code points in the regions 0x20-0x7F and +0xA0-0xFF. The positions 0x20 and 0x7F are special, and under some +circumstances must be assigned the graphic character "ASCII SPACE" and +the control character "ASCII DEL" respectively. -The code space contained within one octet (of size 256) is divided into -4 areas: C0, GL, C1, and GR. GL and GR are the areas into which a -register of charset can be invoked into. + The various regions are given the name C0 (0x00-0x1F), GL (0x20-0x7F), +C1 (0x80-0x9F), and GR (0xA0-0xFF). GL and GR stand for "graphic left" +and "graphic right", respectively, because of the standard method of +displaying graphic character sets in tables with the high byte indexing +columns and the low byte indexing rows. I don't find it very intuitive, +but these are called "registers". + + An ISO 2022-conformant encoding for a graphic character set must use a +fixed number of bytes per character, and the values must fit into a +single register; that is, each byte must range over either 0x20-0x7F, or +0xA0-0xFF. It is not allowed to extend the range of the repertoire of a +character set by using both ranges at the same. This is why a standard +character set such as ISO 8859-1 is actually considered by ISO 2022 to +be an aggregation of two character sets, ASCII and LATIN-1, and why it +is technically incorrect to refer to ISO 8859-1 as "Latin 1". Also, a +single character's bytes must all be drawn from the same register; this +is why Shift JIS (for Japanese) and Big 5 (for Chinese) are not ISO +2022-compatible encodings. -@example -@group - C0: 0x00 - 0x1F - GL: 0x20 - 0x7F - C1: 0x80 - 0x9F - GR: 0xA0 - 0xFF -@end group -@end example + The reason for this restriction becomes clear when you attempt to define +an efficient, robust encoding for a language like Japanese. Like ISO +8859, Japanese encodings are aggregations of several character sets. In +practice, the vast majority of characters are drawn from the "JIS Roman" +character set (a derivative of ASCII; it won't hurt to think of it as +ASCII) and the JIS X 0208 standard "basic Japanese" character set +including not only ideographic characters ("kanji") but syllabic +Japanese characters ("kana"), a wide variety of symbols, and many +alphabetic characters (Roman, Greek, and Cyrillic) as well. Although +JIS X 0208 includes the whole Roman alphabet, as a 2-byte code it is not +suited to programming; thus the inclusion of ASCII in the standard +Japanese encodings. -Usually, in the initial state, G0 is invoked into GL, and G1 -is invoked into GR. + For normal Japanese text such as in newspapers, a broad repertoire of +approximately 3000 characters is used. Evidently this won't fit into +one byte; two must be used. But much of the text processed by Japanese +computers is computer source code, nearly all of which is ASCII. A not +insignificant portion of ordinary text is English (as such or as +borrowed Japanese vocabulary) or other languages which can represented +at least approximately in ASCII, as well. It seems reasonable then to +represent ASCII in one byte, and JIS X 0208 in two. And this is exactly +what the Extended Unix Code for Japanese (EUC-JP) does. ASCII is +invoked to the GL register, and JIS X 0208 is invoked to the GR +register. Thus, each byte can be tested for its character set by +looking at the high bit; if set, it is Japanese, if clear, it is ASCII. +Furthermore, since control characters like newline can never be part of +a graphic character, even in the case of corruption in transmission the +stream will be resynchronized at every line break, on the order of 60-80 +bytes. This coding system requires no escape sequences or special +control codes to represent 99.9% of all Japanese text. -ISO 2022 distinguishes 7-bit environments and 8-bit environments. In -7-bit environments, only C0 and GL are used. + Note carefully the distinction between the character sets (ASCII and JIS +X 0208), the encoding (EUC-JP), and the coding system (ISO 2022). The +JIS X 0208 character set is used in three different encodings for +Japanese, but in ISO-2022-JP it is invoked into GL (so the high bit is +always clear), in EUC-JP it is invoked into GR (setting the high bit in +the process), and in Shift JIS the high bit may be set or reset, and the +significant bits are shifted within the 16-bit character so that the two +main character sets can coexist with a third (the "halfwidth katakana" +of JIS X 0201). As the name implies, the ISO-2022-JP encoding is also a +version of the ISO-2022 coding system. -Charset designation is done by escape sequences of the form: + In order to systematically treat subsidiary character sets (like the +"halfwidth katakana" already mentioned, and the "supplementary kanji" of +JIS X 0212), four further registers are defined: G0, G1, G2, and G3. +Unlike GL and GR, they are not logically distinguished by internal +format. Instead, the process of "invocation" mentioned earlier is +broken into two steps: first, a character set is @dfn{designated} to one +of the registers G0-G3 by use of an @dfn{escape sequence} of the form: @example ESC [@var{I}] @var{I} @var{F} @end example -where @var{I} is an intermediate character in the range 0x20 - 0x2F, and -@var{F} is the final character identifying this charset. +where @var{I} is an intermediate character or characters in the range +0x20 - 0x3F, and @var{F}, from the range 0x30-0x7Fm is the final +character identifying this charset. (Final characters in the range +0x30-0x3F are reserved for private use and will never have a publically +registered meaning.) + + Then that register is @dfn{invoked} to either GL or GR, either +automatically (designations to G0 normally involve invocation to GL as +well), or by use of shifting (affecting only the following character in +the data stream) or locking (effective until the next designation or +locking) control sequences. An encoding conformant to ISO 2022 is +typically defined by designating the initial contents of the G0-G3 +registers, specifying an 7 or 8 bit environment, and specifying whether +further designations will be recognized. + + Some examples of character sets and the registered final characters +@var{F} used to designate them: -The meaning of intermediate characters are: +@need 1000 +@table @asis +@item 94-charset + ASCII (B), left (J) and right (I) half of JIS X 0201, ... +@item 96-charset + Latin-1 (A), Latin-2 (B), Latin-3 (C), ... +@item 94x94-charset + GB2312 (A), JIS X 0208 (B), KSC5601 (C), ... +@item 96x96-charset + none for the moment +@end table + + The meanings of the various characters in these sequences, where not +specified by the ISO 2022 standard (such as the ESC character), are +assigned by @dfn{ECMA}, the European Computer Manufacturers Association. + + The meaning of intermediate characters are: @example @group @@ -586,19 +831,19 @@ ) [0x29]: designate to G1 a 94-charset whose final byte is @var{F}. * [0x2A]: designate to G2 a 94-charset whose final byte is @var{F}. + [0x2B]: designate to G3 a 94-charset whose final byte is @var{F}. + , [0x2C]: designate to G0 a 96-charset whose final byte is @var{F}. - [0x2D]: designate to G1 a 96-charset whose final byte is @var{F}. . [0x2E]: designate to G2 a 96-charset whose final byte is @var{F}. / [0x2F]: designate to G3 a 96-charset whose final byte is @var{F}. @end group @end example -The following rule is not allowed in ISO 2022 but can be used in Mule. + The comma may be used in files read and written only by MULE, as a MULE +extension, but this is illegal in ISO 2022. (The reason is that in ISO +2022 G0 must be a 94-member character set, with 0x20 assigned the value +SPACE, and 0x7F assigned the value DEL.) -@example - , [0x2C]: designate to G0 a 96-charset whose final byte is @var{F}. -@end example - -Here are examples of designations: + Here are examples of designations: @example @group @@ -610,12 +855,15 @@ @end group @end example -To use a charset designated to G2 or G3, and to use a charset designated +(The short forms used to designate GB2312 and JIS X 0208 are for +backwards compatibility; the long forms are preferred.) + + To use a charset designated to G2 or G3, and to use a charset designated to G1 in a 7-bit environment, you must explicitly invoke G1, G2, or G3 into GL. There are two types of invocation, Locking Shift (forever) and Single Shift (one character only). -Locking Shift is done as follows: + Locking Shift is done as follows: @example LS0 or SI (0x0F): invoke G0 into GL @@ -627,7 +875,7 @@ LS3R: invoke G3 into GR @end example -Single Shift is done as follows: + Single Shift is done as follows: @example @group @@ -636,48 +884,53 @@ @end group @end example + The shift functions (such as LS1R and SS3) are represented by control +characters (from C1) in 8 bit environments and by escape sequences in 7 +bit environments. + (#### Ben says: I think the above is slightly incorrect. It appears that SS2 invokes G2 into GR and SS3 invokes G3 into GR, whereas ESC N and ESC O behave as indicated. The above definitions will not parse EUC-encoded text correctly, and it looks like the code in mule-coding.c has similar problems.) -You may realize that there are a lot of ISO-2022-compliant ways of -encoding multilingual text. Now, in the world, there exist many coding -systems such as X11's Compound Text, Japanese JUNET code, and so-called -EUC (Extended UNIX Code); all of these are variants of ISO 2022. + Evidently there are a lot of ISO-2022-compliant ways of encoding +multilingual text. Now, in the world, there exist many coding systems +such as X11's Compound Text, Japanese JUNET code, and so-called EUC +(Extended UNIX Code); all of these are variants of ISO 2022. -In Mule, we characterize ISO 2022 by the following attributes: + In MULE, we characterize a version of ISO 2022 by the following +attributes: @enumerate @item -Initial designation to G0 thru G3. +The character sets initially designated to G0 thru G3. @item -Allow designation of short form for Japanese and Chinese. +Whether short form designations are allowed for Japanese and Chinese. @item -Should we designate ASCII to G0 before control characters? +Whether ASCII should be designated to G0 before control characters. @item -Should we designate ASCII to G0 at the end of line? +Whether ASCII should be designated to G0 at the end of line. @item 7-bit environment or 8-bit environment. @item -Use Locking Shift or not. +Whether Locking Shifts are used or not. @item -Use ASCII or JIS0201-1976-Roman. +Whether to use ASCII or the variant JIS X 0201-1976-Roman. @item -Use JISX0208-1983 or JISX0208-1976. +Whether to use JIS X 0208-1983 or the older version JIS X 0208-1976. @end enumerate (The last two are only for Japanese.) -By specifying these attributes, you can create any variant + By specifying these attributes, you can create any variant of ISO 2022. -Here are several examples: + Here are several examples: @example @group -junet -- Coding system used in JUNET. +ISO-2022-JP -- Coding system used in Japanese email (RFC 1463 #### check). 1. G0 <- ASCII, G1..3 <- never used 2. Yes. 3. Yes. @@ -685,125 +938,50 @@ 5. 7-bit environment 6. No. 7. Use ASCII - 8. Use JISX0208-1983 + 8. Use JIS X 0208-1983 @end group @group -ctext -- Compound Text - 1. G0 <- ASCII, G1 <- Latin-1, G2,3 <- never used +ctext -- X11 Compound Text + 1. G0 <- ASCII, G1 <- Latin-1, G2,3 <- never used. 2. No. 3. No. 4. Yes. - 5. 8-bit environment + 5. 8-bit environment. 6. No. - 7. Use ASCII - 8. Use JISX0208-1983 + 7. Use ASCII. + 8. Use JIS X 0208-1983. @end group @group -euc-china -- Chinese EUC. Although many people call this -as "GB encoding", the name may cause misunderstanding. - 1. G0 <- ASCII, G1 <- GB2312, G2,3 <- never used +euc-china -- Chinese EUC. Often called the "GB encoding", but that is +technically incorrect. + 1. G0 <- ASCII, G1 <- GB 2312, G2,3 <- never used. 2. No. 3. Yes. 4. Yes. - 5. 8-bit environment + 5. 8-bit environment. 6. No. - 7. Use ASCII - 8. Use JISX0208-1983 + 7. Use ASCII. + 8. Use JIS X 0208-1983. @end group @group -korean-mail -- Coding system used in Korean network. - 1. G0 <- ASCII, G1 <- KSC5601, G2,3 <- never used +ISO-2022-KR -- Coding system used in Korean email. + 1. G0 <- ASCII, G1 <- KSC 5601, G2,3 <- never used. 2. No. 3. Yes. 4. Yes. - 5. 7-bit environment + 5. 7-bit environment. 6. Yes. - 7. No. - 8. No. + 7. Use ASCII. + 8. Use JIS X 0208-1983. @end group @end example -Mule creates all these coding systems by default. - -@node Coding Systems -@section Coding Systems - -A coding system is an object that defines how text containing multiple -character sets is encoded into a stream of (typically 8-bit) bytes. The -coding system is used to decode the stream into a series of characters -(which may be from multiple charsets) when the text is read from a file -or process, and is used to encode the text back into the same format -when it is written out to a file or process. - -For example, many ISO-2022-compliant coding systems (such as Compound -Text, which is used for inter-client data under the X Window System) use -escape sequences to switch between different charsets---Japanese Kanji, -for example, is invoked with @samp{ESC $ ( B}; ASCII is invoked with -@samp{ESC ( B}; and Cyrillic is invoked with @samp{ESC - L}. See -@code{make-coding-system} for more information. - -Coding systems are normally identified using a symbol, and the symbol is -accepted in place of the actual coding system object whenever a coding -system is called for. (This is similar to how faces and charsets work.) - -@defun coding-system-p object -This function returns non-@code{nil} if @var{object} is a coding system. -@end defun +MULE creates all of these coding systems by default. -@menu -* Coding System Types:: Classifying coding systems. -* EOL Conversion:: Dealing with different ways of denoting - the end of a line. -* Coding System Properties:: Properties of a coding system. -* Basic Coding System Functions:: Working with coding systems. -* Coding System Property Functions:: Retrieving a coding system's properties. -* Encoding and Decoding Text:: Encoding and decoding text. -* Detection of Textual Encoding:: Determining how text is encoded. -* Big5 and Shift-JIS Functions:: Special functions for these non-standard - encodings. -@end menu - -@node Coding System Types -@subsection Coding System Types - -@table @code -@item nil -@itemx autodetect -Automatic conversion. XEmacs attempts to detect the coding system used -in the file. -@item no-conversion -No conversion. Use this for binary files and such. On output, graphic -characters that are not in ASCII or Latin-1 will be replaced by a -@samp{?}. (For a no-conversion-encoded buffer, these characters will -only be present if you explicitly insert them.) -@item shift-jis -Shift-JIS (a Japanese encoding commonly used in PC operating systems). -@item iso2022 -Any ISO-2022-compliant encoding. Among other things, this includes JIS -(the Japanese encoding commonly used for e-mail), national variants of -EUC (the standard Unix encoding for Japanese and other languages), and -Compound Text (an encoding used in X11). You can specify more specific -information about the conversion with the @var{flags} argument. -@item big5 -Big5 (the encoding commonly used for Taiwanese). -@item ccl -The conversion is performed using a user-written pseudo-code program. -CCL (Code Conversion Language) is the name of this pseudo-code. -@item internal -Write out or read in the raw contents of the memory representing the -buffer's text. This is primarily useful for debugging purposes, and is -only enabled when XEmacs has been compiled with @code{DEBUG_XEMACS} set -(the @samp{--debug} configure option). @strong{Warning}: Reading in a -file using @code{internal} conversion can result in an internal -inconsistency in the memory representing a buffer's text, which will -produce unpredictable results and may cause XEmacs to crash. Under -normal circumstances you should never use @code{internal} conversion. -@end table - -@node EOL Conversion +@node EOL Conversion, Coding System Properties, ISO 2022, Coding Systems @subsection EOL Conversion @table @code @@ -830,7 +1008,7 @@ internally, and @code{coding-system-property} will return @code{nil}.) @end table -@node Coding System Properties +@node Coding System Properties, Basic Coding System Functions, EOL Conversion, Coding Systems @subsection Coding System Properties @table @code @@ -842,6 +1020,18 @@ End-of-line conversion to be used. It should be one of the types listed in @ref{EOL Conversion}. +@item eol-lf +The coding system which is the same as this one, except that it uses the +Unix line-breaking convention. + +@item eol-crlf +The coding system which is the same as this one, except that it uses the +DOS line-breaking convention. + +@item eol-cr +The coding system which is the same as this one, except that it uses the +Macintosh line-breaking convention. + @item post-read-conversion Function called after a file has been read in, to perform the decoding. Called with two arguments, @var{beg} and @var{end}, denoting a region of @@ -853,7 +1043,7 @@ the current buffer to be encoded. @end table -The following additional properties are recognized if @var{type} is + The following additional properties are recognized if @var{type} is @code{iso2022}: @table @code @@ -931,7 +1121,7 @@ specification is the same as for @code{input-charset-conversion}. @end table -The following additional properties are recognized (and required) if + The following additional properties are recognized (and required) if @var{type} is @code{ccl}: @table @code @@ -942,13 +1132,16 @@ CCL program used for encoding (converting to external format). @end table -@node Basic Coding System Functions + The following properties are used internally: @var{eol-cr}, +@var{eol-crlf}, @var{eol-lf}, and @var{base}. + +@node Basic Coding System Functions, Coding System Property Functions, Coding System Properties, Coding Systems @subsection Basic Coding System Functions @defun find-coding-system coding-system-or-name This function retrieves the coding system of the given name. -If @var{coding-system-or-name} is a coding-system object, it is simply + If @var{coding-system-or-name} is a coding-system object, it is simply returned. Otherwise, @var{coding-system-or-name} should be a symbol. If there is no such coding system, @code{nil} is returned. Otherwise the associated coding system object is returned. @@ -968,6 +1161,11 @@ This function returns the name of the given coding system. @end defun +@defun coding-system-base coding-system +Returns the base coding system (undecided EOL convention) +coding system. +@end defun + @defun make-coding-system name type &optional doc-string props This function registers symbol @var{name} as a coding system. @@ -992,7 +1190,7 @@ @var{coding-system} with eol type @var{eol-type}. @end defun -@node Coding System Property Functions +@node Coding System Property Functions, Encoding and Decoding Text, Basic Coding System Functions, Coding Systems @subsection Coding System Property Functions @defun coding-system-doc-string coding-system @@ -1007,7 +1205,7 @@ This function returns the @var{prop} property of @var{coding-system}. @end defun -@node Encoding and Decoding Text +@node Encoding and Decoding Text, Detection of Textual Encoding, Coding System Property Functions, Coding Systems @subsection Encoding and Decoding Text @defun decode-coding-region start end coding-system &optional buffer @@ -1028,7 +1226,7 @@ defaults to the current buffer if unspecified. @end defun -@node Detection of Textual Encoding +@node Detection of Textual Encoding, Big5 and Shift-JIS Functions, Encoding and Decoding Text, Coding Systems @subsection Detection of Textual Encoding @defun coding-category-list @@ -1064,20 +1262,20 @@ defaults to the current buffer. @end defun -@node Big5 and Shift-JIS Functions +@node Big5 and Shift-JIS Functions, Predefined Coding Systems, Detection of Textual Encoding, Coding Systems @subsection Big5 and Shift-JIS Functions -These are special functions for working with the non-standard + These are special functions for working with the non-standard Shift-JIS and Big5 encodings. @defun decode-shift-jis-char code -This function decodes a JISX0208 character of Shift-JIS coding-system. +This function decodes a JIS X 0208 character of Shift-JIS coding-system. @var{code} is the character code in Shift-JIS as a cons of type bytes. The corresponding character is returned. @end defun @defun encode-shift-jis-char ch -This function encodes a JISX0208 character @var{ch} to SHIFT-JIS +This function encodes a JIS X 0208 character @var{ch} to SHIFT-JIS coding-system. The corresponding character code in SHIFT-JIS is returned as a cons of two bytes. @end defun @@ -1093,10 +1291,379 @@ coding-system. The corresponding character code in Big5 is returned. @end defun +@node Predefined Coding Systems, , Big5 and Shift-JIS Functions, Coding Systems +@subsection Coding Systems Implemented + + MULE initializes most of the commonly used coding systems at XEmacs's +startup. A few others are initialized only when the relevant language +environment is selected and support libraries are loaded. (NB: The +following list is based on XEmacs 21.2.19, the development branch at the +time of writing. The list may be somewhat different for other +versions. Recent versions of GNU Emacs 20 implement a few more rare +coding systems; work is being done to port these to XEmacs.) + + Unfortunately, there is not a consistent naming convention for character +sets, and for practical purposes coding systems often take their name +from their principal character sets (ASCII, KOI8-R, Shift JIS). Others +take their names from the coding system (ISO-2022-JP, EUC-KR), and a few +from their non-text usages (internal, binary). To provide for this, and +for the fact that many coding systems have several common names, an +aliasing system is provided. Finally, some effort has been made to use +names that are registered as MIME charsets (this is why the name +'shift_jis contains that un-Lisp-y underscore). + + There is a systematic naming convention regarding end-of-line (EOL) +conventions for different systems. A coding system whose name ends in +"-unix" forces the assumptions that lines are broken by newlines (0x0A). +A coding system whose name ends in "-mac" forces the assumptions that +lines are broken by ASCII CRs (0x0D). A coding system whose name ends +in "-dos" forces the assumptions that lines are broken by CRLF sequences +(0x0D 0x0A). These subsidiary coding systems are automatically derived +from a base coding system. Use of the base coding system implies +autodetection of the text file convention. (The fact that the -unix, +-mac, and -dos are derived from a base system results in them showing up +as "aliases" in `list-coding-systems'.) These subsidiaries have a +consistent modeline indicator as well. "-dos" coding systems have ":T" +appended to their modeline indicator, while "-mac" coding systems have +":t" appended (eg, "ISO8:t" for iso-2022-8-mac). + + In the following table, each coding system is given with its mode line +indicator in parentheses. Non-textual coding systems are listed first, +followed by textual coding systems and their aliases. (The coding system +subsidiary modeline indicators ":T" and ":t" will be omitted from the +table of coding systems.) + + ### SJT 1999-08-23 Maybe should order these by language? Definitely +need language usage for the ISO-8859 family. + + Note that although true coding system aliases have been implemented for +XEmacs 21.2, the coding system initialization has not yet been converted +as of 21.2.19. So coding systems described as aliases have the same +properties as the aliased coding system, but will not be equal as Lisp +objects. + +@table @code + +@item automatic-conversion +@itemx undecided +@itemx undecided-dos +@itemx undecided-mac +@itemx undecided-unix + +Modeline indicator: @code{Auto}. A type @code{undecided} coding system. +Attempts to determine an appropriate coding system from file contents or +the environment. + +@item raw-text +@itemx no-conversion +@itemx raw-text-dos +@itemx raw-text-mac +@itemx raw-text-unix +@itemx no-conversion-dos +@itemx no-conversion-mac +@itemx no-conversion-unix + +Modeline indicator: @code{Raw}. A type @code{no-conversion} coding system, +which converts only line-break-codes. An implementation quirk means +that this coding system is also used for ISO8859-1. + +@item binary +Modeline indicator: @code{Binary}. A type @code{no-conversion} coding +system which does no character coding or EOL conversions. An alias for +@code{raw-text-unix}. + +@item alternativnyj +@itemx alternativnyj-dos +@itemx alternativnyj-mac +@itemx alternativnyj-unix + +Modeline indicator: @code{Cy.Alt}. A type @code{ccl} coding system used for +Alternativnyj, an encoding of the Cyrillic alphabet. + +@item big5 +@itemx big5-dos +@itemx big5-mac +@itemx big5-unix + +Modeline indicator: @code{Zh/Big5}. A type @code{big5} coding system used for +BIG5, the most common encoding of traditional Chinese as used in Taiwan. + +@item cn-gb-2312 +@itemx cn-gb-2312-dos +@itemx cn-gb-2312-mac +@itemx cn-gb-2312-unix + +Modeline indicator: @code{Zh-GB/EUC}. A type @code{iso2022} coding system used +for simplified Chinese (as used in the People's Republic of China), with +the @code{ascii} (G0), @code{chinese-gb2312} (G1), and @code{sisheng} +(G2) character sets initially designated. Chinese EUC (Extended Unix +Code). + +@item ctext-hebrew +@itemx ctext-hebrew-dos +@itemx ctext-hebrew-mac +@itemx ctext-hebrew-unix + +Modeline indicator: @code{CText/Hbrw}. A type @code{iso2022} coding system +with the @code{ascii} (G0) and @code{hebrew-iso8859-8} (G1) character +sets initially designated for Hebrew. + +@item ctext +@itemx ctext-dos +@itemx ctext-mac +@itemx ctext-unix + +Modeline indicator: @code{CText}. A type @code{iso2022} 8-bit coding system +with the @code{ascii} (G0) and @code{latin-iso8859-1} (G1) character +sets initially designated. X11 Compound Text Encoding. Often +mistakenly recognized instead of EUC encodings; usual cause is +inappropriate setting of @code{coding-priority-list}. + +@item escape-quoted + +Modeline indicator: @code{ESC/Quot}. A type @code{iso2022} 8-bit coding +system with the @code{ascii} (G0) and @code{latin-iso8859-1} (G1) +character sets initially designated and escape quoting. Unix EOL +conversion (ie, no conversion). It is used for .ELC files. + +@item euc-jp +@itemx euc-jp-dos +@itemx euc-jp-mac +@itemx euc-jp-unix + +Modeline indicator: @code{Ja/EUC}. A type @code{iso2022} 8-bit coding system +with @code{ascii} (G0), @code{japanese-jisx0208} (G1), +@code{katakana-jisx0201} (G2), and @code{japanese-jisx0212} (G3) +initially designated. Japanese EUC (Extended Unix Code). + +@item euc-kr +@itemx euc-kr-dos +@itemx euc-kr-mac +@itemx euc-kr-unix + +Modeline indicator: @code{ko/EUC}. A type @code{iso2022} 8-bit coding system +with @code{ascii} (G0) and @code{korean-ksc5601} (G1) initially +designated. Korean EUC (Extended Unix Code). + +@item hz-gb-2312 +Modeline indicator: @code{Zh-GB/Hz}. A type @code{no-conversion} coding +system with Unix EOL convention (ie, no conversion) using +post-read-decode and pre-write-encode functions to translate the Hz/ZW +coding system used for Chinese. + +@item iso-2022-7bit +@itemx iso-2022-7bit-unix +@itemx iso-2022-7bit-dos +@itemx iso-2022-7bit-mac +@itemx iso-2022-7 + +Modeline indicator: @code{ISO7}. A type @code{iso2022} 7-bit coding system +with @code{ascii} (G0) initially designated. Other character sets must +be explicitly designated to be used. + +@item iso-2022-7bit-ss2 +@itemx iso-2022-7bit-ss2-dos +@itemx iso-2022-7bit-ss2-mac +@itemx iso-2022-7bit-ss2-unix + +Modeline indicator: @code{ISO7/SS}. A type @code{iso2022} 7-bit coding system +with @code{ascii} (G0) initially designated. Other character sets must +be explicitly designated to be used. SS2 is used to invoke a +96-charset, one character at a time. + +@item iso-2022-8 +@itemx iso-2022-8-dos +@itemx iso-2022-8-mac +@itemx iso-2022-8-unix + +Modeline indicator: @code{ISO8}. A type @code{iso2022} 8-bit coding system +with @code{ascii} (G0) and @code{latin-iso8859-1} (G1) initially +designated. Other character sets must be explicitly designated to be +used. No single-shift or locking-shift. + +@item iso-2022-8bit-ss2 +@itemx iso-2022-8bit-ss2-dos +@itemx iso-2022-8bit-ss2-mac +@itemx iso-2022-8bit-ss2-unix + +Modeline indicator: @code{ISO8/SS}. A type @code{iso2022} 8-bit coding system +with @code{ascii} (G0) and @code{latin-iso8859-1} (G1) initially +designated. Other character sets must be explicitly designated to be +used. SS2 is used to invoke a 96-charset, one character at a time. + +@item iso-2022-int-1 +@itemx iso-2022-int-1-dos +@itemx iso-2022-int-1-mac +@itemx iso-2022-int-1-unix + +Modeline indicator: @code{INT-1}. A type @code{iso2022} 7-bit coding system +with @code{ascii} (G0) and @code{korean-ksc5601} (G1) initially +designated. ISO-2022-INT-1. + +@item iso-2022-jp-1978-irv +@itemx iso-2022-jp-1978-irv-dos +@itemx iso-2022-jp-1978-irv-mac +@itemx iso-2022-jp-1978-irv-unix + +Modeline indicator: @code{Ja-78/7bit}. A type @code{iso2022} 7-bit coding +system. For compatibility with old Japanese terminals; if you need to +know, look at the source. + +@item iso-2022-jp +@itemx iso-2022-jp-2 (ISO7/SS) +@itemx iso-2022-jp-dos +@itemx iso-2022-jp-mac +@itemx iso-2022-jp-unix +@itemx iso-2022-jp-2-dos +@itemx iso-2022-jp-2-mac +@itemx iso-2022-jp-2-unix + +Modeline indicator: @code{MULE/7bit}. A type @code{iso2022} 7-bit coding +system with @code{ascii} (G0) initially designated, and complex +specifications to insure backward compatibility with old Japanese +systems. Used for communication with mail and news in Japan. The "-2" +versions also use SS2 to invoke a 96-charset one character at a time. + +@item iso-2022-kr +Modeline indicator: @code{Ko/7bit} A type @code{iso2022} 7-bit coding +system with @code{ascii} (G0) and @code{korean-ksc5601} (G1) initially +designated. Used for e-mail in Korea. + +@item iso-2022-lock +@itemx iso-2022-lock-dos +@itemx iso-2022-lock-mac +@itemx iso-2022-lock-unix + +Modeline indicator: @code{ISO7/Lock}. A type @code{iso2022} 7-bit coding +system with @code{ascii} (G0) initially designated, using Locking-Shift +to invoke a 96-charset. + +@item iso-8859-1 +@itemx iso-8859-1-dos +@itemx iso-8859-1-mac +@itemx iso-8859-1-unix + +Due to implementation, this is not a type @code{iso2022} coding system, +but rather an alias for the @code{raw-text} coding system. + +@item iso-8859-2 +@itemx iso-8859-2-dos +@itemx iso-8859-2-mac +@itemx iso-8859-2-unix + +Modeline indicator: @code{MIME/Ltn-2}. A type @code{iso2022} coding +system with @code{ascii} (G0) and @code{latin-iso8859-2} (G1) initially +invoked. + +@item iso-8859-3 +@itemx iso-8859-3-dos +@itemx iso-8859-3-mac +@itemx iso-8859-3-unix + +Modeline indicator: @code{MIME/Ltn-3}. A type @code{iso2022} coding system +with @code{ascii} (G0) and @code{latin-iso8859-3} (G1) initially +invoked. + +@item iso-8859-4 +@itemx iso-8859-4-dos +@itemx iso-8859-4-mac +@itemx iso-8859-4-unix + +Modeline indicator: @code{MIME/Ltn-4}. A type @code{iso2022} coding system +with @code{ascii} (G0) and @code{latin-iso8859-4} (G1) initially +invoked. + +@item iso-8859-5 +@itemx iso-8859-5-dos +@itemx iso-8859-5-mac +@itemx iso-8859-5-unix + +Modeline indicator: @code{ISO8/Cyr}. A type @code{iso2022} coding system with +@code{ascii} (G0) and @code{cyrillic-iso8859-5} (G1) initially invoked. + +@item iso-8859-7 +@itemx iso-8859-7-dos +@itemx iso-8859-7-mac +@itemx iso-8859-7-unix + +Modeline indicator: @code{Grk}. A type @code{iso2022} coding system with +@code{ascii} (G0) and @code{greek-iso8859-7} (G1) initially invoked. + +@item iso-8859-8 +@itemx iso-8859-8-dos +@itemx iso-8859-8-mac +@itemx iso-8859-8-unix + +Modeline indicator: @code{MIME/Hbrw}. A type @code{iso2022} coding system with +@code{ascii} (G0) and @code{hebrew-iso8859-8} (G1) initially invoked. + +@item iso-8859-9 +@itemx iso-8859-9-dos +@itemx iso-8859-9-mac +@itemx iso-8859-9-unix + +Modeline indicator: @code{MIME/Ltn-5}. A type @code{iso2022} coding system +with @code{ascii} (G0) and @code{latin-iso8859-9} (G1) initially +invoked. + +@item koi8-r +@itemx koi8-r-dos +@itemx koi8-r-mac +@itemx koi8-r-unix + +Modeline indicator: @code{KOI8}. A type @code{ccl} coding-system used for +KOI8-R, an encoding of the Cyrillic alphabet. + +@item shift_jis +@itemx shift_jis-dos +@itemx shift_jis-mac +@itemx shift_jis-unix + +Modeline indicator: @code{Ja/SJIS}. A type @code{shift-jis} coding-system +implementing the Shift-JIS encoding for Japanese. The underscore is to +conform to the MIME charset implementing this encoding. + +@item tis-620 +@itemx tis-620-dos +@itemx tis-620-mac +@itemx tis-620-unix + +Modeline indicator: @code{TIS620}. A type @code{ccl} encoding for Thai. The +external encoding is defined by TIS620, the internal encoding is +peculiar to MULE, and called @code{thai-xtis}. + +@item viqr + +Modeline indicator: @code{VIQR}. A type @code{no-conversion} coding +system with Unix EOL convention (ie, no conversion) using +post-read-decode and pre-write-encode functions to translate the VIQR +coding system for Vietnamese. + +@item viscii +@itemx viscii-dos +@itemx viscii-mac +@itemx viscii-unix + +Modeline indicator: @code{VISCII}. A type @code{ccl} coding-system used +for VISCII 1.1 for Vietnamese. Differs slightly from VSCII; VISCII is +given priority by XEmacs. + +@item vscii +@itemx vscii-dos +@itemx vscii-mac +@itemx vscii-unix + +Modeline indicator: @code{VSCII}. A type @code{ccl} coding-system used +for VSCII 1.1 for Vietnamese. Differs slightly from VISCII, which is +given priority by XEmacs. Use +@code{(prefer-coding-system 'vietnamese-vscii)} to give priority to VSCII. + +@end table + @node CCL, Category Tables, Coding Systems, MULE @section CCL -CCL (Code Conversion Language) is a simple structured programming + CCL (Code Conversion Language) is a simple structured programming language designed for character coding conversions. A CCL program is compiled to CCL code (represented by a vector of integers) and executed by the CCL interpreter embedded in Emacs. The CCL interpreter @@ -1107,7 +1674,7 @@ statements and operations, especially for multiple return values and I/O operations). -CCL is used for code conversion during process I/O and file I/O for + CCL is used for code conversion during process I/O and file I/O for non-ISO2022 coding systems. (It is the only way for a user to specify a code conversion function.) It is also used for calculating the code point of an X11 font from a character code. However, since CCL is @@ -1116,14 +1683,14 @@ three or more arithmetic operations can be calculated faster by CCL than by Emacs Lisp. -@strong{Warning:} The code in @file{src/mule-ccl.c} and + @strong{Warning:} The code in @file{src/mule-ccl.c} and @file{$packages/lisp/mule-base/mule-ccl.el} is the definitive description of CCL's semantics. The previous version of this section contained several typos and obsolete names left from earlier versions of MULE, and many may remain. (I am not an experienced CCL programmer; the few who know CCL well find writing English painful.) -A CCL program transforms an input data stream into an output data + A CCL program transforms an input data stream into an output data stream. The input stream, held in a buffer of constant bytes, is left unchanged. The buffer may be filled by an external input operation, taken from an Emacs buffer, or taken from a Lisp string. The output @@ -1131,7 +1698,7 @@ output operation, inserted into an Emacs buffer, or returned as a Lisp string. -A CCL program is a (Lisp) list containing two or three members. The + A CCL program is a (Lisp) list containing two or three members. The first member is the @dfn{buffer magnification}, which indicates the required minimum size of the output buffer as a multiple of the input buffer. It is followed by the @dfn{main block} which executes while @@ -1139,7 +1706,7 @@ executed when the input is exhausted. Both the main block and the EOF block are CCL blocks. -A @dfn{CCL block} is either a CCL statement or list of CCL statements. + A @dfn{CCL block} is either a CCL statement or list of CCL statements. A @dfn{CCL statement} is either a @dfn{set statement} (either an integer or an @dfn{assignment}, which is a list of a register to receive the assignment, an assignment operator, and an expression) or a @dfn{control @@ -1154,11 +1721,11 @@ * CCL Examples:: The encoding functions for Big5 and KOI-8. @end menu -@node CCL Syntax, CCL Statements, CCL, CCL +@node CCL Syntax, CCL Statements, , CCL @comment Node, Next, Previous, Up @subsection CCL Syntax -The full syntax of a CCL program in BNF notation: + The full syntax of a CCL program in BNF notation: @format CCL_PROGRAM := @@ -1217,13 +1784,13 @@ @comment Node, Next, Previous, Up @subsection CCL Statements -The Emacs Code Conversion Language provides the following statement + The Emacs Code Conversion Language provides the following statement types: @dfn{set}, @dfn{if}, @dfn{branch}, @dfn{loop}, @dfn{repeat}, @dfn{break}, @dfn{read}, @dfn{write}, @dfn{call}, and @dfn{end}. @heading Set statement: -The @dfn{set} statement has three variants with the syntaxes + The @dfn{set} statement has three variants with the syntaxes @samp{(@var{reg} = @var{expression})}, @samp{(@var{reg} @var{assignment_operator} @var{expression})}, and @samp{@var{integer}}. The assignment operator variation of the @@ -1236,10 +1803,10 @@ @heading I/O statements: -The @dfn{read} statement takes one or more registers as arguments. It + The @dfn{read} statement takes one or more registers as arguments. It reads one byte (a C char) from the input into each register in turn. -The @dfn{write} takes several forms. In the form @samp{(write @var{reg} + The @dfn{write} takes several forms. In the form @samp{(write @var{reg} ...)} it takes one or more registers as arguments and writes each in turn to the output. The integer in a register (interpreted as an Emchar) is encoded to multibyte form (ie, Bufbytes) and written to the @@ -1253,13 +1820,13 @@ @heading Conditional statements: -The @dfn{if} statement takes an @var{expression}, a @var{CCL block}, and + The @dfn{if} statement takes an @var{expression}, a @var{CCL block}, and an optional @var{second CCL block} as arguments. If the @var{expression} evaluates to non-zero, the first @var{CCL block} is executed. Otherwise, if there is a @var{second CCL block}, it is executed. -The @dfn{read-if} variant of the @dfn{if} statement takes an + The @dfn{read-if} variant of the @dfn{if} statement takes an @var{expression}, a @var{CCL block}, and an optional @var{second CCL block} as arguments. The @var{expression} must have the form @code{(@var{reg} @var{operator} @var{operand})} (where @var{operand} is @@ -1268,7 +1835,7 @@ then conditionally executes a CCL block just as the @code{if} statement does. -The @dfn{branch} statement takes an @var{expression} and one or more CCL + The @dfn{branch} statement takes an @var{expression} and one or more CCL blocks as arguments. The CCL blocks are treated as a zero-indexed array, and the @code{branch} statement uses the @var{expression} as the index of the CCL block to execute. Null CCL blocks may be used as @@ -1276,7 +1843,7 @@ @code{branch} statement in the containing CCL block. Out-of-range values for the @var{EXPRESSION} are also treated as no-ops. -The @dfn{read-branch} variant of the @dfn{branch} statement takes an + The @dfn{read-branch} variant of the @dfn{branch} statement takes an @var{register}, a @var{CCL block}, and an optional @var{second CCL block} as arguments. The @code{read-branch} statement first reads from the input into the @var{register}, then conditionally executes a CCL @@ -1284,16 +1851,16 @@ @heading Loop control statements: -The @dfn{loop} statement creates a block with an implied jump from the + The @dfn{loop} statement creates a block with an implied jump from the end of the block back to its head. The loop is exited on a @code{break} statement, and continued without executing the tail by a @code{repeat} statement. -The @dfn{break} statement, written @samp{(break)}, terminates the + The @dfn{break} statement, written @samp{(break)}, terminates the current loop and continues with the next statement in the current block. -The @dfn{repeat} statement has three variants, @code{repeat}, + The @dfn{repeat} statement has three variants, @code{repeat}, @code{write-repeat}, and @code{write-read-repeat}. Each continues the current loop from its head, possibly after performing I/O. @code{repeat} takes no arguments and does no I/O before jumping. @@ -1309,11 +1876,11 @@ @heading Other control statements: -The @dfn{call} statement, written @samp{(call @var{ccl-program-name})}, + The @dfn{call} statement, written @samp{(call @var{ccl-program-name})}, executes a CCL program as a subroutine. It does not return a value to the caller, but can modify the register status. -The @dfn{end} statement, written @samp{(end)}, terminates the CCL + The @dfn{end} statement, written @samp{(end)}, terminates the CCL program successfully, and returns to caller (which may be a CCL program). It does not alter the status of the registers. @@ -1321,13 +1888,13 @@ @comment Node, Next, Previous, Up @subsection CCL Expressions -CCL, unlike Lisp, uses infix expressions. The simplest CCL expressions + CCL, unlike Lisp, uses infix expressions. The simplest CCL expressions consist of a single @var{operand}, either a register (one of @code{r0}, ..., @code{r0}) or an integer. Complex expressions are lists of the form @code{( @var{expression} @var{operator} @var{operand} )}. Unlike C, assignments are not expressions. -In the following table, @var{X} is the target resister for a @dfn{set}. + In the following table, @var{X} is the target resister for a @dfn{set}. In subexpressions, this is implicitly @code{r7}. This means that @code{>8}, @code{//}, @code{de-sjis}, and @code{en-sjis} cannot be used freely in subexpressions, since they return parts of their values in @@ -1361,7 +1928,7 @@ @item @tab @tab @tab r[7] = LOWER_BYTE (DE-SJIS (Y, Z)) @end multitable -The CCL operators are as in C, with the addition of CCL_LSH8, CCL_RSH8, + The CCL operators are as in C, with the addition of CCL_LSH8, CCL_RSH8, CCL_DIVMOD, CCL_ENCODE_SJIS, and CCL_DECODE_SJIS. The CCL_ENCODE_SJIS and CCL_DECODE_SJIS treat their first and second bytes as the high and low bytes of a two-byte character code. (SJIS stands for Shift JIS, an @@ -1370,11 +1937,11 @@ Shift JIS. CCL_DECODE_SJIS is its inverse.) It is somewhat odd to represent the SJIS operations in infix form. -@node Calling CCL, CCL Examples, CCL Expressions, CCL +@node Calling CCL, CCL Examples, CCL Expressions, CCL @comment Node, Next, Previous, Up @subsection Calling CCL -CCL programs are called automatically during Emacs buffer I/O when the + CCL programs are called automatically during Emacs buffer I/O when the external representation has a coding system type of @code{shift-jis}, @code{big5}, or @code{ccl}. The program is specified by the coding system (@pxref{Coding Systems}). You can also call CCL programs from @@ -1411,7 +1978,7 @@ registers and IC. Returns the resulting string. @end defun -To call a CCL program from another CCL program, it must first be + To call a CCL program from another CCL program, it must first be registered: @defun register-ccl-program name ccl-program @@ -1421,7 +1988,7 @@ program. @end defun -Information about the processor time used by the CCL interpreter can be + Information about the processor time used by the CCL interpreter can be obtained using these functions: @defun ccl-elapsed-time @@ -1436,11 +2003,11 @@ Resets the CCL interpreter's internal elapsed time registers. @end defun -@node CCL Examples, , Calling CCL, CCL +@node CCL Examples, , Calling CCL, CCL @comment Node, Next, Previous, Up @subsection CCL Examples -This section is not yet written. + This section is not yet written. @node Category Tables, , CCL, MULE @section Category Tables diff -r 9f011ab08d48 -r 2f8bb876ab1d man/lispref/postgresql.texi --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/man/lispref/postgresql.texi Mon Aug 13 11:16:07 2007 +0200 @@ -0,0 +1,1254 @@ +@c -*-texinfo-*- +@c This is part of the XEmacs Lisp Reference Manual. +@c Copyright (C) 2000 Electrotechnical Laboratory, JAPAN +@c Licensed to the Free Software Foundation +@c See the file lispref.texi for copying conditions. +@c Thank you Oscar Figueiredo! This file was shamelessly cloned from +@c ldap.texi. +@setfilename ../../info/postgresql.info +@node PostgreSQL Support, Internationalization, LDAP Support, top +@chapter PostgreSQL Support +@cindex PostgreSQL + +XEmacs can be linked with PostgreSQL libpq run-time support to provide +relational database access from Emacs Lisp code. + +@menu +* Building XEmacs with PostgreSQL support:: +* XEmacs PostgreSQL libpq API:: +* XEmacs PostgreSQL libpq Examples:: +@end menu + +@node Building XEmacs with PostgreSQL support, XEmacs PostgreSQL libpq API, ,PostgreSQL Support +@comment node-name, next, previous, up +@section Building XEmacs with PostgreSQL support + +XEmacs PostgreSQL support requires linking to the PostgreSQL libpq.so +library. Describing how to build and install PostgreSQL is beyond the +scope of this document, see the PostgreSQL manual for details. + +If you have installed XEmacs from one of the binary kits on +(@url{ftp://ftp.xemacs.org/}), or are using an XEmacs binary from a CD +ROM, you should have XEmacs PostgreSQL support by default. If you are +building XEmacs from source on a Linux system with PostgreSQL installed +into the default location, it should be autodetected when you run +configure. If you have installed PostgreSQL into its non-Linux default +location, @file{/usr/local/pgsql}, you must specify +@code{--site-prefixes=/usr/local/pgsql} when you run configure. If +you installed PostgreSQL into another location, use that instead of +@file{/usr/local/pgsql} when specifying @code{--site-prefixes}. + +As of XEmacs 21.2, PostgreSQL versions 6.5.3 and 7.0 are supported. +XEmacs Lisp support for V7.0 is somewhat more extensive than support for +V6.5. In particular, asynchronous queries are supported. + +@node XEmacs PostgreSQL libpq API, XEmacs PostgreSQL libpq Examples, Building XEmacs with PostgreSQL support, PostgreSQL Support +@comment node-name, next, previous, up +@section XEmacs PostgreSQL libpq API + +XEmacs PostgreSQL API is intended to be a policy-free, low-level binding +to libpq. The intent is to provide all the basic functionality and then +let high level Lisp code decide its own policies. + +This documentation assumes that the reader has knowledge of SQL, but +requires no prior knowledge of libpq. + +There are many examples in this manual and some setup will be required. +In order to run most of the following examples, the following code needs +to be executed. In addition to the data is in this table, nearly all of +the examples will assume that the free variable @code{P} refers to this +database connection. The examples in the original edition of this +manual were run against Postgres 7.0beta1. + +@example +(progn + (setq P (pq-connectdb "")) + ;; id is the primary key, shikona is a Japanese word that + ;; means `the professional name of a Sumo wrestler', and + ;; rank is the Sumo rank name. + (pq-exec P (concat "CREATE TABLE xemacs_test" + " (id int, shikona text, rank text);")) + (pq-exec P "COPY xemacs_test FROM stdin;") + (pq-put-line P "1\tMusashimaru\tYokuzuna\n") + (pq-put-line P "2\tDejima\tOozeki\n") + (pq-put-line P "3\tMusoyama\tSekiwake\n") + (pq-put-line P "4\tMiyabiyama\tSekiwake\n") + (pq-put-line P "5\tWakanoyama\tMaegashira\n") + (pq-put-line P "\\.\n") + (pq-end-copy P)) + @result{} nil +@end example + +@menu +* libpq Lisp Variables:: +* libpq Lisp Symbols and DataTypes:: +* Synchronous Interface Functions:: +* Asynchronous Interface Functions:: +* Large Object Support:: +* Other libpq Functions:: +* Unimplemented libpq Functions:: +@end menu + +@node libpq Lisp Variables, libpq Lisp Symbols and DataTypes, XEmacs PostgreSQL libpq API, XEmacs PostgreSQL libpq API +@comment node-name, next, previous, up +@subsection libpq Lisp Variables + +Various Unix environment variables are used by libpq to provide defaults +to the many different parameters. In the XEmacs Lisp API, these +environment variables are bound to Lisp variables to provide more +convenient access to Lisp Code. These variables are passed to the +backend database server during the establishment of a database +connection and when the @code{pq-setenv} call is made. + +@defvar pg:host +Initialized from the @var{PGHOST} environment variable. The default +host to connect to. +@end defvar + +@defvar pg:user +Initialized from the @var{PGUSER} environment variable. The default +database user name. +@end defvar + +@defvar pg:options +Initialized from the @var{PGOPTIONS} environment variable. Default +additional server options. +@end defvar + +@defvar pg:port +Initialized from the @var{PGPORT} environment variable. The default TCP +port to connect to. +@end defvar + +@defvar pg:tty +Initialized from the @var{PGTTY} environment variable. The default +debugging TTY. + +Compatibility note: Debugging TTYs are turned off in the XEmacs Lisp +binding. +@end defvar + +@defvar pg:database +Initialized from the @var{PGDATABASE} environment variable. The default +database to connect to. +@end defvar + +@defvar pg:realm +Initialized from the @var{PGREALM} environment variable. The default +Kerberos realm. +@end defvar + +@defvar pg:client-encoding +Initialized from the @var{PGCLIENTENCODING} environment variable. The +default client encoding. + +Compatibility note: This variable is not present in non-Mule XEmacsen. +This variable is not present in versions of libpq prior to 7.0. +In the current implementation, client encoding is equivalent to the +@code{file-name-coding-system} format. +@end defvar + +@c unused +@defvar pg:authtype +Initialized from the @var{PGAUTHTYPE} environment variable. The default +authentication scheme used. + +Compatibility note: This variable is unused in versions of libpq after +6.5. It is not implemented at all in the XEmacs Lisp binding. +@end defvar + +@defvar pg:geqo +Initialized from the @var{PGGEQO} environment variable. Genetic +optimizer options. +@end defvar + +@defvar pg:cost-index +Initialized from the @var{PGCOSTINDEX} environment variable. Cost index +options. +@end defvar + +@defvar pg:cost-heap +Initialized from the @var{PGCOSTHEAP} environment variable. Cost heap +options. +@end defvar + +@defvar pg:tz +Initialized from the @var{PGTZ} environment variable. Default +timezone. +@end defvar + +@defvar pg:date-style +Initialized from the @var{PGDATESTYLE} environment variable. Default +date style in returned date objects. +@end defvar + +@defvar pg-coding-system +This is a variable controlling which coding system is used to encode +non-ASCII strings sent to the database. + +Compatibility Note: This variable is not present in InfoDock. +@end defvar + +@node libpq Lisp Symbols and DataTypes, Synchronous Interface Functions, libpq Lisp Variables, XEmacs PostgreSQL libpq API +@comment node-name, next, previous, up +@subsection libpq Lisp Symbols and Datatypes + +The following set of symbols are used to represent the intermediate +states involved in the asynchronous interface. + +@defvr {Symbol} pgres::polling-failed +Undocumented. A fatal error has occurred during processing of an +asynchronous operation. +@end defvr + +@defvr {Symbol} pgres::polling-reading +An intermediate status return during an asynchronous operation. It +indicates that one may use @code{select} before polling again. +@end defvr + +@defvr {Symbol} pgres::polling-writing +An intermediate status return during an asynchronous operation. It +indicates that one may use @code{select} before polling again. +@end defvr + +@defvr {Symbol} pgres::polling-ok +An asynchronous operation has successfully completed. +@end defvr + +@defvr {Symbol} pgres::polling-active +An intermediate status return during an asynchronous operation. One can +call the poll function again immediately. +@end defvr + +@defun pq-pgconn conn field +@var{conn} A database connection object. +@var{field} A symbol indicating which field of PGconn to fetch. Possible +values are shown in the following table. +@table @code +@item pq::db +Database name +@item pq::user +Database user name +@item pq::pass +Database user's password +@item pq::host +Hostname database server is running on +@item pq::port +TCP port number used in the connection +@item pq::tty +Debugging TTY + +Compatibility note: Debugging TTYs are not used in the XEmacs Lisp API. +@item pq::options +Additional server options +@item pq::status +Connection status. Possible return values are shown in the following +table. +@table @code +@item pg::connection-ok +The normal, connected status. +@item pg::connection-bad +The connection is not open and the PGconn object needs to be deleted by +@code{pq-finish}. +@item pg::connection-started +An asynchronous connection has been started, but is not yet complete. +@item pg::connection-made +An asynchronous connect has been made, and there is data waiting to be sent. +@item pg::connection-awaiting-response +Awaiting data from the backend during an asynchronous connection. +@item pg::connection-auth-ok +Received authentication, waiting for the backend to start up. +@item pg::connection-setenv +Negotiating environment during an asynchronous connection. +@end table +@item pq::error-message +The last error message that was delivered to this connection. +@item pq::backend-pid +The process ID of the backend database server. +@end table +@end defun + +The @code{PGresult} object is used by libpq to encapsulate the results +of queries. The printed representation takes on four forms. When the +PGresult object contains tuples from an SQL @code{SELECT} it will look +like: + +@example +(setq R (pq-exec P "SELECT * FROM xemacs_test;")) + @result{} # +@end example + +The number in brackets indicates how many rows of data are available. +When the PGresult object is the result of a command query that doesn't +return anything, it will look like: + +@example +(pq-exec P "CREATE TABLE a_new_table (i int);") + @result{} # +@end example + +When either the query is a command-type query that can affect a number +of different rows, but doesn't return any of them it will look like: + +@example +(progn + (pq-exec P "INSERT INTO a_new_table VALUES (1);") + (pq-exec P "INSERT INTO a_new_table VALUES (2);") + (pq-exec P "INSERT INTO a_new_table VALUES (3);") + (setq R (pq-exec P "DELETE FROM a_new_table;"))) + @result{} # +@end example + +Lastly, when the underlying PGresult object has been deallocated +directly by @code{pq-clear} the printed representation will look like: + +@example +(progn + (setq R (pq-exec P "SELECT * FROM xemacs_test;")) + (pq-clear R) + R) + @result{} # +@end example + +The following set of functions are accessors to various data in the PGresult +object. + +@defun pq-result-status result +Return status of a query result. +@var{result} is a PGresult object. The return value is one of the +symbols in the following table. +@table @code +@item pgres::empty-query +A query contained no text. This is usually the result of a recoverable +error, or a minor programming error. +@item pgres::command-ok +A query command that doesn't return anything was executed properly by +the backend. +@item pgres::tuples-ok +A query command that returns tuples was executed properly by the +backend. +@item pgres::copy-out +Copy Out data transfer is in progress. +@item pgres::copy-in +Copy In data transfer is in progress. +@item pgres::bad-response +An unexpected response was received from the backend. +@item pgres::nonfatal-error +Undocumented. This value is returned when the libpq function +@code{PQresultStatus} is called with a @var{NULL} pointer. +@item pgres::fatal-error +Undocumented. An error has occurred in processing the query and the +operation was not completed. +@end table +@end defun + +@defun pq-res-status result +Return the query result status as a string, not a symbol. +@var{result} is a PGresult object. + +@example +(setq R (pq-exec P "SELECT * FROM xemacs_test;")) + @result{} # +(pq-res-status R) + @result{} "PGRES_TUPLES_OK" +@end example +@end defun + +@defun pq-result-error-message result +Return an error message generated by the query, if any. +@var{result} is a PGresult object. + +@example +(setq R (pq-exec P "SELECT * FROM xemacs-test;")) + @result{} +(pq-result-error-message R) + @result{} "ERROR: parser: parse error at or near \"-\" +" +@end example +@end defun + +@defun pq-ntuples result +Return the number of tuples in the query result. +@var{result} is a PGresult object. + +@example +(setq R (pq-exec P "SELECT * FROM xemacs_test;")) + @result{} # +(pq-ntuples R) + @result{} 5 +@end example +@end defun + +@defun pq-nfields result +Return the number of fields in each tuple of the query result. +@var{result} is a PGresult object. + +@example +(setq R (pq-exec P "SELECT * FROM xemacs_test;")) + @result{} # +(pq-nfields R) + @result{} 3 +@end example +@end defun + +@defun pq-binary-tuples result +Returns t if binary tuples are present in the results, nil otherwise. +@var{result} is a PGresult object. + +@example +(setq R (pq-exec P "SELECT * FROM xemacs_test;")) + @result{} # +(pq-binary-tuples R) + @result{} nil +@end example +@end defun + +@defun pq-fname result field-index +Returns the name of a specific field. +@var{result} is a PGresult object. +@var{field-index} is the number of the column to select from. The first +column is number zero. + +@example +(let (i l) + (setq R (pq-exec P "SELECT * FROM xemacs_test;")) + (setq i (pq-nfields R)) + (while (>= (decf i) 0) + (push (pq-fname R i) l)) + l) + @result{} ("id" "shikona" "rank") +@end example +@end defun + +@defun pq-fnumber result field-name +Return the field number corresponding to the given field name. +-1 is returned on a bad field name. +@var{result} is a PGresult object. +@var{field-name} is a string representing the field name to find. +@example +(setq R (pq-exec P "SELECT * FROM xemacs_test;")) + @result{} # +(pq-fnumber R "id") + @result{} 0 +(pq-fnumber R "Not a field") + @result{} -1 +@end example +@end defun + +@defun pq-ftype result field-num +Return an integer code representing the data type of the specified column. +@var{result} is a PGresult object. +@var{field-num} is the field number. + +The return value of this function is the Object ID (Oid) in the database +of the type. Further queries need to be made to various system tables +in order to convert this value into something useful. +@end defun + +@defun pq-fmod result field-num +Return the type modifier code associated with a field. Field numbers +start at zero. +@var{result} is a PGresult object. +@var{field-index} selects which field to use. +@end defun + +@defun pq-fsize result field-index +Return size of the given field. +@var{result} is a PGresult object. +@var{field-index} selects which field to use. + +@example +(let (i l) + (setq R (pq-exec P "SELECT * FROM xemacs_test;")) + (setq i (pq-nfields R)) + (while (>= (decf i) 0) + (push (list (pq-ftype R i) (pq-fsize R i)) l)) + l) + @result{} ((23 23) (25 25) (25 25)) +@end example +@end defun + +@defun pq-get-value result tup-num field-num +Retrieve a return value. +@var{result} is a PGresult object. +@var{tup-num} selects which tuple to fetch from. +@var{field-num} selects which field to fetch from. + +Both tuples and fields are numbered from zero. + +@example +(setq R (pq-exec P "SELECT * FROM xemacs_test;")) + @result{} # +(pq-get-value R 0 1) + @result{} "Musashimaru" +(pq-get-value R 1 1) + @result{} "Dejima" +(pq-get-value R 2 1) + @result{} "Musoyama" +@end example +@end defun + +@defun pq-get-length result tup-num field-num +Return the length of a specific value. +@var{result} is a PGresult object. +@var{tup-num} selects which tuple to fetch from. +@var{field-num} selects which field to fetch from. + +@example +(setq R (pq-exec P "SELECT * FROM xemacs_test;")) + @result{} # +(pq-get-length R 0 1) + @result{} 11 +(pq-get-length R 1 1) + @result{} 6 +(pq-get-length R 2 1) + @result{} 8 +@end example +@end defun + +@defun pq-get-is-null result tup-num field-num +Return t if the specific value is the SQL @var{NULL}. +@var{result} is a PGresult object. +@var{tup-num} selects which tuple to fetch from. +@var{field-num} selects which field to fetch from. +@end defun + +@defun pq-cmd-status result +Return a summary string from the query. +@var{result} is a PGresult object. +@example +@comment This example was written on day 3 of the 2000 Haru Basho. +(pq-exec P "INSERT INTO xemacs_test + VALUES (6, 'Wakanohana', 'Yokozuna');") + @result{} # +(pq-cmd-status R) + @result{} "INSERT 542086 1" +(setq R (pq-exec P "UPDATE xemacs_test SET rank='retired' + WHERE shikona='Wakanohana';")) + @result{} # +(pq-cmd-status R) + @result{} "UPDATE 1" +@end example + +Note that the first number returned from an insertion, like in the +example, is an object ID number and will almost certainly vary from +system to system since object ID numbers in Postgres must be unique +across all databases. +@end defun + +@defun pq-cmd-tuples result +Return the number of tuples if the last command was an INSERT/UPDATE/DELETE. +If the last command was something else, the empty string is returned. +@var{result} is a PGresult object. + +@example +(setq R (pq-exec P "INSERT INTO xemacs_test VALUES + (7, 'Takanohana', 'Yokuzuna');")) + @result{} # +(pq-cmd-tuples R) + @result{} "1" +(setq R (pq-exec P "SELECT * from xemacs_test;")) + @result{} # +(pq-cmd-tuples R) + @result{} "" +(setq R (pq-exec P "DELETE FROM xemacs_test + WHERE shikona LIKE '%hana';")) + @result{} # +(pq-cmd-tuples R) + @result{} "2" +@end example +@end defun + +@defun pq-oid-value result +Return the object id of the insertion if the last command was an INSERT. +0 is returned if the last command was not an insertion. +@var{result} is a PGresult object. + +In the first example, the numbers you will see on your local system will +almost certainly be different, however the second number from the right +in the unprintable PGresult object and the number returned by +@code{pq-oid-value} should match. +@example +(setq R (pq-exec P "INSERT INTO xemacs_test VALUES + (8, 'Terao', 'Maegashira');")) + @result{} # +(pq-oid-value R) + @result{} 542089 +(setq R (pq-exec P "SELECT shikona FROM xemacs_test + WHERE rank='Maegashira';")) + @result{} # +(pq-oid-value R) + @result{} 0 +@end example +@end defun + +@defun pq-make-empty-pgresult conn status +Create an empty pgresult with the given status. +@var{conn} a database connection object +@var{status} a value that can be returned by @code{pq-result-status}. + +The caller is responsible for making sure the return value gets properly +freed. +@end defun + +@node Synchronous Interface Functions, Asynchronous Interface Functions, libpq Lisp Symbols and DataTypes, XEmacs PostgreSQL libpq API +@comment node-name, next, previous, up +@subsection Synchronous Interface Functions + +@defun pq-connectdb conninfo +Establish a (synchronous) database connection. +@var{conninfo} A string of blank separated options. Options are of the +form ``@var{option} = @var{value}''. If @var{value} contains blanks, it +must be single quoted. Blanks around the equal sign are optional. +Multiple option assignments are blank separated. +@example +(pq-connectdb "dbname=japanese port = 25432") + @result{} # +@end example +The printed representation of a database connection object has four +fields. The first field is the hostname where the database server is +running (in this case localhost), the second field is the port number, +the third field is the database user name, and the fourth field is the +name of the database. + +Database connection objects which have been disconnected and will +generate an immediate error if they are used look like: +@example + # +@end example +Bad connections can be reestablished with @code{pq-reset}, or deleted +entirely with @code{pq-finish}. + +A database connection object that has been deleted looks like: +@example +(let ((P1 (pq-connectdb ""))) + (pq-finish P1) + P1) + @result{} # +@end example + +Note that database connection objects are the most heavy weight objects +in XEmacs Lisp at this writing, usually representing as much as several +megabytes of virtual memory on the machine the database server is +running on. It is wisest to explicitly delete them when you are +finished with them, rather than letting garbage collection do it. An +example idiom is: + +@example +(let ((P (pq-connectiondb ""))) + (unwind-protect + (progn + (...)) ; access database here + (pq-finish P))) +@end example + +The following options are available in the options string: +@table @code +@item authtype +Authentication type. Same as @var{PGAUTHTYPE}. This is no longer used. +@item user +Database user name. Same as @var{PGUSER}. +@item password +Database password. +@item dbname +Database name. Same as @var{PGDATABASE} +@item host +Symbolic hostname. Same as @var{PGHOST}. +@item hostaddr +Host address as four octets (eg. like 192.168.1.1). +@item port +TCP port to connect to. Same as @var{PGPORT}. +@item tty +Debugging TTY. Same as @var{PGTTY}. This value is suppressed in the +XEmacs Lisp API. +@item options +Extra backend database options. Same as @var{PGOPTIONS}. +@end table +A database connection object is returned regardless of whether a +connection was established or not. +@end defun + +@defun pq-reset conn +Reestablish database connection. +@var{conn} A database connection object. + +This function reestablishes a database connection using the original +connection parameters. This is useful if something has happened to the +TCP link and it has become broken. +@end defun + +@defun pq-exec conn query +Make a synchronous database query. +@var{conn} A database connection object. +@var{query} A string containing an SQL query. +A PGresult object is returned, which in turn may be queried by its many +accessor functions to retrieve state out of it. If the query string +contains multiple SQL commands, only results from the final command are +returned. + +@example +(setq R (pq-exec P "SELECT * FROM xemacs_test; +DELETE FROM xemacs_test WHERE id=8;")) + @result{} # +@end example +@end defun + +@defun pq-notifies conn +Return the latest async notification that has not yet been handled. +@var{conn} A database connection object. +If there has been a notification, then a list of two elements will be returned. +The first element contains the relation name being notified, the second +element contains the backend process ID number. nil is returned if there +aren't any notifications to process. +@end defun + +@defun PQsetenv conn +Synchronous transfer of environment variables to a backend +@var{conn} A database connection object. + +Environment variable transfer is done as a normal part of database +connection. + +Compatibility note: This function was present but not documented in versions +of libpq prior to 7.0. +@end defun + +@node Asynchronous Interface Functions, Large Object Support, Synchronous Interface Functions, XEmacs PostgreSQL libpq API +@comment node-name, next, previous, up +@subsection Asynchronous Interface Functions + +Making command by command examples is too complex with the asynchronous +interface functions. See the examples section for complete calling +sequences. + +@defun pq-connect-start conninfo +Begin establishing an asynchronous database connection. +@var{conninfo} A string containing the connection options. See the +documentation of @code{pq-connectdb} for a listing of all the available +flags. +@end defun + +@defun pq-connect-poll conn +An intermediate function to be called during an asynchronous database +connection. +@var{conn} A database connection object. +The result codes are documented in a previous section. +@end defun + +@defun pq-is-busy conn +Returns t if @code{pq-get-result} would block waiting for input. +@var{conn} A database connection object. +@end defun + +@defun pq-consume-input conn +Consume any available input from the backend. +@var{conn} A database connection object. + +Nil is returned if anything bad happens. +@end defun + +@defun pq-reset-start conn +Reset connection to the backend asynchronously. +@var{conn} A database connection object. +@end defun + +@defun pq-reset-poll conn +Poll an asynchronous reset for completion +@var{conn} A database connection object. +@end defun + +@defun pq-reset-cancel conn +Attempt to request cancellation of the current operation. +@var{conn} A database connection object. + +The return value is t if the cancel request was successfully +dispatched, nil if not (in which case conn->errorMessage is set). +Note: successful dispatch is no guarantee that there will be any effect at +the backend. The application must read the operation result as usual. +@end defun + +@defun pq-send-query conn query +Submit a query to Postgres and don't wait for the result. +@var{conn} A database connection object. +Returns: t if successfully submitted + nil if error (conn->errorMessage is set) +@end defun + +@defun pq-get-result conn +Retrieve an asynchronous result from a query. +@var{conn} A database connection object. + +NIL is returned when no more query work remains. +@end defun + +@defun pq-set-nonblocking conn arg +Sets the PGconn's database connection non-blocking if the arg is TRUE +or makes it non-blocking if the arg is FALSE, this will not protect +you from PQexec(), you'll only be safe when using the non-blocking API. +@var{conn} A database connection object. +@end defun + +@defun pq-is-nonblocking conn +Return the blocking status of the database connection +@var{conn} A database connection object. +@end defun + +@defun pq-flush conn +Force the write buffer to be written (or at least try) +@var{conn} A database connection object. +@end defun + +@defun PQsetenvStart conn +Start asynchronously passing environment variables to a backend. +@var{conn} A database connection object. + +Compatibility note: this function is only available with libpq-7.0. +@end defun + +@defun PQsetenvPoll conn +Check an asynchronous enviroment variables transfer for completion. +@var{conn} A database connection object. + +Compatibility note: this function is only available with libpq-7.0. +@end defun + +@defun PQsetenvAbort conn +Attempt to terminate an asynchronous environment variables transfer. +@var{conn} A database connection object. + +Compatibility note: this function is only available with libpq-7.0. +@end defun + +@node Large Object Support, Other libpq Functions, Asynchronous Interface Functions, XEmacs PostgreSQL libpq API +@comment node-name, next, previous, up +@subsection Large Object Support + +@defun pq-lo-import conn filename +Import a file as a large object into the database. +@var{conn} a database connection object +@var{filename} filename to import + +On success, the object id is returned. +@end defun + +@defun pq-lo-export conn oid filename +Copy a large object in the database into a file. +@var{conn} a database connection object. +@var{oid} object id number of a large object. +@var{filename} filename to export to. +@end defun + +@node Other libpq Functions, Unimplemented libpq Functions, Large Object Support, XEmacs PostgreSQL libpq API +@comment node-name, next, previous, up +@subsection Other libpq Functions + +@defun pq-finish conn +Destroy a database connection object by calling free on it. +@var{conn} a database connection object + +It is possible to not call this routine because the usual XEmacs garbage +collection mechanism will call the underlying libpq routine whenever it +is releasing stale @code{PGconn} objects. However, this routine is +useful in @code{unwind-protect} clauses to make connections go away +quickly when unrecoverable errors have occurred. + +After calling this routine, the printed representation of the XEmacs +wrapper object will contain the string ``DEAD''. +@end defun + +@defun pq-client-encoding conn +Return the client encoding as an integer code. +@var{conn} a database connection object + +@example +(pq-client-encoding P) + @result{} 1 +@end example + +Compatibility note: This function did not exist prior to libpq-7.0 and +does not exist in a non-Mule XEmacs. +@end defun + +@defun pq-set-client-encoding conn encoding +Set client coding system. +@var{conn} a database connection object +@var{encoding} a string representing the desired coding system + +@example +(pq-set-client-encoding P "EUC_JP") + @result{} 0 +@end example + +The current idiom for ensuring proper coding system conversion is the +following (illustrated for EUC Japanese encoding): +@example +(setq P (pq-connectdb "...")) +(let ((file-name-coding-system 'euc-jp) + (pg-coding-system 'euc-jp)) + (pq-set-client-encoding "EUC_JP") + ...) +(pq-finish P) +@end example +Compatibility note: This function did not exist prior to libpq-7.0 and +does not exist in a non-Mule XEmacs. +@end defun + +@defun pq-env-2-encoding +Return the integer code representing the coding system in @var{PGCLIENTENCODING}. + +@example +(pq-env-2-encoding) + @result{} 0 +@end example +Compatibility note: This function did not exist prior to libpq-7.0 and +does not exist in a non-Mule XEmacs. +@end defun + +@defun pq-clear res +Destroy a query result object by calling free() on it. +@var{res} a query result object + +Note: The memory allocation systems of libpq and XEmacs are different. +The XEmacs representation of a query result object will have both the +XEmacs version and the libpq version freed at the next garbage collection +when the object is no longer being referenced. Calling this function does +not release the XEmacs object, it is still subject to the usual rules for +Lisp objects. The printed representation of the XEmacs object will contain +the string ``DEAD'' after this routine is called indicating that it is no +longer useful for anything. +@end defun + +@defun pq-conn-defaults +Return a data structure that represents the connection defaults. +The data is returned as a list of lists, where each sublist contains +info regarding a single option. +@end defun + +@node Unimplemented libpq Functions, , Other libpq Functions, XEmacs PostgreSQL libpq API +@comment node-name, next, previous, up +@subsection Unimplemented libpq Functions + +@deftypefn {Unimplemented Function} PGconn *PQsetdbLogin (char *pghost, char *pgport, char *pgoptions, char *pgtty, char *dbName, char *login, char *pwd) +Synchronous database connection. +@var{pghost} is the hostname of the PostgreSQL backend to connect to. +@var{pgport} is the TCP port number to use. +@var{pgoptions} specifies other backend options. +@var{pgtty} specifies the debugging tty to use. +@var{dbName} specifies the database name to use. +@var{login} specifies the database user name. +@var{pwd} specifies the database user's password. + +This routine is deprecated as of libpq-7.0, and its functionality can be +replaced by external Lisp code if needed. +@end deftypefn + +@deftypefn {Unimplemented Function} PGconn *PQsetdb (char *pghost, char *pgport, char *pgoptions, char *pgtty, char *dbName) +Synchronous database connection. +@var{pghost} is the hostname of the PostgreSQL backend to connect to. +@var{pgport} is the TCP port number to use. +@var{pgoptions} specifies other backend options. +@var{pgtty} specifies the debugging tty to use. +@var{dbName} specifies the database name to use. + +This routine was deprecated in libpq-6.5. +@end deftypefn + +@deftypefn {Unimplemented Function} int PQsocket (PGconn *conn) +Return socket file descriptor to a backend database process. +@var{conn} database connection object. +@end deftypefn + +@deftypefn {Unimplemented Function} void PQprint (FILE *fout, PGresult *res, PGprintOpt *ps) +Print out the results of a query to a designated C stream. +@var{fout} C stream to print to +@var{res} the query result object to print +@var{ps} the print options structure. + +This routine is deprecated as of libpq-7.0 and cannot be sensibly exported +to XEmacs Lisp. +@end deftypefn + +@deftypefn {Unimplemented Function} void PQdisplayTuples (PGresult *res, FILE *fp, int fillAlign, char *fieldSep, int printHeader, int quiet) +@var{res} query result object to print +@var{fp} C stream to print to +@var{fillAlign} pad the fields with spaces +@var{fieldSep} field separator +@var{printHeader} display headers? +@var{quiet} + +This routine was deprecated in libpq-6.5. +@end deftypefn + +@deftypefn {Unimplemented Function} void PQprintTuples (PGresult *res, FILE *fout, int printAttName, int terseOutput, int width) +@var{res} query result object to print +@var{fout} C stream to print to +@var{printAttName} print attribute names +@var{terseOutput} delimiter bars +@var{width} width of column, if 0, use variable width + +This routine was deprecated in libpq-6.5. +@end deftypefn + +@deftypefn {Unimplemented Function} int PQmblen (char *s, int encoding) +Determine length of a multibyte encoded char at @code{*s}. +@var{s} encoded string +@var{encoding} type of encoding + +Compatibility note: This function was introduced in libpq-7.0. +@end deftypefn + +@deftypefn {Unimplemented Function} void PQtrace (PGconn *conn, FILE *debug_port) +Enable tracing on @code{debug_port}. +@var{conn} database connection object. +@var{debug_port} C output stream to use. +@end deftypefn + +@deftypefn {Unimplemented Function} void PQuntrace (PGconn *conn) +Disable tracing. +@var{conn} database connection object. +@end deftypefn + +@deftypefn {Unimplemented Function} char *PQoidStatus (PGconn *conn) +Return the object id as a string of the last tuple inserted. +@var{conn} database connection object. + +Compatibility note: This function is deprecated in libpq-7.0, however it +is used internally by the XEmacs binding code when linked against versions +prior to 7.0. +@end deftypefn + +@deftypefn {Unimplemented Function} PGresult *PQfn (PGconn *conn, int fnid, int *result_buf, int *result_len, int result_is_int, PQArgBlock *args, int nargs) +``Fast path'' interface --- not really recommended for application use +@var{conn} A database connection object. +@var{fnid} +@var{result_buf} +@var{result_len} +@var{result_is_int} +@var{args} +@var{nargs} +@end deftypefn + +The following set of very low level large object functions aren't +appropriate to be exported to Lisp. + +@deftypefn {Unimplemented Function} int pq-lo-open (PGconn *conn, int lobjid, int mode) +@var{conn} a database connection object. +@var{lobjid} a large object ID. +@var{mode} opening modes. +@end deftypefn + +@deftypefn {Unimplemented Function} int pq-lo-close (PGconn *conn, int fd) +@var{conn} a database connection object. +@var{fd} a large object file descriptor +@end deftypefn + +@deftypefn {Unimplemented Function} int pq-lo-read (PGconn *conn, int fd, char *buf, int len) +@var{conn} a database connection object. +@var{fd} a large object file descriptor. +@var{buf} buffer to read into. +@var{len} size of buffer. +@end deftypefn + +@deftypefn {Unimplemented Function} int pq-lo-write (PGconn *conn, int fd, char *buf, size_t len) +@var{conn} a database connection object. +@var{fd} a large object file descriptor. +@var{buf} buffer to write from. +@var{len} size of buffer. +@end deftypefn + +@deftypefn {Unimplemented Function} int pq-lo-lseek (PGconn *conn, int fd, int offset, int whence) +@var{conn} a database connection object. +@var{fd} a large object file descriptor. +@var{offset} +@var{whence} +@end deftypefn + +@deftypefn {Unimplemented Function} int pq-lo-creat (PGconn *conn, int mode) +@var{conn} a database connection object. +@var{mode} opening modes. +@end deftypefn + +@deftypefn {Unimplemented Function} int pq-lo-tell (PGconn *conn, int fd) +@var{conn} a database connection object. +@var{fd} a large object file descriptor. +@end deftypefn + +@deftypefn {Unimplemented Function} int pq-lo-unlink (PGconn *conn, int lobjid) +@var{conn} a database connection object. +@var{lbojid} a large object ID. +@end deftypefn + +@node XEmacs PostgreSQL libpq Examples, , XEmacs PostgreSQL libpq API, PostgreSQL Support +@comment node-name, next, previous, up +@section XEmacs PostgreSQL libpq Examples + +This is an example of one method of establishing an asynchronous +connection. + +@example +(defun database-poller (P) + (message "%S before poll" (pq-pgconn P 'pq::status)) + (pq-connect-poll P) + (message "%S after poll" (pq-pgconn P 'pq::status)) + (if (eq (pq-pgconn P 'pq::status) 'pg::connection-ok) + (message "Done!") + (add-timeout .1 'database-poller P))) + @result{} database-poller +(progn + (setq P (pq-connect-start "")) + (add-timeout .1 'database-poller P)) + @result{} pg::connection-started before poll + @result{} pg::connection-made after poll + @result{} pg::connection-made before poll + @result{} pg::connection-awaiting-response after poll + @result{} pg::connection-awaiting-response before poll + @result{} pg::connection-auth-ok after poll + @result{} pg::connection-auth-ok before poll + @result{} pg::connection-setenv after poll + @result{} pg::connection-setenv before poll + @result{} pg::connection-ok after poll + @result{} Done! +P + @result{} # +@end example + +Here is an example of one method of doing an asynchronous reset. + +@example +(defun database-poller (P) + (let (PS) + (message "%S before poll" (pq-pgconn P 'pq::status)) + (setq PS (pq-reset-poll P)) + (message "%S after poll [%S]" (pq-pgconn P 'pq::status) PS) + (if (eq (pq-pgconn P 'pq::status) 'pg::connection-ok) + (message "Done!") + (add-timeout .1 'database-poller P)))) + @result{} database-poller +(progn + (pq-reset-start P) + (add-timeout .1 'database-poller P)) + @result{} pg::connection-started before poll + @result{} pg::connection-made after poll [pgres::polling-writing] + @result{} pg::connection-made before poll + @result{} pg::connection-awaiting-response after poll [pgres::polling-reading] + @result{} pg::connection-awaiting-response before poll + @result{} pg::connection-setenv after poll [pgres::polling-reading] + @result{} pg::connection-setenv before poll + @result{} pg::connection-ok after poll [pgres::polling-ok] + @result{} Done! +P + @result{} # +@end example + +And finally, an asynchronous query. + +@example +(defun database-poller (P) + (let (R) + (pq-consume-input P) + (if (pq-is-busy P) + (add-timeout .1 'database-poller P) + (setq R (pq-get-result P)) + (if R + (progn + (push R result-list) + (add-timeout .1 'database-poller P)))))) + @result{} database-poller +(when (pq-send-query P "SELECT * FROM xemacs_test;") + (setq result-list nil) + (add-timeout .1 'database-poller P)) + @result{} 885 +;; wait a moment +result-list + @result{} (#) +@end example + +Here is an example showing how multiple SQL statements in a single query +can have all their results collected. +@example +;; Using the same @code{database-poller} function from the previous example +(when (pq-send-query P "SELECT * FROM xemacs_test; +SELECT * FROM pg_database; +SELECT * FROM pg_user;") + (setq result-list nil) + (add-timeout .1 'database-poller P)) + @result{} 1782 +;; wait a moment +result-list + @result{} (# # #) +@end example + +Here is an example which illustrates collecting all data from a query, +including the field names. + +@example +(defun pg-util-query-results (results) + "Retrieve results of last SQL query into a list structure." + (let ((i (1- (pq-ntuples R))) + j l1 l2) + (while (>= i 0) + (setq j (1- (pq-nfields R))) + (setq l2 nil) + (while (>= j 0) + (push (pq-get-value R i j) l2) + (decf j)) + (push l2 l1) + (decf i)) + (setq j (1- (pq-nfields R))) + (setq l2 nil) + (while (>= j 0) + (push (pq-fname R j) l2) + (decf j)) + (push l2 l1) + l1)) + @result{} pg-util-query-results +(setq R (pq-exec P "SELECT * FROM xemacs_test ORDER BY field2 DESC;")) + @result{} # +(pg-util-query-results R) + @result{} (("f1" "field2") ("a" "97") ("b" "97") ("stuff" "42") ("a string" "12") ("foo" "10") ("string" "2") ("text" "1")) +@end example + +Here is an example of a query that uses a database cursor. + +@example +(let (data R) + (setq R (pq-exec P "BEGIN;")) + (setq R (pq-exec P "DECLARE k_cursor CURSOR FOR SELECT * FROM xemacs_test ORDER BY f1 DESC;")) + + (setq R (pq-exec P "FETCH k_cursor;")) + (while (eq (pq-ntuples R) 1) + (push (list (pq-get-value R 0 0) (pq-get-value R 0 1)) data) + (setq R (pq-exec P "FETCH k_cursor;"))) + (setq R (pq-exec P "END;")) + data) + @result{} (("a" "97") ("a string" "12") ("b" "97") ("foo" "10") ("string" "2") ("stuff" "42") ("text" "1")) +@end example + +Here's another example of cursors, this time with a Lisp macro to +implement a mapping function over a table. + +@example +(defmacro map-db (P table condition callout) + `(let (R) + (pq-exec ,P "BEGIN;") + (pq-exec ,P (concat "DECLARE k_cursor CURSOR FOR SELECT * FROM " + ,table + " " + ,condition + " ORDER BY f1 DESC;")) + (setq R (pq-exec P "FETCH k_cursor;")) + (while (eq (pq-ntuples R) 1) + (,callout (pq-get-value R 0 0) (pq-get-value R 0 1)) + (setq R (pq-exec P "FETCH k_cursor;"))) + (pq-exec P "END;"))) + @result{} map-db +(defun callback (arg1 arg2) + (message "arg1 = %s, arg2 = %s" arg1 arg2)) + @result{} callback +(map-db P "xemacs_test" "WHERE field2 > 10" callback) + @result{} arg1 = stuff, arg2 = 42 + @result{} arg1 = b, arg2 = 97 + @result{} arg1 = a string, arg2 = 12 + @result{} arg1 = a, arg2 = 97 + @result{} # +@end example diff -r 9f011ab08d48 -r 2f8bb876ab1d man/lispref/scrollbars.texi --- a/man/lispref/scrollbars.texi Mon Aug 13 11:15:00 2007 +0200 +++ b/man/lispref/scrollbars.texi Mon Aug 13 11:16:07 2007 +0200 @@ -3,8 +3,8 @@ @c Copyright (C) 1995 Ben Wing. @c See the file lispref.texi for copying conditions. @setfilename ../../info/glyphs.info -@node Scrollbars, Drag and Drop, Toolbar, top -@chapter scrollbars +@node Scrollbars, Drag and Drop, Gutter, top +@chapter Scrollbars @cindex scrollbars Not yet documented. diff -r 9f011ab08d48 -r 2f8bb876ab1d man/lispref/toolbar.texi --- a/man/lispref/toolbar.texi Mon Aug 13 11:15:00 2007 +0200 +++ b/man/lispref/toolbar.texi Mon Aug 13 11:16:07 2007 +0200 @@ -3,7 +3,7 @@ @c Copyright (C) 1995, 1996 Ben Wing. @c See the file lispref.texi for copying conditions. @setfilename ../../info/toolbar.info -@node Toolbar, Scrollbars, Dialog Boxes, top +@node Toolbar, Gutter, Dialog Boxes, top @chapter Toolbar @cindex toolbar diff -r 9f011ab08d48 -r 2f8bb876ab1d man/xemacs-faq.texi --- a/man/xemacs-faq.texi Mon Aug 13 11:15:00 2007 +0200 +++ b/man/xemacs-faq.texi Mon Aug 13 11:16:07 2007 +0200 @@ -1,4 +1,4 @@ -\input texinfo.tex @c -*-texinfo-*- +\input texinfo.tex @c -*- mode: texinfo; coding: iso-2022-8 -*- @c %**start of header @setfilename ../info/xemacs-faq.info @settitle Frequently asked questions about XEmacs @@ -7,7 +7,7 @@ @finalout @titlepage @title XEmacs FAQ -@subtitle Frequently asked questions about XEmacs @* Last Modified: $Date: 2000/01/27 17:11:28 $ +@subtitle Frequently asked questions about XEmacs @* Last Modified: $Date: 2000/03/07 09:19:02 $ @sp 1 @author Tony Rossini @author Ben Wing @@ -403,6 +403,9 @@ * Q6.3.2:: What are the differences between the various MS Windows emacsen? * Q6.3.3:: What is the porting team doing at the moment? +Troubleshooting: +* Q6.4.1:: XEmacs won't start on Windows. (NEW) + Current Events: * Q7.0.1:: What is new in 20.2? @@ -697,9 +700,8 @@ @c @uref{ftp://ftp.cs.cornell.edu/pub/parmet/, Emacs 18.59}. Yes, there is a port of XEmacs 19.14, tested on MacOS 7.6.1 and MacOS -8.5.1 by @uref{pjarvis@@ispchannel.com,Pitts Jarvis}. It's available -at @uref{http://my.ispchannel.com/~pjarvis/xemacs.html, -http://my.ispchannel.com/~pjarvis/xemacs.html}. +8.5.1 by @email{pjarvis@@ispchannel.com, Pitts Jarvis}. It's available +at @uref{http://my.ispchannel.com/~pjarvis/xemacs.html}. @node Q1.0.12, Q1.0.13, Q1.0.11, Introduction @unnumberedsubsec Q1.0.12: Is there a port of XEmacs to NextStep? @@ -3035,8 +3037,8 @@ @end quotation +@node Q3.3.1, Q3.3.2, Q3.2.6, Customization @unnumberedsec 3.3: The Modeline -@node Q3.3.1, Q3.3.2, Q3.2.6, Customization @unnumberedsubsec Q3.3.1: How can I make the modeline go away? @lisp @@ -6103,6 +6105,9 @@ * Q6.3.2:: What are the differences between the various MS Windows emacsen? * Q6.3.3:: What is the porting team doing at the moment? +Troubleshooting: +* Q6.4.1:: XEmacs won't start on Windows. (NEW) + @end menu @node Q6.0.1, Q6.0.2, MS Windows, MS Windows @@ -6433,11 +6438,31 @@ @end itemize -@node Q6.3.3, , Q6.3.2, MS Windows +@node Q6.3.3, Q6.4.1, Q6.3.2, MS Windows @unnumberedsubsec Q6.3.3: What is the porting team doing at the moment? The porting team is continuing work on the MS Windows-specific code. +@node Q6.4.1, ,Q6.3.3, MS Windows +@unnumberedsec 6.3: Troubleshooting +@unnumberedsubsec Q6.4.1 XEmacs won't start on Windows. (NEW) + +XEmacs relies on a process called "dumping" to generate a working +executable. Under MS-Windows this process effectively fixes the memory +addresses of information in the executable. When XEmacs starts up it tries +to reserve these memory addresses so that the dumping process can be +reversed - putting the information back at the correct addresses. +Unfortunately some .dlls (For instance the soundblaster driver) occupy +memory addresses that can conflict with those needed by the dumped XEmacs +executable. In this instance XEmacs will fail to start without any +explanation. Note that this is extremely machine specific. + +Work is being done on fixes for 21.1.* that will make more intelligent +guesses about which memory addresses will be free and so this should +cure the problem for most people. + +21.2 implements "portable dumping" which will eliminate the problem +altogether. @node Current Events, , MS Windows, Top @unnumbered 7 What the Future Holds diff -r 9f011ab08d48 -r 2f8bb876ab1d man/xemacs/custom.texi --- a/man/xemacs/custom.texi Mon Aug 13 11:15:00 2007 +0200 +++ b/man/xemacs/custom.texi Mon Aug 13 11:16:07 2007 +0200 @@ -28,8 +28,10 @@ are parsed. * Init File:: How to write common customizations in the @file{.emacs} file. -* Audible Bell:: Changing how Emacs sounds the bell. -* Faces:: Changing the fonts and colors of a region of text. +* Audible Bell:: Changing how Emacs sounds the bell. +* Faces:: Changing the fonts and colors of a region of text. +* Frame Components:: Controlling the presence and positions of the + menubar, toolbars, and gutters. * X Resources:: X resources controlling various aspects of the behavior of XEmacs. @end menu @@ -2052,6 +2054,16 @@ @var{frame} argument is provided, the face is changed only in that frame; otherwise, it is changed in all frames. +@node Frame Components +@section Frame Components + +You can control the presence and position of most frame components, such +as the menubar, toolbars, and gutters. + +This section is not written yet. Try the Lisp Reference Manual: +@ref{Menubar,,,lispref,}, @ref{Toolbar Intro,,,lispref,}, and +@ref{Gutter Intro,,,lispref,}. + @node X Resources @section X Resources @cindex X resources @@ -2477,7 +2489,7 @@ @subsection Menubar Resources As the menubar is implemented as a widget which is not a part of XEmacs -proper, it does not use the fac" mechanism for specifying fonts and +proper, it does not use the face mechanism for specifying fonts and colors: It uses whatever resources are appropriate to the type of widget which is used to implement it. diff -r 9f011ab08d48 -r 2f8bb876ab1d man/xemacs/frame.texi --- a/man/xemacs/frame.texi Mon Aug 13 11:15:00 2007 +0200 +++ b/man/xemacs/frame.texi Mon Aug 13 11:16:07 2007 +0200 @@ -41,9 +41,21 @@ window}(@pxref{Echo Area}). It is used by XEmacs to exchange information with the user. There is only one echo area per XEmacs frame. @item -If you are running XEmacs under the X Window System, a +If you are running XEmacs under a graphical windowing system, a menu bar at the top of the frame makes shortcuts to several of the commands available (@pxref{Pull-down Menus}). +@item +If you are running XEmacs under a graphical windowing system, a +toolbar at the top of the frame, just under the menu bar if it exists, +provides ``one-touch'' shortcuts to several commands. (Not yet +documented.) +@item +If you are running XEmacs under a graphical windowing system, a +gutter at the top (under the toolbar) and/or bottom of the frame +provides advanced GUI facilities like tab controls for rapid switching +among related windows and progress bars for time-consuming operations +like downloads across the Internet. Gutters are an experimental feature +introduced in XEmacs version 21.2. (Not yet documented.) @end itemize You can subdivide the XEmacs frame into multiple text windows, and use diff -r 9f011ab08d48 -r 2f8bb876ab1d man/xemacs/glossary.texi --- a/man/xemacs/glossary.texi Mon Aug 13 11:15:00 2007 +0200 +++ b/man/xemacs/glossary.texi Mon Aug 13 11:16:07 2007 +0200 @@ -278,7 +278,7 @@ each corresponding to a top-level X window and each looking like the screen on a TTY. Each frame contains one or more non-overlapping Emacs windows (possibly with associated scrollbars, under X), an -echo area, and (under X) possibly a menubar. +echo area, and (under X) possibly a menubar, toolbar, and/or gutter. @item Global Global means `independent of the current environment; in effect diff -r 9f011ab08d48 -r 2f8bb876ab1d man/xemacs/help.texi --- a/man/xemacs/help.texi Mon Aug 13 11:15:00 2007 +0200 +++ b/man/xemacs/help.texi Mon Aug 13 11:16:07 2007 +0200 @@ -1,20 +1,28 @@ @node Help, Mark, M-x, Top @chapter Help +@kindex Help @cindex help @cindex self-documentation +@findex help-command +@kindex C-h +@kindex F1 - Emacs provides extensive help features which revolve around a single + XEmacs provides extensive help features accessible through a single character, @kbd{C-h}. @kbd{C-h} is a prefix key that is used only for -documentation-printing commands. The characters you can type after +documentation-printing commands. The characters that you can type after @kbd{C-h} are called @dfn{help options}. One help option is @kbd{C-h}; -you use it to ask for help about using @kbd{C-h}. +that is how you ask for help about using @kbd{C-h}. To cancel, type +@kbd{C-g}. The function key @key{F1} is equivalent to @kbd{C-h}. - @kbd{C-h C-h} prints a list of the possible help options, and then asks -you to type the desired option. It prompts with the string: +@kindex C-h C-h +@findex help-for-help + @kbd{C-h C-h} (@code{help-for-help}) displays a list of the possible +help options, and then asks you to type the desired option. It prompts +with the string: @smallexample -A, B, C, F, I, K, L, M, N, S, T, V, W, C-c, C-d, C-n, C-w or C-h for more help: +A B C F I K L M N P S T V W C-c C-d C-f C-i C-k C-n C-w; ? for more help: @end smallexample @noindent @@ -23,66 +31,109 @@ Typing a third @kbd{C-h} displays a description of what the options mean; Emacs still waits for you to type an option. To cancel, type @kbd{C-g}. + Most help buffers use a special major mode, Help mode, which lets you +scroll conveniently with @key{SPC} and @key{DEL} or @key{BS}. + +@menu +* Help Summary:: Brief list of all Help commands. +* Key Help:: Asking what a key does in XEmacs. +* Name Help:: Asking about a command, variable or function name. +* Apropos:: Asking what pertains to a given topic. +* Library Keywords:: Finding Lisp libraries by keywords (topics). +* Help Mode:: Special features of Help mode and Help buffers. +* Misc Help:: Other help commands. +@end menu + +@iftex +@node Help Summary, Help Summary, Help, Help +@end iftex +@ifinfo +@node Help Summary, Key Help, Help, Help +@section Help Summary +@end ifinfo + Here is a summary of the defined help commands. @table @kbd -@item C-h a @var{string} @key{RET} -Display a list of commands whose names contain @var{string} -(@code{command-@*apropos}).@refill +@item C-h a @var{regexp} @key{RET} +Display a list of functions and variables whose names match @var{regexp} +(@code{heper-apropos}). +@item C-h A @var{regexp} +Show all commands whose names contain matches for @var{regexp} +(@code{command-apropos}). @item C-h b -Display a table of all key bindings currently in effect, with local bindings of -the current major mode first, followed by all global bindings -(@code{describe-bindings}). +Display a table of all key bindings currently in effect, with local +bindings of the current major mode first, followed by all global +bindings (@code{describe-bindings}). @item C-h c @var{key} -Print the name of the command that @var{key} runs (@code{describe-key-@*briefly}). -@kbd{c} is for `character'. For more extensive information on @var{key}, -use @kbd{C-h k}. -@item C-h f @var{function} @key{RET} +Print the name of the command that @var{key} runs +(@code{describe-key-briefly}). Here @kbd{c} stands for `character'. For more +extensive information on @var{key}, use @kbd{C-h k}. +@item C-h d @var{function} @key{RET} +@itemx C-h f @var{function} @key{RET} Display documentation on the Lisp function named @var{function} -(@code{describe-function}). Note that commands are Lisp functions, so +(@code{describe-function}). Since commands are Lisp functions, a command name may be used. @item C-h i Run Info, the program for browsing documentation files (@code{info}). -The complete Emacs manual is available online in Info. +The complete XEmacs manual is available online in Info. @item C-h k @var{key} -Display name and documentation of the command @var{key} runs (@code{describe-key}). +Display the name and documentation of the command that @var{key} runs +(@code{describe-key}). @item C-h l Display a description of the last 100 characters you typed (@code{view-lossage}). @item C-h m Display documentation of the current major mode (@code{describe-mode}). @item C-h n -Display documentation of Emacs changes, most recent first +@itemx C-h C-n +Display documentation of XEmacs changes, most recent first (@code{view-emacs-news}). @item C-h p +Find packages by topic keyword (@code{finder-by-keyword}). +@item C-h C-p Display a table of all mouse bindings currently in effect now, with -local bindings of the current major mode first, followed by all global bindings -(@code{describe-pointer}). +local bindings of the current major mode first, followed by all global +bindings (@code{describe-pointer}). @item C-h s Display current contents of the syntax table, plus an explanation of -what they mean (@code{describe-syntax}). +what they mean (@code{describe-syntax}). @xref{Syntax}. @item C-h t -Display the Emacs tutorial (@code{help-with-tutorial}). +Enter the XEmacs interactive tutorial (@code{help-with-tutorial}). @item C-h v @var{var} @key{RET} Display the documentation of the Lisp variable @var{var} -(@code{describe-@*variable}). +(@code{describe-variable}). @item C-h w @var{command} @key{RET} Print which keys run the command named @var{command} (@code{where-is}). -@item M-x apropos @var{regexp} -Show all symbols whose names contain matches for @var{regexp}. +@item C-h B @key{RET} +Display info on how to deal with Beta versions of XEmacs +(@code{describe-beta}). +@item C-h C @var{group} @key{RET} +Select customization buffer for @var{group} (@code{customize}). +@item C-h F @key{RET} +View the local copy of the XEmacs FAQ (@code{xemacs-local-faq}). +@item C-h C-i @var{file} @key{RET} +Read Info file @var{file} with Info browser (@code{Info-query}). +@item C-h C-c @var{command} @key{RET} +Look up an Emacs command @var{command} in the Emacs manual in the Info +system (@code{Info-goto-emacs-command-node}). +@item C-h C-f @var{function} @key{RET} +Look up an Emacs Lisp function @var{function} in the Elisp manual in the +Info system (@code{Info-elisp-ref}). @end table +@node Key Help, Name Help, Help Summary, Help @section Documentation for a Key @kindex C-h c @findex describe-key-briefly The most basic @kbd{C-h} options are @kbd{C-h c} -(@code{describe-key-briefly}) and @kbd{C-h k}@*(@code{describe-key}). -@kbd{C-h c @var{key}} prints the name of the command that @var{key} is -bound to in the echo area. For example, @kbd{C-h c C-f} prints +(@code{describe-key-briefly}) and @w{@kbd{C-h k}} (@code{describe-key}). +@kbd{C-h c @var{key}} prints in the echo area the name of the command +that @var{key} is bound to. For example, @kbd{C-h c C-f} prints @samp{forward-char}. Since command names are chosen to describe what -the command does, using this option is a good way to get a somewhat cryptic -description of what @var{key} does.@refill +the commands do, this is a good way to get a very brief description of +what @var{key} does. @kindex C-h k @findex describe-key @@ -93,6 +144,10 @@ selection. This information does not usually fit into the echo area, so a window is used for the display. + @kbd{C-h c} and @kbd{C-h k} work for any sort of key sequences, +including function keys and mouse events. + +@node Name Help, Apropos, Key Help, Help @section Help by Command or Variable Name @kindex C-h f @@ -116,117 +171,238 @@ @code{describe-function} shows its arglist if the @var{function} is not an autoload function. - @kbd{C-h f} is also useful for Lisp functions you are planning to -use in a Lisp program. For example, if you have just written the code -@code{(make-vector len)} and want to make sure you are using -@code{make-vector} properly, type @kbd{C-h f make-vector @key{RET}}. Because -@kbd{C-h f} allows all function names, not just command names, you may find -that some of your favorite abbreviations that work in @kbd{M-x} don't work -in @kbd{C-h f}. An abbreviation may be unique among command names, yet fail -to be unique when other function names are allowed. + @kbd{C-h f} is also useful for Lisp functions that you are planning to +use in a Lisp program. For example, if you have just written the +expression @code{(make-vector len)} and want to make sure you are using +@code{make-vector} properly, type @kbd{C-h f make-vector @key{RET}}. +Because @kbd{C-h f} allows all function names, not just command names, +you may find that some of your favorite abbreviations that work in +@kbd{M-x} don't work in @kbd{C-h f}. An abbreviation may be unique +among command names, yet fail to be unique when other function names are +allowed. - -If you type @key{RET}, leaving the minibuffer empty, @kbd{C-h f} by -default describes the function called by the innermost Lisp expression -in the buffer around point, @i{provided} that that is a valid, defined Lisp -function name. For example, if point is located following the text + The function name for @kbd{C-h f} to describe has a default which is +used if you type @key{RET} leaving the minibuffer empty. The default is +the function called by the innermost Lisp expression in the buffer +around point, @emph{provided} that is a valid, defined Lisp function +name. For example, if point is located following the text @samp{(make-vector (car x)}, the innermost list containing point is the -one starting with @samp{(make-vector}, so the default is to describe -the function @code{make-vector}. +one that starts with @samp{(make-vector}, so the default is to describe the +function @code{make-vector}. @kbd{C-h f} is often useful just to verify that you have the right -spelling for the function name. If @kbd{C-h f} mentions a default in the -prompt, you have typed the name of a defined Lisp function. If that is -what you wanted to know, just type @kbd{C-g} to cancel the @kbd{C-h f} -command and continue editing. +spelling for the function name. If @kbd{C-h f} mentions a name from the +buffer as the default, that name must be defined as a Lisp function. If +that is all you want to know, just type @kbd{C-g} to cancel the @kbd{C-h +f} command, then go on editing. @kindex C-h w @findex where-is - @kbd{C-h w @var{command} @key{RET}} (@code{where-s}) tells you what + @kbd{C-h w @var{command} @key{RET}} (@code{where-is}) tells you what keys are bound to @var{command}. It prints a list of the keys in the -echo area. Alternatively, it informs you that a command is not bound to -any keys, which implies that you must use @kbd{M-x} to call the -command.@refill +echo area. Alternatively, it informs you that a command is not bound to +any keys, which implies that you must use @kbd{M-x} to call the +command. @kindex C-h v @findex describe-variable @kbd{C-h v} (@code{describe-variable}) is like @kbd{C-h f} but describes Lisp variables instead of Lisp functions. Its default is the Lisp symbol around or before point, if that is the name of a known Lisp -variable. @xref{Variables}.@refill +variable. @xref{Variables}. +@node Apropos, Library Keywords, Name Help, Help @section Apropos -@kindex C-h a +@kindex C-h A @findex command-apropos -@cindex apropos +@cindex apropos @table @kbd -@item C-h a +@item C-h A Show only symbols that are names of commands -(@code{command-apropos}).@refill +(@code{command-apropos}). @item M-x apropos @var{regexp} Show all symbols whose names comtain matches for @var{regexp}. @end table - It is possible to ask a question like, ``What are the commands for -working with files?'' To do this, type @kbd{C-h a file @key{RET}}, -which displays a list of all command names that contain @samp{file}, -such as @code{copy-file}, @code{find-file}, and so on. With each -command name a brief description of its use and information on the keys -you can use to invoke it is displayed. For example, you would be -informed that you can invoke @code{find-file} by typing @kbd{C-x C-f}. -The @kbd{a} in @kbd{C-h a} stands for `Apropos'; @kbd{C-h a} runs the -Lisp function @code{command-apropos}.@refill + A more sophisticated sort of question to ask is, ``What are the +commands for working with files?'' To ask this question, type @kbd{C-h +a file @key{RET}}, which displays a list of all command names that +contain @samp{file}, including @code{copy-file}, @code{find-file}, and +so on. With each command name appears a brief description of how to use +the command, and what keys you can currently invoke it with. For +example, it would say that you can invoke @code{find-file} by typing +@kbd{C-x C-f}. The @kbd{A} in @kbd{C-h A} stands for `Apropos'; +@kbd{C-h A} runs the command @code{command-apropos}. This command +normally checks only commands (interactive functions); if you specify a +prefix argument, it checks noninteractive functions as well. - Because @kbd{C-h a} looks only for functions whose names contain the + Because @kbd{C-h A} looks only for functions whose names contain the string you specify, you must use ingenuity in choosing the string. If you are looking for commands for killing backwards and @kbd{C-h a -kill-backwards @key{RET}} doesn't reveal any commands, don't give up. -Try just @kbd{kill}, or just @kbd{backwards}, or just @kbd{back}. Be -persistent. Pretend you are playing Adventure. Also note that you can -use a regular expression as the argument (@pxref{Regexps}). +kill-backwards @key{RET}} doesn't reveal any, don't give up. Try just +@kbd{kill}, or just @kbd{backwards}, or just @kbd{back}. Be persistent. +Pretend you are playing Adventure. Also note that you can use a regular +expression as the argument, for more flexibility (@pxref{Regexps}). Here is a set of arguments to give to @kbd{C-h a} that covers many -classes of Emacs commands, since there are strong conventions for naming -standard Emacs commands. By giving you a feeling for the naming -conventions, this set of arguments can also help you develop a -technique for picking @code{apropos} strings. +classes of XEmacs commands, since there are strong conventions for +naming the standard XEmacs commands. By giving you a feel for the +naming conventions, this set should also serve to aid you in developing +a technique for picking @code{apropos} strings. @quotation char, line, word, sentence, paragraph, region, page, sexp, list, defun, -buffer, frame, window, file, dir, register, mode, -beginning, end, forward, backward, next, previous, up, down, search, goto, -kill, delete, mark, insert, yank, fill, indent, case, -change, set, what, list, find, view, describe. +rect, buffer, frame, window, face, file, dir, register, mode, beginning, +end, forward, backward, next, previous, up, down, search, goto, kill, +delete, mark, insert, yank, fill, indent, case, change, set, what, list, +find, view, describe, default. @end quotation @findex apropos To list all Lisp symbols that contain a match for a regexp, not just the ones that are defined as commands, use the command @kbd{M-x apropos} -instead of @kbd{C-h a}. +instead of @kbd{C-h A}. This command does not check key bindings by +default; specify a numeric argument if you want it to check them. + +@findex apropos-documentation + The @code{apropos-documentation} command is like @code{apropos} except +that it searches documentation strings for matches for the specified +regular expression. + +@findex apropos-value + The @code{apropos-value} command is like @code{apropos} except that it +searches symbols' values for matches for the specified regular +expression. This command does not check function definitions or +property lists by default; specify a numeric argument if you want it to +check them. + +@vindex apropos-do-all + If the variable @code{apropos-do-all} is non-@code{nil}, the commands +above all behave as if they had been given a prefix argument. + + If you want more information about a function definition, variable or +symbol property listed in the Apropos buffer, you can click on it with +@kbd{Mouse-2} or move there and type @key{RET}. + +@node Library Keywords, Help Mode, Apropos, Help +@section Keyword Search for Lisp Libraries + +@kindex C-h p +@findex finder-by-keyword +The @kbd{C-h p} command lets you search the standard Emacs Lisp +libraries by topic keywords. Here is a partial list of keywords you can +use: +@display +abbrev abbreviation handling, typing shortcuts, macros +bib code related to the `bib' bibliography processor +c C, C++, and Objective-C language support +calendar calendar and time management support +comm communications, networking, remote access to files +data support for editing files of data +docs support for Emacs documentation +dumped files preloaded into Emacs +emulations emulations of other editors +extensions Emacs Lisp language extensions +faces support for multiple fonts +frames support for Emacs frames and window systems +games games, jokes and amusements +hardware support for interfacing with exotic hardware +help support for on-line help systems +hypermedia support for links between text or other media types +i18n internationalization and alternate character-set support +internal code for Emacs internals, build process, defaults +languages specialized modes for editing programming languages +lisp Lisp support, including Emacs Lisp +local code local to your site +maint maintenance aids for the Emacs development group +mail modes for electronic-mail handling +matching various sorts of searching and matching +mouse mouse support +mule multi-language extensions +news support for netnews reading and posting +oop support for object-oriented programming +outlines support for hierarchical outlining +processes process, subshell, compilation, and job control support +terminals support for terminal types +tex code related to the TeX formatter +tools programming tools +unix front-ends/assistants for, or emulators of, UNIX features +vms support code for vms +wp word processing +@end display + +@node Help Mode, Misc Help, Library Keywords, Help +@section Help Mode Commands + + Help buffers provide the commands of View mode (@pxref{Misc File +Ops}), plus a few special commands of their own. + +@table @kbd +@item @key{SPC} +Scroll forward. +@item @key{DEL} +@itemx @key{BS} +Scroll backward. +@c @item @key{RET} +@c Follow a cross reference at point. +@c @item @key{TAB} +@c Move point forward to the next cross reference. +@c @item S-@key{TAB} +@c Move point back to the previous cross reference. +@c @item Mouse-2 +@c Follow a cross reference that you click on. +@end table + + When a command name (@pxref{M-x,, Running Commands by Name}) or +variable name (@pxref{Variables}) appears in the documentation, it +normally appears inside paired single-quotes. + +@node Misc Help, , Help Mode, Help @section Other Help Commands @kindex C-h i @findex info +@cindex Info +@cindex manuals, on-line +@cindex on-line manuals @kbd{C-h i} (@code{info}) runs the Info program, which is used for -browsing through structured documentation files. The entire Emacs manual +browsing through structured documentation files. The entire XEmacs manual is available within Info. Eventually all the documentation of the GNU system will be available. Type @kbd{h} after entering Info to run a tutorial on using Info. + If you specify a numeric argument, @kbd{C-h i} prompts for the name of +a documentation file. This way, you can browse a file which doesn't +have an entry in the top-level Info menu. It is also handy when you +need to get to the documentation quickly, and you know the exact name of +the file. + +@kindex C-h C-f +@kindex C-h C-k +@findex Info-elisp-ref +@findex Info-goto-emacs-command-node + There are two special help commands for accessing XEmacs documentation +through Info. @kbd{C-h C-f @var{function} @key{RET}} enters Info and +goes straight to the documentation of the XEmacs function +@var{function}. @kbd{C-h C-k @var{key}} enters Info and goes straight +to the documentation of the key @var{key}. These two keys run the +commands @code{Info-elisp-ref} and +@code{Info-goto-emacs-key-command-node}. + @kindex C-h l @findex view-lossage If something surprising happens, and you are not sure what commands you typed, use @kbd{C-h l} (@code{view-lossage}). @kbd{C-h l} prints the last -100 command characters you typed. If you see commands you don't -know, use @kbd{C-h c} to find out what they do. +100 command characters you typed in. If you see commands that you don't +know, you can use @kbd{C-h c} to find out what they do. @kindex C-h m @findex describe-mode - Emacs has several major modes. Each mode redefines a few keys and + XEmacs has several major modes. Each mode redefines a few keys and makes a few other changes in how editing works. @kbd{C-h m} (@code{describe-mode}) prints documentation on the current major mode, which normally describes all the commands that are changed in this mode. @@ -234,13 +410,21 @@ @kindex C-h b @findex describe-bindings @kbd{C-h b} (@code{describe-bindings}) and @kbd{C-h s} -(@code{describe-syntax}) present information about the current Emacs +(@code{describe-syntax}) present information about the current XEmacs mode that is not covered by @kbd{C-h m}. @kbd{C-h b} displays a list of -all key bindings currently in effect, with the local bindings of the current -major mode first, followed by the global bindings (@pxref{Key +all the key bindings currently in effect, with the local bindings of the +current major mode first, followed by the global bindings (@pxref{Key Bindings}). @kbd{C-h s} displays the contents of the syntax table with -explanations of each character's syntax (@pxref{Syntax}).@refill +explanations of each character's syntax (@pxref{Syntax}). + You can get a similar list for a particular prefix key by typing +@kbd{C-h} after the prefix key. (There are a few prefix keys for which +this does not work---those that provide their own bindings for +@kbd{C-h}. One of these is @key{ESC}, because @kbd{@key{ESC} C-h} is +actually @kbd{C-M-h}, which marks a defun.) + +@kindex C-h F +@findex xemacs-local-faq @kindex C-h n @findex view-emacs-news @kindex C-h t @@ -252,14 +436,16 @@ @kindex C-h C-w @findex describe-no-warranty The other @kbd{C-h} options display various files of useful -information. @kbd{C-h C-w} (@code{describe-no-warranty}) displays -details on the complete absence of warranty for XEmacs. @kbd{C-h n} -(@code{view-emacs-news}) displays the file @file{emacs/etc/NEWS}, which -contains documentation on Emacs changes arranged chronologically. -@kbd{C-h t} (@code{help-with-tutorial}) displays the learn-by-doing -Emacs tutorial. @kbd{C-h C-c} (@code{describe-copying}) displays the file -@file{emacs/etc/COPYING}, which tells you the conditions you must obey -in distributing copies of Emacs. @kbd{C-h C-d} +information. @kbd{C-h C-w} (@code{describe-no-warranty}) displays the +full details on the complete absence of warranty for XEmacs. @kbd{C-h +n} (@code{view-emacs-news}) displays the file @file{xemacs/etc/NEWS}, +which contains documentation on XEmacs changes arranged chronologically. +@kbd{C-h F} (@code{xemacs-local-faq}) displays local version of the +XEmacs frequentliy-answered-questions-list. @kbd{C-h t} +(@code{help-with-tutorial}) displays the learn-by-doing XEmacs +tutorial. @kbd{C-h C-c} (@code{describe-copying}) displays the file +@file{xemacs/etc/COPYING}, which tells you the conditions you must obey +in distributing copies of XEmacs. @kbd{C-h C-d} (@code{describe-distribution}) displays another file named -@file{emacs/etc/DISTRIB}, which tells you how you can order a copy of -the latest version of Emacs.@refill +@file{xemacs/etc/DISTRIB}, which tells you how you can order a copy of +the latest version of XEmacs. diff -r 9f011ab08d48 -r 2f8bb876ab1d man/xemacs/xemacs.texi --- a/man/xemacs/xemacs.texi Mon Aug 13 11:15:00 2007 +0200 +++ b/man/xemacs/xemacs.texi Mon Aug 13 11:16:07 2007 +0200 @@ -271,9 +271,13 @@ Registers -* RegPos:: Saving positions in registers. -* RegText:: Saving text in registers. -* RegRect:: Saving rectangles in registers. +* Position: RegPos. Saving positions in registers. +* Text: RegText. Saving text in registers. +* Rectangle: RegRect. Saving rectangles in registers. +* Configurations: RegConfig. Saving window configurations in registers. +* Files: RegFiles. File names in registers. +* Numbers: RegNumbers. Numbers in registers. +* Bookmarks:: Bookmarks are like registers, but persistent. Controlling the Display diff -r 9f011ab08d48 -r 2f8bb876ab1d nt/ChangeLog --- a/nt/ChangeLog Mon Aug 13 11:15:00 2007 +0200 +++ b/nt/ChangeLog Mon Aug 13 11:16:07 2007 +0200 @@ -1,3 +1,66 @@ +2000-03-20 Martin Buchholz + + * XEmacs 21.2.32 is released. + +2000-03-15 Mike Alexander + + * xemacs.mak: Fix for generation of $(XEMACS)\Installation. + +2000-03-14 Adrian Aichner + + * xemacs.mak (LIB_SRC_TOOLS): LIB_SRC_TOOLS depend on + XEMACS_INCLUDES when we USE_PORTABLE_DUMPER. + +2000-03-13 Ben Wing + + * xemacs.mak (TEMACS_ENTRYPOINT): + Fix for portable dumper. + +2000-03-12 Ben Wing + + * xemacs.mak (*): + * config.inc: New. + + a) Added a file called config.inc which makes it easier to set + build options for MS Windows. (Previously, the only way to do this + was through command line options to nmake.) + + b) Cleaned the file up a bit. + + c) Changed xemacs to be a windows application and not a console + application, now that runemacs.exe is no longer necessary. + + d) Added support for building the tags file. + + * xemacs.dsw: New. + * xemacs.dsp: New. + For compiling, editing, and debugging XEmacs using the VC++ 5.0 + GUI. They may well work under other versions of VC++, but I don't + have access to them to test them. + +2000-03-11 Andy Piper + + * PROBLEMS: Doc fix from Reini Urban . + +2000-02-27 Mike Alexander + + * xemacs.rc: Include the portable dump data if INCLUDE_DUMP is defined + + * xemacs.mak: Add the portable dump data to the EXE as a resource + +2000-03-07 Jonathan Harris + + * xemacs.mak (TEMACS_LIBS): Add ole32.lib and uuid.lib. + (installation): Always regenerate installation report. + +2000-02-25 Craig Lanning + + * inc\sys\time.h: MinGW defines struct timeval in . + +2000-02-24 Martin Buchholz + + * config.h (INLINE_HEADER): Define properly (?) for Windows. + 2000-02-23 Martin Buchholz * XEmacs 21.2.31 is released. diff -r 9f011ab08d48 -r 2f8bb876ab1d nt/PROBLEMS --- a/nt/PROBLEMS Mon Aug 13 11:15:00 2007 +0200 +++ b/nt/PROBLEMS Mon Aug 13 11:16:07 2007 +0200 @@ -87,9 +87,9 @@ Function XEmacs binding -------- -------------- Undo C-_ - Cut C-Insert - Copy C-Insert - Paste Sh-Del + Cut Sh-Del + Copy C-Insert + Paste Sh-Insert You can rebind keys to make XEmacs more Windows-compatible; for example, to bind C-z to undo: diff -r 9f011ab08d48 -r 2f8bb876ab1d nt/config.h --- a/nt/config.h Mon Aug 13 11:15:00 2007 +0200 +++ b/nt/config.h Mon Aug 13 11:16:07 2007 +0200 @@ -583,11 +583,13 @@ /* MSVC version >= 2.x without /Za supports __inline */ #if (_MSC_VER < 900) || defined(__STDC__) -# define INLINE static +# define inline #else -# define INLINE __inline +# define inline __inline #endif +#define INLINE_HEADER inline static + /* MSVC warnings no-no crap. When adding one to this section, 1. Think twice 2. Insert textual description of the warning. diff -r 9f011ab08d48 -r 2f8bb876ab1d nt/config.inc.samp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nt/config.inc.samp Mon Aug 13 11:16:07 2007 +0200 @@ -0,0 +1,72 @@ +# -*- mode: makefile -*- + +############################################################################ + +INSTALL_DIR=c:\Program Files\XEmacs\XEmacs-$(XEMACS_VERSION_STRING) + +PACKAGE_PREFIX=c:\Program Files\XEmacs + +############################################################################ + +# Multilingual support (not currently working). +HAVE_MULE=0 + +# Native MS Windows support. +HAVE_MSW=1 + +# X Windows support. +HAVE_X=0 +X11_DIR= + +############################################################################ + +# Set this to enable XPM support (virtually mandatory), and specify +# the directory containing xpm. +HAVE_XPM=1 +XPM_DIR=f:\src\xpm-3.4k + +# Set this to enable GIF support. +HAVE_GIF=1 + +# Set this to enable PNG support (virtually mandatory), and specify +# the directories containing png and zlib. +HAVE_PNG=1 +PNG_DIR=f:\src\libpng-1.0.3 +ZLIB_DIR=f:\src\zlib + +# Set this to enable TIFF support, and specify the directory containing tiff. +HAVE_TIFF=0 +TIFF_DIR= + +# Set this to enable JPEG support, and specify the directory containing jpeg. +HAVE_JPEG=0 +JPEG_DIR= + +# Set this to enable XFace support, and specify the directory containing +# compface. +HAVE_XFACE=0 +COMPFACE_DIR= + +############################################################################ + +# Set this to specify the location of makeinfo. (If not set, XEmacs will +# attempt to use its built-in texinfo support when building info files.) +MAKEINFO=f:\src\texinfo-4.0\makeinfo\makeinfo.exe + +############################################################################ + +# Set this to enable some debug code that doesn't slow things down. +DEBUG_XEMACS=1 + +# Set this to see exactly which compilation commands are being run (not +# generally recommended). +VERBOSECC=0 + +############################################################################ + +# Some technical options. + +USE_MINIMAL_TAGBITS=0 +USE_INDEXED_LRECORD_IMPLEMENTATION=0 +USE_PORTABLE_DUMPER=0 +GUNG_HO=0 diff -r 9f011ab08d48 -r 2f8bb876ab1d nt/inc/sys/time.h --- a/nt/inc/sys/time.h Mon Aug 13 11:15:00 2007 +0200 +++ b/nt/inc/sys/time.h Mon Aug 13 11:16:07 2007 +0200 @@ -4,11 +4,15 @@ #include +#ifdef __MINGW32__ +#include +#else struct timeval { long tv_sec; /* seconds */ long tv_usec; /* microseconds */ }; +#endif struct timezone { diff -r 9f011ab08d48 -r 2f8bb876ab1d nt/xemacs.dsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nt/xemacs.dsp Mon Aug 13 11:16:07 2007 +0200 @@ -0,0 +1,1392 @@ +# Microsoft Developer Studio Project File - Name="xemacs" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) External Target" 0x0106 + +CFG=xemacs - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "xemacs.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "xemacs.mak" CFG="xemacs - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "xemacs - Win32 Release" (based on "Win32 (x86) External Target") +!MESSAGE "xemacs - Win32 Debug" (based on "Win32 (x86) External Target") +!MESSAGE + +# Begin Project +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" + +!IF "$(CFG)" == "xemacs - Win32 Release" + +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Cmd_Line "NMAKE /f xemacs.mak" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "xemacs.exe" +# PROP BASE Bsc_Name "xemacs.bsc" +# PROP BASE Target_Dir "" +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Cmd_Line "NMAKE /f xemacs.mak" +# PROP Rebuild_Opt "/a" +# PROP Target_File "xemacs.exe" +# PROP Bsc_Name "xemacs.bsc" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "xemacs - Win32 Debug" + +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Cmd_Line "NMAKE /f xemacs.mak" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "xemacs.exe" +# PROP BASE Bsc_Name "xemacs.bsc" +# PROP BASE Target_Dir "" +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Cmd_Line "NMAKE /f xemacs.mak" +# PROP Rebuild_Opt "/a" +# PROP Target_File "..\src\xemacs.exe" +# PROP Bsc_Name "..\src\temacs.bsc" +# PROP Target_Dir "" + +!ENDIF + +# Begin Target + +# Name "xemacs - Win32 Release" +# Name "xemacs - Win32 Debug" + +!IF "$(CFG)" == "xemacs - Win32 Release" + +!ELSEIF "$(CFG)" == "xemacs - Win32 Debug" + +!ENDIF + +# Begin Source File + +SOURCE=..\src\abbrev.c +# End Source File +# Begin Source File + +SOURCE=..\src\alloc.c +# End Source File +# Begin Source File + +SOURCE=..\src\alloca.c +# End Source File +# Begin Source File + +SOURCE=..\src\backtrace.h +# End Source File +# Begin Source File + +SOURCE="..\src\balloon-x.c" +# End Source File +# Begin Source File + +SOURCE=..\src\balloon_help.c +# End Source File +# Begin Source File + +SOURCE=..\src\balloon_help.h +# End Source File +# Begin Source File + +SOURCE=..\src\bitmaps.h +# End Source File +# Begin Source File + +SOURCE=..\src\blocktype.c +# End Source File +# Begin Source File + +SOURCE=..\src\blocktype.h +# End Source File +# Begin Source File + +SOURCE="..\src\broken-sun.h" +# End Source File +# Begin Source File + +SOURCE=..\src\buffer.c +# End Source File +# Begin Source File + +SOURCE=..\src\buffer.h +# End Source File +# Begin Source File + +SOURCE=..\src\bufslots.h +# End Source File +# Begin Source File + +SOURCE=..\src\bytecode.c +# End Source File +# Begin Source File + +SOURCE=..\src\bytecode.h +# End Source File +# Begin Source File + +SOURCE=..\src\callint.c +# End Source File +# Begin Source File + +SOURCE=..\src\callproc.c +# End Source File +# Begin Source File + +SOURCE=..\src\casefiddle.c +# End Source File +# Begin Source File + +SOURCE=..\src\casetab.c +# End Source File +# Begin Source File + +SOURCE=..\src\chartab.c +# End Source File +# Begin Source File + +SOURCE=..\src\chartab.h +# End Source File +# Begin Source File + +SOURCE=..\src\cm.c +# End Source File +# Begin Source File + +SOURCE=..\src\cm.h +# End Source File +# Begin Source File + +SOURCE=..\src\cmdloop.c +# End Source File +# Begin Source File + +SOURCE=..\src\cmds.c +# End Source File +# Begin Source File + +SOURCE=..\src\commands.h +# End Source File +# Begin Source File + +SOURCE=..\src\config.h +# End Source File +# Begin Source File + +SOURCE=..\src\conslots.h +# End Source File +# Begin Source File + +SOURCE="..\src\console-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\console-msw.h" +# End Source File +# Begin Source File + +SOURCE="..\src\console-stream.c" +# End Source File +# Begin Source File + +SOURCE="..\src\console-stream.h" +# End Source File +# Begin Source File + +SOURCE="..\src\console-tty.c" +# End Source File +# Begin Source File + +SOURCE="..\src\console-tty.h" +# End Source File +# Begin Source File + +SOURCE="..\src\console-x.c" +# End Source File +# Begin Source File + +SOURCE="..\src\console-x.h" +# End Source File +# Begin Source File + +SOURCE=..\src\console.c +# End Source File +# Begin Source File + +SOURCE=..\src\console.h +# End Source File +# Begin Source File + +SOURCE=..\src\data.c +# End Source File +# Begin Source File + +SOURCE=..\src\database.c +# End Source File +# Begin Source File + +SOURCE=..\src\database.h +# End Source File +# Begin Source File + +SOURCE=..\src\debug.c +# End Source File +# Begin Source File + +SOURCE=..\src\debug.h +# End Source File +# Begin Source File + +SOURCE="..\src\device-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\device-tty.c" +# End Source File +# Begin Source File + +SOURCE="..\src\device-x.c" +# End Source File +# Begin Source File + +SOURCE=..\src\device.c +# End Source File +# Begin Source File + +SOURCE=..\src\device.h +# End Source File +# Begin Source File + +SOURCE=..\src\dgif_lib.c +# End Source File +# Begin Source File + +SOURCE="..\src\dialog-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\dialog-x.c" +# End Source File +# Begin Source File + +SOURCE=..\src\dialog.c +# End Source File +# Begin Source File + +SOURCE="..\src\dired-msw.c" +# End Source File +# Begin Source File + +SOURCE=..\src\dired.c +# End Source File +# Begin Source File + +SOURCE=..\src\doc.c +# End Source File +# Begin Source File + +SOURCE=..\src\doprnt.c +# End Source File +# Begin Source File + +SOURCE=..\src\dragdrop.c +# End Source File +# Begin Source File + +SOURCE=..\src\dragdrop.h +# End Source File +# Begin Source File + +SOURCE=..\src\dynarr.c +# End Source File +# Begin Source File + +SOURCE=..\src\ecrt0.c +# End Source File +# Begin Source File + +SOURCE=..\src\editfns.c +# End Source File +# Begin Source File + +SOURCE=..\src\eldap.c +# End Source File +# Begin Source File + +SOURCE=..\src\eldap.h +# End Source File +# Begin Source File + +SOURCE=..\src\elhash.c +# End Source File +# Begin Source File + +SOURCE=..\src\elhash.h +# End Source File +# Begin Source File + +SOURCE=..\src\Emacs.ad.h +# End Source File +# Begin Source File + +SOURCE=..\src\emacs.c +# End Source File +# Begin Source File + +SOURCE=..\src\EmacsFrame.c +# End Source File +# Begin Source File + +SOURCE=..\src\EmacsFrame.h +# End Source File +# Begin Source File + +SOURCE=..\src\EmacsFrameP.h +# End Source File +# Begin Source File + +SOURCE=..\src\EmacsManager.c +# End Source File +# Begin Source File + +SOURCE=..\src\EmacsManager.h +# End Source File +# Begin Source File + +SOURCE=..\src\EmacsManagerP.h +# End Source File +# Begin Source File + +SOURCE="..\src\EmacsShell-sub.c" +# End Source File +# Begin Source File + +SOURCE=..\src\EmacsShell.c +# End Source File +# Begin Source File + +SOURCE=..\src\EmacsShell.h +# End Source File +# Begin Source File + +SOURCE=..\src\EmacsShellP.h +# End Source File +# Begin Source File + +SOURCE=..\src\emodules.c +# End Source File +# Begin Source File + +SOURCE=..\src\emodules.h +# End Source File +# Begin Source File + +SOURCE=..\src\esd.c +# End Source File +# Begin Source File + +SOURCE=..\src\eval.c +# End Source File +# Begin Source File + +SOURCE="..\src\event-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\event-stream.c" +# End Source File +# Begin Source File + +SOURCE="..\src\event-tty.c" +# End Source File +# Begin Source File + +SOURCE="..\src\event-unixoid.c" +# End Source File +# Begin Source File + +SOURCE="..\src\event-Xt.c" +# End Source File +# Begin Source File + +SOURCE="..\src\events-mod.h" +# End Source File +# Begin Source File + +SOURCE=..\src\events.c +# End Source File +# Begin Source File + +SOURCE=..\src\events.h +# End Source File +# Begin Source File + +SOURCE=..\src\extents.c +# End Source File +# Begin Source File + +SOURCE=..\src\extents.h +# End Source File +# Begin Source File + +SOURCE="..\src\ExternalClient-Xlib.c" +# End Source File +# Begin Source File + +SOURCE=..\src\ExternalClient.c +# End Source File +# Begin Source File + +SOURCE=..\src\ExternalClient.h +# End Source File +# Begin Source File + +SOURCE=..\src\ExternalClientP.h +# End Source File +# Begin Source File + +SOURCE=..\src\ExternalShell.c +# End Source File +# Begin Source File + +SOURCE=..\src\ExternalShell.h +# End Source File +# Begin Source File + +SOURCE=..\src\ExternalShellP.h +# End Source File +# Begin Source File + +SOURCE="..\src\extw-Xlib.c" +# End Source File +# Begin Source File + +SOURCE="..\src\extw-Xlib.h" +# End Source File +# Begin Source File + +SOURCE="..\src\extw-Xt.c" +# End Source File +# Begin Source File + +SOURCE="..\src\extw-Xt.h" +# End Source File +# Begin Source File + +SOURCE=..\src\faces.c +# End Source File +# Begin Source File + +SOURCE=..\src\faces.h +# End Source File +# Begin Source File + +SOURCE="..\src\file-coding.c" +# End Source File +# Begin Source File + +SOURCE="..\src\file-coding.h" +# End Source File +# Begin Source File + +SOURCE=..\src\fileio.c +# End Source File +# Begin Source File + +SOURCE=..\src\filelock.c +# End Source File +# Begin Source File + +SOURCE=..\src\filemode.c +# End Source File +# Begin Source File + +SOURCE=..\src\floatfns.c +# End Source File +# Begin Source File + +SOURCE=..\src\fns.c +# End Source File +# Begin Source File + +SOURCE="..\src\font-lock.c" +# End Source File +# Begin Source File + +SOURCE="..\src\frame-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\frame-tty.c" +# End Source File +# Begin Source File + +SOURCE="..\src\frame-x.c" +# End Source File +# Begin Source File + +SOURCE=..\src\frame.c +# End Source File +# Begin Source File + +SOURCE=..\src\frame.h +# End Source File +# Begin Source File + +SOURCE=..\src\frameslots.h +# End Source File +# Begin Source File + +SOURCE="..\src\free-hook.c" +# End Source File +# Begin Source File + +SOURCE=..\src\general.c +# End Source File +# Begin Source File + +SOURCE=..\src\getloadavg.c +# End Source File +# Begin Source File + +SOURCE=..\src\getpagesize.h +# End Source File +# Begin Source File + +SOURCE=..\src\gif_io.c +# End Source File +# Begin Source File + +SOURCE=..\src\gifrlib.h +# End Source File +# Begin Source File + +SOURCE="..\src\glyphs-eimage.c" +# End Source File +# Begin Source File + +SOURCE="..\src\glyphs-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\glyphs-msw.h" +# End Source File +# Begin Source File + +SOURCE="..\src\glyphs-widget.c" +# End Source File +# Begin Source File + +SOURCE="..\src\glyphs-x.c" +# End Source File +# Begin Source File + +SOURCE="..\src\glyphs-x.h" +# End Source File +# Begin Source File + +SOURCE=..\src\glyphs.c +# End Source File +# Begin Source File + +SOURCE=..\src\glyphs.h +# End Source File +# Begin Source File + +SOURCE=..\src\gmalloc.c +# End Source File +# Begin Source File + +SOURCE=..\src\gpmevent.c +# End Source File +# Begin Source File + +SOURCE=..\src\gpmevent.h +# End Source File +# Begin Source File + +SOURCE="..\src\gui-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\gui-x.c" +# End Source File +# Begin Source File + +SOURCE="..\src\gui-x.h" +# End Source File +# Begin Source File + +SOURCE=..\src\gui.c +# End Source File +# Begin Source File + +SOURCE=..\src\gui.h +# End Source File +# Begin Source File + +SOURCE=..\src\gutter.c +# End Source File +# Begin Source File + +SOURCE=..\src\gutter.h +# End Source File +# Begin Source File + +SOURCE=..\src\hash.c +# End Source File +# Begin Source File + +SOURCE=..\src\hash.h +# End Source File +# Begin Source File + +SOURCE=..\src\hftctl.c +# End Source File +# Begin Source File + +SOURCE=..\src\hpplay.c +# End Source File +# Begin Source File + +SOURCE=..\src\imgproc.c +# End Source File +# Begin Source File + +SOURCE=..\src\imgproc.h +# End Source File +# Begin Source File + +SOURCE=..\src\indent.c +# End Source File +# Begin Source File + +SOURCE=..\src\inline.c +# End Source File +# Begin Source File + +SOURCE="..\src\input-method-motif.c" +# End Source File +# Begin Source File + +SOURCE="..\src\input-method-xfs.c" +# End Source File +# Begin Source File + +SOURCE="..\src\input-method-xlib.c" +# End Source File +# Begin Source File + +SOURCE=..\src\insdel.c +# End Source File +# Begin Source File + +SOURCE=..\src\insdel.h +# End Source File +# Begin Source File + +SOURCE=..\src\intl.c +# End Source File +# Begin Source File + +SOURCE="..\src\iso-wide.h" +# End Source File +# Begin Source File + +SOURCE=..\src\keymap.c +# End Source File +# Begin Source File + +SOURCE=..\src\keymap.h +# End Source File +# Begin Source File + +SOURCE=..\src\lastfile.c +# End Source File +# Begin Source File + +SOURCE=..\src\libsst.c +# End Source File +# Begin Source File + +SOURCE=..\src\libsst.h +# End Source File +# Begin Source File + +SOURCE=..\src\libst.h +# End Source File +# Begin Source File + +SOURCE="..\src\line-number.c" +# End Source File +# Begin Source File + +SOURCE="..\src\line-number.h" +# End Source File +# Begin Source File + +SOURCE=..\src\linuxplay.c +# End Source File +# Begin Source File + +SOURCE="..\src\lisp-disunion.h" +# End Source File +# Begin Source File + +SOURCE="..\src\lisp-union.h" +# End Source File +# Begin Source File + +SOURCE=..\src\lisp.h +# End Source File +# Begin Source File + +SOURCE=..\src\lread.c +# End Source File +# Begin Source File + +SOURCE=..\src\lrecord.h +# End Source File +# Begin Source File + +SOURCE=..\src\lstream.c +# End Source File +# Begin Source File + +SOURCE=..\src\lstream.h +# End Source File +# Begin Source File + +SOURCE=..\src\macros.c +# End Source File +# Begin Source File + +SOURCE=..\src\macros.h +# End Source File +# Begin Source File + +SOURCE=..\src\malloc.c +# End Source File +# Begin Source File + +SOURCE=..\src\marker.c +# End Source File +# Begin Source File + +SOURCE=..\src\md5.c +# End Source File +# Begin Source File + +SOURCE="..\src\mem-limits.h" +# End Source File +# Begin Source File + +SOURCE="..\src\menubar-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\menubar-msw.h" +# End Source File +# Begin Source File + +SOURCE="..\src\menubar-x.c" +# End Source File +# Begin Source File + +SOURCE=..\src\menubar.c +# End Source File +# Begin Source File + +SOURCE=..\src\menubar.h +# End Source File +# Begin Source File + +SOURCE=..\src\minibuf.c +# End Source File +# Begin Source File + +SOURCE=..\src\miscplay.c +# End Source File +# Begin Source File + +SOURCE=..\src\miscplay.h +# End Source File +# Begin Source File + +SOURCE="..\src\mule-canna.c" +# End Source File +# Begin Source File + +SOURCE="..\src\mule-ccl.c" +# End Source File +# Begin Source File + +SOURCE="..\src\mule-ccl.h" +# End Source File +# Begin Source File + +SOURCE="..\src\mule-charset.c" +# End Source File +# Begin Source File + +SOURCE="..\src\mule-charset.h" +# End Source File +# Begin Source File + +SOURCE="..\src\mule-mcpath.c" +# End Source File +# Begin Source File + +SOURCE="..\src\mule-mcpath.h" +# End Source File +# Begin Source File + +SOURCE="..\src\mule-wnnfns.c" +# End Source File +# Begin Source File + +SOURCE=..\src\mule.c +# End Source File +# Begin Source File + +SOURCE=..\src\nas.c +# End Source File +# Begin Source File + +SOURCE=..\src\ndir.h +# End Source File +# Begin Source File + +SOURCE=..\src\nt.c +# End Source File +# Begin Source File + +SOURCE=..\src\nt.h +# End Source File +# Begin Source File + +SOURCE=..\src\ntheap.c +# End Source File +# Begin Source File + +SOURCE=..\src\ntheap.h +# End Source File +# Begin Source File + +SOURCE=..\src\ntplay.c +# End Source File +# Begin Source File + +SOURCE=..\src\ntproc.c +# End Source File +# Begin Source File + +SOURCE="..\src\objects-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\objects-msw.h" +# End Source File +# Begin Source File + +SOURCE="..\src\objects-tty.c" +# End Source File +# Begin Source File + +SOURCE="..\src\objects-tty.h" +# End Source File +# Begin Source File + +SOURCE="..\src\objects-x.c" +# End Source File +# Begin Source File + +SOURCE="..\src\objects-x.h" +# End Source File +# Begin Source File + +SOURCE=..\src\objects.c +# End Source File +# Begin Source File + +SOURCE=..\src\objects.h +# End Source File +# Begin Source File + +SOURCE="..\src\offix-cursors.h" +# End Source File +# Begin Source File + +SOURCE="..\src\offix-types.h" +# End Source File +# Begin Source File + +SOURCE=..\src\offix.c +# End Source File +# Begin Source File + +SOURCE=..\src\offix.h +# End Source File +# Begin Source File + +SOURCE=..\src\opaque.c +# End Source File +# Begin Source File + +SOURCE=..\src\opaque.h +# End Source File +# Begin Source File + +SOURCE=..\src\paths.h +# End Source File +# Begin Source File + +SOURCE="..\src\pre-crt0.c" +# End Source File +# Begin Source File + +SOURCE=..\src\print.c +# End Source File +# Begin Source File + +SOURCE="..\src\process-nt.c" +# End Source File +# Begin Source File + +SOURCE="..\src\process-unix.c" +# End Source File +# Begin Source File + +SOURCE=..\src\process.c +# End Source File +# Begin Source File + +SOURCE=..\src\process.h +# End Source File +# Begin Source File + +SOURCE=..\src\procimpl.h +# End Source File +# Begin Source File + +SOURCE=..\src\profile.c +# End Source File +# Begin Source File + +SOURCE=..\src\ralloc.c +# End Source File +# Begin Source File + +SOURCE=..\src\rangetab.c +# End Source File +# Begin Source File + +SOURCE=..\src\rangetab.h +# End Source File +# Begin Source File + +SOURCE=..\src\realpath.c +# End Source File +# Begin Source File + +SOURCE="..\src\redisplay-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\redisplay-output.c" +# End Source File +# Begin Source File + +SOURCE="..\src\redisplay-tty.c" +# End Source File +# Begin Source File + +SOURCE="..\src\redisplay-x.c" +# End Source File +# Begin Source File + +SOURCE=..\src\redisplay.c +# End Source File +# Begin Source File + +SOURCE=..\src\redisplay.h +# End Source File +# Begin Source File + +SOURCE=..\src\regex.c +# End Source File +# Begin Source File + +SOURCE=..\src\regex.h +# End Source File +# Begin Source File + +SOURCE="..\src\scrollbar-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\scrollbar-msw.h" +# End Source File +# Begin Source File + +SOURCE="..\src\scrollbar-x.c" +# End Source File +# Begin Source File + +SOURCE="..\src\scrollbar-x.h" +# End Source File +# Begin Source File + +SOURCE=..\src\scrollbar.c +# End Source File +# Begin Source File + +SOURCE=..\src\scrollbar.h +# End Source File +# Begin Source File + +SOURCE=..\src\search.c +# End Source File +# Begin Source File + +SOURCE="..\src\select-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\select-x.c" +# End Source File +# Begin Source File + +SOURCE=..\src\select.c +# End Source File +# Begin Source File + +SOURCE=..\src\select.h +# End Source File +# Begin Source File + +SOURCE=..\src\sgiplay.c +# End Source File +# Begin Source File + +SOURCE=..\src\sheap.c +# End Source File +# Begin Source File + +SOURCE=..\src\signal.c +# End Source File +# Begin Source File + +SOURCE=..\src\sound.c +# End Source File +# Begin Source File + +SOURCE=..\src\specifier.c +# End Source File +# Begin Source File + +SOURCE=..\src\specifier.h +# End Source File +# Begin Source File + +SOURCE=..\src\strcat.c +# End Source File +# Begin Source File + +SOURCE=..\src\strcmp.c +# End Source File +# Begin Source File + +SOURCE=..\src\strcpy.c +# End Source File +# Begin Source File + +SOURCE=..\src\strftime.c +# End Source File +# Begin Source File + +SOURCE="..\src\sunOS-fix.c" +# End Source File +# Begin Source File + +SOURCE=..\src\sunplay.c +# End Source File +# Begin Source File + +SOURCE=..\src\sunpro.c +# End Source File +# Begin Source File + +SOURCE=..\src\symbols.c +# End Source File +# Begin Source File + +SOURCE=..\src\symeval.h +# End Source File +# Begin Source File + +SOURCE=..\src\symsinit.h +# End Source File +# Begin Source File + +SOURCE=..\src\syntax.c +# End Source File +# Begin Source File + +SOURCE=..\src\syntax.h +# End Source File +# Begin Source File + +SOURCE=..\src\sysdep.c +# End Source File +# Begin Source File + +SOURCE=..\src\sysdep.h +# End Source File +# Begin Source File + +SOURCE=..\src\sysdir.h +# End Source File +# Begin Source File + +SOURCE=..\src\sysdll.c +# End Source File +# Begin Source File + +SOURCE=..\src\sysdll.h +# End Source File +# Begin Source File + +SOURCE=..\src\sysfile.h +# End Source File +# Begin Source File + +SOURCE=..\src\sysfloat.h +# End Source File +# Begin Source File + +SOURCE=..\src\sysproc.h +# End Source File +# Begin Source File + +SOURCE=..\src\syspwd.h +# End Source File +# Begin Source File + +SOURCE=..\src\syssignal.h +# End Source File +# Begin Source File + +SOURCE=..\src\systime.h +# End Source File +# Begin Source File + +SOURCE=..\src\systty.h +# End Source File +# Begin Source File + +SOURCE=..\src\syswait.h +# End Source File +# Begin Source File + +SOURCE=..\src\termcap.c +# End Source File +# Begin Source File + +SOURCE=..\src\terminfo.c +# End Source File +# Begin Source File + +SOURCE="..\src\toolbar-msw.c" +# End Source File +# Begin Source File + +SOURCE="..\src\toolbar-x.c" +# End Source File +# Begin Source File + +SOURCE=..\src\toolbar.c +# End Source File +# Begin Source File + +SOURCE=..\src\toolbar.h +# End Source File +# Begin Source File + +SOURCE=..\src\tooltalk.c +# End Source File +# Begin Source File + +SOURCE=..\src\tooltalk.h +# End Source File +# Begin Source File + +SOURCE=..\src\tparam.c +# End Source File +# Begin Source File + +SOURCE=..\src\undo.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexaix.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexalpha.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexapollo.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexconvex.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexcw.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexec.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexelf.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexelfsgi.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexencap.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexenix.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexfreebsd.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexfx2800.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexhp9k3.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexhp9k800.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexmips.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexnext.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexnt.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexsni.c +# End Source File +# Begin Source File + +SOURCE="..\src\unexsol2-6.c" +# End Source File +# Begin Source File + +SOURCE=..\src\unexsol2.c +# End Source File +# Begin Source File + +SOURCE=..\src\unexsunos4.c +# End Source File +# Begin Source File + +SOURCE=..\src\universe.h +# End Source File +# Begin Source File + +SOURCE="..\src\vm-limit.c" +# End Source File +# Begin Source File + +SOURCE=..\src\widget.c +# End Source File +# Begin Source File + +SOURCE=..\src\window.c +# End Source File +# Begin Source File + +SOURCE=..\src\window.h +# End Source File +# Begin Source File + +SOURCE=..\src\winslots.h +# End Source File +# Begin Source File + +SOURCE=.\xemacs.mak +# End Source File +# Begin Source File + +SOURCE=..\src\xgccache.c +# End Source File +# Begin Source File + +SOURCE=..\src\xgccache.h +# End Source File +# Begin Source File + +SOURCE=..\src\xintrinsic.h +# End Source File +# Begin Source File + +SOURCE=..\src\xintrinsicp.h +# End Source File +# Begin Source File + +SOURCE=..\src\xmmanagerp.h +# End Source File +# Begin Source File + +SOURCE=..\src\xmprimitivep.h +# End Source File +# Begin Source File + +SOURCE=..\src\xmu.c +# End Source File +# Begin Source File + +SOURCE=..\src\xmu.h +# End Source File +# End Target +# End Project diff -r 9f011ab08d48 -r 2f8bb876ab1d nt/xemacs.dsw --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nt/xemacs.dsw Mon Aug 13 11:16:07 2007 +0200 @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "xemacs"=".\xemacs.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff -r 9f011ab08d48 -r 2f8bb876ab1d nt/xemacs.mak --- a/nt/xemacs.mak Mon Aug 13 11:15:00 2007 +0200 +++ b/nt/xemacs.mak Mon Aug 13 11:16:07 2007 +0200 @@ -26,9 +26,14 @@ XEMACS=.. LISP=$(XEMACS)\lisp +LIB_SRC=$(XEMACS)\lib-src MODULES=$(XEMACS)\modules NT=$(XEMACS)\nt OUTDIR=$(NT)\obj +SRC=$(XEMACS)\src +MAKEDIRSTRING=$(MAKEDIR:\=\\) +XEMACSDIRSTRING=$(MAKEDIRSTRING:\\nt=) + # Define a variable for the 'del' command to use DEL=-del @@ -37,6 +42,8 @@ !include "..\version.sh" +!include "config.inc" + !if !defined(INFODOCK) INFODOCK=0 !endif @@ -315,7 +322,7 @@ MSW_LIBS= !if $(HAVE_MSW_C_DIRED) MSW_DEFINES=$(MSW_DEFINES) -DHAVE_MSW_C_DIRED -MSW_C_DIRED_SRC=$(XEMACS)\src\dired-msw.c +MSW_C_DIRED_SRC=$(SRC)\dired-msw.c MSW_C_DIRED_OBJ=$(OUTDIR)\dired-msw.obj !endif !if $(HAVE_XPM) @@ -325,7 +332,7 @@ !endif !if $(HAVE_GIF) MSW_DEFINES=$(MSW_DEFINES) -DHAVE_GIF -MSW_GIF_SRC=$(XEMACS)\src\dgif_lib.c $(XEMACS)\src\gif_io.c +MSW_GIF_SRC=$(SRC)\dgif_lib.c $(SRC)\gif_io.c MSW_GIF_OBJ=$(OUTDIR)\dgif_lib.obj $(OUTDIR)\gif_io.obj !endif !if $(HAVE_PNG) @@ -350,13 +357,13 @@ !endif !if $(HAVE_TOOLBARS) MSW_DEFINES=$(MSW_DEFINES) -DHAVE_TOOLBARS -MSW_TOOLBAR_SRC=$(XEMACS)\src\toolbar.c $(XEMACS)\src\toolbar-msw.c +MSW_TOOLBAR_SRC=$(SRC)\toolbar.c $(SRC)\toolbar-msw.c MSW_TOOLBAR_OBJ=$(OUTDIR)\toolbar.obj $(OUTDIR)\toolbar-msw.obj MSW_LIBS=$(MSW_LIBS) comctl32.lib !endif !if $(HAVE_DIALOGS) MSW_DEFINES=$(MSW_DEFINES) -DHAVE_DIALOGS -MSW_DIALOG_SRC=$(XEMACS)\src\dialog.c $(XEMACS)\src\dialog-msw.c +MSW_DIALOG_SRC=$(SRC)\dialog.c $(SRC)\dialog-msw.c MSW_DIALOG_OBJ=$(OUTDIR)\dialog.obj $(OUTDIR)\dialog-msw.obj !endif !if $(HAVE_WIDGETS) @@ -408,7 +415,7 @@ # Generic variables -INCLUDES=$(X_INCLUDES) $(MSW_INCLUDES) -I$(XEMACS)\nt\inc -I$(XEMACS)\src -I$(XEMACS)\lwlib +INCLUDES=$(X_INCLUDES) $(MSW_INCLUDES) -I$(NT)\inc -I$(SRC) -I$(XEMACS)\lwlib DEFINES=$(X_DEFINES) $(MSW_DEFINES) $(MULE_DEFINES) \ $(TAGBITS_DEFINES) $(LRECORD_DEFINES) $(UNION_DEFINES) \ @@ -424,24 +431,23 @@ -@mkdir $(OUTDIR) XEMACS_INCLUDES=\ - $(XEMACS)\src\config.h \ - $(XEMACS)\src\Emacs.ad.h \ - $(XEMACS)\src\paths.h + $(SRC)\config.h \ + $(SRC)\Emacs.ad.h \ + $(SRC)\paths.h -$(XEMACS)\src\config.h: config.h - copy config.h $(XEMACS)\src +$(SRC)\config.h: config.h + copy config.h $(SRC) -$(XEMACS)\src\Emacs.ad.h: Emacs.ad.h - copy Emacs.ad.h $(XEMACS)\src +$(SRC)\Emacs.ad.h: Emacs.ad.h + copy Emacs.ad.h $(SRC) -$(XEMACS)\src\paths.h: paths.h - copy paths.h $(XEMACS)\src +$(SRC)\paths.h: paths.h + copy paths.h $(SRC) #------------------------------------------------------------------------------ # lib-src programs -LIB_SRC = $(XEMACS)\lib-src LIB_SRC_DEFINES = -DHAVE_CONFIG_H -DWIN32 -DWINDOWSNT # @@ -471,7 +477,7 @@ # Inferred rule {$(LIB_SRC)}.c{$(LIB_SRC)}.exe : cd $(LIB_SRC) - $(CCV) -I. -I$(XEMACS)/src -I$(XEMACS)/nt/inc $(LIB_SRC_DEFINES) $(CFLAGS) -Fe$@ $** -link -incremental:no + $(CCV) -I. -I$(XEMACS)/src -I$(XEMACS)/nt/inc $(LIB_SRC_DEFINES) $(CFLAGS) -Fe$@ $** -link -incremental:no setargv.obj cd $(NT) # Individual dependencies @@ -497,6 +503,11 @@ $(LIB_SRC_TOOLS) \ $(LIB_SRC)/minitar.exe !endif +!if $(USE_PORTABLE_DUMPER) +LIB_SRC_TOOLS = \ + $(XEMACS_INCLUDES) \ + $(LIB_SRC_TOOLS) +!endif # Shorthand target minitar: $(LIB_SRC)/minitar.exe @@ -505,7 +516,7 @@ # runxemacs proglet -RUNEMACS = $(XEMACS)\src\runxemacs.exe +RUNEMACS = $(SRC)\runxemacs.exe $(RUNEMACS): $(LIB_SRC)\run.c $(LIB_SRC)\run.res $(CCV) -I$(LIB_SRC) $(CFLAGS) -Fe$@ -Fo$(LIB_SRC) -Fd$(LIB_SRC)\ $** kernel32.lib user32.lib -link -incremental:no @@ -520,7 +531,7 @@ !if !$(USE_SYSTEM_MALLOC) || !$(USE_PORTABLE_DUMPER) LASTFILE=$(OUTDIR)\lastfile.lib -LASTFILE_SRC=$(XEMACS)\src +LASTFILE_SRC=$(SRC) LASTFILE_FLAGS=$(CFLAGS) $(INCLUDES) -Fo$@ -Fd$* -c LASTFILE_OBJS= \ $(OUTDIR)\lastfile.obj @@ -583,135 +594,135 @@ DOC=$(LIB_SRC)\DOC DOC_SRC1=\ - $(XEMACS)\src\abbrev.c \ - $(XEMACS)\src\alloc.c \ - $(XEMACS)\src\alloca.c \ - $(XEMACS)\src\blocktype.c \ - $(XEMACS)\src\buffer.c \ - $(XEMACS)\src\bytecode.c \ - $(XEMACS)\src\callint.c \ - $(XEMACS)\src\callproc.c \ - $(XEMACS)\src\casefiddle.c \ - $(XEMACS)\src\casetab.c \ - $(XEMACS)\src\chartab.c \ - $(XEMACS)\src\cmdloop.c \ - $(XEMACS)\src\cmds.c \ - $(XEMACS)\src\console-stream.c \ - $(XEMACS)\src\console.c \ - $(XEMACS)\src\data.c \ - $(XEMACS)\src\device.c + $(SRC)\abbrev.c \ + $(SRC)\alloc.c \ + $(SRC)\alloca.c \ + $(SRC)\blocktype.c \ + $(SRC)\buffer.c \ + $(SRC)\bytecode.c \ + $(SRC)\callint.c \ + $(SRC)\callproc.c \ + $(SRC)\casefiddle.c \ + $(SRC)\casetab.c \ + $(SRC)\chartab.c \ + $(SRC)\cmdloop.c \ + $(SRC)\cmds.c \ + $(SRC)\console-stream.c \ + $(SRC)\console.c \ + $(SRC)\data.c \ + $(SRC)\device.c DOC_SRC2=\ - $(XEMACS)\src\dired.c \ - $(XEMACS)\src\doc.c \ - $(XEMACS)\src\doprnt.c \ - $(XEMACS)\src\dragdrop.c \ - $(XEMACS)\src\dynarr.c \ - $(XEMACS)\src\editfns.c \ - $(XEMACS)\src\elhash.c \ - $(XEMACS)\src\emacs.c \ - $(XEMACS)\src\eval.c \ - $(XEMACS)\src\event-stream.c \ - $(XEMACS)\src\events.c \ - $(XEMACS)\src\extents.c \ - $(XEMACS)\src\faces.c \ - $(XEMACS)\src\file-coding.c \ - $(XEMACS)\src\fileio.c \ - $(XEMACS)\src\filemode.c \ - $(XEMACS)\src\floatfns.c \ - $(XEMACS)\src\fns.c + $(SRC)\dired.c \ + $(SRC)\doc.c \ + $(SRC)\doprnt.c \ + $(SRC)\dragdrop.c \ + $(SRC)\dynarr.c \ + $(SRC)\editfns.c \ + $(SRC)\elhash.c \ + $(SRC)\emacs.c \ + $(SRC)\eval.c \ + $(SRC)\event-stream.c \ + $(SRC)\events.c \ + $(SRC)\extents.c \ + $(SRC)\faces.c \ + $(SRC)\file-coding.c \ + $(SRC)\fileio.c \ + $(SRC)\filemode.c \ + $(SRC)\floatfns.c \ + $(SRC)\fns.c DOC_SRC3=\ - $(XEMACS)\src\font-lock.c \ - $(XEMACS)\src\frame.c \ - $(XEMACS)\src\general.c \ - $(XEMACS)\src\glyphs.c \ - $(XEMACS)\src\glyphs-eimage.c \ - $(XEMACS)\src\glyphs-widget.c \ - $(XEMACS)\src\gui.c \ - $(XEMACS)\src\gutter.c \ - $(XEMACS)\src\hash.c \ - $(XEMACS)\src\imgproc.c \ - $(XEMACS)\src\indent.c \ - $(XEMACS)\src\insdel.c \ - $(XEMACS)\src\intl.c \ - $(XEMACS)\src\keymap.c \ - $(XEMACS)\src\line-number.c \ - $(XEMACS)\src\lread.c \ - $(XEMACS)\src\lstream.c \ - $(XEMACS)\src\macros.c \ - $(XEMACS)\src\marker.c + $(SRC)\font-lock.c \ + $(SRC)\frame.c \ + $(SRC)\general.c \ + $(SRC)\glyphs.c \ + $(SRC)\glyphs-eimage.c \ + $(SRC)\glyphs-widget.c \ + $(SRC)\gui.c \ + $(SRC)\gutter.c \ + $(SRC)\hash.c \ + $(SRC)\imgproc.c \ + $(SRC)\indent.c \ + $(SRC)\insdel.c \ + $(SRC)\intl.c \ + $(SRC)\keymap.c \ + $(SRC)\line-number.c \ + $(SRC)\lread.c \ + $(SRC)\lstream.c \ + $(SRC)\macros.c \ + $(SRC)\marker.c DOC_SRC4=\ - $(XEMACS)\src\md5.c \ - $(XEMACS)\src\menubar.c \ - $(XEMACS)\src\minibuf.c \ - $(XEMACS)\src\nt.c \ - $(XEMACS)\src\ntplay.c \ - $(XEMACS)\src\ntproc.c \ - $(XEMACS)\src\objects.c \ - $(XEMACS)\src\opaque.c \ - $(XEMACS)\src\print.c \ - $(XEMACS)\src\process.c \ - $(XEMACS)\src\process-nt.c \ - $(XEMACS)\src\profile.c \ - $(XEMACS)\src\rangetab.c \ - $(XEMACS)\src\realpath.c \ - $(XEMACS)\src\redisplay-output.c \ - $(XEMACS)\src\redisplay.c \ - $(XEMACS)\src\regex.c \ - $(XEMACS)\src\scrollbar.c \ - $(XEMACS)\src\search.c \ - $(XEMACS)\src\select.c \ - $(XEMACS)\src\signal.c \ - $(XEMACS)\src\sound.c + $(SRC)\md5.c \ + $(SRC)\menubar.c \ + $(SRC)\minibuf.c \ + $(SRC)\nt.c \ + $(SRC)\ntplay.c \ + $(SRC)\ntproc.c \ + $(SRC)\objects.c \ + $(SRC)\opaque.c \ + $(SRC)\print.c \ + $(SRC)\process.c \ + $(SRC)\process-nt.c \ + $(SRC)\profile.c \ + $(SRC)\rangetab.c \ + $(SRC)\realpath.c \ + $(SRC)\redisplay-output.c \ + $(SRC)\redisplay.c \ + $(SRC)\regex.c \ + $(SRC)\scrollbar.c \ + $(SRC)\search.c \ + $(SRC)\select.c \ + $(SRC)\signal.c \ + $(SRC)\sound.c DOC_SRC5=\ - $(XEMACS)\src\specifier.c \ - $(XEMACS)\src\strftime.c \ - $(XEMACS)\src\symbols.c \ - $(XEMACS)\src\syntax.c \ - $(XEMACS)\src\sysdep.c \ - $(XEMACS)\src\termcap.c \ - $(XEMACS)\src\tparam.c \ - $(XEMACS)\src\undo.c \ - $(XEMACS)\src\window.c \ - $(XEMACS)\src\widget.c + $(SRC)\specifier.c \ + $(SRC)\strftime.c \ + $(SRC)\symbols.c \ + $(SRC)\syntax.c \ + $(SRC)\sysdep.c \ + $(SRC)\termcap.c \ + $(SRC)\tparam.c \ + $(SRC)\undo.c \ + $(SRC)\window.c \ + $(SRC)\widget.c !if $(HAVE_X) DOC_SRC6=\ - $(XEMACS)\src\balloon_help.c \ - $(XEMACS)\src\console-x.c \ - $(XEMACS)\src\device-x.c \ - $(XEMACS)\src\dialog-x.c \ - $(XEMACS)\src\EmacsFrame.c \ - $(XEMACS)\src\EmacsManager.c \ - $(XEMACS)\src\EmacsShell-sub.c\ - $(XEMACS)\src\EmacsShell.c \ - $(XEMACS)\src\event-Xt.c \ - $(XEMACS)\src\frame-x.c \ - $(XEMACS)\src\glyphs-x.c \ - $(XEMACS)\src\gui-x.c \ - $(XEMACS)\src\menubar.c \ - $(XEMACS)\src\menubar-x.c \ - $(XEMACS)\src\objects-x.c \ - $(XEMACS)\src\redisplay-x.c \ - $(XEMACS)\src\scrollbar-x.c \ - $(XEMACS)\src\balloon-x.c \ - $(XEMACS)\src\xgccache.c \ - $(XEMACS)\src\xmu.c \ - $(XEMACS)\src\select-x.c + $(SRC)\balloon_help.c \ + $(SRC)\console-x.c \ + $(SRC)\device-x.c \ + $(SRC)\dialog-x.c \ + $(SRC)\EmacsFrame.c \ + $(SRC)\EmacsManager.c \ + $(SRC)\EmacsShell-sub.c\ + $(SRC)\EmacsShell.c \ + $(SRC)\event-Xt.c \ + $(SRC)\frame-x.c \ + $(SRC)\glyphs-x.c \ + $(SRC)\gui-x.c \ + $(SRC)\menubar.c \ + $(SRC)\menubar-x.c \ + $(SRC)\objects-x.c \ + $(SRC)\redisplay-x.c \ + $(SRC)\scrollbar-x.c \ + $(SRC)\balloon-x.c \ + $(SRC)\xgccache.c \ + $(SRC)\xmu.c \ + $(SRC)\select-x.c !endif !if $(HAVE_MSW) DOC_SRC7=\ - $(XEMACS)\src\console-msw.c \ - $(XEMACS)\src\device-msw.c \ - $(XEMACS)\src\event-msw.c \ - $(XEMACS)\src\frame-msw.c \ - $(XEMACS)\src\glyphs-msw.c \ - $(XEMACS)\src\gui-msw.c \ - $(XEMACS)\src\menubar-msw.c \ - $(XEMACS)\src\objects-msw.c \ - $(XEMACS)\src\redisplay-msw.c \ - $(XEMACS)\src\scrollbar-msw.c \ - $(XEMACS)\src\select-msw.c \ + $(SRC)\console-msw.c \ + $(SRC)\device-msw.c \ + $(SRC)\event-msw.c \ + $(SRC)\frame-msw.c \ + $(SRC)\glyphs-msw.c \ + $(SRC)\gui-msw.c \ + $(SRC)\menubar-msw.c \ + $(SRC)\objects-msw.c \ + $(SRC)\redisplay-msw.c \ + $(SRC)\scrollbar-msw.c \ + $(SRC)\select-msw.c \ $(MSW_C_DIRED_SRC) \ $(MSW_TOOLBAR_SRC) \ $(MSW_DIALOG_SRC) \ @@ -720,31 +731,31 @@ !if $(HAVE_MULE) DOC_SRC8=\ - $(XEMACS)\src\mule.c \ - $(XEMACS)\src\mule-charset.c \ - $(XEMACS)\src\mule-ccl.c + $(SRC)\mule.c \ + $(SRC)\mule-charset.c \ + $(SRC)\mule-ccl.c ! if $(HAVE_X) - DOC_SRC8=$(DOC_SRC8) $(XEMACS)\src\input-method-xlib.c + DOC_SRC8=$(DOC_SRC8) $(SRC)\input-method-xlib.c ! endif !endif !if $(DEBUG_XEMACS) DOC_SRC9=\ - $(XEMACS)\src\debug.c \ - $(XEMACS)\src\tests.c + $(SRC)\debug.c \ + $(SRC)\tests.c !endif !if !$(USE_SYSTEM_MALLOC) DOC_SRC10=\ - $(XEMACS)\src\free-hook.c \ - $(XEMACS)\src\gmalloc.c \ - $(XEMACS)\src\ntheap.c \ - $(XEMACS)\src\vm-limit.c + $(SRC)\free-hook.c \ + $(SRC)\gmalloc.c \ + $(SRC)\ntheap.c \ + $(SRC)\vm-limit.c !endif !if !$(USE_PORTABLE_DUMPER) DOC_SRC11=\ - $(XEMACS)\src\unexnt.c + $(SRC)\unexnt.c !endif #------------------------------------------------------------------------------ @@ -757,20 +768,22 @@ !ENDIF !if !$(USE_PORTABLE_DUMPER) -TEMACS_ENTRYPOINT=-entry:_start +TEMACS_ENTRYPOINT=-entry:_start +!else +TEMACS_ENTRYPOINT=-entry:mainCRTStartup !endif -TEMACS_DIR=$(XEMACS)\src +TEMACS_DIR=$(SRC) TEMACS=$(TEMACS_DIR)\temacs.exe TEMACS_BROWSE=$(TEMACS_DIR)\temacs.bsc -TEMACS_SRC=$(XEMACS)\src +TEMACS_SRC=$(SRC) TEMACS_LIBS=$(LASTFILE) $(LWLIB) $(X_LIBS) $(MSW_LIBS) \ oldnames.lib kernel32.lib user32.lib gdi32.lib advapi32.lib \ - shell32.lib wsock32.lib winmm.lib winspool.lib $(LIBC_LIB) + shell32.lib wsock32.lib winmm.lib winspool.lib ole32.lib uuid.lib $(LIBC_LIB) TEMACS_LFLAGS=-nologo $(LIBRARIES) $(DEBUG_FLAGS) -base:0x1000000\ - -stack:0x800000 $(TEMACS_ENTRYPOINT) -subsystem:console\ + -stack:0x800000 $(TEMACS_ENTRYPOINT) -subsystem:windows\ -pdb:$(TEMACS_DIR)\temacs.pdb -map:$(TEMACS_DIR)\temacs.map \ - -heap:0x00100000 -out:$@ -nodefaultlib + -heap:0x00100000 -nodefaultlib -incremental:no TEMACS_CPP_FLAGS=-c \ $(CFLAGS) $(INCLUDES) $(DEFINES) $(DEBUG_DEFINES) \ -DEMACS_MAJOR_VERSION=$(emacs_major_version) \ @@ -946,8 +959,7 @@ $(OUTDIR)\tparam.obj \ $(OUTDIR)\undo.obj \ $(OUTDIR)\widget.obj \ - $(OUTDIR)\window.obj \ - $(OUTDIR)\xemacs.res + $(OUTDIR)\window.obj # Rules @@ -977,7 +989,7 @@ #$(TEMACS_SRC)\paths.h: $(TEMACS_SRC)\paths.h.in # !"cd $(TEMACS_SRC); cp paths.h.in paths.h" -$(TEMACS): $(TEMACS_INCLUDES) $(TEMACS_OBJS) +$(TEMACS): $(TEMACS_INCLUDES) $(TEMACS_OBJS) $(OUTDIR)\xemacs.res !if $(DEBUG_XEMACS) @dir /b/s $(OUTDIR)\*.sbr > bscmake.tmp bscmake -nologo -o$(TEMACS_BROWSE) @bscmake.tmp @@ -985,20 +997,23 @@ !endif !if $(USE_PORTABLE_DUMPER) @if exist $(TEMACS_DIR)\xemacs.dmp del $(TEMACS_DIR)\xemacs.dmp -!endif link.exe @<< - $(TEMACS_LFLAGS) $(TEMACS_OBJS) $(TEMACS_LIBS) + $(TEMACS_LFLAGS) -out:$@ $(TEMACS_OBJS) $(TEMACS_LIBS) << +!else + link.exe @<< + $(TEMACS_LFLAGS) -out:$@ $(TEMACS_OBJS) $(OUTDIR)\xemacs.res $(TEMACS_LIBS) +<< +!endif $(OUTDIR)\xemacs.res: xemacs.rc rc -Fo$@ xemacs.rc # Section handling automated tests starts here -SRCDIR=$(MAKEDIR)\..\src -PROGNAME=$(SRCDIR)\xemacs.exe +PROGNAME=$(SRC)\xemacs.exe blddir=$(MAKEDIR:\=\\)\\.. -temacs_loadup=$(TEMACS) -batch -l $(SRCDIR)/../lisp/loadup.el +temacs_loadup=$(TEMACS) -batch -l $(LISP)/loadup.el dump_temacs = $(temacs_loadup) dump run_temacs = $(temacs_loadup) run-temacs ## We have automated tests!! @@ -1008,17 +1023,36 @@ # .PHONY: check check-temacs check: - cd $(SRCDIR) + cd $(SRC) $(PROGNAME) $(batch_test_emacs) check-temacs: - cd $(SRCDIR) + cd $(SRC) set EMACSBOOTSTRAPLOADPATH=$(LISP) set EMACSBOOTSTRAPMODULEPATH=$(MODULES) $(run_temacs) $(batch_test_emacs) # Section handling automated tests ends here +# Section handling tags starts here + +tagslisp=lisp + +tags: + @echo If you don't have a copy of etags around, then do 'make lib-src' first. + @echo To make use of the tags file, put the following in your .emacs: + @echo (setq tag-table-alist + @echo '(("$(XEMACSDIRSTRING)\\" . "$(XEMACSDIRSTRING)\\"))) + cd $(XEMACS) + $(DEL) TAGS + set PATH=lib-src;%PATH% +# argh!!! we need two ^^'s to get one ^, but only before a backslash. +# i have no idea why. probably some obscure nmake quoting convention. + etags -a -r "/[ ]*DEF\(VAR\|INE\)_[A-Z_]+[ ]*([ ]*\"\([^^\"]+\)\"/\2/" src\*.c src\*.h lwlib\*.c lwlib\*.h lib-src\*.c lib-src\*.h + etags -a -l none -r "/^(def\(var\|un\|alias\|const\|macro\|subst\|struct\|face\|group\|custom\|ine-\(function\|compiler-macro\|[a-z-]+alias\)\)[ ]+'?\([^ ]+\)/\3/" $(tagslisp)\*.el + +# Section handling tags ends here + # Section handling info starts here !if !defined(MAKEINFO) @@ -1258,14 +1292,21 @@ set EMACSBOOTSTRAPMODULEPATH=$(MODULES) -1 $(TEMACS) -batch -l $(TEMACS_DIR)\..\lisp\loadup.el dump !if $(USE_PORTABLE_DUMPER) - copy temacs.exe xemacs.exe + rc -d INCLUDE_DUMP -Fo $(OUTDIR)\xemacs.res $(NT)\xemacs.rc + link.exe @<< + $(TEMACS_LFLAGS) -out:xemacs.exe $(TEMACS_OBJS) $(OUTDIR)\xemacs.res $(TEMACS_LIBS) +<< +# Make the resource section read/write since almost all of it is the dump +# data which needs to be writable. This avoids having to copy it. + editbin -nologo -section:.rsrc,rw xemacs.exe + del $(TEMACS_DIR)\xemacs.dmp !endif cd $(NT) @if not exist $(TEMACS_DIR)\SATISFIED nmake -nologo -f xemacs.mak $@ #------------------------------------------------------------------------------ # use this rule to build the complete system -all: $(XEMACS)\Installation $(OUTDIR)\nul $(LASTFILE) $(LWLIB) \ +all: installation $(OUTDIR)\nul $(LASTFILE) $(LWLIB) \ $(LIB_SRC_TOOLS) $(RUNEMACS) $(TEMACS) update-elc $(DOC) dump-xemacs \ $(LISP)/auto-autoloads.el $(LISP)/custom-load.el info @@ -1282,10 +1323,7 @@ @xcopy /q $(LIB_SRC)\*.exe "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)\" @copy $(LIB_SRC)\DOC "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)" @copy $(CONFIG_VALUES) "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)" - @copy $(XEMACS)\src\xemacs.exe "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)" -!if $(USE_PORTABLE_DUMPER) - @copy $(XEMACS)\src\xemacs.dmp "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)" -!endif + @copy $(SRC)\xemacs.exe "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)" @copy $(RUNEMACS) "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)" @xcopy /e /q $(XEMACS)\etc "$(INSTALL_DIR)\etc\" @xcopy /e /q $(XEMACS)\info "$(INSTALL_DIR)\info\" @@ -1342,12 +1380,9 @@ perl ./make-src-depend > depend.tmp perl -MFile::Compare -e "compare('depend.tmp', 'depend') && rename('depend.tmp', 'depend') or unlink('depend.tmp')" -installation:: - @if exist $(XEMACS)\Installation del $(XEMACS)\Installation +$(XEMACS)\Installation:: installation -installation:: $(XEMACS)\Installation - -$(XEMACS)\Installation: +installation:: @type > $(XEMACS)\Installation << !if defined(OS) OS: $(OS) diff -r 9f011ab08d48 -r 2f8bb876ab1d nt/xemacs.rc --- a/nt/xemacs.rc Mon Aug 13 11:15:00 2007 +0200 +++ b/nt/xemacs.rc Mon Aug 13 11:16:07 2007 +0200 @@ -1,3 +1,7 @@ +#ifdef INCLUDE_DUMP +101 DUMP "xemacs.dmp" +#endif + XEmacs icon preload "xemacs.ico" XEmacsFile icon "File.ico" XEmacsLisp icon "Lisp.ico" diff -r 9f011ab08d48 -r 2f8bb876ab1d src/ChangeLog --- a/src/ChangeLog Mon Aug 13 11:15:00 2007 +0200 +++ b/src/ChangeLog Mon Aug 13 11:16:07 2007 +0200 @@ -1,3 +1,1226 @@ +2000-03-20 Martin Buchholz + + * XEmacs 21.2.32 is released. + +2000-03-12 Jan Vroonhof + + * sysdep.c: Include proper headers for mmap when pdumping() + +2000-03-20 Martin Buchholz + + * buffer.h (DFC_ALLOCA_USE_CONVERTED_DATA): + (DFC_MALLOC_USE_CONVERTED_DATA): + Add aliasing-safe casts to allow use with char* or unsigned char* + lvalues. + + * eldap.c (Fldap_open): + (Fldap_search_basic): + (Fldap_add): + (Fldap_modify): + Make C++-compilable. + Make sure GCPRO'ed variables are initialized. + Use temp variables to avoid repeated calls to Flength. + +2000-03-16 Martin Buchholz + + * sysfile.h: + Make sure PATH_MAX is always defined. + Include limits.h for PATH_MAX. + Deprecate use of MAXPATHLEN. + +2000-03-10 Martin Buchholz + + * emacs.c: Add reinit_vars_of_fileio. + * symsinit.h: Add reinit_vars_of_fileio. + * fileio.c (reinit_vars_of_fileio): New. + * fileio.c (Fmake_temp_name): + Initialize temp_name random number from microseconds to make + collisions even less likely. Initialize always at process startup + time. (make-temp-name) used to return the same file name twice in + a row when PDUMP. + Random stylistic fiddling. + Comment fixes. + +2000-03-20 Andy Piper + + * glyphs.c (image_instantiate): allow text glyphs to be + instantiated in the minibuffer window. + +2000-03-19 Andy Piper + + * glyphs.c (image_instance_hash): be careful about which items we + hash on. + + * glyphs-widget.c (tab_control_set_property): record into pending + items rather than the actual items. + + * glyphs-x.c (x_update_widget): use pending items to update with. + + * glyphs-msw.c (mswindows_tab_control_update): use pending items + to update with. + + * glyphs.c (mark_image_instance): mark pending items. + + * window.c (Fset_window_configuration): record the buffer. + (Fselect_window): totally revert previous change which breaks many + things. + +2000-03-18 Andy Piper + + * glyphs-msw.c (mswindows_tab_control_update): force selected + item. + + * glyphs.c (image_instantiate): don't allow the minibuffer as a + window domain cache, otherwise we get inconsistencies at + startup. There is something fishy at startup which can lead to the + minibuffer being the selected window when the gutter content is + instantiated. + + * gui.c (parse_gui_item_tree_list): add probably unneccessary + gcpros. + (parse_gui_item_tree_children): ditto. + (parse_gui_item_tree_item): ditto. + + * glyphs.c (Fupdate_widget_instances): return something. + +2000-03-18 Yoshiki Hayashi + + * window.c (Fselect_window): Undo 2000-03-17 change. + +2000-03-17 SL Baur + + * postgresql.c (Fpq_setenv): Remove this turkey when linking + against v7.0 libraries. Insta-coredump city until the postgres + folks fix it. + +2000-03-17 Andy Piper + + * faces.c (complex_vars_of_faces): don't give the widget face an + inherited background pixmap. + + * glyphs-msw.c (mswindows_tab_control_instantiate): select the + selected item. + + * event-stream.c (Fdispatch_non_command_events): return something. + + * gutter.c (output_gutter): use widget face. + (clear_gutter): ditto. + + * NEWS: adjust again. + + * window.c (Fselect_window): make sure this runs to completion to + avoid oddities with Fset_window_configuration. + (Fcurrent_window_configuration): in general do not save the + minibuffer as the selected window. + + * glyphs.h (IMAGE_INSTANCE_HASH_DEPTH): increase. + +2000-03-16 Olivier Galibert + + * emacs.c (Frunning_temacs_p): Revert previous patch. + (main_1): Reinitialize running_temacs_argc if pdump_load succeeds. + +2000-03-16 Andy Piper + + * glyphs-x.c (x_tab_control_update): if no widget values then + return. + + * NEWS: update for new features. + + * event-Xt.c (emacs_Xt_force_event_pending): new function. Post a + synthetic event to the native system. + (reinit_vars_of_event_Xt): set force_event_pending to + emacs_Xt_force_event_pending. + + * events.h (struct event_stream): add force_event_pending. + + * specifier.c (recompute_one_cached_specifier_in_window): add + comment. + + * redisplay.c (redisplay_frame): don't call + update_frame_subwindows. Reset subwindow cachels when + subwindows_changed, removing this was an optimization too far. + + * redisplay-output.c (compare_runes): reorganize so that we catch + glyph changes when we want them. Set optimize_output when this + would help layouts. + (redisplay_output_layout): remove frame_really_changed, use + optimize_output instead. + + * redisplay-msw.c (mswindows_output_display_block): reset + optimize_output after outputting a glyph. + * redisplay-x.c (x_output_display_block): ditto. + * redisplay-tty.c (tty_output_display_block): ditto. + + * gutter.c: (specifier_vars_of_gutter): use new spec changed + functions. + (gutter_specs_changed): do specific gutter positions. + (top_gutter_specs_changed): new function. Only update the + specified gutter specs. + (bottom_gutter_specs_changed): ditto. + (left_gutter_specs_changed): ditto. + (right_gutter_specs_changed): ditto. + + * gui.c (gui_item_hash_internal): new function, does a real hash. + (gui_item_id_hash): use it. + (gui_item_hash): hash the eval'ed gui_item. + + * gui-x.c (popup_selection_callback): send an eval event to call + Fupdate_widget_instances. + + * gui-msw.c (mswindows_handle_gui_wm_command): send an eval event + to call Fupdate_widget_instances. + + * glyphs.h (struct Lisp_Image_Instance): add optimize_output flag. + (IMAGE_INSTANCE_OPTIMIZE_OUTPUT): access it. + + * glyphs.c: (update_frame_subwindows): deleted. + (Fupdate_widget_instances): new function for updating the dirty + state of widgets that might have changed. + (syms_of_glyphs): add Qupdate_widget_instances. + (full_list_hash): hash a list completely. + (image_instance_hash): use it for items and properties. + + * frame-msw.c (mswindows_size_frame_internal): remove unused + variable. + + * faces.h (struct face_cachel): fix comment. + + * event-stream.c (Fdispatch_non_command_events): new + function. Process non-command events, forcing an event cycle + beforehand. + (syms_of_event_stream): declare. + (event_stream_force_event_pending): new function. Force an event + on the native event queue so that an event cycle will occur next + time we check. + + * event-msw.c: + (struct ntpipe_shove_stream): + (mswindows_enqueue_dispatch_event): + (mswindows_dequeue_dispatch_event): + (mswindows_cancel_dispatch_event): + (mswindows_pump_outstanding_events): + (mswindows_drain_windows_queue): + (mswindows_handle_paint): + (mswindows_wnd_proc): + (mswindows_key_to_emacs_keysym): + (get_process_input_waitable): + (emacs_mswindows_delete_stream_pair): re-indent file. + (mswindows_need_event): do not process further fds if the windows + fd is set, otherwise you get endless XM_BUMPQUEUE cycles. This + fixes the 100% cpu problem. + (reinit_vars_of_event_mswindows): set force_event_pending to 0. + +2000-03-15 Olivier Galibert + + * alloc.h: New. + * dumper.h: New. + * dumper.c: New. + + * emacs.c: Moved dump file searching to dumper.c. + (Frunning_temacs_p): Fixed. + + * alloc.c: Moved everything pdump-related to dumper.c. Removed + last_lrecord_type_index_assigned. + +2000-02-20 Olivier Galibert + + * symsinit.h: Added reinit parameter to init_console_stream + declaration. + + * lisp.h: Added file parameter to pdump_load declaration. + + * emacs.c (main_1): Added -nd/--nodump-file and -sd/--show-dump-id + support. Added dump file searching. + + * config.h.in: Added EMACS_PROGNAME. + + * console-stream.c (init_console_stream): Fix reinitialisation + when running from temacs. + + * alloc.c (pdump): Add id support. + (pdump_load): Add file parameter and signature/id support. + + * Makefile.in.in: Add full pdump support. + +2000-03-15 SL Baur + + * postgresql.c: Update documentation to reflect latest code + status. + (print_result): Show tuple counts in printed representation when + appropriate. + (Fpq_put_nbytes): MULE-ize. + (Fpq_get_line_async): Ditto. + +2000-03-14 SL Baur + + * postgresql.c (Fpq_lo_import): Fix return value. + Suggested by: Kenji Itoh . + +2000-03-13 Ben Wing + + * alloc.c (pdump_load): + Fix compile warning under mswin. + +2000-03-14 SL Baur + + * postgresql.c: Mule-ization, bug fixes. + Use PG_CODING to encapsulate coding system name changes. + Backport a version of TO_EXTERNAL format for 21.1/InfoDock. + (pg-coding-system): Create. + + (Fpq_conn_defaults): Mule-ize. + (Fpq_connectdb): Mule-ize & bug fix. + (Fpq_connect_start): Mule-ize. + (Fpq_set_client_encoding): Mule-ize. + (Fpq_finish): Document `DEAD' connection status. + (Fpq_clear): Ditto. + (Fpq_pgconn): Mule-ize. + (Fpq_exec): Mule-ize & bug fix. + (Fpq_send_query): Ditto. + (Fpq_get_result): Ditto. + (Fpq_res_status): Mule-ize. + (Fpq_result_error_message): Mule-ize. + (Fpq_ntuples): fix comments. + (Fpq_fname): Mule-ize. + (Fpq_fnumber): Mule-ize. + (Fpq_ftype): fix comments. + (Fpq_get_value): Mule-ize. + (Fpq_cmd_status): Ditto. + (Fpq_cmd_tuples): Ditto. + (Fpq_oid_value): Ditto. + (Fpq_notifies): Ditto. + (Fpq_lo_import): Ditto. + (Fpq_lo_export): Ditto. + (Fpq_get_line): Ditto. + (Fpq_put_line): Mule-ize and bug fix. + (syms_of_postgresql): Fix ifdef'ing, add pg-coding-system. + +2000-03-10 SL Baur + + * postgresql.c (vars_of_postgresql): Mule-ize. + (Fpq_conn_defaults): Ditto. + +2000-03-12 Ben Wing + + * alloc.c (Fmake_byte_code): + * alloc.c (debug_string_purity_print): + * alloc.c (pdump_backtrace): + * alloc.c (pdump_get_indirect_count): + * alloc.c (pdump_register_sub): + * alloc.c (pdump_register_object): + * alloc.c (pdump_register_struct): + * alloc.c (pdump_dump_data): + * alloc.c (pdump_reloc_one): + Minor cleanups. + + * console-msw.c: + * console-msw.c (GetConsoleHwnd): + * console-msw.c (msw_hide_console): + * console-msw.c (msw_show_console): + * console-msw.c (msw_ensure_console_buffered): + * console-msw.c (msw_output_console_string): + * console-msw.c (console_type_create_mswindows): + + a) Added functions to manipulate the console window for use with + shell support. + + b) Added support for writing text to the console, which is now + used under Windows when xemacs is not being run non-interactively, + to write text that would otherwise be destined for stdout because + under these circumstances, text written to stdout tends to + disappear and not be seen. + + * console-msw.h: + * event-Xt.c: + * event-Xt.c (x_event_to_emacs_event): + * event-Xt.c (describe_event_window): + * events-mod.h (XEMACS_MOD_CONTROL): + * events.c: + * events.c (Fmake_event): + * events.c (character_to_event): + * events.c (event_to_character): + * events.c (format_event_object): + * events.c (Fevent_modifiers): + * events.h: + * events.h (struct key_data): + * events.h (struct button_data): + * events.h (struct misc_user_data): + * frame-x.c (Fcde_start_drag_internal): + * frame-x.c (Foffix_start_drag_internal): + * gpmevent.c (Freceive_gpm_event): + * keymap.c: + * keymap.c (bucky_sym_to_bucky_bit): + * keymap.c (control_meta_superify): + * keymap.c (make_key_description): + * keymap.c (keymap_lookup_directly): + * keymap.c (create_bucky_submap): + * keymap.c (keymap_store): + * keymap.c (define_key_check_and_coerce_keysym): + * keymap.c (define_key_parser): + * keymap.c (define_key_alternate_name): + * keymap.c (Fdefine_key): + * keymap.c (raw_lookup_key_mapper): + * keymap.c (struct map_keymap_unsorted_closure): + * keymap.c (map_keymap_unsorted_mapper): + * keymap.c (map_keymap_sort_predicate): + * keymap.c (map_keymap_sorted): + * keymap.c (accessible_keymaps_mapper_1): + * keymap.c (where_is_recursive_mapper): + * keymap.c (describe_map_mapper): + * keymap.c (describe_map_sort_predicate): + * keymap.c (describe_map): + * keymap.c (complex_vars_of_keymap): + And a number of other files, the key modifier preprocessor + constants that xemacs uses have names that conflict with constants + defined under MS Windows for other purposes, so they were renamed + to begin with the prefix XEMACS_. The variables that hold such + modifiers were changed to consistently be of type int to fix + various compile warnings. + + * console.c (complex_vars_of_console): + * device.c: + * device-msw.c: + * device-msw.c (mswindows_finish_init_device): + * device-msw.c (msw_get_workspace_coords): + * device-msw.c (mswindows_device_system_metrics): + and various other files, added support for a new + device property called offset-workspace which returns the position + of the upper left corner of the workspace area and goes along with + the existing size-workspace property. + + * dialog-msw.c: + * dialog-msw.c (push_bufbyte_string_as_unicode): + * dialog-msw.c (mswindows_popup_dialog_box): + Added support for XEmacs-style accelerator specifications in + button text. Note: I didn't add support for this under X Windows, + and somebody needs to do this. + + * dialog.c: + * dialog.c (Fpopup_dialog_box): + Documented the support for accelerators that was just mentioned. + + editfns.c (get_home_directory): Changed behavior under Windows + when HOME not defined; former behavior was irretrievably broken. + + * emacs.c: + * emacs.c (main_1): + * emacs.c (main): + * minibuf.c (clear_echo_area_internal): + * minibuf.c (echo_area_append): + * print.c: + * print.c (std_handle_out_external): + * print.c (std_handle_out_va): + * print.c (fatal): + * print.c (write_string_to_stdio_stream): + * print.c (output_string): + * print.c (debug_print): + * print.c (debug_backtrace): + * print.c (debug_short_backtrace): + Cleaned up the code that prints text to stdout so that this can be + changed to output into a console window instead under MS Windows, + as described above. + + * eval.c: + * eval.c (DEFEND_AGAINST_THROW_RECURSION): + * eval.c (internal_catch): + * eval.c (unwind_to_catch): + * eval.c (throw_or_bomb_out): + * eval.c (condition_case_1): + * eval.c (signal_1): + * eval.c (check_error_state_sanity): + * eval.c (call_with_suspended_errors_1): + * eval.c (call_with_suspended_errors): + * eval.c (reinit_vars_of_eval): + Added code to catch throw loops and check for a pesky bug that may + be gone now. + + * event-msw.c: + * event-msw.c (key_needs_default_processing_p): + * event-msw.c (mswindows_wnd_proc): + * event-msw.c (mswindows_modifier_state): + * event-msw.c (emacs_mswindows_quit_p): + * event-msw.c (vars_of_event_mswindows): + a) Added support for using the alt key to select menu items as is + standard under MS Windows. This is controlled using the variable + menu-accelerator-enabled, just like under X Windows. There is an + option on the options menu to turn this support on. I really + think that it should be on by default under Windows, but I'm not + going to make this change yet. + + b) Added support for dynamic display size changes under Windows. + + * event-stream.c: + * event-stream.c (maybe_echo_keys): + * event-stream.c (Fnext_event): + * event-stream.c (command_builder_find_leaf): + * event-stream.c (lookup_command_event): + * event-stream.c (execute_command_event): + * event-stream.c (pre_command_hook): + * event-stream.c (post_command_hook): + * event-stream.c (syms_of_event_stream): + * event-stream.c (vars_of_event_stream): + * event-stream.c (complex_vars_of_event_stream): + * events.h (struct command_builder): + + a) Tried to clean up a little bit the horribly written x-specific + accelerator code that crept into this file. I moved this code + into menubar-x.c where it belongs. I also needed to move the + command builder structure into the file events.h because it is + accessed directly by this accelerator code. What I didn't do, but + which should be done at some point, is to properly abstract this + code using device methods instead of the kludgy way that it + currently hooks into the event code. + + b) Added the lisp variables this-command-properties and + last-command- properties, which should be used to synchronize two + adjacent commands in preference to playing games with the variable + this-command, which is typically what happens. + + c) Added some slightly nasty code to hook into the lisp support + for shifted- motion-key selection. This is actually necessary for + somewhat complicated reasons, which are described in + simple.el. (NB: I think the proper thing would be to have the code + that calls the pre and post command hooks also call out to generic + lisp functions in simple.el, where all built-in stuff could be + added. I will think about this more.) + + * event-unixoid.c (poll_fds_for_input): + * lread.c (readchar): + * redisplay-tty.c (tty_clear_frame): + * redisplay-x.c (x_get_gc): + * signal.c (interrupt_signal): + And a whole bunch of other files: fixed up places that printed + directly to stderr to instead call the function stderr_out so that + the changes I made under Windows work correctly. + + * filemode.c (mode_string): + Warning fixes. + + * frame-msw.c: + * frame-msw.c (mswindows_size_frame_internal): + Fixed the computation of frame size and position to keep the frame + within the workspace area, rather than within the physical + dimensions of the screen, so that the frame doesn't overlap window + manager decorations, such as the start menu and toolbar, typically + at the bottom of the screen. + + * frame.c (vars_of_frame): + Changed the default frame title format under MS Windows to consist + of buffername-XEmacs, which is standard under MS Windows. I think + it might be a good idea to change this everywhere because I think + it is superior to the current frame title format, but this is the + kind of change that is likely to cause some people to get annoyed, + so I'm not making it. + + * glyphs-eimage.c (png_instantiate): Fixed some compile warnings. + + * gui-msw.c (mswindows_handle_gui_wm_command): + Fixed compile warnings. + + * gui-x.c: + * gui-x.c (strdup_and_add_accel): + * gui-x.c (button_item_to_widget_value): + * gui-x.h: + Added code to automatically put an accelerator onto the beginning + of menu items that don't have one as is now the standard, and is + described more later. Also fixed things so that the menu item + name can be an evaluated expression, again a new standard. + + * gui.c: + * gui.c (gui_item_add_keyval_pair): + * gui.c (make_gui_item_from_keywords_internal): + * gui.c (gui_add_item_keywords_to_plist): + * gui.c (gui_item_accelerator): + * gui.c (gui_name_accelerator): + * gui.c (gui_item_included_p): + * gui.c (gui_item_display_flush_left): + * gui.c (gui_item_display_flush_right): + * gui.c (parse_gui_item_tree_item): + * gui.c (parse_gui_item_tree_children): + * gui.c (parse_gui_item_tree_list): + Mule-ized. Cleanup. GCPRO addition. + + * line-number.c (buffer_line_number): + * lisp.h: + * lisp.h (EMACS_INT_MAX): + Added the manifest constant EMACS_INT_MIN corresponding to the + existing constant EMACS_INT_MAX. This is partially to fix compile + warnings under Windows, and partly for cleanliness. + + * menubar-msw.c: + * menubar-msw.c (REPLACE_ME_WITH_GLOBAL_VARIABLE_WHICH_CONTROLS_RIGHT_FLUSH): + * menubar-msw.c (msw_translate_menu_or_dialog_item): + * menubar-msw.c (displayable_menu_item): + * menubar-msw.c (populate_menu_add_item): + * menubar-msw.c (populate_or_checksum_helper): + * menubar-msw.c (populate_menu): + * menubar-msw.c (update_frame_menubar_maybe): + * menubar-msw.c (prune_menubar): + * menubar-msw.c (msw_char_is_accelerator): + * menubar-msw.c (unsafe_handle_wm_initmenu_1): + * menubar-msw.c (mswindows_handle_wm_command): + * menubar-msw.c (mswindows_handle_wm_initmenupopup): + * menubar-msw.c (mswindows_handle_wm_initmenu): + * menubar-msw.c (mswindows_update_frame_menubars): + * menubar-msw.c (mswindows_free_frame_menubars): + * menubar-msw.c (mswindows_popup_menu): + Fixed a bug in handling accelerators where an extra character + would be displayed in the menu item. Also generalized the + function displayable_menu_item because it is now used by the + dialog box code as well. And finally, added code in the functions + that create the menubar to extract a list of accelerators for the + top level menubar, which is used in the event code to determine + whether a particular alt-key combination should be used to invoke + a menu item, or should be passed through to access the standard + XEmacs keymap binding for this key combination. + + Much needed GCPROing. + + * menubar-x.c: + * menubar-x.c (menu_item_descriptor_to_widget_value_1): + * menubar-x.c (menu_item_descriptor_to_widget_value): + * menubar-x.c (restore_in_menu_callback): + * menubar-x.c (x_popup_menu): + * menubar-x.c (menu_move_up): + * menubar-x.c (menu_move_down): + * menubar-x.c (menu_move_left): + * menubar-x.c (menu_move_right): + * menubar-x.c (menu_select_item): + * menubar-x.c (command_builder_operate_menu_accelerator): + * menubar-x.c (menu_accelerator_junk_on_error): + * menubar-x.c (command_builder_find_menu_accelerator): + * menubar-x.c (Faccelerate_menu): + * menubar.h: + Moved a whole bunch of code here that was previously in + event-stream.c as described above. There is also code connected + to the new standard of adding an accelerator to the beginning of + menu items that don't have one as described above and below. + + * menubar.c: + * menubar.c (menu_parse_submenu_keywords): + * menubar.c (Fmenu_find_real_submenu): + * menubar.c (Fnormalize_menu_item_name): + * menubar.c (syms_of_menubar): + * menubar.c (vars_of_menubar): + * menubar.c (complex_vars_of_menubar): + + a) Cleaned up a bunch of documentation and improved it. + + b) XEmacs now automatically adds an accelerator onto the beginning + of any menu items that don't have one. I did this because there + will inevitably be some menu items on the main menubar that don't + have accelerators on them because the package that adds that + particular menu item hasn't yet been fixed up to have accelerators + in them and it looked rather strange to have some items with and + some items without accelerators, especially since even in items + without accelerators, you can, at least under windows, still + access the item through an accelerator corresponding to the first + character in the item's name. If people don't like this behavior, + I can add a variable to turn it off optionally, but I'm not sure + this is a good idea because we really do need to have accelerators + on all of the menu items, and if a package doesn't like the + accelerators being put on the first character, then it should put + the accelerators where they belong. + + c) I made a behavior change, which is that the descriptor that + specifies the text of the menu item, which formerly was just a + string, can now also be an evaluated expression. This makes this + descriptor parallel with all of the others, which could also be + evaluated expressions. This also obviates the need for the + keyword :label, which was previously listed in the documentation + as unimplemented, and which was for the same purpose. + + d) GCPROing. + + * ntproc.c: + * ntproc.c (new_child): + * ntproc.c (sys_spawnve): + * ntproc.c (find_child_console): + * ntproc.c (sys_kill): + Fixed compile warnings. By the way, this file should really go + away entirely, and this will happen as soon as Kirill makes his + final round of process cleanups, which affect the function + call-process. + + * process-nt.c: + * process-nt.c (struct nt_process_data): + * process-nt.c (find_process_from_pid): + * process-nt.c (send_signal_the_nt_way): + * process-nt.c (enable_child_signals): + * process-nt.c (find_child_console): + * process-nt.c (send_signal_the_95_way): + * process-nt.c (nt_finalize_process_data): + * process-nt.c (ensure_console_window_exists): + * process-nt.c (nt_create_process): + * process-nt.c (nt_kill_child_process): + * process-nt.c (nt_kill_process_by_pid): + * process-nt.c (nt_open_network_stream): + * process-nt.c (vars_of_process_nt): + Copied over code from Emacs 20.5 to correctly send signals to sub- + processes under Windows 95. Also added code to automatically + create and hide console window when a sub-process is created under + Windows 95, which obviates the need for the separate runemacs.exe + executable, and finally implemented some variables that were + implemented in Emacs 20.5, but previously not in XEmacs. These + include mswindows- start-process-share-console and + mswindows-start-process-inherit-error-mode. (Both of these only + apply to Windows 95.) + + * regex.c (regex_compile): Fixed a compile warning. + + * select-msw.c: + * select-msw.c (mswindows_own_selection): + * select-msw.c (mswindows_get_foreign_selection): + * select-msw.c (mswindows_disown_selection): + * select-msw.c (console_type_create_select_mswindows): + * select-msw.c (syms_of_select_mswindows): + Cleaned up the file and implemented the device method + selection_exists_p, which had accidentally been left out. Also + removed four lisp functions that were remnants from before the + time when the selection code was properly device abstracted. + These functions are no longer needed because there are generic + equivalents, and because they were added recently and don't exist + in FSF Emacs, I don't think there's any problem with just deleting + them. + + * sysdep.c: + * sysdep.c (sys_subshell): + Fixed a compile warning, although in this case there's probably + something wrong with this code, and it ought to be looked into + more thoroughly by somebody who understands it. + + * window.c: + * window.c (Fwindow_text_area_height): + * window.c (Fwindow_width): + * window.c (Fwindow_full_width): + * window.c (Fwindow_pixel_width): + * window.c (debug_print_window): + * window.c (syms_of_window): + Added functions window-text-area-height and window-full-width, + which are functions for returning various width and height + characteristics of a window. (One of these functions is necessary + for making the file dialog box work correctly, and the other one + was added for completeness.) Also added a table to the + documentation for window-height which describes the entire scheme + for accessing width and height characteristics of a window. + +2000-03-12 Kirill 'Big K' Katsnelson + + * nt.c (fstat): Added a comment for another problem with + non-encapsulated [f]stat(), reported by Adrian Aichner + . + +2000-03-11 Andy Piper + + * window.c (make_dummy_parent): initialize subwindow instance + cache. + (Fset_window_configuration): zero extent_modiff. + +2000-03-10 Andy Piper + + * redisplay.c (Fredraw_frame): reset the changed_set flags so that + more changes can be triggered. + (Fredisplay_frame): ditto. + (Fredraw_device): ditto. + (Fredisplay_device): ditto. + (redisplay_frame): make non-static. + (redisplay_frame): call update_frame_gutter_geometry outside of + display proper. + + * gutter.h: declare update_frame_gutter_geometry. + + * redisplay.h: declare redisplay_frame. + + * gutter.c (update_frame_gutter_geometry): move geometry changes + in update_frame_gutters here. Geometry changes can only occur + outside of redisplay. + (update_frame_gutters): remove geometry change code. + (Fredisplay_gutter_area): make sure that we are in display when we + update and that we have flushed any size changes. + +2000-03-11 Andy Piper + + * alloc.c (pdump_dump_data): remove i & count shadows. + +2000-02-27 Mike Alexander + + * sysdep.h: Declare pdump_read_file + + * sysdep.c (pdump_read_file): New function + + * alloc.c (pdump_load): Call pdump_read_file to get the portable + dump data + +2000-03-10 SL Baur + + * lrecord.h: add `lrecord_type_pgsetenv'. + +2000-03-08 SL Baur + + * symsinit.h: declare (vars|syms)_of* functions. + * lrecord.h: add `lrecord_type_pgconn' and 'lrecord_type_pgresult'. + +2000-03-06 SL Baur + + * config.h.in: Add symbols HAVE_POSTGRESQL and HAVE_POSTGRESQLV7 + + * inline.c: Include postgresql.h lrecord stuffs to placate buggy + GCCs. + + * emacs.c (main_1): Call postgres initialization code. + + * postgresql.h: New file. PostgreSQL RDBMS support. + * postgresql.c: New file. + +2000-03-08 Yoshiki Hayashi + + * redisplay-output.c (redisplay_output_display_block): Disable + redundant code. + +2000-03-09 Yoshiki Hayashi + + * mule-canna.c (Fcanna_henkan_region): Translate doc-string. + (Fcanna_henkan_next): Ditto. + (Fcanna_bunsetu_henkou): Ditto. + (Fcanna_henkan_kakutei): Ditto. + (Fcanna_henkan_end): Ditto. + (Fcanna_henkan_quit): Ditto. + (Fcanna_henkan_next): Set retun value correctly. + (c2mu): Use unsigned char instead of signed char. + +2000-03-09 Yoshiki Hayashi + + * emacs.c (main_1): Always call syms_of_gui. + * inline.c: include gui.h + +2000-03-09 Yoshiki Hayashi + + * redisplay.c (Vvisible_bell): Renamed from visible_bell and + converted to Lisp_Object. + (Qtop_bottom): New variable. + (syms_of_redisplay): Initialize it. + * redisplay.h (Vvisible_bell): Ditto. + * sound.c (ding): Ditto and check if Vvisible_bell is nil. + * redisplay-x.c (x_flash): When Vvisible_bell is top-bottom, + only flash top and bottom. + +2000-03-08 Andy Piper + + * buffer.c (Frename_buffer): record new buffer name the right way. + +2000-03-08 Andy Piper + + * glyphs.c (update_subwindow): increase hash depth so that widget + items get picked up properly. + + * redisplay-output.c (compare_runes): increase hash depth so that + widget items get picked up properly. + +2000-03-08 Andy Piper + + * gutter.c (output_gutter): add some debug. + + * glyphs.h (struct Lisp_Image_Instance): add display_hash. + (IMAGE_INSTANCE_DISPLAY_HASH): new macro. + (XIMAGE_INSTANCE_DISPLAY_HASH): ditto. + + * redisplay-output.c (compare_runes): use display_hash to + determine if glyphs really are not the same. + + * glyphs.c (update_subwindow): check display_hash to see if + anything really needs to be updated. If not then do + nothing. Record the display_hash after updating. + (image_instance_equal): compare the image_instance face also. + +2000-03-07 Yoshiki Hayashi + + * redisplay.h: Fix comment style. + +2000-03-08 Jonathan Harris + + * consle-msw.h (struct mswindows_frame): + Added new member paint_pending to indicate whether a WM_PAINT + magic event has been queued for this frame. + + * event-msw.c (mswindows_drain_windows_queue): + Don't queue a WM_PAINT magic event if one is already queued. + (emacs_mswindows_handle_magic_event): clear paint_pending flag. + + * frame-msw.c (mswindows_init_frame_1): initialise paint_pending flag. + +2000-03-07 Didier Verna + + * dired.c: #include `regex.h' after `sysfile.h'. + +2000-03-06 Martin Buchholz + + * sound.c (init_nas_sound): Fix compiler warning. + + * alloc.c (ALIASING_VOIDPP_DEREFERENCE): New. + (FREE_STRUCT_P): + (MARK_STRUCT_AS_FREE): + (MARK_STRUCT_AS_NOT_FREE): + Make `gcc -fstrict-aliasing' work properly. + +2000-03-07 Jonathan Harris + + * device-msw.c (mswindows_finish_init_device): Call CoInitialize(). + (mswindows_delete_device): Call CoUnnitialize(). + + * event-msw.c (mswindows_wnd_proc): WM_DROPFILES: Decode Shortcuts. + +2000-02-25 + + * process-nt.c: MinGW now has , but still needs + . + + * sysdep.c: This extern declaration for environ prevents MinGW + from finding the variable in CRTDLL.DLL. + + * s\mingw32.h (PBS_SMOOTH): Removed, now defined in cygwin's + windows headers. + (SHGFI_EXETYPE): .. + (WM_MOUSEWHEEL): .. + (_WIN32_IE): Added, needed to get the TCS_BOTTOM and TCS_VERTICAL + definitions. + (MMRESULT): Removed, now defined in cygwin's windows headers. + (TIMECAPS): .. + (uid_t,gid_t,pid_t,ssize_t): .. + (_timeb): Removed, MinGW defines both _timeb and timeb. + (HAVE_H_ERRNO): Added. + (HAVE_TZNAME): Added, configure is not detecting this. + +2000-02-03 IKEYAMA Tomonori + + * chartab.h (XCHAR_TABLE_VALUE_UNSAFE): New macro. + * syntax.c (syntax_match): Use it. + + * cmds.c: Import auto-fill-chars from FSF Emacs. + (Vauto_fill_chars): New variables. + (internal_self_insert): Check Vauto_fill_chars. + (vars_of_cmds): + Declare auto-fill-chars as a Lisp variable and initialize it. + +2000-03-05 Jonathan Harris + + * fileio.c (Fmake_symbolic_link): + (Ffile_symlink_p): + Run handlers even if local machine doesn't have symlinks. + +2000-03-05 Jonathan Harris + + * event-msw.c (mswindows_drain_windows_queue): + Don't generate paint magic events for non-XEmacs frames. + +2000-03-05 Andy Piper + + * redisplay.c (redisplay_frame): generate_displayable_area and + friends assumes that we are not in GC, we therefore have to make + sure that this doesn't happen. + + * gutter.c (calculate_gutter_size): generate_displayable_area + assumes that we are not in GC, we therefore have to make sure that + this doesn't happen. + +2000-03-05 Martin Buchholz + + * opaque.c (DEFINE_LRECORD_IMPLEMENTATION): opaque_ptr ==> opaque-ptr + +2000-03-03 Jan Vroonhof + + * redisplay.c (regenerate_window): Make sure we set a sane value + for end_pos even if we jump out of the loop. + (regenerate_window): Answer Ben's question :-). + (start_end_of_last_line): Add may_error argument. + (start_of_last_line): + (end_of_last_line): Pass may_error = 0. + (end_of_last_line_may_error): New function. + (pixel_to_glyph_translation): Use it, so we don't crash in + event_to_glyph. + +2000-03-04 Andy Piper + + * window.h (struct window): add gutter_extent_modiff. + + * window.c (allocate_window): zero out gutter_extent_modiff. + + * redisplay.h: declare sync_display_line_structs. + + * redisplay.c (add_glyph_rune): add a better comment. + + * redisplay-output.c (sync_display_line_structs): made non-static. + (compare_runes): remove unneccesary glyph cachel access. + + * gutter.h: declare gutter_extent_signal_changed_region_maybe. + + * gutter.c (output_gutter): don't output the gutter if extent + changes only involve extents in buffers. use 4 sets of display + lines. + (gutter_extent_signal_changed_region_maybe): new function. Mark + extents in gutters as changed. + (update_frame_gutters): use 4 sets of display lines. + (reset_gutter_display_lines): ditto. + (free_frame_gutters): ditto. + (redraw_exposed_gutter): force output of gutters. + + * frame.h (struct frame): add 4 sets of gutter display lines. + + * extents.c: (extent_changed_for_redisplay): signal changes to + extents in strings in the gutter as well as extents in buffers. + +2000-03-02 Andy Piper + + * gutter.c (specifier_vars_of_gutter): cosmetic changes. + + * frame.c (Fmake_frame): make sure the gutters get initialized + after the frame is visible. + (set_frame_selected_window): re-arrange compilation macros a + little. + (change_frame_size_1): mark gutters changed. + + * device.c (Fset_device_class): mark gutters changed. + +2000-03-01 Andy Piper + + * window.c (window_top_frame_gutter_height): deleted. + (window_bottom_frame_gutter_height): ditto. + (window_left_frame_gutter_height): ditto. + (window_right_frame_gutter_height): ditto. + (window_top_gutter_height): don't use them. + (window_bottom_gutter_height): ditto. + (window_left_gutter_width): ditto. + (window_right_gutter_width): ditto. + (Fsplit_window): ditto. + (Fwindow_pixel_edges): don't use border dimensions here. + + * scrollbar.c (update_scrollbar_instance): don't take gutters into account. + (update_scrollbar_instance): ditto. + + * redisplay.c (generate_modeline): don't take gutters into account. + (generate_modeline): ditto. + (redisplay_frame): small gutter display optimisation. + + * redisplay-x.c (x_output_vertical_divider): don't take gutters into account. + + * redisplay-msw.c (mswindows_output_vertical_divider): don't take + gutters into account. + + * gutter.h (WINDOW_REAL_*_GUTTER_BOUNDS): remove bogus checks + for window position and type. + + * gutter.c (get_gutter_coords): fix for frame gutters. + (update_frame_gutters): update frame geometry if the gutters have + changed. + (init_frame_gutters): record current gutter geometries. + + * glyphs-msw.c (mswindows_subwindow_instantiate): remove unused + var. + (mswindows_widget_instantiate): ditto. + + * frame.h (struct frame): add current_gutter_bounds. + + * frame.c (change_frame_size_1): position window and minibuffer + appropriately taking into account the frame gutters. + + * frame-x.c: (x_initialize_frame_size): take into account the + frame gutters. + +2000-02-29 Stephen J. Turnbull + + * emacs.c (data-directory): Xref `locate-data-file' in docstring. + +2000-02-29 Stephen J. Turnbull + + * alloc.c (dumpopaquevec): Increase dimension for --with-canna. + +1999-12-30 Yoshiki Hayashi + + * file-coding.c (reset_decoding_stream): Clear previous + detection state when autodetect. + +2000-02-29 Didier Verna + + * extents.c (set_extent_glyph_1): don't require extents to be + attached. + +2000-02-27 Andy Piper + + * gutter.c (Fset_default_gutter_position): don't default left and + right gutter visibility to t. + (Fset_default_gutter_position): run + default-gutter-position-changed-hook. + (syms_of_gutter): add default-gutter-position-changed-hook. + +2000-02-26 Andy Piper + + * specifier.c (Fmake_specifier): add gutter references. + + * gutter.h (RAW_WINDOW_GUTTER): new macro. + + * lisp.h: declare Fvalid_plist_p. + + * gutter.c (gutter_geometry_changed_in_window): mark the modeline + as changed. + (default_gutter_visible_p_changed_in_window): invalidate gutter as + well as its visibility so that it gets reconstructed. + (construct_window_gutter_spec): new function. Construct a string + to be displayed in the gutter from a plist of strings. Take care + to only use elements that are declared as visible. + (calculate_gutter_size): use RAW_WINDOW_GUTTER instead of + WINDOW_GUTTER. + (gutter_validate): allow plists of strings in the specifier. + (gutter_specs_changed): construct the real_gutter from the gutter + specs using construct_window_gutter_spec. + (gutter_visible_validate): gutter-visible is a new specifier type. + (Fgutter_visible_specifier_p): new function for the new specifier. + (syms_of_gutter): declare gutter-visible and + Fgutter_visible_specifier_p. + (specifier_type_create_gutter): intitalize new gutter-visible + specifier. + (reinit_specifier_type_create_gutter): ditto. + (specifier_vars_of_gutter): use new specifier type for gutter + visibility. + (init_frame_gutters): construct real_gutter correctly. + (Fgutter_specifier_p): beef up documentation. + (Fgutter_size_specifier_p): ditto. + + * winslots.h: add real_gutter slots. + +2000-02-25 Andy Piper + + * device-msw.c: Be kind to older cygwin versions. From Raymond + Toy . + + * gui-msw.c (Fmswindows_shell_execute): Remove things unknown to + earlier cygwins. From Raymond Toy . + +2000-02-25 Martin Buchholz + + * elhash.c (MARK_OBJ): Practice macro hygiene. + +2000-02-24 Martin Buchholz + + * miscplay.c: s/__inline__/inline/g; + * glyphs-msw.c (set_mono_pixel): INLINE ==> static inline + (get_device_compdc): INLINE ==> static inline + * *.[ch]: Change INLINE to INLINE_HEADER globally. + find -name '*.h' | \ + xargs global-replace \ + 's/(^|(?<=[^A-Za-z0-9_]))INLINE((?=[^A-Za-z0-9_])|$)/INLINE_HEADER/g' + +2000-02-25 Andy Piper + + * window.c (window_top_frame_gutter_height): new function. + (window_top_window_gutter_height): ditto. + (window_top_gutter_height): use them. + (window_bottom_frame_gutter_height): new function. + (window_bottom_window_gutter_height): ditto. + (window_bottom_gutter_height): use them. + (window_left_window_gutter_width): new function. + (window_left_frame_gutter_width): ditto. + (window_left_gutter_width): use them. + (window_right_window_gutter_width): new function. + (window_right_frame_gutter_width): ditto. + (window_right_gutter_width): use them. + (window_pixel_height): new function. calulate window pixel height + with frame gutter involvement. + (Fsplit_window): calculate new sizes taking frame gutters into + account. + (window_char_height_to_pixel_height): don't include frame gutters. + (window_char_height): use window_pixel_height. + (window_pixheight): rename from window_pixel_height. + (change_window_height): use it. + (window_pixel_height_to_char_height): don't include frame gutters. + (window_char_width_to_pixel_width): ditto. + +2000-02-25 Andy Piper + + * glyphs.h (IMAGE_INSTANCE_FACE): glyph might be nil, don't crash + if it is. + +2000-02-24 Martin Buchholz + + * alloc.c (staticpro): + (staticpro_nodump): + (dumpstruct): + (dumpopaque): + (pdump_wire): + (pdump_wire_list): + (compact_string_chars): + (pdump_dump_wired): + Convert: if (foo) abort(); ==> assert (! foo); + + * eldap.c (Fldap_search_basic): + (Fldap_add): + (Fldap_modify): + (Fldap_delete): + Fix compiler warnings, and possible crashes if (random) return + value were to be used. + +2000-02-21 Kirill 'Big K' Katsnelson + + * device-msw.c: Workaround ResetDC failure. + + * frame-msw.c (msprinter_init_frame_3): Added an assertion before + applying a devmode. + + * redisplay-msw.c (get_frame_dc): Added start_page_p. + (mswindows_text_width): Do not start printer page. + + * console-msw.h (CHECK_MSGDI_DEVICE): Added this and friends. + + * glyphs-msw.c: Added image methods to msprinter console and + msprinter-specific image instantiation. + +2000-02-20 Mike Alexander + + * select-msw.c (Fmswindows_set_clipboard): GC protect more things + to avoid crashes when selection-sets-clipboard is on + (mswindows_own_selection): ditto + +2000-02-19 Kirill 'Big K' Katsnelson + + * glyphs-msw.c: + * redisplay-msw.c (get_frame_dc): + (get_frame_compdc): + * console-msw.h: + * device-msw.c (mswindows_init_device): + (mswindows_delete_device): + (msprinter_init_device): + (msprinter_delete_device): + * frame-msw.c (mswindows_init_frame_1): + (mswindows_delete_frame): + (msprinter_init_frame_3): + (msprinter_delete_frame): Move compatible DC to device object from + frame object, for both mswindows and msprinter. Only one at a time + is needed, it is a real waste to have one per frame! + +2000-02-23 Andy Piper + + * glyphs.c: add dynamic width and height elements. + (image_instance_equal): ditto. + + * glyphs-widget.c (widget_query_geometry): calculate width and + height dynamically if required. + (initialize_widget_image_instance): initialize dynamic dimensions. + (widget_instantiate): pick-up dynamic dimensions. + + * glyphs.h (struct Lisp_Image_Instance): add width and height for + dynamic determination. Add appropriate macros. + + * gutter.h (WINDOW_GUTTER_BORDER_WIDTH): make non-integer + dimensions safe. + (WINDOW_GUTTER_SIZE): ditto. + (WINDOW_GUTTER_SIZE_INTERNAL): ditto. + + * redisplay-msw.c (get_frame_compdc): gcc can't cope with this + inline. + (get_frame_dc): ditto. + + * redisplay.h (GLOBAL_RESET_CHANGED_FLAGS): don't reset faces + here. + 2000-02-23 Martin Buchholz * XEmacs 21.2.31 is released. @@ -12,7 +1235,7 @@ 2000-02-21 Mike Sperber - * .dbxrc: + * .dbxrc: * .gdbinit: * Makefile.in.in: Remove obsolete EMACSBOOTSTRAP... environment variables. @@ -62,9 +1285,9 @@ * alloc.c (pdump_load): * alloc.c (GC_CHECK_LHEADER_INVARIANTS): New. * alloc.c (lrecord_type_index): Delete. - Make lisp object type indexes be constant. + Make lisp object type indexes be constant. Makes (byte-compile) 5% faster. - Put all marker functions into their own array. + Put all marker functions into their own array. Makes (garbage-collect) 5% faster. Optimize SYMBOL_VALUE_MAGIC_P. Makes (byte-compile) 2-3% faster. @@ -109,7 +1332,7 @@ * objects-msw.c: (mswindows_X_color_map): tweak some values so they match the default Windows palette. (mswindows_color_to_string): New function. - + 2000-02-21 Jonathan Harris * s/windowsnt.h: Only use __declspec(noreturn) with MSVC>=6. @@ -118,7 +1341,7 @@ * m/*, s/*: Removed obsolete DATA_SEG_BITS, PURE_SEG_BITS, WORD_MACHINE, SIGN_EXTEND_CHAR and EXPLICIT_SIGN_EXTEND. - + * symbols.c (init_symbols_once_early): Removed obsolete DATA_SEG_BITS related kludge. (defvar_magic): Ditto. @@ -137,12 +1360,12 @@ 2000-02-16 Kirill 'Big K' Katsnelson - * keymap.c (get_keyelt): + * keymap.c (get_keyelt): * unexnt.c (unexec): * vm-limit.c (memory_warnings): * ntheap.c (recreate_heap): * ntheap.h (UNINIT_PTR): - * select-msw.c (Fmswindows_get_clipboard): + * select-msw.c (Fmswindows_get_clipboard): (Fmswindows_set_clipboard): * objects-msw.h (MSWINDOWS_BAD_HFONT): * objects-msw.c: @@ -152,15 +1375,15 @@ * sysdep.c (sys_subshell): * process-nt.c (nt_create_process): * nt.c (normalize_filename): - (dostounix_filename): + (dostounix_filename): (unixtodos_filename): * ntproc.c (win32_executable_type): * ntplay.c (play_sound_data_1): - (play_sound_file): - * editfns.c (get_home_directory): - * event-msw.c (struct winsock_stream): - (mswindows_dde_callback): - * device-msw.c (msprinter_init_device): + (play_sound_file): + * editfns.c (get_home_directory): + * event-msw.c (struct winsock_stream): + (mswindows_dde_callback): + * device-msw.c (msprinter_init_device): (msprinter_get_devmode_copy): Frobbed syntax frivolities. * toolbar-msw.c (mswindows_free_frame_toolbars): Paramters to @@ -173,16 +1396,16 @@ * glyphs-widget.c (update_widget): Fixed comparison notation. * event-msw.c (mswindows_dde_callback): Removed extraneous ';'. - + * s\windowsnt.h (DOESNT_RETURN): Defined to support the MSVC __declspec(noreturn) syntax. 2000-02-19 Martin Buchholz - * eldap.c (Fldap_open): - (Fldap_search_basic): - (Fldap_add): - (Fldap_modify): + * eldap.c (Fldap_open): + (Fldap_search_basic): + (Fldap_add): + (Fldap_modify): Use new coding system conversion macros. 2000-01-06 Yoshiki Hayashi @@ -191,7 +1414,7 @@ 1999-11-27 Oscar Figueiredo - * eldap.h (Fldap_search) Renamed from Fldap_search_internal: + * eldap.h (Fldap_search) Renamed from Fldap_search_internal: (Fldap_add, Fldap_modify, Fldap_delete): New functions * eldap.c (Qadd, Qreplace): New constant symbols @@ -200,7 +1423,7 @@ Remove unnecessary calls to slow_down_interrupts and speed_up_interrupts (Fldap_search_basic): Renamed from Fldap_search_internal - Added new optional parameter VERBOSE that triggers the + Added new optional parameter VERBOSE that triggers the display of progress messages Remove unnecessary calls to slow_down_interrupts and speed_up_interrupts diff -r 9f011ab08d48 -r 2f8bb876ab1d src/ChangeLog.1 --- a/src/ChangeLog.1 Mon Aug 13 11:15:00 2007 +0200 +++ b/src/ChangeLog.1 Mon Aug 13 11:16:07 2007 +0200 @@ -50,7 +50,7 @@ * This change adds four scrollbar specifiers: {horizontal,vertical}-scrollbar-visible-p and scrollbar-on-{top,left}-p. - Spare parts supplied by Didier Verna + Spare parts supplied by Didier Verna * frameslots.h: Added slots for the four specifier caching. @@ -80,7 +80,7 @@ (specifier_vars_of_scrollbar): Declared the four specifiers. * window.h (struct window): Defined slots for caching the new - specifiers. + specifiers. * window.c (mark_window): Mark them. (allocate_window): Initialize them. @@ -123,7 +123,7 @@ 1998-05-10 Kirill M. Katsnelson - * EmacsFrame.c (update_various_frame_slots): Do not store internal + * EmacsFrame.c (update_various_frame_slots): Do not store internal border width there. (EmacsFrameInitialize): Do it rather here. (EmacsFrameSetValues): If EditRes has changed internal border @@ -135,11 +135,11 @@ variables and access macros Added size_slipped redisplay bit and mark/clear macros. - * redisplay.c (redisplay_frame): Adjust frame size if size slipped + * redisplay.c (redisplay_frame): Adjust frame size if size slipped bit is set. (redisplay_device): Call redisplay_frame if size slipped bit is set. - - * frame.c (adjust_frame_size): Redisplay beats frame back in shape + + * frame.c (adjust_frame_size): Redisplay beats frame back in shape with this. Added. (frame_size_slipped): Added. (internal_set_frame_size): Clear size slipped bit. @@ -183,7 +183,7 @@ (EmacsFrameSetValues): Simulate a call to resize callback when no actual geometry change happened. - * console.h (struct console_methods): Removed declarations for all + * console.h (struct console_methods): Removed declarations for all _changed_in_frame methods for toolbars and scrollbars. Added frame_size_fixed_p method. @@ -267,7 +267,7 @@ the system. * ntproc.c: Removed select emulation crap and dynamic Windock - loading. + loading. * nt.c: Removed a lot of terrible wrappers for socket functions. @@ -395,9 +395,9 @@ 1998-05-04 Martin Buchholz - * rangetab.c: + * rangetab.c: * rangetab.h: Move #include's from rangetab.h into rangetab.c for - consistency. + consistency. * inline.c: include rangetab.h to get GCC inlines 1998-05-03 SL Baur @@ -466,17 +466,17 @@ * specifier.h: Corrected documentation on magic specifiers. Documented DEPTH parameter to instantiate_method. - Renamed reveal->unlock_ghost_specifiers_protected(). + Renamed reveal->unlock_ghost_specifiers_protected(). * specifier.c: Removed the reveal mechanism and made ghost specifiers read-only, so they are accessible as fallbacks of magic specifier, but aren't modifiable unless C code enables so. (specifier_equal): Compare specifier fallbacks as well. - * scrollbar.c (init_frame_scrollbars): - (init_device_scrollbars): + * scrollbar.c (init_frame_scrollbars): + (init_device_scrollbars): (init_global_scrollbars): Renamed - reveal->unlock_ghost_specifiers_protected(). + reveal->unlock_ghost_specifiers_protected(). 1998-05-01 Hrvoje Niksic @@ -613,7 +613,7 @@ Compute new character sizes passed to change_frame_size, do not use the old (pre-toolbar-change) ones. (update_frame_toolbars): Honor frame_changed and clear frame bits. - (recompute_overlaying_specifier): New helper function, called from + (recompute_overlaying_specifier): New helper function, called from default toolbar specifier change handlers. (default_toolbar_specs_changed): Use it. (default_toolbar_size_changed_in_frame): Ditto. @@ -622,7 +622,7 @@ (toolbar_geometry_changed_in_window): New handler. The old one, some_windows_value_changed, did not do the trick. (default_toolbar_size_changed_in_window): New handler for default - toolbar. + toolbar. (default_toolbar_border_width_changed_in_window): Ditto. (default_toolbar_visible_p_changed_in_window): Ditto. (specifier_vars_of_toolbar): Use one of the above four handlers @@ -765,8 +765,8 @@ 1998-04-24 Martin Buchholz - * mule-charset.h: - * mule-charset.c: + * mule-charset.h: + * mule-charset.c: Use ints instead of bitfields for Lisp_Charset fields. This should work around bugs in the latest egcs snapshot, and make XEmacs faster. Introduce dimension and chars as fields in @@ -812,7 +812,7 @@ * data.c (Fnot): There has traditionally been kludgy startup lisp code that called `null' even if `not' was more appropriate, because `not' was defined in lisp. This is one primitive - sufficiently important that it should ALWAYS be defined. + sufficiently important that it should ALWAYS be defined. Sat Apr 24 1998 Andy Piper @@ -874,10 +874,10 @@ 1998-04-23 Hrvoje Niksic - * fns.c (Fload_average): Respect errno when reporting getloadavg() + * fns.c (Fload_average): Respect errno when reporting getloadavg() errors. - * getloadavg.c (getloadavg): Cleaner Solaris implementation, based + * getloadavg.c (getloadavg): Cleaner Solaris implementation, based on sample code by Casper Dik. 1998-04-23 SL Baur @@ -903,7 +903,7 @@ * toolbar-msw.c (mswindows_clear_toolbar): Fixed wabbit buttons. (mswindows_output_toolbar): Gave 3D look to toolbars. Still no pretty, needs more work. - (mswindows_move_toolbar): Renamed so because it does not deal with + (mswindows_move_toolbar): Renamed so because it does not deal with redrawing exposed toolbars. Properly position toolbars. (mswindows_redraw_exposed_toolbars): Changed calls to the above. @@ -1026,7 +1026,7 @@ * eldap.c: (print_ldap): Ignore escapeflag (Fldap_search_internal): Added unwind protection to appropriately - free the LDAP temporary structures in case of interruption. Added + free the LDAP temporary structures in case of interruption. Added a QUIT to the result fetching loop. 1998-04-19 SL Baur @@ -1193,7 +1193,7 @@ * indent.c (vertical_motion_1): new helper function to share common code between Fvertical_motion and Fvertical_motion_pixels. - Properly handle the WINDOW argument as the doc string indicates it + Properly handle the WINDOW argument as the doc string indicates it should. Update docstrings to be more clear and concise. (Fvertical_motion): use vertical_motion_1. (Fvertical_motion_pixels): use vertical_motion_1. @@ -1206,7 +1206,7 @@ * specifier.c: Reworked many functions to support magic specifiers. - * scrollbar.c (specifier_vars_of_scrollbar): Made magic specifiers + * scrollbar.c (specifier_vars_of_scrollbar): Made magic specifiers Vscrollbar_width and Vscrollbar_height. (init_frame_scrollbars): Enabled critical lisp code operate on ghost specifiers. @@ -1215,7 +1215,7 @@ * scrollbar-msw.c (Fmswindows_init_scrollbar_metrics): Scrollbar init function, called from init-scrollbars-from-resuorce in - lisp/scrollbar.c + lisp/scrollbar.c (syms_of_scrollbar_mswindows): DEFSUBR it. * emacs.c (main_1): Called syms_of_scrollbar_mswindows() @@ -1252,7 +1252,7 @@ * data.c (pure_write_error): Accept an argument. - * emacs.c (vars_of_emacs): New variable `internal-error-checking'; + * emacs.c (vars_of_emacs): New variable `internal-error-checking'; initialize it. 1998-04-16 Hrvoje Niksic @@ -1301,7 +1301,7 @@ * device-x.c (have_xemacs_resources_in_xrdb): adhere to coding standards and avoid opening display twice by breaking - XtOpenDisplay into XOpenDisplay and XtDisplayInitialize. + XtOpenDisplay into XOpenDisplay and XtDisplayInitialize. (x_init_device): Ditto. 1998-04-15 Olivier Galibert @@ -1359,7 +1359,7 @@ 1998-04-13 Greg Klanderman - * redisplay.c (redisplay_window): When echo area is active, and we + * redisplay.c (redisplay_window): When echo area is active, and we swap in the echo area buffer, restore the minibuffer's pointm and startp when we restore the minibuffer to the window. This avoids having the minibuffer point randomly change when it is active but @@ -1391,9 +1391,9 @@ (emacs_mswindows_select_process): Get Win32 process handle directly from process lrecord. (get_process_handle): Removed function. - (emacs_mswindows_handle_magic_event): Removed handling of + (emacs_mswindows_handle_magic_event): Removed handling of XM_BUMPQUEUE magic event. - (mswindows_wnd_proc): Removed handling of WM_EXITMENULOOP message, + (mswindows_wnd_proc): Removed handling of WM_EXITMENULOOP message, which called a do-nothing handler in menubar-msw.c (mswindows_wnd_proc, WM_EXITSIZEMOVE): Queue an empty event instead of magic event, via mswindows_bump_queue(). @@ -1410,18 +1410,18 @@ * event-stream.c (event_stream_deal_with_async_timeout): Conditionalized timer-based polling for finished processes on - HAVE_UNIX_PROCESSES. + HAVE_UNIX_PROCESSES. * menubar-msw.c (mswindows_handle_wm_command): Queued proper bump queue event. (mswindows_handle_wm_exitmenuloop): Removed function. - + * menubar-msw.h: Removed unused function prototype. * process-nt.c (get_nt_process_handle): Added function. * signal.c (init_poll_for_sigchld): Conditionalized on - HAVE_UNIX_PROCESSES. + HAVE_UNIX_PROCESSES. 1998-04-13 Kirill M. Katsnelson @@ -1455,40 +1455,40 @@ * callproc.c (init_callproc): Correctly initialize `shell-file-name' for WINDOWSNT - + * emacs.c (main_1): Properly called new functions (see symsinit.h entry for which). - * event-msw.c (struct ntpipe_slurp_stream): - (slurp_thread): - (make_ntpipe_input_stream): - (get_ntpipe_input_stream_waitable): - (get_ntpipe_input_stream_param): - (ntpipe_slurp_reader): - (ntpipe_slurp_closer): + * event-msw.c (struct ntpipe_slurp_stream): + (slurp_thread): + (make_ntpipe_input_stream): + (get_ntpipe_input_stream_waitable): + (get_ntpipe_input_stream_param): + (ntpipe_slurp_reader): + (ntpipe_slurp_closer): (init_slurp_stream): Win32 pipe input stream implementation. - (struct ntpipe_shove_stream): - (shove_thread): - (make_ntpipe_output_stream): - (get_ntpipe_output_stream_param): - (ntpipe_shove_writer): - (ntpipe_shove_was_blocked_p): - (ntpipe_shove_flusher): - (ntpipe_shove_closer): + (struct ntpipe_shove_stream): + (shove_thread): + (make_ntpipe_output_stream): + (get_ntpipe_output_stream_param): + (ntpipe_shove_writer): + (ntpipe_shove_was_blocked_p): + (ntpipe_shove_flusher): + (ntpipe_shove_closer): (init_shove_stream): Win32 pipe output stream implementation. (mswindows_enqueue_process_event): Dispatch helper. - (find_waitable_handle): - (add_waitable_handle): + (find_waitable_handle): + (add_waitable_handle): (remove_waitable_handle): New three, waitable handles handling. (mswindows_need_event_in_modal_loop): Simplified. (mswindows_need_event): Simplified. - (mswindows_need_event): Generate process events on process output; + (mswindows_need_event): Generate process events on process output; kick status_notify when a process ends. (mswindows_find_console): Simplified. (emacs_mswindows_event_pending_p): Adjusted parameters to mswindows_need_event(). (emacs_mswindows_next_event): Ditto. - (get_process_input_waitable): + (get_process_input_waitable): (get_process_handle): Process select/unselect helpers. (emacs_mswindows_select_process): Implemented. (emacs_mswindows_unselect_process): Implemented. @@ -1521,7 +1521,7 @@ 1998-04-10 Martin Buchholz - * fns.c (Fnthcdr): + * fns.c (Fnthcdr): Most times through the loop will get a cons, so optimize for that. * bytecode.c (Fbyte_code): Remove '91 vintage compiler bug workaround. @@ -1572,8 +1572,8 @@ * event-msw.c (mswindows_wnd_proc): Fix member access macro names. - * frame-msw.c (mswindows_frame_property): - (mswindows_internal_frame_property_p): + * frame-msw.c (mswindows_frame_property): + (mswindows_internal_frame_property_p): (mswindows_frame_properties): Implemented for the 'left and 'top properties. (console_type_create_frame_mswindows): Regsitered the above. @@ -1650,10 +1650,10 @@ * insdel.c (make_gap): Thou shan't cast EMACS_INT_MAX to int. (buffer_insert_string_1): ditto. - * regex.c (print_partial_compiled_pattern): Neither EMACS_INTs nor + * regex.c (print_partial_compiled_pattern): Neither EMACS_INTs nor ptrdiff_t are portably printable as an int. - * redisplay.c (window_line_number): Don't assume that an EMACS_INT + * redisplay.c (window_line_number): Don't assume that an EMACS_INT in an int. * alloc.c (report_pure_usage): Don't assume that a size_t is @@ -1717,24 +1717,24 @@ (sys_chmod): (sys_creat): - * sysdep.c (sys_read_1): - (sys_read): - (sys_write_1): - (sys_write): - (sys_mkdir): - (sys_readlink): - (sys_chmod): - (sys_creat): - - * nt.c (sys_read): - (sys_chmod): - (sys_creat): + * sysdep.c (sys_read_1): + (sys_read): + (sys_write_1): + (sys_write): + (sys_mkdir): + (sys_readlink): + (sys_chmod): + (sys_creat): + + * nt.c (sys_read): + (sys_chmod): + (sys_creat): (sys_write): Change types of sys_* in accordance with published standards. Use size_t and mode_t instead of unsigned int and int. 1998-04-03 Martin Buchholz - * config.h.in (enum_field): + * config.h.in (enum_field): * lisp-union.h: * extents.h: * redisplay.c (add_margin_runes): @@ -1798,7 +1798,7 @@ * window.c (set_window_pixsize): Move up call to check_min_window_sizes. - * indent.c (vmotion_1): renamed from vmotion() and added + * indent.c (vmotion_1): renamed from vmotion() and added additional argument to optionally return the pixel motion. (vpix_motion): Helper for vmotion_1. (vmotion): Wrapper - just call vmotion_1() with the right args. @@ -1807,36 +1807,36 @@ 1998-04-02 Martin Buchholz - * xselect.c: - * event-Xt.c: - * emacs.c: + * xselect.c: + * event-Xt.c: + * emacs.c: Remove last vestiges of #ifdef EPOCH code. It had no chance of - working anyways. In honour of seeing Marc Andreesen in person for + working anyways. In honour of seeing Marc Andreesen in person for the first time today. 1998-04-01 Martin Buchholz - * extents.h: - * lisp-union.h: + * extents.h: + * lisp-union.h: Don't use enums as bitfields - only unsigned ints. Fixes: warning: nonportable bit-field type * eval.c (call_with_suspended_errors): More volatilizing to appease Sunpro cc. - * mem-limits.h: + * mem-limits.h: * ralloc.c: Remove #undef NULL; they're not even used! - * process-unix.c (unix_send_process): send_process is a method, so + * process-unix.c (unix_send_process): send_process is a method, so we can't include volatile in the prototype. We make the argument - non-volatile, make a volatile copy, and then use that instead. - - * frame-x.c (x_delete_frame): The `frame' variable is initialized + non-volatile, make a volatile copy, and then use that instead. + + * frame-x.c (x_delete_frame): The `frame' variable is initialized but not actually used. * Makefile.in.in (xselect.o): The last line of b34-pre2's src/Makefile.in.in contains a dependency that should have been - patched away. + patched away. (mostlyclean): Remove the removal of depend.* - no such files exist anymore @@ -1908,7 +1908,7 @@ 1998-03-30 Martin Buchholz - * redisplay.c (create_right_glyph_block): glyph_type should really + * redisplay.c (create_right_glyph_block): glyph_type should really be glyph_layout. 1998-03-29 Martin Buchholz @@ -1918,7 +1918,7 @@ #include sysfile.h. Check all .o files for missing #includes. * config.h.in: - Discovered that config.h.in was missing ENCAPSULATE_CLOSEDIR, as a + Discovered that config.h.in was missing ENCAPSULATE_CLOSEDIR, as a result of fixing the above. * gui.c (gui_item_add_keyval_pair): We should not use the idiom @@ -1927,7 +1927,7 @@ (signal_too_long_error): Ditto. * glyphs.c (image_instantiate_cache_result): Use XC[AD]R instead - of Fc[ad]r. This is always called with valid conses, and in fact, + of Fc[ad]r. This is always called with valid conses, and in fact, already assumed it. * font-lock.c (find_context): Use context_none with context @@ -1940,7 +1940,7 @@ 1998-03-28 Martin Buchholz - * fns.c (string_putprop): + * fns.c (string_putprop): (string_getprop): Make method functions static. * window.c (find_window_by_pixel_pos): Warning suppression. @@ -1949,7 +1949,7 @@ * redisplay-x.c (x_output_eol_cursor): Remove redundant XSETWINDOW. - * glyphs-x.c (signal_image_error): + * glyphs-x.c (signal_image_error): (signal_image_error_2): (convert_EImage_to_XImage): Make functions static. @@ -1966,7 +1966,7 @@ 1998-03-27 Martin Buchholz - * console-tty.c (free_tty_console_struct): + * console-tty.c (free_tty_console_struct): Replace con->console_data with CONSOLE_type_DATA (con) * *.[ch]: C++ compilability of xemacs, on Linux and Solaris. @@ -1976,7 +1976,7 @@ * eval.c: * bytecode.c: Rename Fcondition_case_3 to condition_case_3 - it's not a DEFUN. - + * buffer.h: Remove all *BUFFER_OR_STRING* macros - unused. (memind_to_bytind): Merge two versions of function by moving @@ -1998,27 +1998,27 @@ * marker.c (print_marker): Fix compiler warning, real bug! - * device.h (MARK_DEVICE_FRAMES_FACES_CHANGED): - * frame.h (MARK_FRAME_FACES_CHANGED): - (MARK_FRAME_TOOLBARS_CHANGED): - (MARK_FRAME_SIZE_CHANGED): - (MARK_FRAME_CHANGED): - (MARK_FRAME_WINDOWS_CHANGED): - (MARK_FRAME_WINDOWS_STRUCTURE_CHANGED): + * device.h (MARK_DEVICE_FRAMES_FACES_CHANGED): + * frame.h (MARK_FRAME_FACES_CHANGED): + (MARK_FRAME_TOOLBARS_CHANGED): + (MARK_FRAME_SIZE_CHANGED): + (MARK_FRAME_CHANGED): + (MARK_FRAME_WINDOWS_CHANGED): + (MARK_FRAME_WINDOWS_STRUCTURE_CHANGED): Fix multiple evaluation of macro arguments. Macros are a fact of life. Callers have to use temp variables to avoid multiple evaluation of arguments. * data.c (Ftrue_list_p): New function, with obvious meaning. - This is terminology from Cltl2. + This is terminology from Cltl2. Also define a corresponding macro TRUE_LIST_P. * device-x.c (validify_resource_component): Optimize. Rename. Use the standard technique of using a precomputed table of valid chars. - - (x_get_resource_prefix): - (Fx_get_resource): - (Fx_get_resource_prefix): + + (x_get_resource_prefix): + (Fx_get_resource): + (Fx_get_resource_prefix): Avoid fixed buffer sizes. Use a char_dynarr. Run validify_resource_component on all computed components. @@ -2033,50 +2033,50 @@ Use acons in functions which create alists. * lisp/cl.el (acons): Add docstring. Really otta be a macro, tho. - * buffer.c (Fbuffer_memory_usage): + * buffer.c (Fbuffer_memory_usage): * window.c (Fwindow_memory_usage): Clean up horrible consing code using new acons function. Fix incorrect value reported for gap-overhead. - + * fns.c (Fmember): - (Fold_member): - (Fmemq): - (Fold_memq): - (memq_no_quit): - (Fassoc): - (Fold_assoc): - (Fassq): - (Fold_assq): - (assq_no_quit): - (Frassoc): - (Fold_rassoc): - (Frassq): - (Fold_rassq): - (rassq_no_quit): - (Fdelete): - (Fold_delete): - (Fdelq): - (Fold_delq): - (delq_no_quit): - (delq_no_quit_and_free_cons): - (Fremassoc): - (Fremassq): - (remassq_no_quit): - (Fremrassoc): - (Fremrassq): - (remrassq_no_quit): - (Fnreverse): - (Freverse): - (Fnthcdr): - Optimize. - Replace calls to Fcar, Fcdr, Fsetcar with XCAR and XCDR. + (Fold_member): + (Fmemq): + (Fold_memq): + (memq_no_quit): + (Fassoc): + (Fold_assoc): + (Fassq): + (Fold_assq): + (assq_no_quit): + (Frassoc): + (Fold_rassoc): + (Frassq): + (Fold_rassq): + (rassq_no_quit): + (Fdelete): + (Fold_delete): + (Fdelq): + (Fold_delq): + (delq_no_quit): + (delq_no_quit_and_free_cons): + (Fremassoc): + (Fremassq): + (remassq_no_quit): + (Fremrassoc): + (Fremrassq): + (remrassq_no_quit): + (Fnreverse): + (Freverse): + (Fnthcdr): + Optimize. + Replace calls to Fcar, Fcdr, Fsetcar with XCAR and XCDR. Simplify logic. Many of these functions wouldn't QUIT if called on cyclic lists. e.g. try (progn (setq x '(nil)) (setcdr x x) (reverse x)) One benchmark of delq showed it to be 3 times faster. * emacs.c: - * database.c: + * database.c: Cleanup of database functions. Make the get_subtype and get_type methods return Lisp_Objects, instead of C strings. No more need for both dbm_type and dbm_lisp_type. @@ -2084,7 +2084,7 @@ Replace old `dbm' names with `database'. Rename struct database to struct Lisp_Database. Rename DEFUN arguments to `database', when applicable. - + * buffer.c: * chartab.c: * console.c: @@ -2112,7 +2112,7 @@ * window.c: Place DEFINE_LRECORD_* after definition of static object methods, to avoid redundant declarations. - + * console.c: * console.h: * device.c: @@ -2142,7 +2142,7 @@ 1998-03-21 Martin Buchholz * alloc.c (list*): Optimize recursion levels. - + * alloc.c: Add debugger support via enum dbg_constants. * gdbinit: Complete rewrite. * gdbinit.union: Remove @@ -2153,7 +2153,7 @@ Support all combinations of Kylish DEFINEs. Work out of the box with no user customizations. See the updated faq for details. - + * emacsfns.h: Remove. Move declarations to lisp.h * dynarr.h: Remove. Move declarations to lisp.h * lisp.h. @@ -2161,8 +2161,8 @@ Introduce EXFUN macro for external declaration to correspond to DEFUN. Include header files only when necessary, i.e. not from lisp.h: - unistd.h, limits.h, fnctl.h, blocktype.h, dynarr.h, emacsfns.h - - + + * lisp.h: * lisp-union.h: * lisp-disunion.h: @@ -2217,7 +2217,7 @@ * depend: New file. Generated by make-src-depend * make-src-depend: New file. generates up-to-date dependencies. Makefile dependencies are now automagically maintained, and - CORRECT. lisp.h and friends are now included in the dependencies, + CORRECT. lisp.h and friends are now included in the dependencies, since this complies with the principle of least astonishment. * symbols.c (symbol_is_constant): Optimize. @@ -2230,7 +2230,7 @@ 1998-03-29 SL Baur * emacs.c (voodoo_free_hook): ELF libraries built with newer - versions of GCC do horrible things in dumped binaries after exit() + versions of GCC do horrible things in dumped binaries after exit() is called. (Fkill_emacs): Use it. @@ -2288,8 +2288,8 @@ glyph_changed_set variables, mimicking clip_changed and clip_changed_set. - (redisplay_window): Reset the window's glyph cache is - f->glyphs_changed is non-zero. Call regenerate_window + (redisplay_window): Reset the window's glyph cache is + f->glyphs_changed is non-zero. Call regenerate_window if f->glyphs_changed is non-zero. (redisplay_frame): Clear f->glyphs_changed after @@ -2311,12 +2311,12 @@ related, mark all frames. * redisplay-output.c (compare_display_blocks): - Output the whole display block if f->glyphs_changed is + Output the whole display block if f->glyphs_changed is non-nil. 1998-03-27 Kyle Jones - * callproc.c (Fcall_process_internal): In the case where + * callproc.c (Fcall_process_internal): In the case where fd_error and fd1 are the same don't close that descriptor twice. @@ -2352,7 +2352,7 @@ (mswindows_init_frame_1): Fixed support for popup frames. (mswindows_delete_frame): Fixed memory leak. (mswindows_get_frame_parent): Implemented. - (mswindows_update_frame_external_traits): Moved part of the former + (mswindows_update_frame_external_traits): Moved part of the former update_EmacsFrame() here. (console_type_create_frame_mswindows): Declare get_frame_parent and update_frame_external_traits methods. @@ -2366,16 +2366,16 @@ windows does not yet have associated frame object (mswindows_find_frame): Casted long to Lisp_Object properly. - * device.c (window_system_pixelated_geometry): Changed to call the + * device.c (window_system_pixelated_geometry): Changed to call the device_implementation_flags device method. * device-msw.c (mswindows_device_implementation_flags): - Implemented. + Implemented. (console_type_create_device_mswindows): Declared the above. * console.h (struct console_methods): Added device_implementation_flags_method and - update_frame_external_traits_method. + update_frame_external_traits_method. Defined flags retuned by device_implementation_flags_method. * console-msw.h (struct mswindows_frame): Added charheight and @@ -2384,7 +2384,7 @@ Moved Windows-specific macros from frame.h here. (typedef struct XEMACS_RECT_WH): Added. Declared global variables. - + 1998-03-19 Kirill M. Katsnelson * console-msw.h: Added prototypes for @@ -2408,8 +2408,8 @@ indication to fake font size to 1. (char_to_pixel_size): Ditto. (round_size_to_char): Ditto. - (pixel_to_real_char_size): - (char_to_real_pixel_size): + (pixel_to_real_char_size): + (char_to_real_pixel_size): (round_size_to_real_char): New three counterparts of the above metioned functions, which always use real character metrics. (change_frame_size_1): Use real character metrics when computing @@ -2423,7 +2423,7 @@ (mswindows_init_frame_2): Commented out, unused. (mswindows_after_init_frame): Added frame method. (mswindows_set_frame_size): Reworked to support pixel base - geometry. + geometry. (mswindows_set_frame_position): Cahnged to use SetWindowPos. (mswindows_lower_frame): Ditto. (mswindows_set_frame_properties): Fixed to perform correct @@ -2432,7 +2432,7 @@ after_init_frame added. * faces.c (default_face_height_and_width_1): Added. - (update_EmacsFrame): Changed method of notifying mswindwows frame, + (update_EmacsFrame): Changed method of notifying mswindwows frame, so modeline border gets redrawn. * faces.h: Prototype for default_face_height_and_width_1(). @@ -2443,13 +2443,13 @@ char if window is maximized. Use real char metrics for rounding. Call DefWindowProc to process WM_GETMINMAXINFO - (mswindows_set_chord_timer): Changed chord timeout from 1/2 to 1/3 + (mswindows_set_chord_timer): Changed chord timeout from 1/2 to 1/3 system double click time * device.c (domain_device_type): New function. - (window_system_pixelated_geometry): New function. + (window_system_pixelated_geometry): New function. (Fdomain_device_type): New function, lisp interface to - domain_device_type(). + domain_device_type(). (syms_of_device): DEFSUBRed the above. * device.h: Ptorotypes for domain_device_type() and @@ -2492,7 +2492,7 @@ 1998-03-27 P. E. Jareth Hein - * glyphs-x.c: + * glyphs-x.c: * imgproc.c: * imgproc.h: * glyphs-x.h: Added in a colormap variable in the X specific image @@ -2501,7 +2501,7 @@ coding standards. * glyphs.h: - * glyphs.c: + * glyphs.c: * glyphs-x.c: added image-conversion-error type * objects-x.c (allocate_nearest_color): Corrected a minor bug involving @@ -2530,13 +2530,13 @@ 1998-03-24 Kirill M. Katsnelson - * fileio.c (Ffile_readable_p): GC protect fix, MS Windows specific. + * fileio.c (Ffile_readable_p): GC protect fix, MS Windows specific. Mon Mar 23 22:14:12 1998 Andy Piper * configure.in: compile in glyphs-msw.o when compiling fopr mswindows. - + Mon Mar 23 22:14:12 1998 Andy Piper * msw-glyphs.el: add support for xpm and bmp. change @@ -2547,7 +2547,7 @@ * Makefile.in.in: fastdump - new target for dumping bypassing bytecompilation, DOC. Add dependencies for glyphs-msw.o. Move imgproc.o to object list. - + * glyphs-msw.h: * glyphs-msw.c: new files adding support for xpm and bmp and EImages. @@ -2557,7 +2557,7 @@ * console-msw.h: add bitspixel field to mswindows frame. * device-msw.c: initialise bitspixel field in mswindows frame. - + * glyphs-x.c (xpm_instantiate): call mswindows_xpm_instantiate if the device type is mswindows. @@ -2565,7 +2565,7 @@ mswindows. * symsinit.h: add prototypes for glyphs-msw.c functions. - + * sheap.c: make includes src-dir compliant. * events.c: remove cygwin ^H <-> erase hack. @@ -2609,7 +2609,7 @@ if the symbol is in Vobarray. * symbols.c (reject_constant_symbols): Signal error when - attempting to assign a value to a keyword, unless the value is the + attempting to assign a value to a keyword, unless the value is the keyword itself. * symbols.c (Fintern): Initialize symbol's ->obarray to t only @@ -2716,7 +2716,7 @@ * config.h.in: Add HAVE_LIBMCHECK and HAVE_MCHECK_H. * hash.c (grow_hashtable): Fix tests to compare against - Qnull_pointer since this function may be called before any symbols + Qnull_pointer since this function may be called before any symbols or the Lisp engine is initialized. * emacs.c (main_1): Restore usage of free-hook.c. @@ -2730,7 +2730,7 @@ control variable is being modified underneath us. - Avoid calling delete_console_internal on stream consoles. - * console-tty.c (free_tty_console_struct): NULL out pointers after + * console-tty.c (free_tty_console_struct): NULL out pointers after xfree'ing. * console-stream.c (allocate_stream_console_struct): Fix memory @@ -2758,7 +2758,7 @@ (Fwrite_region_internal): Ditto. (decide_buffer_type): Function removed. (buf_decide_buffer_type): Function removed. - (Many places): References to DOS_NT replaced with WINDOWSNT. MSDOS- + (Many places): References to DOS_NT replaced with WINDOWSNT. MSDOS- specific code removed. * lread.c (Fload_internal): Removed ugly DOS style re-opening a @@ -2774,7 +2774,7 @@ implemented in nt.c * fileio.c (Ffile_readable_p): Conditionalized declared never used - variables. + variables. (Fexpand_file_name): Ditto. (check_executable): Ditto. @@ -2823,7 +2823,7 @@ 1998-03-15 Kyle Jones - * console.h: Added set_final_cursor_coords method to console + * console.h: Added set_final_cursor_coords method to console struct. * console-tty.h: Added final_cursor_x and final_cursor_y @@ -2872,7 +2872,7 @@ * glyphs-x.c (png_instantiate): Added in override support for png backgrounds. - + 1998-03-13 P. E. Jareth Hein * glyphs-x.c (png_instantiate): Fixed a bug that was causing @@ -3058,7 +3058,7 @@ (Fenlarge_window_pixels): New function. (Fshrink_window_pixels): New function. (window_displayed_pixel_height): New, helper for - Fwindow_displayed_pixel_height. + Fwindow_displayed_pixel_height. (change_window_height): Add `inpixels' argument. (syms_of_window): 3 new DEFSUBR's. @@ -3179,16 +3179,16 @@ (get_eof_char): Ditto * symsinit.h: Prototypes for initialization functions called from - emacs.c: process_type_create_mswindows, process_type_create_unix, + emacs.c: process_type_create_mswindows, process_type_create_unix, vars_of_process_mswindows, vars_of_process_unix. - * procimpl.h: New file. Includes prototypes and other stuff shared + * procimpl.h: New file. Includes prototypes and other stuff shared by process.c and implementation files (process-unix.c, process-msw.c in future). * process.h (PROCESS_LIVE_P): Changed to test against stream existence, to avoid dependency on fds. - + * process.c: Only process implementation independent code is now in this file. Moved the rest into process-unix.c (Fopen_network_stream_internal): Added 5th parameter, protocol @@ -3198,7 +3198,7 @@ processes. UNIX-specific code from the old process.c is here. * Lstream.c (Lstream_was_blocked_p): New function. Replaces - filedesc_stream_was_blocked_p. + filedesc_stream_was_blocked_p. (filedesc_was_blocked_p): Implementation of the method for filedesc stream (filedesc_stream_set_pty_flushing): set pty_flushing flag @@ -3208,10 +3208,10 @@ optional lstream method. Added prototypes for functions in lstream.c - * lisp.h: (USID): Typedef for Unique Stream IDentifier. Reuqired + * lisp.h: (USID): Typedef for Unique Stream IDentifier. Reuqired by the new code in many places. - * events.h (struct event_stream): Declaration of the two mandatory + * events.h (struct event_stream): Declaration of the two mandatory event stream methods, required by process support. * event-unixoid.c (event_stream_unixoid_create_stream_pair): @@ -3235,7 +3235,7 @@ (emacs_Xt_delete_stream_pair): Ditto * emacs.c (main_1): Added calls to process_type_create*() and - vars_of_process() + vars_of_process() * callproc.c: (many places): removed DOS support @@ -3290,7 +3290,7 @@ 1998-03-01 Kyle Jones - * file-coding.c (setup_eol_coding_systems): Don't try + * file-coding.c (setup_eol_coding_systems): Don't try to copy the mnemonic property of the coding system unless it is a string. @@ -3304,7 +3304,7 @@ 1998-03-01 Kyle Jones - * callint.c: Read coding system names for the 'z' and + * callint.c: Read coding system names for the 'z' and 'Z' interactive specs if FILE_CODING or MULE is defined. Previously, coding system names were read only if MULE was defined. @@ -3393,7 +3393,7 @@ * mule-coding.c: #if 0 out functionality until file-coding is split up. - * file-coding.h: + * file-coding.h: * file-coding.c: new files. copies of mule-coding.h and mule-coding.c. The mule case is unchanged. The non-mule case removes coding relating to other charsets - iso2022, big5, sjis, @@ -3431,7 +3431,7 @@ case, the application class is chosen based on whether the user has any resources with application class `XEmacs' set in the resource database. - (vars_of_device_x): make x-emacs-application-class nil by default + (vars_of_device_x): make x-emacs-application-class nil by default and document new behavior in its doc string. 1998-02-23 Aki Vehtari @@ -3451,11 +3451,11 @@ * s/sol2.h: define HAVE_GETLOADAVG for late edition Solaris From Georg Nikodym -1998-02-24 Didier Verna +1998-02-24 Didier Verna * redisplay.c (generate_fstring_runes): fixed the modeline scrolling lossage (the % constructs appearing in the - modeline). Now that we can have negative positions and boundaries, + modeline). Now that we can have negative positions and boundaries, max_pos == -1 can't mean 'no limit' anymore. Me, stupido! (add_string_to_fstring_db_runes): Ditto. (add_glyph_to_fstring_db_runes): Ditto. @@ -3508,7 +3508,7 @@ * unexelf.c: The proper way to check for GNU libc is with __GLIBC__. Suggested by Andreas Jaeger - + 1998-02-18 SL Baur * Makefile.in.in: Remove all references to prefix-args. @@ -3536,28 +3536,28 @@ (Fset-window-configuration): Restore window-cached specifier values. -1998-02-18 Didier Verna +1998-02-18 Didier Verna * modeline.el (mouse-drag-modeline): added the horizontal scrolling functionality for the modeline. This could still be improved, for instance when the mouse goes out of the modeline. -1998-02-18 Didier Verna +1998-02-18 Didier Verna * redisplay.c: (generate_formatted_string_db): new flag to distinguish a modeline string from a title or icon one, plus use a negative first pos to - indicate the modeline hscroll ammount. + indicate the modeline hscroll ammount. (add_string_to_fstring_db_runes): completely rewrote this function to handle the case of scrolled modelines. (add_glyph_to_fstring_db_runes): handle the case of scrolled - modelines. + modelines. * window.c: (Fmodeline_hscroll): new function to return the modeline current - horizontal scroll ammount. + horizontal scroll ammount. (Fset_modeline_hscroll): new function to scroll the modeline - horizontaly. + horizontaly. Plus some updates related to this new functionality (windows configuration, notably). @@ -3604,8 +3604,8 @@ 1998-02-14 Martin Buchholz - * event-Xt.c (x_reset_key_mapping): - * device-x.c: + * event-Xt.c (x_reset_key_mapping): + * device-x.c: (x-keysym-on-keyboard-p): (x-keysym-on-keyboard-sans-modifiers-p): Use x-keysym-on-keyboard-sans-modifiers-p instead of @@ -3677,7 +3677,7 @@ (gui_item_display_flush_left): Ditto (gui_item_display_flush_right): Ditto. The above listen new functions manipulate on properties common to menu items and GUI - buttons. + buttons. * menubar.c (current_frame_menubar): Moved from menubar-msw.c (menu_parse_submenu_keywords): New function @@ -3771,7 +3771,7 @@ Wed Jan 28 13:41:22 1998 Andy Piper * Makefile.in.in: add support for sheap-adjust.h generation for - static heap. + static heap. Wed Jan 28 13:41:22 1998 Andy Piper @@ -3906,7 +3906,7 @@ * frame-msw.c: Added file-based drag and drop support. The "System/Open" DDE command is also implemented as if it were a drag and drop operation. - + * emacsfns.h: * event-stream.c: * events.c: @@ -4004,7 +4004,7 @@ * unexcw.cc: new file for cygwin32 unexec() requires cygwin32 b19. Predicated on HAVE_COFF_H. - * console.c: + * console.c: * device-msw.c: * event-msw.c: * frame-msw.c: @@ -4034,7 +4034,7 @@ 1998-01-23 Hrvoje Niksic * print.c (print_cons): Use XCAR/XCDR. - (print_string): Fix up so it Vprint_string_length works under Mule + (print_string): Fix up so it Vprint_string_length works under Mule correctly. * eval.c (Feval): Increase profile call count. @@ -4122,15 +4122,15 @@ * offix-cursors.h (cursor_bits): Warning elimination. - * redisplay.c (add_blank_rune): - * redisplay.c (add_glyph_rune): - * redisplay.c (add_emchar_rune): + * redisplay.c (add_blank_rune): + * redisplay.c (add_glyph_rune): + * redisplay.c (add_emchar_rune): Warning elimination. Avoid useless computation in non-mule case. * config.h.in: Define HAVE_INVERSE_HYPERBOLIC using 1 configure test, not 3. - * src/alloc.c: - * src/events.c: + * src/alloc.c: + * src/events.c: Rearrange order of declarations and definitions to avoid forward * src/mem-limits.h: Add motivating comment for future cleanup. @@ -4140,7 +4140,7 @@ Always define _GNU_SOURCE when using GNU libc. Support --without-FOO as a synonym for --with-FOO=no. Always use $srcdir to locate config.guess. - Make it clear that CONFIGURATION is optional. + Make it clear that CONFIGURATION is optional. De-emphasize CONFIGURATION parameter. Random cleanup. More compatible with standard GNU install instructions. --with-menubars=athena3d ==> --with-menubars=lucid. @@ -4247,7 +4247,7 @@ Suggested by Aki Vehtari * src/symbols.c (Fsetq_default): Fix docstring. - From Didier Verna + From Didier Verna 1998-01-07 Kirill M. Katsnelson @@ -4283,13 +4283,13 @@ * lread.c (Fload_internal): On Win32, this reopened the file without first closing the handle. This caused running out of handles. - + * nt.c (sys_open): This one made big mess when opening a handle next after MAXDESC-1. Fixed. 1998-01-06 Kirill M. Katsnelson - * objects-msw.c (mswindows_string_to_color): Patched not to modify + * objects-msw.c (mswindows_string_to_color): Patched not to modify const char* parameter. (hexval): Modified to accept uppercase hex digits. @@ -4321,7 +4321,7 @@ * nt.h: Removed FD_* macros. Rely on definitions in winsock.h. Changed EMACSDEBUG references to DEBUG_XEMACS - * event-msw.c (mswindows_cancel_dispatch_event): Returns Qnil when + * event-msw.c (mswindows_cancel_dispatch_event): Returns Qnil when event not found in the queue. Used to return undefined value. 1998-01-07 SL Baur @@ -4362,7 +4362,7 @@ 1997-12-29 Kirill M. Katsnelson - * msw-proc.c (mswindows_enqueue_magic_event): Made extern. User by + * msw-proc.c (mswindows_enqueue_magic_event): Made extern. User by menubar-msw.c * event-msw.h: Prototype for mswindows_enqueue_magic_event @@ -4410,7 +4410,7 @@ * alloc.c (disksave_object_finalization): Don't zero out load-history if history of pure symbols is desired. - * lread.c (build_load_history): If LOADHIST_DUMPED is defined, add + * lread.c (build_load_history): If LOADHIST_DUMPED is defined, add pure symbols to load-history. * emacsfns.h: New symbols added -- LOADHIST_DUMPED, define to get @@ -4432,7 +4432,7 @@ 1997-12-26 Kirill M. Katsnelson * menubar-msw.c, menubar-msw.h: New files. Menus support. - + * console-msw.h: Added frame menu hashtable variable. * gui.c: popup_up_p variable and Fpopup_up_p and @@ -4458,7 +4458,7 @@ can be compared with 'equal. Menubar uses opaque pointers as hash keys in an 'equal style hastable. - * Most of the above touched files: Eliminated compiler warnings. + * Most of the above touched files: Eliminated compiler warnings. 1997-12-18 Hrvoje Niksic @@ -4471,7 +4471,7 @@ 1997-12-26 P. E. Jareth Hein - * glyphs-x.c (imagick_instantiate): Add in error and + * glyphs-x.c (imagick_instantiate): Add in error and warning handling for ImageMagick files 1997-12-26 SL Baur @@ -4587,7 +4587,7 @@ * fileio.c (Finsert_file_contents_internal): Use report_file_error() to report reading error. - * cmds.c (internal_self_insert): Don't self-insert if the expanded + * cmds.c (internal_self_insert): Don't self-insert if the expanded symbol's hook has a non-nil `no-self-insert' property; synch with FSF 20.2. @@ -4622,22 +4622,22 @@ * dired.c (file_name_completion): Use noseeum_cons. (file_name_completion_unwind): Free the cons. -1997-12-16 - +1997-12-16 + * scrollbar.c: Add HAVE_MS_WINDOWS to scrollbar-page functions. - + * msw-proc.c: Handle scrolling events. - + * frame-msw.c: Initialize scrollbar width and height. This should not be necessary, since the window shouldn't be created until init_frame_2 - + * emacs.c: Call mswindows scrolbar setup when appropriate. - + * scrollbar-msw.c: Created for mswindows-scrollbar support. - + * scrollbar-msw.h: Ditto. - + 1997-12-16 Kirill M. Katsnelson * msw-proc.c: Minor bug in the middle button emulation code @@ -4706,7 +4706,7 @@ 1997-12-12 SL Baur - * input-method-xlib.c (describe_XIC): Add casts, use unsigned long + * input-method-xlib.c (describe_XIC): Add casts, use unsigned long int. * eval.c (funcall_subr): Ifdef out as it is now unused. @@ -4786,9 +4786,9 @@ * input-method-xfs.c (Initialize_Locale): Ditto. * input-method-motif.c (Initialize_Locale): Ditto. * input-method-xlib.c (Initialize_Locale): Ditto. - Suggested by Didier Verna and + Suggested by Didier Verna and Martin Buchholz - + 1997-12-10 Karl M. Hegbloom * config.h.in: #undef MAGICK_HEADERS_ARE_UNDER_X11 @@ -4902,11 +4902,11 @@ set the correct window size. 1997-12-04 Jeff Sparkes - + * frame-msw.c: added frame functions for move, resize, iconify, raise, lower, visible_p, iconified_p, focus, make visible, make invisible, set title. - + 1997-12-01 Jonathon Harris * event-msw.c, event-msw.h, frame-msw.c, msw-proc.c: @@ -4931,7 +4931,7 @@ * menubar-x.c: change #ifdef LWLIB_MENUBARS_MOTIF to #if defined LWLIB_MENUBARS_LUCID || defined LWLIB_MENUBARS_MOTIF - around code for incremental menu build. + around code for incremental menu build. * event-stream.c: Changed HAVE_MENUBARS to HAVE_MENUBARS_LUCID in the #ifdef wrappers around menubar accelerator stuff. @@ -5033,7 +5033,7 @@ vector and call mapcar1 with its data. 1997-12-02 P E Jareth Hein - + * objects-x.c: Added colormap/visual support, rewrote allocate_nearest_color, and changed the x-color-instance to deal with possibly not freeing a color. @@ -5142,7 +5142,7 @@ (Fredisplay_echo_area): Clear echo_area_garbaged flag on frame after displaying in echo area. - * redisplay.c: Added hscroll_glyph_width_adjust field + * redisplay.c: Added hscroll_glyph_width_adjust field to position_redisplay_data_type struct. (add_hscroll_rune): Compute the difference in width @@ -5178,7 +5178,7 @@ 1997-11-17 Marc Paquette - * callproc.c (Fcall_process_internal): Fix for bug in + * callproc.c (Fcall_process_internal): Fix for bug in CRLF -> LF conversion. 1997-11-19 Jonathan Harris @@ -5199,7 +5199,7 @@ * callproc.c (Fcall_process_internal): Close fd_error. -1997-11-19 Didier Verna +1997-11-19 Didier Verna * emacs.c (main_1): Added the missing argmatch call to check for the '-h' option. @@ -5255,7 +5255,7 @@ * frame.c: Document new toolbar border width speciifer as being usable as frame properties. - (frame_conversion_internal): Factor the toolbar border + (frame_conversion_internal): Factor the toolbar border widths into the geometry calculations. (change_frame_size_1): Ditto. @@ -5274,11 +5274,11 @@ support for drawing a border along with the blank button. Accept border_width and vertical args. - (x_output_toolbar_button): Added support for drawing a + (x_output_toolbar_button): Added support for drawing a border along with the button. (X_OUTPUT_BUTTONS_LOOP): Pass border_width and vert - args to x_draw_blank_toolbar_button. Set vertical and + args to x_draw_blank_toolbar_button. Set vertical and border_width fields in toolbar button. (x_output_toolbar): Support toolbar border widths. @@ -5324,7 +5324,7 @@ 1997-11-16 Hrvoje Niksic - * events.c (print_event): Use `event-x-pixel' and `event-y-pixel', + * events.c (print_event): Use `event-x-pixel' and `event-y-pixel', to be consistent with `make-event' and `event-properties'. (Fmake_event): Allow nil dnd-data. @@ -5630,7 +5630,7 @@ * redisplay.c: init_redisplay Initialise window system to w32, conditioned on HAVE_W32GUI. - + * symsinit.h: Added syms_of_*_w32, vars_of_*_w32 and init_event_w32_late. @@ -5717,33 +5717,33 @@ 1997-11-02 Andreas Jaeger - * m/vax.h: - * s/cxux.h: - * s/xenix.h: - * s/umax.h: - * s/msdos.h: - * s/template.h: - * termcap.c: - * signal.c: - * lread.c: + * m/vax.h: + * s/cxux.h: + * s/xenix.h: + * s/umax.h: + * s/msdos.h: + * s/template.h: + * termcap.c: + * signal.c: + * lread.c: * callproc.c * buffer.c: Remove VMS dependent code. 1997-11-02 Andreas Jaeger * syspwd.h: - * systty.h: - * systime.h: - * syssignal.h: - * sysproc.h: - * sysfloat.h: - * sysfile.h: - * regex.h: - * process.h: - * ndir.h: - * mule-mcpath.h: - * getpagesize.h: - * sysdep.h: + * systty.h: + * systime.h: + * syssignal.h: + * sysproc.h: + * sysfloat.h: + * sysfile.h: + * regex.h: + * process.h: + * ndir.h: + * mule-mcpath.h: + * getpagesize.h: + * sysdep.h: * fileio.c: * process.c: Remove old VMS code. @@ -5753,8 +5753,8 @@ 1997-11-02 Andreas Jaeger - * sysdep.c: - * getloadavg.c: + * sysdep.c: + * getloadavg.c: * malloc.c: Remove old VMS code. 1997-11-02 Hrvoje Niksic @@ -5803,12 +5803,12 @@ 1997-10-31 Kyle Jones - * callproc.c: GC protect current_dir while infile and + * callproc.c: GC protect current_dir while infile and error_file are being initialized. 1997-10-30 SL Baur - * config.h.in: Remove HAVE_GIF, HAVE_JPEG, HAVE_PNG, HAVE_TIFF and + * config.h.in: Remove HAVE_GIF, HAVE_JPEG, HAVE_PNG, HAVE_TIFF and replace with HAVE_IMAGEMAGICK. 1997-10-30 Kyle Jones @@ -5824,7 +5824,7 @@ 1997-10-28 Kyle Jones - * Under LRECORD_VECTOR, moved vectors from being an basic + * Under LRECORD_VECTOR, moved vectors from being an basic lrecord tpye to an lcrecord. Added support for 31 bits Lisp integers. Added support for maskless pointers to Lisp objects. @@ -5854,7 +5854,7 @@ type checking code on an uninitialized implementation pointer. - (Fpurecopy): return if given a null pointer. THis can + (Fpurecopy): return if given a null pointer. THis can happen when initializing Qnil. (mark_object): return if passed a null pointer. I @@ -5870,7 +5870,7 @@ indirect children list gets reset to a null pointer when a bfufer is killed. - (complex_vars_of_buffer): initialize indirect_children + (complex_vars_of_buffer): initialize indirect_children slow of Vbuffer_local_symbols and Vbuffer_defaults to nil. @@ -6010,11 +6010,11 @@ * README: Remove references to VMS. - * vlimit.h: - * s/vms5-5.h: - * s/vms4-4.h: - * s/vms4-2.h: - * s/vms4-0.h: + * vlimit.h: + * s/vms5-5.h: + * s/vms4-4.h: + * s/vms4-2.h: + * s/vms4-0.h: * s/vms.h: Remove files since VMS isn't supported any more. 1997-10-25 Kyle Jones @@ -6030,7 +6030,7 @@ * alloc.c: Disable purespace statistics unless --debug is in effect. - * console-stream.c (init_console_stream): At the price of a tiny + * console-stream.c (init_console_stream): At the price of a tiny memory leak, reinitialize FILE fields of the console. From Tonny Madsen @@ -6072,15 +6072,15 @@ separate function so that it could be used as a `print' method for lrecord-based strings. -1997-10-20 Jan Vroonhof - +1997-10-20 Jan Vroonhof + * extents.c: Renamed shot property to initial-redisplay-function (extent_fragment_update): Changed the bookkeeping whether an event has been spawned. The initial-redisplay-function property is no longer set to nil. - + * extents.h: ditto - + 1997-10-20 Kyle Jones * Added support for conses and vectors to be lrecords. @@ -6153,7 +6153,7 @@ (make-coding-system, coding-system-type, detect-coding-region): Rename `Qautomatic_conversion' -> `Qundecided'. - + * general.c (syms_of_general): Rename `automatic-conversion' -> `undecided' to sync with Emacs 20.2. @@ -6202,7 +6202,7 @@ 1997-10-11 SL Baur - * realpath.c (realpath): CONST IS LOSING but removing it conflicts + * realpath.c (realpath): CONST IS LOSING but removing it conflicts with system headers. * callproc.c: New variable infopath-internal. @@ -6272,7 +6272,7 @@ * regex.c: Global change: register -> REGISTER. - Ensure REGISTER is always defined. - + * nt.c: Global change: register -> REGISTER. * linuxplay.c: Global change: register -> REGISTER. @@ -6281,7 +6281,7 @@ * gifalloc.c: Global change: register -> REGISTER. - Ensure REGISTER is always defined. - + * getloadavg.c (getloadavg): register -> REGISTER. * eval.c (unwind_to_catch): [Unused variable] register -> REGISTER. @@ -6344,7 +6344,7 @@ Fri Oct 3 12:28:08 1997 Kyle Jones * lisp-disunion.h: Move markbit to be between the - type bits and the value bits. Previously it was always + type bits and the value bits. Previously it was always the sign bit of a EMACS_INT, unless modified by a #define in a machine dependent .h file. @@ -6446,7 +6446,7 @@ is a cons. (Fremrassoc): Ditto. - * dired.c (Fdirectory_files): Nreverse the list only if it will be + * dired.c (Fdirectory_files): Nreverse the list only if it will be sorted. Fri Sep 26 13:55:28 1997 Kyle Jones @@ -6458,7 +6458,7 @@ 1997-09-26 Hrvoje Niksic * dired.c (close_directory_fd): New function. - (Fdirectory_files): Use it to set up an unwind-protection to close + (Fdirectory_files): Use it to set up an unwind-protection to close the descriptor. (Fdirectory_files): Allow QUIT in re_search. (Fdirectory_files): If the file is too big, allocate necessary @@ -6494,7 +6494,7 @@ * syntax.c (Fchar_syntax): convert nil input to \000 for compatibility. - * alloc.c (report_pure_usage): Increase slop to 512 bytes in betas + * alloc.c (report_pure_usage): Increase slop to 512 bytes in betas and reduce it to 4 bytes in releases. 1997-09-23 SL Baur @@ -6535,7 +6535,7 @@ * eval.c (Fapply): replace Flength call with for-loop to compute list length. - + * eval.c (apply_lambda):Use XCAR and XCDR in some places where it is safe to do so. @@ -6577,7 +6577,7 @@ * events.c (Fmake_event): Add default case, remove unused variables. 1997-08-21 Jan Vroonhof - + * extents.c (extent_fragment_update): Trigger one_shot_function * extents.c (set-extent-one-shot-function): New function @@ -6629,7 +6629,7 @@ 1997-08-05 Jens-Ulrik Holger Petersen - * eval.c (vars_of_eval): Updated docstring for `debug_on_error' to + * eval.c (vars_of_eval): Updated docstring for `debug_on_error' to mention `debug-ignored-errors'. 1997-08-01 SL Baur @@ -6644,7 +6644,7 @@ * frame-x.c (x_offix_drop_event_handler): Use stderr_out instead of fprintf. - * mule-coding.c (parse_iso2022_esc): Add abort() trap on unhandled + * mule-coding.c (parse_iso2022_esc): Add abort() trap on unhandled condition. * mule-wnnfns.c (Fwnn_dict_search): Remove unused variable. @@ -6719,7 +6719,7 @@ New variable Vpackage_path. (vars_of_emacs): Use it. - * editfns.c (Fstring_to_char): Return nil instead of `0' for empty + * editfns.c (Fstring_to_char): Return nil instead of `0' for empty string. 1997-07-10 Hrvoje Niksic @@ -6760,7 +6760,7 @@ Was forgotten cut & paste identical clone to Fcompiled_function_interactive? - * Makefile.in.in (alloc.o): Remove dependency on puresize_adjust.h + * Makefile.in.in (alloc.o): Remove dependency on puresize_adjust.h so alloc.c need not be recompiled when puresize changes. * alloc.c (PURIFIED): Use get_PURESIZE() instead of constant. @@ -6775,7 +6775,7 @@ (get_PURESIZE): New function -- declare it. * pure.c: Move final PURESIZE computation and include of - puresize_adjust.h into here so alloc.c need not be recompiled each + puresize_adjust.h into here so alloc.c need not be recompiled each time the puresize is adjusted. (get_PURESIZE): New function. @@ -6795,7 +6795,7 @@ I am still not sure what this buys us, but I guess it doesn't hurt to have it. From Hrvoje Niksic - + * glyphs.c (make_string_from_file): Use insert-file-contents-literally instead of insert-file-contents-internal. @@ -6925,7 +6925,7 @@ 1997-06-18 Martin Buchholz - * Makefile.in: + * Makefile.in: * s/*.h: * m/*.h: * config.h.in: @@ -6946,10 +6946,10 @@ - Make quoted pre-processor string tokens out of all macro values to be used only by configure. * xmu.c: DON'T use Xos.h - * sysdep.c (wait_for_termination): - * search.c: - * editfns.c: - * console-*: + * sysdep.c (wait_for_termination): + * search.c: + * editfns.c: + * console-*: 1997-06-18 Steven L Baur @@ -7049,7 +7049,7 @@ * syntax.c (Fchar_syntax): Handle case of being passed nil. - * data.c (eq_with_ebola_notice): Add more legitimate places in the + * data.c (eq_with_ebola_notice): Add more legitimate places in the bytecompiler that should not get Ebola notices. Tue Jun 10 00:34:40 1997 Kyle Jones @@ -7097,7 +7097,7 @@ * keydefs.c (get_relevant_extent_keymaps): Choose correct keymap at extent boundaries. - + Mon Jun 9 19:35:19 1997 Kyle Jones * redisplay.c (pixel_to_glyph_translation): @@ -7119,7 +7119,7 @@ * sysdep.c: MS Windows NT doesn't (yet) do child TTY processes. From David Hobley - + Sat Jun 7 22:00:54 1997 Kyle Jones * device-x.c (x_delete_device): @@ -7130,7 +7130,7 @@ * frame.c (Fmake_frame): Correct checking of first_frame_on_device. From Hrvoje Niksic - + 1997-06-04 Steven L Baur * device.c (delete_deviceless_console): New function. @@ -7170,7 +7170,7 @@ Sat May 31 19:59:49 1997 Kyle Jones * frame-tty.c (tty_init_frame_3: - Defer selection of the newly created frame until + Defer selection of the newly created frame until an event is read. 1997-06-02 Steven L Baur @@ -7233,7 +7233,7 @@ (Fset_recent_keys_ring_size): New function. Modifies the above. From Hrvoje Niksic - + * event-stream.c: New variable recent_keys_ring_size replacing a hard-coded macro. @@ -7251,7 +7251,7 @@ Wed May 21 11:58:17 1997 Kyle Jones * insdel.c (signal_first_change): - record the current buffer for the unwind instead of the + record the current buffer for the unwind instead of the buffer that's about to become the current buffer. Tue May 20 23:23:39 1997 Steven L Baur @@ -7333,7 +7333,7 @@ * lread.c: New variable featurep. (read1): Add processing for #- and #+. - (read_list_conser): Handle case where a feature test has removed a + (read_list_conser): Handle case where a feature test has removed a portion of the input stream. (vars_of_lread): New feature `xemacs'. @@ -7362,7 +7362,7 @@ HAVE_X_WINDOWS. (main_1): Add vars_of_balloon_x and guard with HAVE_X_WINDOWS. - * process.c (get_process): This function can be passed a BUFFER as + * process.c (get_process): This function can be passed a BUFFER as a parameter. Tue Apr 22 01:32:00 1997 Kyle Jones @@ -7493,7 +7493,7 @@ * dired.c (Fdirectory_files): Clean up GC protection. - * insdel.c (signal_after_change): Don't run after_change_functions + * insdel.c (signal_after_change): Don't run after_change_functions on special Vprin1_to_string_buffer. (signal_before_change): Ditto for before_change_functions. @@ -7551,7 +7551,7 @@ * config.h.in: Strip unimplemented NeXTStep/Epoch stuff out. - * Makefile.in.in: Remove unused NeXTStep support. It's all in the + * Makefile.in.in: Remove unused NeXTStep support. It's all in the cvs attic if someone wishes to revive it. (epoch.o): Remove last vestiges of non-existent epoch support. @@ -7566,7 +7566,7 @@ Tue Apr 1 12:22:32 1997 Steven L Baur - * config.h.in: MAIL_USE_POP, KERBEROS, HESIOD -- new parameters to + * config.h.in: MAIL_USE_POP, KERBEROS, HESIOD -- new parameters to deal with upgraded movemail.c. Fri Mar 28 19:25:22 1997 Steven L Baur @@ -7613,7 +7613,7 @@ Mon Mar 24 12:40:56 1997 David Moore * profile.c: Fixed some comments about GC status of functions. - + * profile.c (inside_profiling): New variable to lock the profiling table. (sigprof_handler): Check it. @@ -7647,7 +7647,7 @@ (Fset_file_modes): ditto (Ffile_newer_than_file_p): ditto (Fset_visited_file_modtime): ditto - + *fileio.c (Ffile_truename): Unneccessary GC protection. (Fdelete_directory): Fix broken caller-must-GC-protect call. @@ -7684,7 +7684,7 @@ * glyphs-x.c (x_print_image_instance): Move define of HAVE_SUBWINDOWS to glyphs-x.h. - (our_skip_input_data): Implement with some error checking based on + (our_skip_input_data): Implement with some error checking based on patch by Dominic Froud. * glyphs-x.h (HAVE_SUBWINDOWS): Define to keep inline.c from @@ -7755,7 +7755,7 @@ Sun Mar 9 21:46:53 1997 Tomasz J. Cholewo - * minibuf.c (regexp_ignore_completion_p): Reverse meaning of + * minibuf.c (regexp_ignore_completion_p): Reverse meaning of completion-regexp-list. Thu Mar 6 19:15:29 1997 Steven L Baur @@ -7843,7 +7843,7 @@ * process.c (record_exited_processes): Fix obvious typo in checking for SIGCLD. - + Sun Feb 23 01:45:49 1997 Martin Buchholz * scrollbar.c (update_scrollbar_instance): Fix for @@ -8312,4 +8312,3 @@ Wed Dec 4 23:38:03 1996 Steven L Baur * redisplay.c: Allow column numbers in modeline to start from 1. - diff -r 9f011ab08d48 -r 2f8bb876ab1d src/ChangeLog.2 --- a/src/ChangeLog.2 Mon Aug 13 11:15:00 2007 +0200 +++ b/src/ChangeLog.2 Mon Aug 13 11:16:07 2007 +0200 @@ -8,9 +8,9 @@ * lisp.h (xfree_1): Make non-public. * (xzero): Use '\0' in memset call for clarity. * (ALIGNOF): Use __alignof__ instead of undocumented __alignof. - * alloc.c (allocate_string_chars_struct): - (make_uninit_string): - (resize_string): + * alloc.c (allocate_string_chars_struct): + (make_uninit_string): + (resize_string): (verify_string_chars_integrity): (compact_string_chars): Now only called for small strings. (sweep_strings): @@ -216,7 +216,7 @@ 2000-01-04 Martin Buchholz - * mule-charset.h (REP_BYTES_BY_FIRST_BYTE): + * mule-charset.h (REP_BYTES_BY_FIRST_BYTE): Remove macro, always use inline function. * mule-charset.c (make_charset): Don't assign to rep_bytes_by_first_byte. (rep_bytes_by_first_byte): Make const. @@ -331,31 +331,31 @@ 1999-12-21 Martin Buchholz - * editfns.c (Fpoint_min): - (Fpoint_min_marker): - (Fpoint_max): - (Fpoint_max_marker): - (Fchar_after): - (Fchar_before): + * editfns.c (Fpoint_min): + (Fpoint_min_marker): + (Fpoint_max): + (Fpoint_max_marker): + (Fchar_after): + (Fchar_before): Docstring fixes. What's a `buffer pointer' anyways? * editfns.c (char=): Remove unused and undocumented optional third BUFFER argument. - * toolbar.h (DEVICE_SUPPORTS_TOOLBARS_P): - * fns.c (plists_differ): - * elhash.c (HASH_CODE): - * elhash.c (KEYS_EQUAL_P): - * redisplay-output.c (redisplay_move_cursor): - * redisplay.c (create_text_block): - * floatfns.c (Flogb): - * glyphs-msw.c (mswindows_initialize_image_instance_mask): - * glyphs-msw.c (xpm_to_eimage): - * buffer.h (POINT_MARKER_P): - * syntax.c (scan_lists): - * cmdloop.c (Fcommand_loop_1): - * widget.c (Fwidget_apply): - * regex.c (STREQ): + * toolbar.h (DEVICE_SUPPORTS_TOOLBARS_P): + * fns.c (plists_differ): + * elhash.c (HASH_CODE): + * elhash.c (KEYS_EQUAL_P): + * redisplay-output.c (redisplay_move_cursor): + * redisplay.c (create_text_block): + * floatfns.c (Flogb): + * glyphs-msw.c (mswindows_initialize_image_instance_mask): + * glyphs-msw.c (xpm_to_eimage): + * buffer.h (POINT_MARKER_P): + * syntax.c (scan_lists): + * cmdloop.c (Fcommand_loop_1): + * widget.c (Fwidget_apply): + * regex.c (STREQ): Remove extra parens, esp. of the form ((expr)) * floatfns.c (Flogb): Make 64-bit clean. @@ -405,7 +405,7 @@ * glyphs-widget.c (VALID_GUI_KEYWORDS): use NONCOPY keyword for callbacks and other things that could recurse. - (VALID_GUI_KEYWORDS): + (VALID_GUI_KEYWORDS): * event-msw.c: fix cpp stuff for cygwin < b20. @@ -456,10 +456,10 @@ 1999-12-18 Martin Buchholz - * fns.c (mapcar1): - (Fmapconcat): - (Fmapcar): - (Fmapvector): + * fns.c (mapcar1): + (Fmapconcat): + (Fmapcar): + (Fmapvector): Docstring fixes. Make them consistent with the lispref and ANSI Lisp. 1999-12-17 Martin Buchholz @@ -479,7 +479,7 @@ * window.c: * event-stream.c: Remove last vestigial uses of GC_* - + * fns.c (mapcar1): Fix ***THREE*** obscure crashes in one function! - Two of those involve evil mapping functions that destructively modify a list being mapped over. @@ -519,7 +519,7 @@ 1999-12-10 Shenghuo ZHU - * file-coding.c (add_coding_system_to_list_mapper): + * file-coding.c (add_coding_system_to_list_mapper): - (coding-system-list) should list aliases correctly. 1999-12-07 Andy Piper @@ -548,7 +548,7 @@ found. (nt_open_network_stream): warn_when_safe if network stream fails to open. - + * ntproc.c (create_child): Remove negative pid hack for Windows 95. Remove incorrect and unnecessary USE_UNION_TYPE handling. @@ -568,7 +568,7 @@ * events.c (Fcopy_event): Don't copy the lrecord_header. - * lisp.h (DO_REALLOC): + * lisp.h (DO_REALLOC): Optimize. Remove redundant parens. Remove generic hygienic macro comment. @@ -577,7 +577,7 @@ 1999-12-05 Martin Buchholz - * lstream.c (Lstream_adding): + * lstream.c (Lstream_adding): - Never compare a size_t and a possibly negative number. - Optimize. @@ -614,11 +614,11 @@ 1999-12-04 Martin Buchholz - * lstream.c: (filedesc_reader): + * lstream.c: (filedesc_reader): (filedesc_writer): Try number 2: Support broken systems where return type of read() and write() is different from ssize_t. - * systty.h: + * systty.h: * sysdep.h: * sysdep.c: - Replace macro calls to EMACS_GET_TTY and EMACS_SET_TTY with @@ -637,7 +637,7 @@ (menu_move_right): Ditto. * lrecord.h (copy_lcrecord): - (zero_lcrecord): + (zero_lcrecord): Always add parentheses around uses of macro arguments. * sysdll.c: #include for exit(). @@ -762,7 +762,7 @@ * file-coding.c (convert_to_external_format): * file-coding.c (convert_from_external_format): - Lstream functions mirror Unix98 read(),write(). Therefore use - Unix98 types size_t and ssize_t. + Unix98 types size_t and ssize_t. - Try to make Lstream* functions 64-bit clean. Someday someone may actually want to read from a Lstream with more than 2**32 bytes. - Add configure support for ssize_t. @@ -790,12 +790,12 @@ 1999-11-26 Martin Buchholz - * device-x.c (x_init_device): + * device-x.c (x_init_device): - Replace magic number `17' with equivalent expn using sizeof. - Replace strcmp with marginally more efficient memcmp. - Avoid using C++ reserved word `class'. - * file-coding.c (determine_real_coding_system): + * file-coding.c (determine_real_coding_system): - Look for both initial and final -*- cookies. - Replace EQ (foo, Qnil) with NILP (foo) - Make searching for cookies more efficient. @@ -848,7 +848,7 @@ * redisplay.h (struct rune): Do not use bitfields for members. (struct rune): Add various comments about further optimizations. - + 1999-11-19 Eric Darve * abbrev.c (abbrev_oblookup): Check whether wordend <= wordstart @@ -914,16 +914,16 @@ * tooltalk.c (tt_build_string): Remove extra parens. * process.c (print_process): Remove extra parens. - * buffer.h (BI_BUF_PTR_BYTE_POS): - (BUF_PTR_BYTE_POS): - (BI_BUF_BYTE_ADDRESS): - (BI_BUF_BYTE_ADDRESS_BEFORE): - (valid_memind_p): - (bytind_to_memind): + * buffer.h (BI_BUF_PTR_BYTE_POS): + (BUF_PTR_BYTE_POS): + (BI_BUF_BYTE_ADDRESS): + (BI_BUF_BYTE_ADDRESS_BEFORE): + (valid_memind_p): + (bytind_to_memind): (memind_to_bytind): Remove extra parens. Inline functions are not macros. - * editfns.c (Fuser_login_name): + * editfns.c (Fuser_login_name): (user_login_name): Use proper type uid_t. @@ -992,18 +992,18 @@ 1999-10-25 Martin Buchholz - * redisplay.h (CLASS_RESET_CHANGED_FLAGS): - (GLOBAL_RESET_CHANGED_FLAGS): - (CLASS_REDISPLAY_FLAGS_CHANGEDP): - (RESET_CHANGED_SET_FLAGS): + * redisplay.h (CLASS_RESET_CHANGED_FLAGS): + (GLOBAL_RESET_CHANGED_FLAGS): + (CLASS_REDISPLAY_FLAGS_CHANGEDP): + (RESET_CHANGED_SET_FLAGS): Fix C++ compile errors/warnings. These macros were just a tad too clever. * process-unix.c (unix_open_network_stream): * objects-x.c (allocate_nearest_color): - * mule-charset.c (vars_of_mule_charset): - * fileio.c (Ffile_truename): - * file-coding.c (vars_of_file_coding): + * mule-charset.c (vars_of_mule_charset): + * fileio.c (Ffile_truename): + * file-coding.c (vars_of_file_coding): Fix compile errors/warnings. * alloc.c (xstrdup): Use fact that memcpy returns its first arg. @@ -1039,8 +1039,8 @@ * sound.c: support HAVE_ESD_SOUND - * miscplay.c: - * miscplay.h: + * miscplay.c: + * miscplay.h: * linuxplay.c: Move large part of linuxplay to generalized file miscplay. Make it platform independent. @@ -1062,7 +1062,7 @@ 1999-10-24 Jan Vroonhof - * unexelf.c: Merge Martin's c++ fixes back in + * unexelf.c: Merge Martin's c++ fixes back in 1999-10-20 Jan Vroonhof @@ -1141,7 +1141,7 @@ * lisp.h (DUMPEDP): Added. Removed dumped flag from dynarr. * alloc.c: Removed hash_next linked list pointer. - + * *.c *.h: Removed markobj and mark_object parameters, removed GC_ and XGC macros. @@ -1731,7 +1731,7 @@ XEmacs slow down to a crawl. I also hope to be able to create a list with more than INT_MAX cons cells. - * redisplay.c (decode_mode_spec): + * redisplay.c (decode_mode_spec): The %p and %P specs in the mode line were not correct for buffers larger than MAX_INT/100! The %p spec was off by .5% even for small buffers! @@ -1741,7 +1741,7 @@ * cmdloop.c (num_input_keys): * print.c (debug_temp): * emacs.c (Vinfo_directory): - Delete unused variables + Delete unused variables * console-x.h (x_interline_space): Mark as unimplemented. * redisplay-x.c (x_interline_space): Mark as unimplemented. @@ -1801,7 +1801,7 @@ * scrollbar-x.c (x_window_is_scrollbar): deleted. * scrollbar-x.h: ditto. - + 1999-09-23 Martin Buchholz * alloc.c (this_marks_a_marked_record): Remove. @@ -2560,7 +2560,7 @@ * console.h (struct console_methods): new console methods for outputting pixmaps and strings. -1999-08-23 Didier Verna +1999-08-23 Didier Verna * sound.c: revert the renaming of `bell_volume' to `Vbell_volume' and `bell_inhibit_time' to `Vbell_inhibit_time'. @@ -3184,7 +3184,7 @@ * s/linux.h: gcc-2.8 changes for powerpc From Justin Vallon -1999-07-05 Didier Verna +1999-07-05 Didier Verna * indent.c: new symbol Qcoerce. (Fmove_to_column): use it + doc string update. @@ -5150,7 +5150,7 @@ * bytecode.c (Ffetch_bytecode): Fix crash when loading lazy-loaded bytecode. -1998-12-02 Didier Verna +1998-12-02 Didier Verna * menubar-x.c (menu_item_descriptor_to_widget_value_1): set the accelerator field to nil for labels. @@ -5161,7 +5161,7 @@ Escape occurrences of '&' and support occurrences of the '%_' accelerator indicator in menus. -1998-11-26 Didier Verna +1998-11-26 Didier Verna * dired.c (Fdirectory_files): use make_string instead of make_ext_string on the filename. The conversion external->internal @@ -6460,14 +6460,14 @@ * chartab.c (canonicalize_char_table_value): Coerce ints to chars for tables of type `char'. -1998-11-26 Didier Verna +1998-11-26 Didier Verna * input-method-xlib.c (Initialize_Locale): don't call XtSetLanguageProc. We've done the whole work here. * input-method-xfs.c (Initialize_Locale): ditto. * input-method-motif.c (Initialize_Locale): ditto. -1998-11-26 Didier Verna +1998-11-26 Didier Verna * process-unix.c (unix_create_process): handle properly Vfile_name_coding_system for converting the program and directory @@ -6912,7 +6912,7 @@ * fns.c (Fremrassq, remrassq_no_quit): A XCAR that should have been an XCDR turned Fremrassq into Fremassq -1998-07-17 Didier Verna +1998-07-17 Didier Verna * redisplay-x.c (x_get_gc): returns a GC with a FillStipple fill style as foreground GC for faces that have the `dim' property. @@ -8250,7 +8250,7 @@ divider face using Vvertical_divider_face background. Fix drawing spacing gaps around the divider. -1998-05-14 Didier Verna +1998-05-14 Didier Verna * redisplay-x.c (x_output_vertical_divider): removed hard-wired values for the vertical divider line width and spacing. Use the @@ -8449,13 +8449,13 @@ * redisplay-msw.c (mswindows_output_vertical_divider): Syntax fix. -1998-05-12 Didier Verna +1998-05-12 Didier Verna * redisplay-x.c (x_output_vertical_divider): draw shadows around the divider line. The shadow thickness is currently hard-wired. This will probably be turned into a specifier soon. -1998-05-12 Didier Verna +1998-05-12 Didier Verna * console.h (struct console_methods): the divider_width console method now requires a struct window * argument. @@ -8593,7 +8593,7 @@ hand-crafted regexps. - Use standard coding conventions for modules/Makefile.in -1998-05-12 Didier Verna +1998-05-12 Didier Verna * redisplay.c: removed the scrolling modeline code that didn't make it for 21.0. To be continued ... diff -r 9f011ab08d48 -r 2f8bb876ab1d src/Makefile.in.in --- a/src/Makefile.in.in Mon Aug 13 11:15:00 2007 +0200 +++ b/src/Makefile.in.in Mon Aug 13 11:16:07 2007 +0200 @@ -25,7 +25,20 @@ PROGNAME=@PROGNAME@ -all: ${PROGNAME} +#define NOT_C_CODE +#include "config.h" + +#ifdef PDUMP +DUMP_TARGET = ${PROGNAME}.dmp +EXE_TARGET = ${PROGNAME} +ID_FILE = dump-id.c +#else +DUMP_TARGET = ${PROGNAME} +EXE_TARGET = temacs +ID_FILE = +#endif + +all: ${DUMP_TARGET} .PHONY : all release dump-elc dump-elcs all-elc all-elcs lint ## For performance and consistency, no built-in rules. @@ -73,8 +86,6 @@ lib_gcc=@lib_gcc@ ##libmcheck=@libmcheck@ -#define NOT_C_CODE -#include "config.h" ## With the traditional VPATH setting, it is not possible to ## simultaneously compile in-place and in another directory. The @@ -98,6 +109,7 @@ vpath paths.h vpath Emacs.ad.h vpath sheap-adjust.h +vpath dump-id.c #else VPATH=@srcdir@ #endif @@ -126,7 +138,7 @@ X11_libs = $(LIBI18N) #endif /* HAVE_X_WINDOWS */ -#ifdef HEAP_IN_DATA +#if defined (HEAP_IN_DATA) && !defined(PDUMP) sheap_obj=sheap.o #endif @@ -309,25 +321,25 @@ mo_file = ${mo_dir}emacs.mo #endif -temacs_loadup = ./temacs -batch -l ${srcdir}/../lisp/loadup.el +temacs_loadup = ./${EXE_TARGET} -nd -batch -l ${srcdir}/../lisp/loadup.el dump_temacs = ${temacs_loadup} dump run_temacs = ${temacs_loadup} run-temacs -debug_temacs = gdb temacs +debug_temacs = gdb ${EXE_TARGET} -release: temacs ${libsrc}DOC $(mo_file) ${other_files} +release: ${EXE_TARGET} ${libsrc}DOC $(mo_file) ${other_files} #ifdef CANNOT_DUMP - ln temacs ${PROGNAME} + ln ${EXE_TARGET} ${PROGNAME} #else -if [ -w ${srcdir}/../lisp ]; then \ - w=`pwd`; cd ${srcdir} && $${w}/temacs -batch -l ${srcdir}/../lisp/inc-vers; \ + w=`pwd`; cd ${srcdir} && $${w}/${EXE_TARGET} -nd -batch -l ${srcdir}/../lisp/inc-vers; \ else true; fi - -./temacs -batch -l ${srcdir}/../lisp/loadup.el dump + -./${EXE_TARGET} -nd -batch -l ${srcdir}/../lisp/loadup.el dump touch release #endif /* ! defined (CANNOT_DUMP) */ -${PROGNAME}: temacs ${libsrc}DOC $(mo_file) ${other_files} update-elc.stamp +${DUMP_TARGET}: ${EXE_TARGET} ${libsrc}DOC $(mo_file) ${other_files} update-elc.stamp #ifdef HEAP_IN_DATA - @$(RM) $@ $@.exe && touch SATISFIED + @$(RM) $@ && touch SATISFIED -${dump_temacs} @if test -f $@; then if test -f SATISFIED; then \ echo "Testing for Lisp shadows ..."; \ @@ -336,25 +348,22 @@ if test -f SATISFIED; then $(RM) SATISFIED; exit 1; fi; \ $(RECURSIVE_MAKE) $@; #else - @$(RM) $@ xemacs.dmp + @$(RM) $@ ${dump_temacs} -#ifdef PDUMP - @mv temacs $@ -#endif @echo "Testing for Lisp shadows ..." @./${PROGNAME} -batch -vanilla -f list-load-path-shadows #endif -fastdump: temacs - @$(RM) ${PROGNAME} && touch SATISFIED +fastdump: ${EXE_TARGET} + @$(RM) ${DUMP_TARGET} && touch SATISFIED -${dump_temacs} @./${PROGNAME} -batch -vanilla -f list-load-path-shadows FRC.update-elc.stamp : -update-elc.stamp : temacs FRC.update-elc.stamp +update-elc.stamp : ${EXE_TARGET} FRC.update-elc.stamp @touch NOBYTECOMPILE - ./temacs -batch -l ${srcdir}/../lisp/update-elc.el + ./${EXE_TARGET} -nd -batch -l ${srcdir}/../lisp/update-elc.el @if test ! -f $@ -o -f NOBYTECOMPILE; then touch $@; fi; \ $(RM) NOBYTECOMPILE @@ -373,16 +382,16 @@ cd ../dynodump && $(RECURSIVE_MAKE) #endif /* DYNODUMP */ -${libsrc}DOC: temacs update-elc.stamp +${libsrc}DOC: ${EXE_TARGET} update-elc.stamp $(RM) ${libsrc}DOC; \ - ${DUMPENV} ./temacs -batch -l ${srcdir}/../lisp/make-docfile.el -- \ + ${DUMPENV} ./${EXE_TARGET} -nd -batch -l ${srcdir}/../lisp/make-docfile.el -- \ -o ${libsrc}DOC -d ${srcdir} -i ${libsrc}../site-packages \ ${obj_src} ${mallocdocsrc} ${rallocdocsrc} dump_elcs: dump-elcs -dump-elcs: temacs - -${DUMPENV} ./temacs -batch -l ${srcdir}/../lisp/update-elc.el +dump-elcs: ${EXE_TARGET} + -${DUMPENV} ./${EXE_TARGET} -nd -batch -l ${srcdir}/../lisp/update-elc.el all-elc all-elcs: cd .. && $(RECURSIVE_MAKE) all-elc @@ -416,6 +425,9 @@ #endif /* I18N3 */ +${libsrc}make-dump-id: + cd ${libsrc} && $(RECURSIVE_MAKE) make-dump-id + ${libsrc}make-docfile: cd ${libsrc} && $(RECURSIVE_MAKE) make-docfile @@ -429,23 +441,26 @@ $(LINT.c) $(LINTFILES) ## end of Lint Section -temacs_deps=\ +link_deps=\ $(start_files) ${objs} ${otherobjs}\ $(lwlib_deps) $(dynodump_deps) -temacs_link_args=\ - ${start_flags} ${ldflags}\ - -o $@ ${start_files} ${objs} ${otherobjs} ${LIBES} +temacs_deps=\ + $(link_deps) $(ID_FILE) -temacs: $(temacs_deps) +temacs_link_args=\ + ${start_flags} ${ldflags} -I${srcdir} \ + -o $@ ${start_files} ${objs} ${otherobjs} ${ID_FILE} ${LIBES} + +${EXE_TARGET}: $(temacs_deps) $(LD) $(temacs_link_args) -#ifdef PDUMP - @$(RM) xemacs.dmp -#endif + +dump-id.c: ${libsrc}make-dump-id ${link_deps} + ${libsrc}make-dump-id .PHONY : run-temacs -run-temacs: temacs +run-temacs: ${EXE_TARGET} -${run_temacs} ## We have automated tests!! @@ -470,8 +485,8 @@ rtc_patch_area -o $@ rtcmacs: $(temacs_deps) rtc_patch.o - $(RM) temacs; $(RECURSIVE_MAKE) temacs RTC_patch_objs=rtc_patch.o - mv temacs rtcmacs + $(RM) ${EXE_TARGET}; $(RECURSIVE_MAKE) ${EXE_TARGET} RTC_patch_objs=rtc_patch.o + mv ${EXE_TARGET} rtcmacs .PHONY: run-rtcmacs run-rtcmacs: rtcmacs @@ -484,7 +499,7 @@ runargs -batch -l ${srcdir}/../lisp/loadup.el run-temacs -q; \ run' rtcmacs -debug-temacs: temacs +debug-temacs: ${EXE_TARGET} -${debug_temacs} ## Purify, Quantify, PureCoverage are software quality products from @@ -502,7 +517,7 @@ PURIFY_LIBS = -lpthread puremacs: $(temacs_deps) $(PURIFY_PROG) $(PURIFY_FLAGS) $(LD) $(temacs_link_args) $(PURIFY_LIBS) - cp $@ temacs + cp $@ ${EXE_TARGET} ## Quantify #ifdef QUANTIFY @@ -514,7 +529,7 @@ quantmacs: $(temacs_deps) $(QUANTIFY_PROG) $(QUANTIFY_FLAGS) $(LD) $(temacs_link_args) - cp $@ temacs + cp $@ ${EXE_TARGET} #endif /* QUANTIFY */ diff -r 9f011ab08d48 -r 2f8bb876ab1d src/alloc.c --- a/src/alloc.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/alloc.c Mon Aug 13 11:16:07 2007 +0200 @@ -36,12 +36,13 @@ Added lcrecord lists for 19.14. slb: Lots of work on the purification and dump time code. Synched Doug Lea malloc support from Emacs 20.2. - og: Killed the purespace. Portable dumper. + og: Killed the purespace. Portable dumper (moved to dumper.c) */ #include #include "lisp.h" +#include "alloc.h" #include "backtrace.h" #include "buffer.h" #include "bytecode.h" @@ -56,6 +57,7 @@ #include "redisplay.h" #include "specifier.h" #include "sysfile.h" +#include "sysdep.h" #include "window.h" #include "console-stream.h" @@ -63,19 +65,8 @@ #include #endif -#ifdef HAVE_MMAP -#include -#include -#endif - #ifdef PDUMP -typedef struct -{ - const struct lrecord_description *desc; - int count; -} pdump_reloc_table; - -static char *pdump_rt_list = 0; +#include "dumper.h" #endif EXFUN (Fgarbage_collect, 0); @@ -393,7 +384,7 @@ (! (implementation->hash == NULL && implementation->equal != NULL))); lcheader = (struct lcrecord_header *) allocate_lisp_storage (size); - set_lheader_implementation (&(lcheader->lheader), implementation); + set_lheader_implementation (&lcheader->lheader, implementation); lcheader->next = all_lcrecords; #if 1 /* mly prefers to see small ID numbers */ lcheader->uid = lrecord_uid_counter++; @@ -657,7 +648,7 @@ This is called when a relocatable block is freed in ralloc.c. */ void refill_memory_reserve (void); void -refill_memory_reserve () +refill_memory_reserve (void) { if (breathing_space == 0) breathing_space = (char *) malloc (4096 - MALLOC_OVERHEAD); @@ -796,12 +787,18 @@ You have some weird system and need to supply a reasonable value here. #endif +/* The construct (* (void **) (ptr)) would cause aliasing problems + with modern optimizing compilers like `gcc -O3 -fstrict-aliasing'. + But `char *' can legally alias any pointer. Hence this union trick. */ +typedef union { char c; void *p; } *aliasing_voidpp; +#define ALIASING_VOIDPP_DEREFERENCE(ptr) \ + (((aliasing_voidpp) (ptr))->p) #define FREE_STRUCT_P(ptr) \ - (* (void **) ptr == (void *) INVALID_POINTER_VALUE) + (ALIASING_VOIDPP_DEREFERENCE (ptr) == (void *) INVALID_POINTER_VALUE) #define MARK_STRUCT_AS_FREE(ptr) \ - (* (void **) ptr = (void *) INVALID_POINTER_VALUE) + (ALIASING_VOIDPP_DEREFERENCE (ptr) = (void *) INVALID_POINTER_VALUE) #define MARK_STRUCT_AS_NOT_FREE(ptr) \ - (* (void **) ptr = 0) + (ALIASING_VOIDPP_DEREFERENCE (ptr) = 0) #ifdef ERROR_CHECK_GC @@ -923,7 +920,7 @@ Lisp_Cons *c; ALLOCATE_FIXED_TYPE (cons, Lisp_Cons, c); - set_lheader_implementation (&(c->lheader), &lrecord_cons); + set_lheader_implementation (&c->lheader, &lrecord_cons); XSETCONS (val, c); c->car = car; c->cdr = cdr; @@ -940,7 +937,7 @@ Lisp_Cons *c; NOSEEUM_ALLOCATE_FIXED_TYPE (cons, Lisp_Cons, c); - set_lheader_implementation (&(c->lheader), &lrecord_cons); + set_lheader_implementation (&c->lheader, &lrecord_cons); XSETCONS (val, c); XCAR (val) = car; XCDR (val) = cdr; @@ -1057,7 +1054,7 @@ if (sizeof (struct lrecord_header) + sizeof (double) != sizeof (*f)) xzero (*f); - set_lheader_implementation (&(f->lheader), &lrecord_float); + set_lheader_implementation (&f->lheader, &lrecord_float); float_data (f) = float_value; XSETFLOAT (val, f); return val; @@ -1297,7 +1294,7 @@ size_t num_longs = BIT_VECTOR_LONG_STORAGE (sizei); size_t sizem = offsetof (Lisp_Bit_Vector, bits[num_longs]); Lisp_Bit_Vector *p = (Lisp_Bit_Vector *) allocate_lisp_storage (sizem); - set_lheader_implementation (&(p->lheader), &lrecord_bit_vector); + set_lheader_implementation (&p->lheader, &lrecord_bit_vector); INCREMENT_CONS_COUNTER (sizem, "bit-vector"); @@ -1401,7 +1398,7 @@ Lisp_Object fun; ALLOCATE_FIXED_TYPE (compiled_function, Lisp_Compiled_Function, f); - set_lheader_implementation (&(f->lheader), &lrecord_compiled_function); + set_lheader_implementation (&f->lheader, &lrecord_compiled_function); f->stack_depth = 0; f->specpdl_depth = 0; @@ -1485,7 +1482,7 @@ f->constants = constants; CHECK_NATNUM (stack_depth); - f->stack_depth = XINT (stack_depth); + f->stack_depth = (unsigned short) XINT (stack_depth); #ifdef COMPILED_FUNCTION_ANNOTATION_HACK if (!NILP (Vcurrent_compiled_function_annotation)) @@ -1548,7 +1545,7 @@ CHECK_STRING (name); ALLOCATE_FIXED_TYPE (symbol, Lisp_Symbol, p); - set_lheader_implementation (&(p->lheader), &lrecord_symbol); + set_lheader_implementation (&p->lheader, &lrecord_symbol); p->name = XSTRING (name); p->plist = Qnil; p->value = Qunbound; @@ -1572,7 +1569,7 @@ struct extent *e; ALLOCATE_FIXED_TYPE (extent, struct extent, e); - set_lheader_implementation (&(e->lheader), &lrecord_extent); + set_lheader_implementation (&e->lheader, &lrecord_extent); extent_object (e) = Qnil; set_extent_start (e, -1); set_extent_end (e, -1); @@ -1602,7 +1599,7 @@ Lisp_Event *e; ALLOCATE_FIXED_TYPE (event, Lisp_Event, e); - set_lheader_implementation (&(e->lheader), &lrecord_event); + set_lheader_implementation (&e->lheader, &lrecord_event); XSETEVENT (val, e); return val; @@ -1625,7 +1622,7 @@ Lisp_Marker *p; ALLOCATE_FIXED_TYPE (marker, Lisp_Marker, p); - set_lheader_implementation (&(p->lheader), &lrecord_marker); + set_lheader_implementation (&p->lheader, &lrecord_marker); p->buffer = 0; p->memind = 0; marker_next (p) = 0; @@ -1642,7 +1639,7 @@ Lisp_Marker *p; NOSEEUM_ALLOCATE_FIXED_TYPE (marker, Lisp_Marker, p); - set_lheader_implementation (&(p->lheader), &lrecord_marker); + set_lheader_implementation (&p->lheader, &lrecord_marker); p->buffer = 0; p->memind = 0; marker_next (p) = 0; @@ -1862,7 +1859,7 @@ /* Allocate the string header */ ALLOCATE_FIXED_TYPE (string, Lisp_String, s); - set_lheader_implementation (&(s->lheader), &lrecord_string); + set_lheader_implementation (&s->lheader, &lrecord_string); set_string_data (s, BIG_STRING_FULLSIZE_P (fullsize) ? xnew_array (Bufbyte, length + 1) @@ -2166,7 +2163,7 @@ /* Allocate the string header */ ALLOCATE_FIXED_TYPE (string, Lisp_String, s); - set_lheader_implementation (&(s->lheader), &lrecord_string); + set_lheader_implementation (&s->lheader, &lrecord_string); SET_C_READONLY_RECORD_HEADER (&s->lheader); s->plist = Qnil; set_string_data (s, (Bufbyte *)contents); @@ -2348,9 +2345,6 @@ /* Garbage Collection */ /************************************************************************/ -/* This will be used more extensively In The Future */ -static int last_lrecord_type_index_assigned; - /* All the built-in lisp object types are enumerated in `enum lrecord_type'. Additional ones may be defined by a module (none yet). We leave some room in `lrecord_implementations_table' for such new lisp object types. */ @@ -2372,108 +2366,89 @@ #else #define NSTATICS 2000 #endif -/* Not "static" because of linker lossage on some systems */ -Lisp_Object *staticvec[NSTATICS] - /* Force it into data space! */ - = {0}; -static int staticidx; + +/* Not "static" because used by dumper.c */ +Lisp_Object *staticvec[NSTATICS]; +int staticidx; /* Put an entry in staticvec, pointing at the variable whose address is given */ void staticpro (Lisp_Object *varaddress) { - if (staticidx >= countof (staticvec)) - /* #### This is now a dubious abort() since this routine may be called */ - /* by Lisp attempting to load a DLL. */ - abort (); + /* #### This is now a dubious assert() since this routine may be called */ + /* by Lisp attempting to load a DLL. */ + assert (staticidx < countof (staticvec)); staticvec[staticidx++] = varaddress; } -/* Not "static" because of linker lossage on some systems */ -Lisp_Object *staticvec_nodump[200] - /* Force it into data space! */ - = {0}; -static int staticidx_nodump; + +Lisp_Object *staticvec_nodump[200]; +int staticidx_nodump; /* Put an entry in staticvec_nodump, pointing at the variable whose address is given */ void staticpro_nodump (Lisp_Object *varaddress) { - if (staticidx_nodump >= countof (staticvec_nodump)) - /* #### This is now a dubious abort() since this routine may be called */ - /* by Lisp attempting to load a DLL. */ - abort (); + /* #### This is now a dubious assert() since this routine may be called */ + /* by Lisp attempting to load a DLL. */ + assert (staticidx_nodump < countof (staticvec_nodump)); staticvec_nodump[staticidx_nodump++] = varaddress; } -/* Not "static" because of linker lossage on some systems */ -struct -{ - void *data; - const struct struct_description *desc; -} dumpstructvec[200]; - -static int dumpstructidx; + +struct pdump_dumpstructinfo dumpstructvec[200]; +int dumpstructidx; /* Put an entry in dumpstructvec, pointing at the variable whose address is given */ void dumpstruct (void *varaddress, const struct struct_description *desc) { - if (dumpstructidx >= countof (dumpstructvec)) - abort (); + assert (dumpstructidx < countof (dumpstructvec)); dumpstructvec[dumpstructidx].data = varaddress; dumpstructvec[dumpstructidx].desc = desc; dumpstructidx++; } -/* Not "static" because of linker lossage on some systems */ -struct dumpopaque_info -{ - void *data; - size_t size; -} dumpopaquevec[200]; - -static int dumpopaqueidx; +struct pdump_dumpopaqueinfo dumpopaquevec[250]; +int dumpopaqueidx; /* Put an entry in dumpopaquevec, pointing at the variable whose address is given */ void dumpopaque (void *varaddress, size_t size) { - if (dumpopaqueidx >= countof (dumpopaquevec)) - abort (); + assert (dumpopaqueidx < countof (dumpopaquevec)); + dumpopaquevec[dumpopaqueidx].data = varaddress; dumpopaquevec[dumpopaqueidx].size = size; dumpopaqueidx++; } Lisp_Object *pdump_wirevec[50]; -static int pdump_wireidx; +int pdump_wireidx; /* Put an entry in pdump_wirevec, pointing at the variable whose address is given */ void pdump_wire (Lisp_Object *varaddress) { - if (pdump_wireidx >= countof (pdump_wirevec)) - abort (); + assert (pdump_wireidx < countof (pdump_wirevec)); pdump_wirevec[pdump_wireidx++] = varaddress; } Lisp_Object *pdump_wirevec_list[50]; -static int pdump_wireidx_list; +int pdump_wireidx_list; /* Put an entry in pdump_wirevec_list, pointing at the variable whose address is given */ void pdump_wire_list (Lisp_Object *varaddress) { - if (pdump_wireidx_list >= countof (pdump_wirevec_list)) - abort (); + assert (pdump_wireidx_list < countof (pdump_wirevec_list)); pdump_wirevec_list[pdump_wireidx_list++] = varaddress; } @@ -2481,7 +2456,7 @@ #define GC_CHECK_LHEADER_INVARIANTS(lheader) do { \ struct lrecord_header * GCLI_lh = (lheader); \ assert (GCLI_lh != 0); \ - assert (GCLI_lh->type <= last_lrecord_type_index_assigned); \ + assert (GCLI_lh->type < lrecord_type_count); \ assert (! C_READONLY_RECORD_HEADER_P (GCLI_lh) || \ (MARKED_RECORD_HEADER_P (GCLI_lh) && \ LISP_READONLY_RECORD_HEADER_P (GCLI_lh))); \ @@ -3075,8 +3050,7 @@ size = string_length (string); fullsize = STRING_FULLSIZE (size); - if (BIG_STRING_FULLSIZE_P (fullsize)) - abort (); + gc_checking_assert (! BIG_STRING_FULLSIZE_P (fullsize)); /* Just skip it if it isn't marked. */ if (! MARKED_RECORD_HEADER_P (&(string->lheader))) @@ -3138,7 +3112,7 @@ { Charcount i; Charcount s = string_char_length (p); - putc ('\"', stderr); + stderr_out ("\""); for (i = 0; i < s; i++) { Emchar ch = string_char (p, i); @@ -3266,28 +3240,7 @@ sweep_events (); #ifdef PDUMP - /* Unmark all dumped objects */ - { - int i; - char *p = pdump_rt_list; - if (p) - for (;;) - { - pdump_reloc_table *rt = (pdump_reloc_table *)p; - p += sizeof (pdump_reloc_table); - if (rt->desc) - { - for (i=0; icount; i++) - { - struct lrecord_header *lh = * (struct lrecord_header **) p; - if (! C_READONLY_RECORD_HEADER_P (lh)) - UNMARK_RECORD_HEADER (lh); - p += sizeof (EMACS_INT); - } - } else - break; - } - } + pdump_objects_unmark (); #endif } @@ -3652,7 +3605,7 @@ garbage_collect_1 (); - for (i = 0; i <= last_lrecord_type_index_assigned; i++) + for (i = 0; i < lrecord_type_count; i++) { if (lcrecord_stats[i].bytes_in_use != 0 || lcrecord_stats[i].bytes_freed != 0 @@ -3993,8 +3946,6 @@ { reinit_alloc_once_early (); - last_lrecord_type_index_assigned = lrecord_type_count - 1; - { int i; for (i = 0; i < countof (lrecord_implementations_table); i++) @@ -4135,1047 +4086,3 @@ { Vgc_pointer_glyph = Fmake_glyph_internal (Qpointer); } - - -#ifdef PDUMP - -/* The structure of the file - * - * 0 - header - * 256 - dumped objects - * stab_offset - nb_staticpro*(Lisp_Object *) from staticvec - * - nb_staticpro*(relocated Lisp_Object) pointed to by staticpro - * - nb_structdmp*pair(void *, adr) for pointers to structures - * - lrecord_implementations_table[] - * - relocation table - * - wired variable address/value couples with the count preceding the list - */ -typedef struct -{ - char signature[8]; - EMACS_UINT stab_offset; - EMACS_UINT reloc_address; - int nb_staticpro; - int nb_structdmp; - int nb_opaquedmp; - int last_type; -} dump_header; - -char *pdump_start, *pdump_end; - -static const unsigned char align_table[256] = -{ - 8, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0 -}; - -typedef struct pdump_entry_list_elmt -{ - struct pdump_entry_list_elmt *next; - const void *obj; - size_t size; - int count; - int is_lrecord; - EMACS_INT save_offset; -} pdump_entry_list_elmt; - -typedef struct -{ - pdump_entry_list_elmt *first; - int align; - int count; -} pdump_entry_list; - -typedef struct pdump_struct_list_elmt -{ - pdump_entry_list list; - const struct struct_description *sdesc; -} pdump_struct_list_elmt; - -typedef struct -{ - pdump_struct_list_elmt *list; - int count; - int size; -} pdump_struct_list; - -static pdump_entry_list pdump_object_table[256]; -static pdump_entry_list pdump_opaque_data_list; -static pdump_struct_list pdump_struct_table; -static pdump_entry_list_elmt *pdump_qnil; - -static int pdump_alert_undump_object[256]; - -static unsigned long cur_offset; -static size_t max_size; -static int pdump_fd; -static void *pdump_buf; - -#define PDUMP_HASHSIZE 200001 - -static pdump_entry_list_elmt **pdump_hash; - -/* Since most pointers are eight bytes aligned, the >>3 allows for a better hash */ -static int -pdump_make_hash (const void *obj) -{ - return ((unsigned long)(obj)>>3) % PDUMP_HASHSIZE; -} - -static pdump_entry_list_elmt * -pdump_get_entry (const void *obj) -{ - int pos = pdump_make_hash (obj); - pdump_entry_list_elmt *e; - - assert (obj != 0); - - while ((e = pdump_hash[pos]) != 0) - { - if (e->obj == obj) - return e; - - pos++; - if (pos == PDUMP_HASHSIZE) - pos = 0; - } - return 0; -} - -static void -pdump_add_entry (pdump_entry_list *list, const void *obj, size_t size, int count, int is_lrecord) -{ - pdump_entry_list_elmt *e; - int align; - int pos = pdump_make_hash (obj); - - while ((e = pdump_hash[pos]) != 0) - { - if (e->obj == obj) - return; - - pos++; - if (pos == PDUMP_HASHSIZE) - pos = 0; - } - - e = xnew (pdump_entry_list_elmt); - - e->next = list->first; - e->obj = obj; - e->size = size; - e->count = count; - e->is_lrecord = is_lrecord; - list->first = e; - - list->count += count; - pdump_hash[pos] = e; - - align = align_table[size & 255]; - if (align < 2 && is_lrecord) - align = 2; - - if (align < list->align) - list->align = align; -} - -static pdump_entry_list * -pdump_get_entry_list (const struct struct_description *sdesc) -{ - int i; - for (i=0; iname, - backtrace[i].position, - backtrace[i].offset); - } - } -} - -static void pdump_register_object (Lisp_Object obj); -static void pdump_register_struct (const void *data, const struct struct_description *sdesc, int count); - -static EMACS_INT -pdump_get_indirect_count (EMACS_INT code, const struct lrecord_description *idesc, const void *idata) -{ - EMACS_INT count; - const void *irdata; - - int line = XD_INDIRECT_VAL (code); - int delta = XD_INDIRECT_DELTA (code); - - irdata = ((char *)idata) + idesc[line].offset; - switch (idesc[line].type) - { - case XD_SIZE_T: - count = *(size_t *)irdata; - break; - case XD_INT: - count = *(int *)irdata; - break; - case XD_LONG: - count = *(long *)irdata; - break; - case XD_BYTECOUNT: - count = *(Bytecount *)irdata; - break; - default: - fprintf (stderr, "Unsupported count type : %d (line = %d, code=%ld)\n", idesc[line].type, line, (long)code); - pdump_backtrace (); - abort (); - } - count += delta; - return count; -} - -static void -pdump_register_sub (const void *data, const struct lrecord_description *desc, int me) -{ - int pos; - - restart: - for (pos = 0; desc[pos].type != XD_END; pos++) - { - const void *rdata = (const char *)data + desc[pos].offset; - - backtrace[me].position = pos; - backtrace[me].offset = desc[pos].offset; - - switch (desc[pos].type) - { - case XD_SPECIFIER_END: - pos = 0; - desc = ((const Lisp_Specifier *)data)->methods->extra_description; - goto restart; - case XD_SIZE_T: - case XD_INT: - case XD_LONG: - case XD_BYTECOUNT: - case XD_LO_RESET_NIL: - case XD_INT_RESET: - case XD_LO_LINK: - break; - case XD_OPAQUE_DATA_PTR: - { - EMACS_INT count = desc[pos].data1; - if (XD_IS_INDIRECT (count)) - count = pdump_get_indirect_count (count, desc, data); - - pdump_add_entry (&pdump_opaque_data_list, - *(void **)rdata, - count, - 1, - 0); - break; - } - case XD_C_STRING: - { - const char *str = *(const char **)rdata; - if (str) - pdump_add_entry (&pdump_opaque_data_list, str, strlen (str)+1, 1, 0); - break; - } - case XD_DOC_STRING: - { - const char *str = *(const char **)rdata; - if ((EMACS_INT)str > 0) - pdump_add_entry (&pdump_opaque_data_list, str, strlen (str)+1, 1, 0); - break; - } - case XD_LISP_OBJECT: - { - const Lisp_Object *pobj = (const Lisp_Object *)rdata; - - assert (desc[pos].data1 == 0); - - backtrace[me].offset = (const char *)pobj - (const char *)data; - pdump_register_object (*pobj); - break; - } - case XD_LISP_OBJECT_ARRAY: - { - int i; - EMACS_INT count = desc[pos].data1; - if (XD_IS_INDIRECT (count)) - count = pdump_get_indirect_count (count, desc, data); - - for (i = 0; i < count; i++) - { - const Lisp_Object *pobj = ((const Lisp_Object *)rdata) + i; - Lisp_Object dobj = *pobj; - - backtrace[me].offset = (const char *)pobj - (const char *)data; - pdump_register_object (dobj); - } - break; - } - case XD_STRUCT_PTR: - { - EMACS_INT count = desc[pos].data1; - const struct struct_description *sdesc = desc[pos].data2; - const char *dobj = *(const char **)rdata; - if (dobj) - { - if (XD_IS_INDIRECT (count)) - count = pdump_get_indirect_count (count, desc, data); - - pdump_register_struct (dobj, sdesc, count); - } - break; - } - default: - fprintf (stderr, "Unsupported dump type : %d\n", desc[pos].type); - pdump_backtrace (); - abort (); - }; - } -} - -static void -pdump_register_object (Lisp_Object obj) -{ - struct lrecord_header *objh; - - if (!POINTER_TYPE_P (XTYPE (obj))) - return; - - objh = XRECORD_LHEADER (obj); - if (!objh) - return; - - if (pdump_get_entry (objh)) - return; - - if (LHEADER_IMPLEMENTATION (objh)->description) - { - int me = depth++; - if (me>65536) - { - fprintf (stderr, "Backtrace overflow, loop ?\n"); - abort (); - } - backtrace[me].obj = objh; - backtrace[me].position = 0; - backtrace[me].offset = 0; - - pdump_add_entry (pdump_object_table + objh->type, - objh, - LHEADER_IMPLEMENTATION (objh)->static_size ? - LHEADER_IMPLEMENTATION (objh)->static_size : - LHEADER_IMPLEMENTATION (objh)->size_in_bytes_method (objh), - 1, - 1); - pdump_register_sub (objh, - LHEADER_IMPLEMENTATION (objh)->description, - me); - --depth; - } - else - { - pdump_alert_undump_object[objh->type]++; - fprintf (stderr, "Undumpable object type : %s\n", LHEADER_IMPLEMENTATION (objh)->name); - pdump_backtrace (); - } -} - -static void -pdump_register_struct (const void *data, const struct struct_description *sdesc, int count) -{ - if (data && !pdump_get_entry (data)) - { - int me = depth++; - int i; - if (me>65536) - { - fprintf (stderr, "Backtrace overflow, loop ?\n"); - abort (); - } - backtrace[me].obj = 0; - backtrace[me].position = 0; - backtrace[me].offset = 0; - - pdump_add_entry (pdump_get_entry_list (sdesc), - data, - sdesc->size, - count, - 0); - for (i=0; isize*i, - sdesc->description, - me); - } - --depth; - } -} - -static void -pdump_dump_data (pdump_entry_list_elmt *elmt, const struct lrecord_description *desc) -{ - size_t size = elmt->size; - int count = elmt->count; - if (desc) - { - int pos, i; - memcpy (pdump_buf, elmt->obj, size*count); - - for (i=0; iobj))->methods->extra_description; - goto restart; - case XD_SIZE_T: - case XD_INT: - case XD_LONG: - case XD_BYTECOUNT: - break; - case XD_LO_RESET_NIL: - { - EMACS_INT count = desc[pos].data1; - int i; - if (XD_IS_INDIRECT (count)) - count = pdump_get_indirect_count (count, desc, elmt->obj); - for (i=0; isave_offset; - break; - } - case XD_INT_RESET: - { - EMACS_INT val = desc[pos].data1; - if (XD_IS_INDIRECT (val)) - val = pdump_get_indirect_count (val, desc, elmt->obj); - *(int *)rdata = val; - break; - } - case XD_OPAQUE_DATA_PTR: - case XD_C_STRING: - case XD_STRUCT_PTR: - { - void *ptr = *(void **)rdata; - if (ptr) - *(EMACS_INT *)rdata = pdump_get_entry (ptr)->save_offset; - break; - } - case XD_LO_LINK: - { - Lisp_Object obj = *(Lisp_Object *)rdata; - pdump_entry_list_elmt *elmt1; - for (;;) - { - elmt1 = pdump_get_entry (XRECORD_LHEADER (obj)); - if (elmt1) - break; - obj = *(Lisp_Object *)(desc[pos].offset + (char *)(XRECORD_LHEADER (obj))); - } - *(EMACS_INT *)rdata = elmt1->save_offset; - break; - } - case XD_LISP_OBJECT: - { - Lisp_Object *pobj = (Lisp_Object *) rdata; - - assert (desc[pos].data1 == 0); - - if (POINTER_TYPE_P (XTYPE (*pobj)) && XRECORD_LHEADER (*pobj)) - *(EMACS_INT *)pobj = - pdump_get_entry (XRECORD_LHEADER (*pobj))->save_offset; - break; - } - case XD_LISP_OBJECT_ARRAY: - { - EMACS_INT count = desc[pos].data1; - int i; - if (XD_IS_INDIRECT (count)) - count = pdump_get_indirect_count (count, desc, elmt->obj); - - for (i=0; isave_offset; - } - break; - } - case XD_DOC_STRING: - { - EMACS_INT str = *(EMACS_INT *)rdata; - if (str > 0) - *(EMACS_INT *)rdata = pdump_get_entry ((void *)str)->save_offset; - break; - } - default: - fprintf (stderr, "Unsupported dump type : %d\n", desc[pos].type); - abort (); - }; - } - } - } - write (pdump_fd, desc ? pdump_buf : elmt->obj, size*count); - if (elmt->is_lrecord && ((size*count) & 3)) - write (pdump_fd, "\0\0\0", 4-((size*count) & 3)); -} - -static void -pdump_reloc_one (void *data, EMACS_INT delta, const struct lrecord_description *desc) -{ - int pos; - - restart: - for (pos = 0; desc[pos].type != XD_END; pos++) - { - void *rdata = (char *)data + desc[pos].offset; - switch (desc[pos].type) - { - case XD_SPECIFIER_END: - pos = 0; - desc = ((const Lisp_Specifier *)data)->methods->extra_description; - goto restart; - case XD_SIZE_T: - case XD_INT: - case XD_LONG: - case XD_BYTECOUNT: - case XD_INT_RESET: - break; - case XD_OPAQUE_DATA_PTR: - case XD_C_STRING: - case XD_STRUCT_PTR: - case XD_LO_LINK: - { - EMACS_INT ptr = *(EMACS_INT *)rdata; - if (ptr) - *(EMACS_INT *)rdata = ptr+delta; - break; - } - case XD_LISP_OBJECT: - { - Lisp_Object *pobj = (Lisp_Object *) rdata; - - assert (desc[pos].data1 == 0); - - if (POINTER_TYPE_P (XTYPE (*pobj)) - && ! EQ (*pobj, Qnull_pointer)) - XSETOBJ (*pobj, XTYPE (*pobj), (char *) XPNTR (*pobj) + delta); - - break; - } - case XD_LISP_OBJECT_ARRAY: - case XD_LO_RESET_NIL: - { - EMACS_INT count = desc[pos].data1; - int i; - if (XD_IS_INDIRECT (count)) - count = pdump_get_indirect_count (count, desc, data); - - for (i=0; i 0) - *(EMACS_INT *)rdata = str + delta; - break; - } - default: - fprintf (stderr, "Unsupported dump type : %d\n", desc[pos].type); - abort (); - }; - } -} - -static void -pdump_allocate_offset (pdump_entry_list_elmt *elmt, const struct lrecord_description *desc) -{ - size_t size = (elmt->is_lrecord ? (elmt->size + 3) & ~3 : elmt->size)*elmt->count; - elmt->save_offset = cur_offset; - if (size>max_size) - max_size = size; - cur_offset += size; -} - -static void -pdump_scan_by_alignment (void (*f)(pdump_entry_list_elmt *, const struct lrecord_description *)) -{ - int align, i; - const struct lrecord_description *idesc; - pdump_entry_list_elmt *elmt; - for (align=8; align>=0; align--) - { - for (i=0; i<=last_lrecord_type_index_assigned; i++) - if (pdump_object_table[i].align == align) - { - elmt = pdump_object_table[i].first; - if (!elmt) - continue; - idesc = lrecord_implementations_table[i]->description; - while (elmt) - { - f (elmt, idesc); - elmt = elmt->next; - } - } - - for (i=0; idescription; - while (elmt) - { - f (elmt, idesc); - elmt = elmt->next; - } - } - - elmt = pdump_opaque_data_list.first; - while (elmt) - { - if (align_table[elmt->size & 255] == align) - f (elmt, 0); - elmt = elmt->next; - } - } -} - -static void -pdump_dump_staticvec (void) -{ - EMACS_INT *reloc = xnew_array (EMACS_INT, staticidx); - int i; - write (pdump_fd, staticvec, staticidx*sizeof (Lisp_Object *)); - - for (i=0; isave_offset; - else - reloc[i] = *(EMACS_INT *)(staticvec[i]); - } - write (pdump_fd, reloc, staticidx*sizeof (Lisp_Object)); - free (reloc); -} - -static void -pdump_dump_structvec (void) -{ - int i; - for (i=0; isave_offset; - write (pdump_fd, &adr, sizeof (adr)); - } -} - -static void -pdump_dump_opaquevec (void) -{ - int i; - for (i=0; idescription; - rt.count = pdump_object_table[i].count; - write (pdump_fd, &rt, sizeof (rt)); - while (elmt) - { - EMACS_INT rdata = pdump_get_entry (elmt->obj)->save_offset; - write (pdump_fd, &rdata, sizeof (rdata)); - elmt = elmt->next; - } - } - - rt.desc = 0; - rt.count = 0; - write (pdump_fd, &rt, sizeof (rt)); - - for (i=0; idescription; - rt.count = pdump_struct_table.list[i].list.count; - write (pdump_fd, &rt, sizeof (rt)); - while (elmt) - { - EMACS_INT rdata = pdump_get_entry (elmt->obj)->save_offset; - for (j=0; jcount; j++) - { - write (pdump_fd, &rdata, sizeof (rdata)); - rdata += elmt->size; - } - elmt = elmt->next; - } - } - rt.desc = 0; - rt.count = 0; - write (pdump_fd, &rt, sizeof (rt)); -} - -static void -pdump_dump_wired (void) -{ - EMACS_INT count = pdump_wireidx + pdump_wireidx_list; - int i; - - write (pdump_fd, &count, sizeof (count)); - - for (i=0; isave_offset; - write (pdump_fd, &pdump_wirevec[i], sizeof (pdump_wirevec[i])); - write (pdump_fd, &obj, sizeof (obj)); - } - - for (i=0; idescription; - for (pos = 0; desc[pos].type != XD_LO_LINK; pos++) - if (desc[pos].type == XD_END) - abort (); - - obj = *(Lisp_Object *)(desc[pos].offset + (char *)(XRECORD_LHEADER (obj))); - } - res = elmt->save_offset; - - write (pdump_fd, &pdump_wirevec_list[i], sizeof (pdump_wirevec_list[i])); - write (pdump_fd, &res, sizeof (res)); - } -} - -void -pdump (void) -{ - int i; - Lisp_Object t_console, t_device, t_frame; - int none; - dump_header hd; - - /* These appear in a DEFVAR_LISP, which does a staticpro() */ - t_console = Vterminal_console; - t_frame = Vterminal_frame; - t_device = Vterminal_device; - - Vterminal_console = Qnil; - Vterminal_frame = Qnil; - Vterminal_device = Qnil; - - pdump_hash = xnew_array_and_zero (pdump_entry_list_elmt *, PDUMP_HASHSIZE); - - for (i=0; i<=last_lrecord_type_index_assigned; i++) - { - pdump_object_table[i].first = 0; - pdump_object_table[i].align = 8; - pdump_object_table[i].count = 0; - pdump_alert_undump_object[i] = 0; - } - pdump_struct_table.count = 0; - pdump_struct_table.size = -1; - - pdump_opaque_data_list.first = 0; - pdump_opaque_data_list.align = 8; - pdump_opaque_data_list.count = 0; - depth = 0; - - for (i=0; iname, pdump_alert_undump_object[i]); - } - if (!none) - return; - - for (i=0; inb_staticpro; - last_lrecord_type_index_assigned = ((dump_header *)pdump_start)->last_type; - delta = ((EMACS_INT)pdump_start) - ((dump_header *)pdump_start)->reloc_address; - p = pdump_start + ((dump_header *)pdump_start)->stab_offset; - - /* Put back the staticvec in place */ - memcpy (staticvec, p, staticidx*sizeof (Lisp_Object *)); - p += staticidx*sizeof (Lisp_Object *); - for (i=0; inb_structdmp; i++) - { - void **adr = PDUMP_READ (p, void **); - *adr = (void *) (PDUMP_READ (p, char *) + delta); - } - - /* Put back the opaques */ - for (i=0; i<((dump_header *)pdump_start)->nb_opaquedmp; i++) - { - struct dumpopaque_info di = PDUMP_READ (p, struct dumpopaque_info); - memcpy (di.data, p, di.size); - p += di.size; - } - - /* Put back the lrecord_implementations_table */ - memcpy (lrecord_implementations_table, p, sizeof (lrecord_implementations_table)); - p += sizeof (lrecord_implementations_table); - - /* Reinitialize lrecord_markers from lrecord_implementations_table */ - for (i=0; i < countof (lrecord_implementations_table); i++) - if (lrecord_implementations_table[i]) - lrecord_markers[i] = lrecord_implementations_table[i]->marker; - - /* Do the relocations */ - pdump_rt_list = p; - count = 2; - for (;;) - { - pdump_reloc_table rt = PDUMP_READ (p, pdump_reloc_table); - if (rt.desc) - { - for (i=0; i < rt.count; i++) - { - char *adr = delta + *(char **)p; - *(char **)p = adr; - pdump_reloc_one (adr, delta, rt.desc); - p += sizeof (char *); - } - } else - if (!(--count)) - break; - } - - /* Put the pdump_wire variables in place */ - count = PDUMP_READ (p, EMACS_INT); - - for (i=0; ibuffer_alist, so this will change it in the per-frame ordering as well. */ Fsetcar (Frassq (buf, Vbuffer_alist), newname); + /* If the buffer is the selected one then this is equivalent to + recording the buffer. */ + if (EQ (Fwindow_buffer (Fselected_window (Qnil)), buf)) + { + va_run_hook_with_args (Qrecord_buffer_hook, 1, buf); + } + if (NILP (current_buffer->filename) && !NILP (current_buffer->auto_save_file_name)) call0 (Qrename_auto_save_file); diff -r 9f011ab08d48 -r 2f8bb876ab1d src/buffer.h --- a/src/buffer.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/buffer.h Mon Aug 13 11:16:07 2007 +0200 @@ -470,8 +470,9 @@ /* section of internally-formatted text */ /* -------------------------------------------------------------- */ -INLINE const Bufbyte *charptr_n_addr (const Bufbyte *ptr, Charcount offset); -INLINE const Bufbyte * +INLINE_HEADER const Bufbyte * +charptr_n_addr (const Bufbyte *ptr, Charcount offset); +INLINE_HEADER const Bufbyte * charptr_n_addr (const Bufbyte *ptr, Charcount offset) { return ptr + charcount_to_bytecount (ptr, offset); @@ -491,8 +492,8 @@ Bytecount non_ascii_set_charptr_emchar (Bufbyte *ptr, Emchar c); Bytecount non_ascii_charptr_copy_char (const Bufbyte *ptr, Bufbyte *ptr2); -INLINE Emchar charptr_emchar (const Bufbyte *ptr); -INLINE Emchar +INLINE_HEADER Emchar charptr_emchar (const Bufbyte *ptr); +INLINE_HEADER Emchar charptr_emchar (const Bufbyte *ptr) { return BYTE_ASCII_P (*ptr) ? @@ -500,8 +501,8 @@ non_ascii_charptr_emchar (ptr); } -INLINE Bytecount set_charptr_emchar (Bufbyte *ptr, Emchar x); -INLINE Bytecount +INLINE_HEADER Bytecount set_charptr_emchar (Bufbyte *ptr, Emchar x); +INLINE_HEADER Bytecount set_charptr_emchar (Bufbyte *ptr, Emchar x) { return !CHAR_MULTIBYTE_P (x) ? @@ -509,8 +510,9 @@ non_ascii_set_charptr_emchar (ptr, x); } -INLINE Bytecount charptr_copy_char (const Bufbyte *ptr, Bufbyte *ptr2); -INLINE Bytecount +INLINE_HEADER Bytecount +charptr_copy_char (const Bufbyte *ptr, Bufbyte *ptr2); +INLINE_HEADER Bytecount charptr_copy_char (const Bufbyte *ptr, Bufbyte *ptr2) { return BYTE_ASCII_P (*ptr) ? @@ -538,8 +540,8 @@ int non_ascii_valid_char_p (Emchar ch); -INLINE int valid_char_p (Emchar ch); -INLINE int +INLINE_HEADER int valid_char_p (Emchar ch); +INLINE_HEADER int valid_char_p (Emchar ch) { return ((unsigned int) (ch) <= 0xff) || non_ascii_valid_char_p (ch); @@ -557,8 +559,8 @@ #ifdef ERROR_CHECK_TYPECHECK -INLINE Emchar XCHAR_OR_CHAR_INT (Lisp_Object obj); -INLINE Emchar +INLINE_HEADER Emchar XCHAR_OR_CHAR_INT (Lisp_Object obj); +INLINE_HEADER Emchar XCHAR_OR_CHAR_INT (Lisp_Object obj) { assert (CHAR_OR_CHAR_INTP (obj)); @@ -622,8 +624,8 @@ /*----------------------------------------------------------------------*/ /* Convert the address of a byte in the buffer into a position. */ -INLINE Bytind BI_BUF_PTR_BYTE_POS (struct buffer *buf, Bufbyte *ptr); -INLINE Bytind +INLINE_HEADER Bytind BI_BUF_PTR_BYTE_POS (struct buffer *buf, Bufbyte *ptr); +INLINE_HEADER Bytind BI_BUF_PTR_BYTE_POS (struct buffer *buf, Bufbyte *ptr) { return (ptr - buf->text->beg + 1 @@ -635,8 +637,8 @@ bytind_to_bufpos (buf, BI_BUF_PTR_BYTE_POS (buf, ptr)) /* Address of byte at position POS in buffer. */ -INLINE Bufbyte * BI_BUF_BYTE_ADDRESS (struct buffer *buf, Bytind pos); -INLINE Bufbyte * +INLINE_HEADER Bufbyte * BI_BUF_BYTE_ADDRESS (struct buffer *buf, Bytind pos); +INLINE_HEADER Bufbyte * BI_BUF_BYTE_ADDRESS (struct buffer *buf, Bytind pos) { return (buf->text->beg + @@ -648,8 +650,8 @@ BI_BUF_BYTE_ADDRESS (buf, bufpos_to_bytind (buf, pos)) /* Address of byte before position POS in buffer. */ -INLINE Bufbyte * BI_BUF_BYTE_ADDRESS_BEFORE (struct buffer *buf, Bytind pos); -INLINE Bufbyte * +INLINE_HEADER Bufbyte * BI_BUF_BYTE_ADDRESS_BEFORE (struct buffer *buf, Bytind pos); +INLINE_HEADER Bufbyte * BI_BUF_BYTE_ADDRESS_BEFORE (struct buffer *buf, Bytind pos) { return (buf->text->beg + @@ -664,8 +666,8 @@ /* Converting between byte indices and memory indices */ /*----------------------------------------------------------------------*/ -INLINE int valid_memind_p (struct buffer *buf, Memind x); -INLINE int +INLINE_HEADER int valid_memind_p (struct buffer *buf, Memind x); +INLINE_HEADER int valid_memind_p (struct buffer *buf, Memind x) { return ((x >= 1 && x <= (Memind) buf->text->gpt) || @@ -673,16 +675,16 @@ x <= (Memind) (buf->text->z + buf->text->gap_size))); } -INLINE Memind bytind_to_memind (struct buffer *buf, Bytind x); -INLINE Memind +INLINE_HEADER Memind bytind_to_memind (struct buffer *buf, Bytind x); +INLINE_HEADER Memind bytind_to_memind (struct buffer *buf, Bytind x) { return (Memind) ((x > buf->text->gpt) ? (x + buf->text->gap_size) : x); } -INLINE Bytind memind_to_bytind (struct buffer *buf, Memind x); -INLINE Bytind +INLINE_HEADER Bytind memind_to_bytind (struct buffer *buf, Memind x); +INLINE_HEADER Bytind memind_to_bytind (struct buffer *buf, Memind x) { #ifdef ERROR_CHECK_BUFPOS @@ -902,16 +904,16 @@ VALIDATE_BYTIND_BACKWARD (buf, x); \ } while (0) -INLINE Bytind prev_bytind (struct buffer *buf, Bytind x); -INLINE Bytind +INLINE_HEADER Bytind prev_bytind (struct buffer *buf, Bytind x); +INLINE_HEADER Bytind prev_bytind (struct buffer *buf, Bytind x) { DEC_BYTIND (buf, x); return x; } -INLINE Bytind next_bytind (struct buffer *buf, Bytind x); -INLINE Bytind +INLINE_HEADER Bytind next_bytind (struct buffer *buf, Bytind x); +INLINE_HEADER Bytind next_bytind (struct buffer *buf, Bytind x) { INC_BYTIND (buf, x); @@ -973,8 +975,8 @@ extern short three_to_one_table[]; -INLINE int real_bufpos_to_bytind (struct buffer *buf, Bufpos x); -INLINE int +INLINE_HEADER int real_bufpos_to_bytind (struct buffer *buf, Bufpos x); +INLINE_HEADER int real_bufpos_to_bytind (struct buffer *buf, Bufpos x) { if (x >= buf->text->mule_bufmin && x <= buf->text->mule_bufmax) @@ -985,8 +987,8 @@ return bufpos_to_bytind_func (buf, x); } -INLINE int real_bytind_to_bufpos (struct buffer *buf, Bytind x); -INLINE int +INLINE_HEADER int real_bytind_to_bufpos (struct buffer *buf, Bytind x); +INLINE_HEADER int real_bytind_to_bufpos (struct buffer *buf, Bytind x) { if (x >= buf->text->mule_bytmin && x <= buf->text->mule_bytmax) @@ -1267,16 +1269,17 @@ } while (0) /* Assign to the `sink' lvalue(s) using the converted data. */ +typedef union { char c; void *p; } *dfc_aliasing_voidpp; #define DFC_ALLOCA_USE_CONVERTED_DATA(sink) do { \ void * dfc_sink_ret = alloca (dfc_sink.data.len + 1); \ memcpy (dfc_sink_ret, dfc_sink.data.ptr, dfc_sink.data.len + 1); \ - (DFC_CPP_CAR sink) = (unsigned char *) dfc_sink_ret; \ + ((dfc_aliasing_voidpp) &(DFC_CPP_CAR sink))->p = dfc_sink_ret; \ (DFC_CPP_CDR sink) = dfc_sink.data.len; \ } while (0) #define DFC_MALLOC_USE_CONVERTED_DATA(sink) do { \ void * dfc_sink_ret = xmalloc (dfc_sink.data.len + 1); \ memcpy (dfc_sink_ret, dfc_sink.data.ptr, dfc_sink.data.len + 1); \ - (DFC_CPP_CAR sink) = (unsigned char *) dfc_sink_ret; \ + ((dfc_aliasing_voidpp) &(DFC_CPP_CAR sink))->p = dfc_sink_ret; \ (DFC_CPP_CDR sink) = dfc_sink.data.len; \ } while (0) #define DFC_C_STRING_ALLOCA_USE_CONVERTED_DATA(sink) do { \ @@ -1704,8 +1707,8 @@ TRT_TABLE_AS_STRING (buf->case_eqv_table) #endif -INLINE Emchar TRT_TABLE_OF (Lisp_Object trt, Emchar c); -INLINE Emchar +INLINE_HEADER Emchar TRT_TABLE_OF (Lisp_Object trt, Emchar c); +INLINE_HEADER Emchar TRT_TABLE_OF (Lisp_Object trt, Emchar c) { return IN_TRT_TABLE_DOMAIN (c) ? TRT_TABLE_CHAR_1 (trt, c) : c; @@ -1717,8 +1720,8 @@ /* 1 if CH is upper case. */ -INLINE int UPPERCASEP (struct buffer *buf, Emchar ch); -INLINE int +INLINE_HEADER int UPPERCASEP (struct buffer *buf, Emchar ch); +INLINE_HEADER int UPPERCASEP (struct buffer *buf, Emchar ch) { return DOWNCASE_TABLE_OF (buf, ch) != ch; @@ -1726,8 +1729,8 @@ /* 1 if CH is lower case. */ -INLINE int LOWERCASEP (struct buffer *buf, Emchar ch); -INLINE int +INLINE_HEADER int LOWERCASEP (struct buffer *buf, Emchar ch); +INLINE_HEADER int LOWERCASEP (struct buffer *buf, Emchar ch) { return (UPCASE_TABLE_OF (buf, ch) != ch && @@ -1736,8 +1739,8 @@ /* 1 if CH is neither upper nor lower case. */ -INLINE int NOCASEP (struct buffer *buf, Emchar ch); -INLINE int +INLINE_HEADER int NOCASEP (struct buffer *buf, Emchar ch); +INLINE_HEADER int NOCASEP (struct buffer *buf, Emchar ch) { return UPCASE_TABLE_OF (buf, ch) == ch; @@ -1745,8 +1748,8 @@ /* Upcase a character, or make no change if that cannot be done. */ -INLINE Emchar UPCASE (struct buffer *buf, Emchar ch); -INLINE Emchar +INLINE_HEADER Emchar UPCASE (struct buffer *buf, Emchar ch); +INLINE_HEADER Emchar UPCASE (struct buffer *buf, Emchar ch) { return (DOWNCASE_TABLE_OF (buf, ch) == ch) ? UPCASE_TABLE_OF (buf, ch) : ch; diff -r 9f011ab08d48 -r 2f8bb876ab1d src/chartab.h --- a/src/chartab.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/chartab.h Mon Aug 13 11:16:07 2007 +0200 @@ -135,9 +135,9 @@ int leading_byte, Emchar c); -INLINE Lisp_Object +INLINE_HEADER Lisp_Object CHAR_TABLE_NON_ASCII_VALUE_UNSAFE (Lisp_Char_Table *ct, Emchar ch); -INLINE Lisp_Object +INLINE_HEADER Lisp_Object CHAR_TABLE_NON_ASCII_VALUE_UNSAFE (Lisp_Char_Table *ct, Emchar ch) { unsigned char lb = CHAR_LEADING_BYTE (ch); @@ -158,6 +158,9 @@ #endif /* not MULE */ +#define XCHAR_TABLE_VALUE_UNSAFE(ct, ch) \ + CHAR_TABLE_VALUE_UNSAFE (XCHAR_TABLE (ct), ch) + enum chartab_range_type { CHARTAB_RANGE_ALL, diff -r 9f011ab08d48 -r 2f8bb876ab1d src/cmds.c --- a/src/cmds.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/cmds.c Mon Aug 13 11:16:07 2007 +0200 @@ -41,6 +41,9 @@ /* This is the command that set up Vself_insert_face. */ Lisp_Object Vself_insert_face_command; + +/* A char-table for characters which may invoke auto-filling. */ +Lisp_Object Vauto_fill_chars; DEFUN ("forward-char", Fforward_char, 0, 2, "_p", /* Move point right N characters (left if N negative). @@ -396,7 +399,9 @@ #endif /* FSFmacs */ } } - if ((c1 == ' ' || c1 == '\n') + if ((CHAR_TABLEP (Vauto_fill_chars) + ? !NILP (XCHAR_TABLE_VALUE_UNSAFE (Vauto_fill_chars, c1)) + : (c1 == ' ' || c1 == '\n')) && !noautofill && !NILP (buf->auto_fill_function)) { @@ -498,4 +503,12 @@ More precisely, a char with closeparen syntax is self-inserted. */ ); Vblink_paren_function = Qnil; + + DEFVAR_LISP ("auto-fill-chars", &Vauto_fill_chars /* +A char-table for characters which invoke auto-filling. +Such characters has value t in this table. +*/); + Vauto_fill_chars = Fmake_char_table (Qgeneric); + XCHAR_TABLE (Vauto_fill_chars)->ascii[' '] = Qt; + XCHAR_TABLE (Vauto_fill_chars)->ascii['\n'] = Qt; } diff -r 9f011ab08d48 -r 2f8bb876ab1d src/config.h.in --- a/src/config.h.in Mon Aug 13 11:15:00 2007 +0200 +++ b/src/config.h.in Mon Aug 13 11:16:07 2007 +0200 @@ -38,7 +38,7 @@ #elif defined(_AIX) #pragma alloca #elif ! defined (alloca) -char *alloca(); +char *alloca (); #endif #endif /* C code */ @@ -47,6 +47,9 @@ files so as to make it obvious where XEmacs changes are. */ #define XEMACS 1 +/* Program name */ +#undef EMACS_PROGNAME + /* Allow s&m files to differentiate OS versions without having multiple files to maintain. */ #undef OS_RELEASE @@ -390,6 +393,11 @@ /* Does the library define ldap_parse_result () ? */ #undef HAVE_LDAP_PARSE_RESULT +/* Do we wish to link against the PostgreSQL RDBMS run-time library? + */ +#undef HAVE_POSTGRESQL +#undef HAVE_POSTGRESQLV7 + /* Do you have the Xauth library present? This will add some extra functionality to gnuserv. */ #undef HAVE_XAUTH @@ -775,30 +783,20 @@ #define LONG_LONG_BITS (SIZEOF_LONG_LONG * BITS_PER_CHAR) #define VOID_P_BITS (SIZEOF_VOID_P * BITS_PER_CHAR) -#ifndef NOT_C_CODE -#ifdef __cplusplus -#define HAVE_INLINE 1 -#define INLINE inline -#else /* not C++ */ +/* Use `INLINE_HEADER' to define inline functions in .h files. + Use `inline static' to define inline functions in .c files. + See the Internals manual for examples and more information. */ + /* Does the keyword `inline' exist? */ -#undef HAVE_INLINE #undef inline -# ifdef HAVE_INLINE -# ifdef __GNUC__ -# ifdef DONT_EXTERN_INLINE_FUNCTIONS -# define INLINE inline -# else -# define INLINE extern inline -# endif -# else -# define INLINE static inline -# endif /* __GNUC__ */ -# else -# define INLINE static -# endif /* HAVE_INLINE */ -#endif /* not C++ */ -#endif /* C code */ +#if defined (__cplusplus) || ! defined (__GNUC__) +# define INLINE_HEADER inline static +#elif defined (DONT_EXTERN_INLINE_HEADER_FUNCTIONS) +# define INLINE_HEADER inline +#else +# define INLINE_HEADER inline extern +#endif #if defined (__cplusplus) && !defined (NOT_C_CODE) /* Avoid C++ keywords used as ordinary C identifiers */ diff -r 9f011ab08d48 -r 2f8bb876ab1d src/console-msw.c --- a/src/console-msw.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/console-msw.c Mon Aug 13 11:16:07 2007 +0200 @@ -1,5 +1,5 @@ /* Console functions for mswindows. - Copyright (C) 1996 Ben Wing. + Copyright (C) 1996, 2000 Ben Wing. This file is part of XEmacs. @@ -28,6 +28,8 @@ #include #include "lisp.h" +#include "events.h" +#include "opaque.h" #include "console-msw.h" @@ -44,6 +46,69 @@ return 1; } +static HWND msw_console_hwnd = 0; + +#define KLUDGE_BUFSIZE 1024 /* buffer size for console window titles */ + +/* Direct from the horse's mouth: Microsoft KB article Q124103 */ +static HWND +GetConsoleHwnd (void) +{ + HWND hwndFound; /* this is what is returned to the caller */ + char pszNewWindowTitle[KLUDGE_BUFSIZE]; /* contains fabricated WindowTitle */ + char pszOldWindowTitle[KLUDGE_BUFSIZE]; /* contains original WindowTitle */ + + /* fetch current window title */ + + GetConsoleTitle(pszOldWindowTitle, KLUDGE_BUFSIZE); + + /* format a "unique" NewWindowTitle */ + + wsprintf(pszNewWindowTitle,"%d/%d", + GetTickCount(), + GetCurrentProcessId()); + + /* change current window title */ + + SetConsoleTitle(pszNewWindowTitle); + + /* ensure window title has been updated */ + + Sleep(40); + + /* look for NewWindowTitle */ + + hwndFound=FindWindow(NULL, pszNewWindowTitle); + + /* restore original window title */ + + SetConsoleTitle(pszOldWindowTitle); + + return(hwndFound); +} + +HWND +msw_get_console_hwnd (void) +{ + if (!msw_console_hwnd) + msw_console_hwnd = GetConsoleHwnd (); + return msw_console_hwnd; +} + +int +msw_ensure_console_allocated (void) +{ + HWND fgwin = GetForegroundWindow (); + /* stupid mswin api won't let you create the console window + hidden! creating it changes the focus! fuck me! */ + if (AllocConsole ()) + { + SetForegroundWindow (fgwin); + return 1; + } + return 0; +} + static Lisp_Object mswindows_canonicalize_console_connection (Lisp_Object connection, Error_behavior errb) @@ -71,51 +136,70 @@ return mswindows_canonicalize_console_connection (connection, errb); } - -/************************************************************************/ -/* initialization */ -/************************************************************************/ - void -syms_of_console_mswindows (void) +msw_hide_console (void) { + ShowWindow (msw_get_console_hwnd (), SW_HIDE); } void -console_type_create_mswindows (void) +msw_show_console (void) { - INITIALIZE_CONSOLE_TYPE (mswindows, "mswindows", "console-mswindows-p"); + HWND hwnd = msw_get_console_hwnd (); + ShowWindow (hwnd, SW_SHOWNA); - /* console methods */ -/* CONSOLE_HAS_METHOD (mswindows, init_console); */ -/* CONSOLE_HAS_METHOD (mswindows, mark_console); */ - CONSOLE_HAS_METHOD (mswindows, initially_selected_for_input); -/* CONSOLE_HAS_METHOD (mswindows, delete_console); */ - CONSOLE_HAS_METHOD (mswindows, canonicalize_console_connection); - CONSOLE_HAS_METHOD (mswindows, canonicalize_device_connection); -/* CONSOLE_HAS_METHOD (mswindows, semi_canonicalize_console_connection); */ -/* CONSOLE_HAS_METHOD (mswindows, semi_canonicalize_device_connection); */ - - INITIALIZE_CONSOLE_TYPE (msprinter, "msprinter", "console-msprinter-p"); + /* I tried to raise the window to the top without activating + it, but this fails. Apparently Windows just doesn't like + having the active window not be on top. So instead, we + at least put it just below our own window, where part of it + will likely be seen. */ + SetWindowPos (hwnd, GetForegroundWindow (), 0, 0, 0, 0, + SWP_NOSIZE | SWP_NOMOVE | SWP_NOSENDCHANGING | + SWP_NOACTIVATE); } -void -reinit_console_type_create_mswindows (void) +static int msw_console_buffered = 0; +HANDLE msw_console_buffer; + +static void +msw_ensure_console_buffered (void) { - REINITIALIZE_CONSOLE_TYPE (mswindows); - REINITIALIZE_CONSOLE_TYPE (msprinter); + if (!msw_console_buffered) + { + COORD new_size; + + new_size.X = 80; + new_size.Y = 1000; + msw_ensure_console_allocated (); + msw_console_buffer = + CreateConsoleScreenBuffer (GENERIC_WRITE, 0, NULL, + CONSOLE_TEXTMODE_BUFFER, NULL); + SetConsoleScreenBufferSize (msw_console_buffer, new_size); + SetConsoleActiveScreenBuffer (msw_console_buffer); + msw_console_buffered = 1; + } } -void -vars_of_console_mswindows (void) +int +msw_output_console_string (CONST Extbyte *str, Extcount len) { - Fprovide (Qmswindows); + DWORD num_written; + + msw_ensure_console_buffered (); + msw_show_console (); + return WriteConsole (msw_console_buffer, str, len, &num_written, NULL); +} + +/* Determine if running on Windows 9x and not NT */ +int +msw_windows9x_p (void) +{ + return GetVersion () & 0x80000000; } #ifdef DEBUG_XEMACS -#include "events.h" -#include "opaque.h" + /* * Random helper functions for debugging. * Intended for use in the MSVC "Watch" window which doesn't like @@ -176,3 +260,45 @@ } #endif /* DEBUG_XEMACS */ + + + +/************************************************************************/ +/* initialization */ +/************************************************************************/ + +void +syms_of_console_mswindows (void) +{ +} + +void +console_type_create_mswindows (void) +{ + INITIALIZE_CONSOLE_TYPE (mswindows, "mswindows", "console-mswindows-p"); + + /* console methods */ +/* CONSOLE_HAS_METHOD (mswindows, init_console); */ +/* CONSOLE_HAS_METHOD (mswindows, mark_console); */ + CONSOLE_HAS_METHOD (mswindows, initially_selected_for_input); +/* CONSOLE_HAS_METHOD (mswindows, delete_console); */ + CONSOLE_HAS_METHOD (mswindows, canonicalize_console_connection); + CONSOLE_HAS_METHOD (mswindows, canonicalize_device_connection); +/* CONSOLE_HAS_METHOD (mswindows, semi_canonicalize_console_connection); */ +/* CONSOLE_HAS_METHOD (mswindows, semi_canonicalize_device_connection); */ + + INITIALIZE_CONSOLE_TYPE (msprinter, "msprinter", "console-msprinter-p"); +} + +void +reinit_console_type_create_mswindows (void) +{ + REINITIALIZE_CONSOLE_TYPE (mswindows); + REINITIALIZE_CONSOLE_TYPE (msprinter); +} + +void +vars_of_console_mswindows (void) +{ + Fprovide (Qmswindows); +} diff -r 9f011ab08d48 -r 2f8bb876ab1d src/console-msw.h --- a/src/console-msw.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/console-msw.h Mon Aug 13 11:16:07 2007 +0200 @@ -45,22 +45,6 @@ #include #endif -/* - * XXX FIXME: The following X modifier defs in events-mod.h clash with win32 - * hotkey defs in winuser.h. For the moment lose the win32 versions. - * Maybe we should rename all of MOD_* to something that doesn't clash. - */ -#ifdef MOD_CONTROL -# undef MOD_CONTROL -#endif -#ifdef MOD_ALT -# undef MOD_ALT -#endif -#ifdef MOD_SHIFT -# undef MOD_SHIFT -#endif - - /* The name of the main window class */ #define XEMACS_CLASS "XEmacs" @@ -93,6 +77,7 @@ int horzsize, vertsize; /* Size in mm */ int bitspixel; Lisp_Object fontlist; /* List of strings, device fonts */ + HDC hcdc; /* Compatible DC */ }; #define DEVICE_MSWINDOWS_DATA(d) DEVICE_TYPE_DATA (d, mswindows) @@ -106,10 +91,11 @@ #define DEVICE_MSWINDOWS_VERTSIZE(d) (DEVICE_MSWINDOWS_DATA (d)->vertsize) #define DEVICE_MSWINDOWS_BITSPIXEL(d) (DEVICE_MSWINDOWS_DATA (d)->bitspixel) #define DEVICE_MSWINDOWS_FONTLIST(d) (DEVICE_MSWINDOWS_DATA (d)->fontlist) +#define DEVICE_MSWINDOWS_HCDC(d) (DEVICE_MSWINDOWS_DATA (d)->hcdc) struct msprinter_device { - HDC hdc; + HDC hdc, hcdc; /* Printer and the comp. DCs */ HANDLE hprinter; Lisp_Object fontlist; char* name; @@ -119,6 +105,7 @@ #define DEVICE_MSPRINTER_DATA(d) DEVICE_TYPE_DATA (d, msprinter) #define DEVICE_MSPRINTER_HDC(d) (DEVICE_MSPRINTER_DATA (d)->hdc) +#define DEVICE_MSPRINTER_HCDC(d) (DEVICE_MSPRINTER_DATA (d)->hcdc) #define DEVICE_MSPRINTER_HPRINTER(d) (DEVICE_MSPRINTER_DATA (d)->hprinter) #define DEVICE_MSPRINTER_FONTLIST(d) (DEVICE_MSPRINTER_DATA (d)->fontlist) #define DEVICE_MSPRINTER_NAME(d) (DEVICE_MSPRINTER_DATA (d)->name) @@ -140,6 +127,24 @@ /* Printer functions in frame-msw.c */ void msprinter_start_page (struct frame *f); +/* Common checks */ + +#define DEVICE_MSGDI_P(dev) (DEVICE_MSWINDOWS_P(dev) || DEVICE_MSPRINTER_P(dev)) +#define CHECK_MSGDI_DEVICE(d) \ + do { \ + CHECK_DEVICE (d); \ + if (!(DEVICEP (d) && DEVICE_MSGDI_P(XDEVICE(d)))) \ + dead_wrong_type_argument \ + (list3 (Qor, Qmswindows, Qmsprinter), d); \ + } while (0) +#define CONCHECK_MSGDI_DEVICE(d) \ + do { \ + CHECK_DEVICE (d); \ + if (!(DEVICEP (d) && DEVICE_MSGDI_P(XDEVICE(d)))) \ + wrong_type_argument \ + (list3 (Qor, Qmswindows, Qmsprinter), d); \ + } while (0) + /* * Frame */ @@ -159,9 +164,6 @@ /* DC for this win32 window */ HDC hdc; - /* compatible DC for bitmap operations */ - HDC cdc; - /* Time of last click event, for button 2 emul */ DWORD last_click_time; @@ -196,6 +198,7 @@ int ignore_next_lbutton_up : 1; int ignore_next_rbutton_up : 1; int sizing : 1; + int paint_pending : 1; /* Whether a WM_PAINT magic event has been queued */ /* Geometry, in characters, as specified by proplist during frame creation. Memebers are set to -1 for unspecified */ @@ -206,7 +209,6 @@ #define FRAME_MSWINDOWS_HANDLE(f) (FRAME_MSWINDOWS_DATA (f)->hwnd) #define FRAME_MSWINDOWS_DC(f) (FRAME_MSWINDOWS_DATA (f)->hdc) -#define FRAME_MSWINDOWS_CDC(f) (FRAME_MSWINDOWS_DATA (f)->cdc) #define FRAME_MSWINDOWS_MENU_HASH_TABLE(f) (FRAME_MSWINDOWS_DATA (f)->menu_hash_table) #define FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE(f) \ (FRAME_MSWINDOWS_DATA (f)->toolbar_hash_table) @@ -236,7 +238,6 @@ struct msprinter_frame { - HDC hcdc; /* Compatoble DC */ int left_margin, top_margin, /* All in twips */ right_margin, bottom_margin; int charheight, charwidth; /* As per proplist or -1 if not gven */ @@ -250,7 +251,6 @@ #define FRAME_MSPRINTER_RIGHT_MARGIN(f) (FRAME_MSPRINTER_DATA (f)->top_margin) #define FRAME_MSPRINTER_TOP_MARGIN(f) (FRAME_MSPRINTER_DATA (f)->right_margin) #define FRAME_MSPRINTER_BOTTOM_MARGIN(f) (FRAME_MSPRINTER_DATA (f)->bottom_margin) -#define FRAME_MSPRINTER_CDC(f) (FRAME_MSPRINTER_DATA (f)->hcdc) #define FRAME_MSPRINTER_JOB_STARTED(f) (FRAME_MSPRINTER_DATA (f)->job_started) #define FRAME_MSPRINTER_PAGE_STARTED(f) (FRAME_MSPRINTER_DATA (f)->page_started) #define FRAME_MSPRINTER_ORIENTATION(f) (FRAME_MSPRINTER_DATA (f)->orientation) @@ -293,7 +293,8 @@ extern HSZ mswindows_dde_topic_system; extern HSZ mswindows_dde_item_open; HDDEDATA CALLBACK mswindows_dde_callback (UINT uType, UINT uFmt, HCONV hconv, - HSZ hszTopic, HSZ hszItem, HDDEDATA hdata, + HSZ hszTopic, HSZ hszItem, + HDDEDATA hdata, DWORD dwData1, DWORD dwData2); void mswindows_enqueue_misc_user_event (Lisp_Object channel, @@ -301,18 +302,11 @@ Lisp_Object object); Lisp_Object mswindows_cancel_dispatch_event (Lisp_Event* event); Lisp_Object mswindows_pump_outstanding_events (void); -Lisp_Object mswindows_protect_modal_loop (Lisp_Object (*bfun) (Lisp_Object barg), +Lisp_Object mswindows_protect_modal_loop (Lisp_Object (*bfun) + (Lisp_Object barg), Lisp_Object barg); void mswindows_unmodalize_signal_maybe (void); -#ifdef HAVE_TOOLBARS -Lisp_Object -mswindows_get_toolbar_button_text ( struct frame* f, int command_id ); -Lisp_Object -mswindows_handle_toolbar_wm_command (struct frame* f, HWND ctrl, WORD id); -#endif -Lisp_Object -mswindows_handle_gui_wm_command (struct frame* f, HWND ctrl, DWORD id); COLORREF mswindows_string_to_color (const char *name); USID emacs_mswindows_create_stream_pair (void* inhandle, void* outhandle, Lisp_Object* instream, @@ -328,13 +322,29 @@ extern Lisp_Object Vmswindows_frame_being_created; extern Lisp_Object mswindows_frame_being_created; +void msw_get_workspace_coords (RECT *rc); + +HWND msw_get_console_hwnd (void); +void msw_hide_console (void); +void msw_show_console (void); +int msw_output_console_string (CONST Extbyte *str, Extcount len); + Lisp_Object mswindows_enumerate_fonts (HDC hdc); +int msw_char_is_accelerator (struct frame *f, Emchar ch); +Bytecount msw_translate_menu_or_dialog_item (Bufbyte *item, Bytecount len, + Bytecount maxlen, Emchar *accel, + Lisp_Object error_name); + +#ifdef HAVE_TOOLBARS Lisp_Object mswindows_get_toolbar_button_text (struct frame* f, int command_id); Lisp_Object mswindows_handle_toolbar_wm_command (struct frame* f, HWND ctrl, WORD id); +#endif Lisp_Object mswindows_handle_gui_wm_command (struct frame* f, - HWND ctrl, DWORD id); + HWND ctrl, LPARAM id); + +int msw_windows9x_p (void); #endif /* INCLUDED_console_msw_h_ */ diff -r 9f011ab08d48 -r 2f8bb876ab1d src/console-stream.c --- a/src/console-stream.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/console-stream.c Mon Aug 13 11:16:07 2007 +0200 @@ -328,7 +328,7 @@ #ifndef PDUMP void -init_console_stream (void) +init_console_stream (int reinit) { /* This function can GC */ if (!initialized) @@ -350,13 +350,16 @@ #else void -init_console_stream (void) +init_console_stream (int reinit) { /* This function can GC */ - Vterminal_device = Fmake_device (Qstream, Qnil, Qnil); - Vterminal_console = Fdevice_console (Vterminal_device); - Vterminal_frame = Fmake_frame (Qnil, Vterminal_device); - minibuf_window = XFRAME (Vterminal_frame)->minibuffer_window; + if (!reinit) + { + Vterminal_device = Fmake_device (Qstream, Qnil, Qnil); + Vterminal_console = Fdevice_console (Vterminal_device); + Vterminal_frame = Fmake_frame (Qnil, Vterminal_device); + minibuf_window = XFRAME (Vterminal_frame)->minibuffer_window; + } if (initialized) { stream_init_console (XCONSOLE (Vterminal_console), Qnil); diff -r 9f011ab08d48 -r 2f8bb876ab1d src/console.c --- a/src/console.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/console.c Mon Aug 13 11:16:07 2007 +0200 @@ -1410,11 +1410,11 @@ /* While this should be const it can't be because some things (i.e. edebug) do manipulate it. */ DEFVAR_CONSOLE_LOCAL ("defining-kbd-macro", defining_kbd_macro /* -Non-nil while a console macro is being defined. Don't set this! +Non-nil while a keyboard macro is being defined. Don't set this! */ ); DEFVAR_CONSOLE_LOCAL ("last-kbd-macro", last_kbd_macro /* -Last kbd macro defined, as a vector of events; nil if none defined. +Last keyboard macro defined, as a vector of events; nil if none defined. */ ); DEFVAR_CONSOLE_LOCAL ("prefix-arg", prefix_arg /* diff -r 9f011ab08d48 -r 2f8bb876ab1d src/console.h --- a/src/console.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/console.h Mon Aug 13 11:16:07 2007 +0200 @@ -453,9 +453,9 @@ #define CONSOLE_TYPE_P(con, type) EQ (CONSOLE_TYPE (con), Q##type) #ifdef ERROR_CHECK_TYPECHECK -INLINE struct console * +INLINE_HEADER struct console * error_check_console_type (struct console *con, Lisp_Object sym); -INLINE struct console * +INLINE_HEADER struct console * error_check_console_type (struct console *con, Lisp_Object sym) { assert (EQ (CONSOLE_TYPE (con), sym)); diff -r 9f011ab08d48 -r 2f8bb876ab1d src/database.h --- a/src/database.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/database.h Mon Aug 13 11:16:07 2007 +0200 @@ -18,7 +18,7 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* This file is only necessary to get INLINE handling correct. +/* This file is only necessary to get inline handling correct. See inline.c */ #ifndef INCLUDED_database_h_ diff -r 9f011ab08d48 -r 2f8bb876ab1d src/device-msw.c --- a/src/device-msw.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/device-msw.c Mon Aug 13 11:16:07 2007 +0200 @@ -40,7 +40,16 @@ #include "frame.h" #include "sysdep.h" +#if (defined (__CYGWIN32__) || defined(__MINGW32__)) && \ + CYGWIN_VERSION_DLL_MAJOR < 21 +extern BOOL WINAPI DdeFreeStringHandle(DWORD,HSZ); +#else #include +#endif + +#if !(defined (__CYGWIN32__) || defined(__MINGW32__)) +# include /* For CoInitialize */ +#endif /* win32 DDE management library globals */ #ifdef HAVE_DRAGNDROP @@ -129,8 +138,8 @@ DEVICE_MSWINDOWS_VERTSIZE(d) = GetDeviceCaps(hdc, VERTSIZE); DEVICE_MSWINDOWS_BITSPIXEL(d) = GetDeviceCaps(hdc, BITSPIXEL); DEVICE_MSWINDOWS_FONTLIST (d) = mswindows_enumerate_fonts (hdc); - - DeleteDC (hdc); + + DEVICE_MSWINDOWS_HCDC(d) = hdc; /* Register the main window class */ wc.cbSize = sizeof (WNDCLASSEX); @@ -174,13 +183,20 @@ /* Initialize DDE management library and our related globals. We execute a * dde Open("file") by simulating a drop, so this depends on dnd support. */ #ifdef HAVE_DRAGNDROP +# if !(defined(__CYGWIN32__) || defined(__MINGW32__)) + CoInitialize (NULL); +# endif + mswindows_dde_mlid = 0; DdeInitialize (&mswindows_dde_mlid, (PFNCALLBACK)mswindows_dde_callback, APPCMD_FILTERINITS|CBF_FAIL_SELFCONNECTIONS|CBF_FAIL_ADVISES| - CBF_FAIL_POKES|CBF_FAIL_REQUESTS|CBF_SKIP_ALLNOTIFICATIONS, 0); + CBF_FAIL_POKES|CBF_FAIL_REQUESTS|CBF_SKIP_ALLNOTIFICATIONS, + 0); - mswindows_dde_service = DdeCreateStringHandle (mswindows_dde_mlid, XEMACS_CLASS, 0); - mswindows_dde_topic_system = DdeCreateStringHandle (mswindows_dde_mlid, SZDDESYS_TOPIC, 0); + mswindows_dde_service = DdeCreateStringHandle (mswindows_dde_mlid, + XEMACS_CLASS, 0); + mswindows_dde_topic_system = DdeCreateStringHandle (mswindows_dde_mlid, + SZDDESYS_TOPIC, 0); mswindows_dde_item_open = DdeCreateStringHandle (mswindows_dde_mlid, TEXT(MSWINDOWS_DDE_ITEM_OPEN), 0); DdeNameService (mswindows_dde_mlid, mswindows_dde_service, 0L, DNS_REGISTER); @@ -196,11 +212,22 @@ DdeFreeStringHandle (mswindows_dde_mlid, mswindows_dde_topic_system); DdeFreeStringHandle (mswindows_dde_mlid, mswindows_dde_service); DdeUninitialize (mswindows_dde_mlid); + +# if !(defined(__CYGWIN32__) || defined(__MINGW32__)) + CoUninitialize (); +# endif #endif + DeleteDC (DEVICE_MSWINDOWS_HCDC(d)); free (d->device_data); } +void +msw_get_workspace_coords (RECT *rc) +{ + SystemParametersInfo (SPI_GETWORKAREA, 0, rc, 0); +} + static void mswindows_mark_device (struct device *d) { @@ -271,10 +298,18 @@ case DM_size_workspace: { RECT rc; - SystemParametersInfo (SPI_GETWORKAREA, 0, &rc, 0); + msw_get_workspace_coords (&rc); return Fcons (make_int (rc.right - rc.left), make_int (rc.bottom - rc.top)); } + + case DM_offset_workspace: + { + RECT rc; + msw_get_workspace_coords (&rc); + return Fcons (make_int (rc.left), make_int (rc.top)); + } + /* case DM_size_toolbar: case DM_size_toolbar_button: @@ -344,8 +379,11 @@ if (DEVICE_MSPRINTER_HDC (d) == NULL) signal_open_printer_error (d); + DEVICE_MSPRINTER_HCDC(d) = + CreateCompatibleDC (DEVICE_MSPRINTER_HDC (d)); + /* Determinie DEVMODE size and store the default DEVMODE */ - DEVICE_MSPRINTER_DEVMODE_SIZE(d) = + DEVICE_MSPRINTER_DEVMODE_SIZE(d) = DocumentProperties (NULL, DEVICE_MSPRINTER_HPRINTER(d), printer_name, NULL, NULL, 0); if (DEVICE_MSPRINTER_DEVMODE_SIZE(d) <= 0) @@ -411,6 +449,8 @@ ClosePrinter (DEVICE_MSPRINTER_HPRINTER (d)); if (DEVICE_MSPRINTER_HDC (d)) DeleteDC (DEVICE_MSPRINTER_HDC (d)); + if (DEVICE_MSPRINTER_HCDC (d)) + DeleteDC (DEVICE_MSPRINTER_HCDC (d)); if (DEVICE_MSPRINTER_NAME (d)) free (DEVICE_MSPRINTER_NAME (d)); if (DEVICE_MSPRINTER_DEVMODE (d)) @@ -481,7 +521,15 @@ devmode, devmode, DM_IN_BUFFER | DM_OUT_BUFFER); - ResetDC (DEVICE_MSPRINTER_HDC (d), devmode); + /* #### ResetDC fails sometimes, Bill only know s why. + The solution below looks more like a workaround to me, + although it might be fine. --kkm */ + if (ResetDC (DEVICE_MSPRINTER_HDC (d), devmode) == NULL) + { + DeleteDC (DEVICE_MSPRINTER_HDC (d)); + DEVICE_MSPRINTER_HDC (d) = + CreateDC ("WINSPOOL", DEVICE_MSPRINTER_NAME(d), NULL, devmode); + } } diff -r 9f011ab08d48 -r 2f8bb876ab1d src/device.c --- a/src/device.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/device.c Mon Aug 13 11:16:07 2007 +0200 @@ -891,6 +891,7 @@ MARK_FRAME_GLYPHS_CHANGED (f); MARK_FRAME_SUBWINDOWS_CHANGED (f); MARK_FRAME_TOOLBARS_CHANGED (f); + MARK_FRAME_GUTTERS_CHANGED (f); f->menubar_changed = 1; } } @@ -990,7 +991,7 @@ decorations. For printers, this is the size of printable area. offset-workspace Offset of workspace area from the top left corner - of screen or paper. + of screen or paper, in pixels. size-device-mm Device screen size in millimeters. device-dpi Device resolution, in dots per inch. num-bit-planes Integer, number of device bit planes. diff -r 9f011ab08d48 -r 2f8bb876ab1d src/device.h --- a/src/device.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/device.h Mon Aug 13 11:16:07 2007 +0200 @@ -238,9 +238,9 @@ #define DEVICE_TYPE_P(d, type) EQ (DEVICE_TYPE (d), Q##type) #ifdef ERROR_CHECK_TYPECHECK -INLINE struct device * +INLINE_HEADER struct device * error_check_device_type (struct device *d, Lisp_Object sym); -INLINE struct device * +INLINE_HEADER struct device * error_check_device_type (struct device *d, Lisp_Object sym) { assert (EQ (DEVICE_TYPE (d), sym)); diff -r 9f011ab08d48 -r 2f8bb876ab1d src/dialog-msw.c --- a/src/dialog-msw.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/dialog-msw.c Mon Aug 13 11:16:07 2007 +0200 @@ -168,6 +168,25 @@ Dynarr_add_many (dynarr, uni_string, sizeof(WCHAR) * length); } +/* Helper function which converts the supplied string STRING into Unicode and + pushes it at the end of DYNARR */ +static void +push_bufbyte_string_as_unicode (unsigned_char_dynarr* dynarr, Bufbyte *string, + Bytecount len) +{ + Extbyte *mbcs_string; + Charcount length = bytecount_to_charcount (string, len); + LPWSTR uni_string; + + TO_EXTERNAL_FORMAT (C_STRING, string, + C_STRING_ALLOCA, mbcs_string, + Qnative); + uni_string = alloca_array (WCHAR, length + 1); + length = MultiByteToWideChar (CP_ACP, 0, mbcs_string, -1, + uni_string, sizeof(WCHAR) * (length + 1)); + Dynarr_add_many (dynarr, uni_string, sizeof(WCHAR) * length); +} + /* Given button TEXT, return button width in DLU */ static unsigned int button_width (Lisp_Object text) @@ -362,7 +381,21 @@ Dynarr_add_many (template, &button_class_id, sizeof (button_class_id)); /* Next thing to add is control text, as Unicode string */ - push_lisp_string_as_unicode (template, pgui_item->name); + { + Lisp_Object ctext = pgui_item->name; + Emchar accel_unused; + Bufbyte *trans = (Bufbyte *) alloca (2 * XSTRING_LENGTH (ctext) + 3); + Bytecount translen; + + memcpy (trans, XSTRING_DATA (ctext), XSTRING_LENGTH (ctext) + 1); + translen = + msw_translate_menu_or_dialog_item (trans, + XSTRING_LENGTH (ctext), + 2 * XSTRING_LENGTH (ctext) + 3, + &accel_unused, + ctext); + push_bufbyte_string_as_unicode (template, trans, translen); + } /* Specify 0 length creation data. */ Dynarr_add_many (template, &zeroes, 2); @@ -385,7 +418,8 @@ vector = make_vector (Dynarr_length (dialog_items), Qunbound); dialog_data = Fcons (frame, vector); for (i = 0; i < Dynarr_length (dialog_items); i++) - XVECTOR_DATA (vector) [i] = XGUI_ITEM (*Dynarr_atp (dialog_items, i))->callback; + XVECTOR_DATA (vector) [i] = + XGUI_ITEM (*Dynarr_atp (dialog_items, i))->callback; /* Woof! Everything is ready. Pop pop pop in now! */ if (!CreateDialogIndirectParam (NULL, diff -r 9f011ab08d48 -r 2f8bb876ab1d src/dialog.c --- a/src/dialog.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/dialog.c Mon Aug 13 11:16:07 2007 +0200 @@ -21,9 +21,6 @@ /* Synched up with: Not in FSF. */ -/* #### There ain't nothin' here because dialog boxes have not been - properly abstracted yet. */ - #include #include "lisp.h" #include "frame.h" @@ -48,6 +45,11 @@ resource database, so it is possible for resources to override what string is actually displayed. +Accelerators can be indicated in the string by putting the sequence +"%_" before the character corresponding to the key that will invoke +the button. Uppercase and lowercase accelerators are equivalent. The +sequence "%%" is also special, and is translated into a single %. + If the `callback' of a button is a symbol, then it must name a command. It will be invoked with `call-interactively'. If it is a list, then it is evaluated with `eval'. @@ -57,8 +59,7 @@ Though the keyword/value syntax is supported for dialog boxes just as in popup menus, the only keyword which is both meaningful and fully implemented -for dialog box buttons is `:active'. -*/ +for dialog box buttons is `:active'. */ (dbox_desc)) { struct frame *f = selected_frame (); @@ -72,7 +73,8 @@ CHECK_CONS (dbox_desc); CHECK_STRING (XCAR (dbox_desc)); if (!CONSP (XCDR (dbox_desc))) - signal_simple_error ("Dialog descriptor must supply at least one button", dbox_desc); + signal_simple_error ("Dialog descriptor must supply at least one button", + dbox_desc); DEVMETH (d, popup_dialog_box, (f, dbox_desc)); diff -r 9f011ab08d48 -r 2f8bb876ab1d src/dired.c --- a/src/dired.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/dired.c Mon Aug 13 11:16:07 2007 +0200 @@ -23,16 +23,16 @@ #include #include "lisp.h" +#include "sysfile.h" +#include "sysdir.h" +#include "systime.h" +#include "sysdep.h" +#include "syspwd.h" #include "buffer.h" #include "commands.h" #include "elhash.h" #include "regex.h" #include "opaque.h" -#include "sysfile.h" -#include "sysdir.h" -#include "systime.h" -#include "sysdep.h" -#include "syspwd.h" Lisp_Object Vcompletion_ignored_extensions; Lisp_Object Qdirectory_files; diff -r 9f011ab08d48 -r 2f8bb876ab1d src/dump-id.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/dump-id.h Mon Aug 13 11:16:07 2007 +0200 @@ -0,0 +1,6 @@ +#ifndef INCLUDED_dump_id_h_ +#define INCLUDED_dump_id_h_ + +extern unsigned int dump_id; + +#endif diff -r 9f011ab08d48 -r 2f8bb876ab1d src/dumper.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/dumper.c Mon Aug 13 11:16:07 2007 +0200 @@ -0,0 +1,1355 @@ +/* Portable data dumper for XEmacs. + Copyright (C) 1999-2000 Olivier Galibert + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + +#include +#include "lisp.h" +#include "dump-id.h" +#include "specifier.h" +#include "alloc.h" +#include "elhash.h" +#include "sysfile.h" +#include "console-stream.h" +#include "dumper.h" + +#ifdef HAVE_MMAP +#include +#endif + +#ifndef SEPCHAR +#define SEPCHAR ':' +#endif + +typedef struct +{ + const struct lrecord_description *desc; + int count; +} pdump_reloc_table; + +static char *pdump_rt_list = 0; + +void +pdump_objects_unmark (void) +{ + int i; + char *p = pdump_rt_list; + if (p) + for (;;) + { + pdump_reloc_table *rt = (pdump_reloc_table *)p; + p += sizeof (pdump_reloc_table); + if (rt->desc) + { + for (i=0; icount; i++) + { + struct lrecord_header *lh = * (struct lrecord_header **) p; + if (! C_READONLY_RECORD_HEADER_P (lh)) + UNMARK_RECORD_HEADER (lh); + p += sizeof (EMACS_INT); + } + } else + break; + } +} + + +/* The structure of the file + * + * 0 - header + * 256 - dumped objects + * stab_offset - nb_staticpro*(Lisp_Object *) from staticvec + * - nb_staticpro*(relocated Lisp_Object) pointed to by staticpro + * - nb_structdmp*pair(void *, adr) for pointers to structures + * - lrecord_implementations_table[] + * - relocation table + * - wired variable address/value couples with the count preceding the list + */ + + +#define DUMP_SIGNATURE "XEmacsDP" +#define DUMP_SIGNATURE_LEN (sizeof (DUMP_SIGNATURE) - 1) + +typedef struct +{ + char signature[DUMP_SIGNATURE_LEN]; + unsigned int id; + EMACS_UINT stab_offset; + EMACS_UINT reloc_address; + int nb_staticpro; + int nb_structdmp; + int nb_opaquedmp; +} dump_header; + +char *pdump_start, *pdump_end; +static size_t pdump_length; +void (*pdump_free) (void); + +static const unsigned char align_table[256] = +{ + 8, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, + 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0 +}; + +typedef struct pdump_entry_list_elmt +{ + struct pdump_entry_list_elmt *next; + const void *obj; + size_t size; + int count; + int is_lrecord; + EMACS_INT save_offset; +} pdump_entry_list_elmt; + +typedef struct +{ + pdump_entry_list_elmt *first; + int align; + int count; +} pdump_entry_list; + +typedef struct pdump_struct_list_elmt +{ + pdump_entry_list list; + const struct struct_description *sdesc; +} pdump_struct_list_elmt; + +typedef struct +{ + pdump_struct_list_elmt *list; + int count; + int size; +} pdump_struct_list; + +static pdump_entry_list pdump_object_table[256]; +static pdump_entry_list pdump_opaque_data_list; +static pdump_struct_list pdump_struct_table; +static pdump_entry_list_elmt *pdump_qnil; + +static int pdump_alert_undump_object[256]; + +static unsigned long cur_offset; +static size_t max_size; +static int pdump_fd; +static void *pdump_buf; + +#define PDUMP_HASHSIZE 200001 + +static pdump_entry_list_elmt **pdump_hash; + +/* Since most pointers are eight bytes aligned, the >>3 allows for a better hash */ +static int +pdump_make_hash (const void *obj) +{ + return ((unsigned long)(obj)>>3) % PDUMP_HASHSIZE; +} + +static pdump_entry_list_elmt * +pdump_get_entry (const void *obj) +{ + int pos = pdump_make_hash (obj); + pdump_entry_list_elmt *e; + + assert (obj != 0); + + while ((e = pdump_hash[pos]) != 0) + { + if (e->obj == obj) + return e; + + pos++; + if (pos == PDUMP_HASHSIZE) + pos = 0; + } + return 0; +} + +static void +pdump_add_entry (pdump_entry_list *list, const void *obj, size_t size, int count, int is_lrecord) +{ + pdump_entry_list_elmt *e; + int align; + int pos = pdump_make_hash (obj); + + while ((e = pdump_hash[pos]) != 0) + { + if (e->obj == obj) + return; + + pos++; + if (pos == PDUMP_HASHSIZE) + pos = 0; + } + + e = xnew (pdump_entry_list_elmt); + + e->next = list->first; + e->obj = obj; + e->size = size; + e->count = count; + e->is_lrecord = is_lrecord; + list->first = e; + + list->count += count; + pdump_hash[pos] = e; + + align = align_table[size & 255]; + if (align < 2 && is_lrecord) + align = 2; + + if (align < list->align) + list->align = align; +} + +static pdump_entry_list * +pdump_get_entry_list (const struct struct_description *sdesc) +{ + int i; + for (i=0; iname, + backtrace[i].position, + backtrace[i].offset); + } + } +} + +static void pdump_register_object (Lisp_Object obj); +static void pdump_register_struct (const void *data, const struct struct_description *sdesc, int count); + +static EMACS_INT +pdump_get_indirect_count (EMACS_INT code, const struct lrecord_description *idesc, const void *idata) +{ + EMACS_INT count; + const void *irdata; + + int line = XD_INDIRECT_VAL (code); + int delta = XD_INDIRECT_DELTA (code); + + irdata = ((char *)idata) + idesc[line].offset; + switch (idesc[line].type) + { + case XD_SIZE_T: + count = *(size_t *)irdata; + break; + case XD_INT: + count = *(int *)irdata; + break; + case XD_LONG: + count = *(long *)irdata; + break; + case XD_BYTECOUNT: + count = *(Bytecount *)irdata; + break; + default: + stderr_out ("Unsupported count type : %d (line = %d, code=%ld)\n", idesc[line].type, line, (long)code); + pdump_backtrace (); + abort (); + } + count += delta; + return count; +} + +static void +pdump_register_sub (const void *data, const struct lrecord_description *desc, int me) +{ + int pos; + + restart: + for (pos = 0; desc[pos].type != XD_END; pos++) + { + const void *rdata = (const char *)data + desc[pos].offset; + + backtrace[me].position = pos; + backtrace[me].offset = desc[pos].offset; + + switch (desc[pos].type) + { + case XD_SPECIFIER_END: + pos = 0; + desc = ((const Lisp_Specifier *)data)->methods->extra_description; + goto restart; + case XD_SIZE_T: + case XD_INT: + case XD_LONG: + case XD_BYTECOUNT: + case XD_LO_RESET_NIL: + case XD_INT_RESET: + case XD_LO_LINK: + break; + case XD_OPAQUE_DATA_PTR: + { + EMACS_INT count = desc[pos].data1; + if (XD_IS_INDIRECT (count)) + count = pdump_get_indirect_count (count, desc, data); + + pdump_add_entry (&pdump_opaque_data_list, + *(void **)rdata, + count, + 1, + 0); + break; + } + case XD_C_STRING: + { + const char *str = *(const char **)rdata; + if (str) + pdump_add_entry (&pdump_opaque_data_list, str, strlen (str)+1, 1, 0); + break; + } + case XD_DOC_STRING: + { + const char *str = *(const char **)rdata; + if ((EMACS_INT)str > 0) + pdump_add_entry (&pdump_opaque_data_list, str, strlen (str)+1, 1, 0); + break; + } + case XD_LISP_OBJECT: + { + const Lisp_Object *pobj = (const Lisp_Object *)rdata; + + assert (desc[pos].data1 == 0); + + backtrace[me].offset = (const char *)pobj - (const char *)data; + pdump_register_object (*pobj); + break; + } + case XD_LISP_OBJECT_ARRAY: + { + int i; + EMACS_INT count = desc[pos].data1; + if (XD_IS_INDIRECT (count)) + count = pdump_get_indirect_count (count, desc, data); + + for (i = 0; i < count; i++) + { + const Lisp_Object *pobj = ((const Lisp_Object *)rdata) + i; + Lisp_Object dobj = *pobj; + + backtrace[me].offset = (const char *)pobj - (const char *)data; + pdump_register_object (dobj); + } + break; + } + case XD_STRUCT_PTR: + { + EMACS_INT count = desc[pos].data1; + const struct struct_description *sdesc = desc[pos].data2; + const char *dobj = *(const char **)rdata; + if (dobj) + { + if (XD_IS_INDIRECT (count)) + count = pdump_get_indirect_count (count, desc, data); + + pdump_register_struct (dobj, sdesc, count); + } + break; + } + default: + stderr_out ("Unsupported dump type : %d\n", desc[pos].type); + pdump_backtrace (); + abort (); + }; + } +} + +static void +pdump_register_object (Lisp_Object obj) +{ + struct lrecord_header *objh; + + if (!POINTER_TYPE_P (XTYPE (obj))) + return; + + objh = XRECORD_LHEADER (obj); + if (!objh) + return; + + if (pdump_get_entry (objh)) + return; + + if (LHEADER_IMPLEMENTATION (objh)->description) + { + int me = depth++; + if (me>65536) + { + stderr_out ("Backtrace overflow, loop ?\n"); + abort (); + } + backtrace[me].obj = objh; + backtrace[me].position = 0; + backtrace[me].offset = 0; + + pdump_add_entry (pdump_object_table + objh->type, + objh, + LHEADER_IMPLEMENTATION (objh)->static_size ? + LHEADER_IMPLEMENTATION (objh)->static_size : + LHEADER_IMPLEMENTATION (objh)->size_in_bytes_method (objh), + 1, + 1); + pdump_register_sub (objh, + LHEADER_IMPLEMENTATION (objh)->description, + me); + --depth; + } + else + { + pdump_alert_undump_object[objh->type]++; + stderr_out ("Undumpable object type : %s\n", LHEADER_IMPLEMENTATION (objh)->name); + pdump_backtrace (); + } +} + +static void +pdump_register_struct (const void *data, const struct struct_description *sdesc, int count) +{ + if (data && !pdump_get_entry (data)) + { + int me = depth++; + int i; + if (me>65536) + { + stderr_out ("Backtrace overflow, loop ?\n"); + abort (); + } + backtrace[me].obj = 0; + backtrace[me].position = 0; + backtrace[me].offset = 0; + + pdump_add_entry (pdump_get_entry_list (sdesc), + data, + sdesc->size, + count, + 0); + for (i=0; isize*i, + sdesc->description, + me); + } + --depth; + } +} + +static void +pdump_dump_data (pdump_entry_list_elmt *elmt, const struct lrecord_description *desc) +{ + size_t size = elmt->size; + int count = elmt->count; + if (desc) + { + int pos, i; + memcpy (pdump_buf, elmt->obj, size*count); + + for (i=0; iobj))->methods->extra_description; + goto restart; + case XD_SIZE_T: + case XD_INT: + case XD_LONG: + case XD_BYTECOUNT: + break; + case XD_LO_RESET_NIL: + { + EMACS_INT num = desc[pos].data1; + int j; + if (XD_IS_INDIRECT (num)) + num = pdump_get_indirect_count (num, desc, elmt->obj); + for (j=0; jsave_offset; + break; + } + case XD_INT_RESET: + { + EMACS_INT val = desc[pos].data1; + if (XD_IS_INDIRECT (val)) + val = pdump_get_indirect_count (val, desc, elmt->obj); + *(int *)rdata = val; + break; + } + case XD_OPAQUE_DATA_PTR: + case XD_C_STRING: + case XD_STRUCT_PTR: + { + void *ptr = *(void **)rdata; + if (ptr) + *(EMACS_INT *)rdata = pdump_get_entry (ptr)->save_offset; + break; + } + case XD_LO_LINK: + { + Lisp_Object obj = *(Lisp_Object *)rdata; + pdump_entry_list_elmt *elmt1; + for (;;) + { + elmt1 = pdump_get_entry (XRECORD_LHEADER (obj)); + if (elmt1) + break; + obj = *(Lisp_Object *)(desc[pos].offset + (char *)(XRECORD_LHEADER (obj))); + } + *(EMACS_INT *)rdata = elmt1->save_offset; + break; + } + case XD_LISP_OBJECT: + { + Lisp_Object *pobj = (Lisp_Object *) rdata; + + assert (desc[pos].data1 == 0); + + if (POINTER_TYPE_P (XTYPE (*pobj)) && XRECORD_LHEADER (*pobj)) + *(EMACS_INT *)pobj = + pdump_get_entry (XRECORD_LHEADER (*pobj))->save_offset; + break; + } + case XD_LISP_OBJECT_ARRAY: + { + EMACS_INT num = desc[pos].data1; + int j; + if (XD_IS_INDIRECT (num)) + num = pdump_get_indirect_count (num, desc, elmt->obj); + + for (j=0; jsave_offset; + } + break; + } + case XD_DOC_STRING: + { + EMACS_INT str = *(EMACS_INT *)rdata; + if (str > 0) + *(EMACS_INT *)rdata = pdump_get_entry ((void *)str)->save_offset; + break; + } + default: + stderr_out ("Unsupported dump type : %d\n", desc[pos].type); + abort (); + }; + } + } + } + write (pdump_fd, desc ? pdump_buf : elmt->obj, size*count); + if (elmt->is_lrecord && ((size*count) & 3)) + write (pdump_fd, "\0\0\0", 4-((size*count) & 3)); +} + +static void +pdump_reloc_one (void *data, EMACS_INT delta, const struct lrecord_description *desc) +{ + int pos; + + restart: + for (pos = 0; desc[pos].type != XD_END; pos++) + { + void *rdata = (char *)data + desc[pos].offset; + switch (desc[pos].type) + { + case XD_SPECIFIER_END: + pos = 0; + desc = ((const Lisp_Specifier *)data)->methods->extra_description; + goto restart; + case XD_SIZE_T: + case XD_INT: + case XD_LONG: + case XD_BYTECOUNT: + case XD_INT_RESET: + break; + case XD_OPAQUE_DATA_PTR: + case XD_C_STRING: + case XD_STRUCT_PTR: + case XD_LO_LINK: + { + EMACS_INT ptr = *(EMACS_INT *)rdata; + if (ptr) + *(EMACS_INT *)rdata = ptr+delta; + break; + } + case XD_LISP_OBJECT: + { + Lisp_Object *pobj = (Lisp_Object *) rdata; + + assert (desc[pos].data1 == 0); + + if (POINTER_TYPE_P (XTYPE (*pobj)) + && ! EQ (*pobj, Qnull_pointer)) + XSETOBJ (*pobj, XTYPE (*pobj), (char *) XPNTR (*pobj) + delta); + + break; + } + case XD_LISP_OBJECT_ARRAY: + case XD_LO_RESET_NIL: + { + EMACS_INT num = desc[pos].data1; + int j; + if (XD_IS_INDIRECT (num)) + num = pdump_get_indirect_count (num, desc, data); + + for (j=0; j 0) + *(EMACS_INT *)rdata = str + delta; + break; + } + default: + stderr_out ("Unsupported dump type : %d\n", desc[pos].type); + abort (); + }; + } +} + +static void +pdump_allocate_offset (pdump_entry_list_elmt *elmt, const struct lrecord_description *desc) +{ + size_t size = (elmt->is_lrecord ? (elmt->size + 3) & ~3 : elmt->size)*elmt->count; + elmt->save_offset = cur_offset; + if (size>max_size) + max_size = size; + cur_offset += size; +} + +static void +pdump_scan_by_alignment (void (*f)(pdump_entry_list_elmt *, const struct lrecord_description *)) +{ + int align, i; + const struct lrecord_description *idesc; + pdump_entry_list_elmt *elmt; + for (align=8; align>=0; align--) + { + for (i=0; idescription; + while (elmt) + { + f (elmt, idesc); + elmt = elmt->next; + } + } + + for (i=0; idescription; + while (elmt) + { + f (elmt, idesc); + elmt = elmt->next; + } + } + + elmt = pdump_opaque_data_list.first; + while (elmt) + { + if (align_table[elmt->size & 255] == align) + f (elmt, 0); + elmt = elmt->next; + } + } +} + +static void +pdump_dump_staticvec (void) +{ + EMACS_INT *reloc = xnew_array (EMACS_INT, staticidx); + int i; + write (pdump_fd, staticvec, staticidx*sizeof (Lisp_Object *)); + + for (i=0; isave_offset; + else + reloc[i] = *(EMACS_INT *)(staticvec[i]); + } + write (pdump_fd, reloc, staticidx*sizeof (Lisp_Object)); + free (reloc); +} + +static void +pdump_dump_structvec (void) +{ + int i; + for (i=0; isave_offset; + write (pdump_fd, &adr, sizeof (adr)); + } +} + +static void +pdump_dump_opaquevec (void) +{ + int i; + for (i=0; idescription; + rt.count = pdump_object_table[i].count; + write (pdump_fd, &rt, sizeof (rt)); + while (elmt) + { + EMACS_INT rdata = pdump_get_entry (elmt->obj)->save_offset; + write (pdump_fd, &rdata, sizeof (rdata)); + elmt = elmt->next; + } + } + + rt.desc = 0; + rt.count = 0; + write (pdump_fd, &rt, sizeof (rt)); + + for (i=0; idescription; + rt.count = pdump_struct_table.list[i].list.count; + write (pdump_fd, &rt, sizeof (rt)); + while (elmt) + { + EMACS_INT rdata = pdump_get_entry (elmt->obj)->save_offset; + for (j=0; jcount; j++) + { + write (pdump_fd, &rdata, sizeof (rdata)); + rdata += elmt->size; + } + elmt = elmt->next; + } + } + rt.desc = 0; + rt.count = 0; + write (pdump_fd, &rt, sizeof (rt)); +} + +static void +pdump_dump_wired (void) +{ + EMACS_INT count = pdump_wireidx + pdump_wireidx_list; + int i; + + write (pdump_fd, &count, sizeof (count)); + + for (i=0; isave_offset; + write (pdump_fd, &pdump_wirevec[i], sizeof (pdump_wirevec[i])); + write (pdump_fd, &obj, sizeof (obj)); + } + + for (i=0; idescription; + for (pos = 0; desc[pos].type != XD_LO_LINK; pos++) + assert (desc[pos].type != XD_END); + + obj = *(Lisp_Object *)(desc[pos].offset + (char *)(XRECORD_LHEADER (obj))); + } + res = elmt->save_offset; + + write (pdump_fd, &pdump_wirevec_list[i], sizeof (pdump_wirevec_list[i])); + write (pdump_fd, &res, sizeof (res)); + } +} + +void +pdump (void) +{ + int i; + Lisp_Object t_console, t_device, t_frame; + int none; + dump_header hd; + + /* These appear in a DEFVAR_LISP, which does a staticpro() */ + t_console = Vterminal_console; + t_frame = Vterminal_frame; + t_device = Vterminal_device; + + Vterminal_console = Qnil; + Vterminal_frame = Qnil; + Vterminal_device = Qnil; + + pdump_hash = xnew_array_and_zero (pdump_entry_list_elmt *, PDUMP_HASHSIZE); + + for (i=0; iname, pdump_alert_undump_object[i]); + } + if (!none) + return; + + for (i=0; isignature, DUMP_SIGNATURE, DUMP_SIGNATURE_LEN) + && ((dump_header *)pdump_start)->id == dump_id); +} + +static int pdump_load_finish (void) +{ + int i; + char *p; + EMACS_INT delta; + EMACS_INT count; + + pdump_end = pdump_start + pdump_length; + +#define PDUMP_READ(p, type) (p = (char*) (((type *) p) + 1), *((type *) p - 1)) + + staticidx = ((dump_header *)(pdump_start))->nb_staticpro; + delta = ((EMACS_INT)pdump_start) - ((dump_header *)pdump_start)->reloc_address; + p = pdump_start + ((dump_header *)pdump_start)->stab_offset; + + /* Put back the staticvec in place */ + memcpy (staticvec, p, staticidx*sizeof (Lisp_Object *)); + p += staticidx*sizeof (Lisp_Object *); + for (i=0; inb_structdmp; i++) + { + void **adr = PDUMP_READ (p, void **); + *adr = (void *) (PDUMP_READ (p, char *) + delta); + } + + /* Put back the opaques */ + for (i=0; i<((dump_header *)pdump_start)->nb_opaquedmp; i++) + { + struct pdump_dumpopaqueinfo di = PDUMP_READ (p, struct pdump_dumpopaqueinfo); + memcpy (di.data, p, di.size); + p += di.size; + } + + /* Put back the lrecord_implementations_table */ + /* The (void *) cast is there to make Ben happy. */ + memcpy ((void *) lrecord_implementations_table, p, lrecord_type_count*sizeof (lrecord_implementations_table[0])); + p += lrecord_type_count*sizeof (lrecord_implementations_table[0]); + + /* Reinitialize lrecord_markers from lrecord_implementations_table */ + for (i=0; i < lrecord_type_count; i++) + if (lrecord_implementations_table[i]) + lrecord_markers[i] = lrecord_implementations_table[i]->marker; + + /* Do the relocations */ + pdump_rt_list = p; + count = 2; + for (;;) + { + pdump_reloc_table rt = PDUMP_READ (p, pdump_reloc_table); + if (rt.desc) + { + for (i=0; i < rt.count; i++) + { + char *adr = delta + *(char **)p; + *(char **)p = adr; + pdump_reloc_one (adr, delta, rt.desc); + p += sizeof (char *); + } + } else + if (!(--count)) + break; + } + + /* Put the pdump_wire variables in place */ + count = PDUMP_READ (p, EMACS_INT); + + for (i=0; iexe_path && !IS_DIRECTORY_SEP (*w) && (*w != '-') && (*w != '.')); + } + while (w>exe_path && !IS_DIRECTORY_SEP (*w)); + return 0; +} + +int pdump_load(const char *argv0) +{ + char exe_path[PATH_MAX]; + char *w; +#ifdef WINDOWSNT + GetModuleFileName (NULL, exe_name, PATH_MAX); +#else /* !WINDOWSNT */ + const char *dir, *p; + + dir = argv0; + if (dir[0] == '-') + { + /* XEmacs as a login shell, oh goody! */ + dir = getenv("SHELL"); + } + + p = dir + strlen(dir); + while (p != dir && !IS_ANY_SEP (p[-1])) p--; + + if (p != dir) + { + /* invocation-name includes a directory component -- presumably it + is relative to cwd, not $PATH */ + strcpy (exe_path, dir); + } + else + { + const char *path = getenv ("PATH"); + const char *name = p; + for (;;) + { + p = path; + while (*p && *p != SEPCHAR) + p++; + if (p == path) + { + exe_path[0] = '.'; + w = exe_path + 1; + } + else + { + memcpy (exe_path, path, p - path); + w = exe_path + (p - path); + } + if (!IS_DIRECTORY_SEP (w[-1])) + { + *w++ = '/'; + } + strcpy(w, name); + + /* ### #$%$#^$^@%$^#%@$ ! */ +#ifdef access +#undef access +#endif + + if (!access (exe_path, X_OK)) + break; + if (!*p) + { + /* Oh well, let's have some kind of default */ + sprintf (exe_path, "./%s", name); + break; + } + path = p+1; + } + } +#endif /* WINDOWSNT */ + + if (pdump_file_try (exe_path)) + { + pdump_load_finish (); + return 1; + } + +#ifdef WINDOWSNT + if (pdump_resource_get ()) + { + if (pdump_load_check ()) + { + pdump_load_finish (); + return 1; + } + pdump_free (); + } +#endif + + return 0; +} diff -r 9f011ab08d48 -r 2f8bb876ab1d src/dumper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/dumper.h Mon Aug 13 11:16:07 2007 +0200 @@ -0,0 +1,30 @@ +/* Portable data dumper for XEmacs. + Copyright (C) 1999-2000 Olivier Galibert + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + +#ifndef INCLUDED_dumper_h +#define INCLUDED_dumper_h + +void pdump_objects_unmark (void); +void pdump (void); +int pdump_load (const char *argv0); + +#endif /* INCLUDED_dumper_h */ diff -r 9f011ab08d48 -r 2f8bb876ab1d src/editfns.c --- a/src/editfns.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/editfns.c Mon Aug 13 11:16:07 2007 +0200 @@ -822,10 +822,18 @@ of a few bytes */ } +/* !!#### not Mule correct. */ + /* Returns the home directory, in external format */ Extbyte * get_home_directory (void) { + /* !!#### this is hopelessly bogus. Rule #1: Do not make any assumptions + about what format an external string is in. Could be Unicode, for all + we know, and then all the operations below are totally bogus. + Instead, convert all data to internal format *right* at the juncture + between XEmacs and the outside world, the very moment we first get + the data. --ben */ int output_home_warning = 0; if (cached_home_directory == NULL) @@ -847,7 +855,9 @@ } else { -# if 1 +# if 0 /* changed by ben. This behavior absolutely stinks, and the + possibility being addressed here occurs quite commonly. + Using the current directory makes absolutely no sense. */ /* * Use the current directory. * This preserves the existing XEmacs behavior, but is different diff -r 9f011ab08d48 -r 2f8bb876ab1d src/eldap.c --- a/src/eldap.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/eldap.c Mon Aug 13 11:16:07 2007 +0200 @@ -417,7 +417,7 @@ LDAPMessage *e; BerElement *ptr; char *a, *dn; - int i, rc, rc2; + int i, rc; int matches; struct ldap_unwind_struct unwind; @@ -426,10 +426,11 @@ int speccount = specpdl_depth (); - Lisp_Object list, entry, result; + Lisp_Object list = Qnil; + Lisp_Object entry = Qnil; + Lisp_Object result = Qnil; struct gcpro gcpro1, gcpro2, gcpro3; - list = entry = result = Qnil; GCPRO3 (list, entry, result); unwind.res = NULL; @@ -489,9 +490,9 @@ /* Perform the search */ if (ldap_search (ld, - NILP (base) ? "" : (char *) XSTRING_DATA (base), + NILP (base) ? (char *) "" : (char *) XSTRING_DATA (base), ldap_scope, - NILP (filter) ? "" : (char *) XSTRING_DATA (filter), + NILP (filter) ? (char *) "" : (char *) XSTRING_DATA (filter), ldap_attributes, NILP (attrsonly) ? 0 : 1) == -1) @@ -538,7 +539,7 @@ { for (i = 0; unwind.vals[i] != NULL; i++) { - list = Fcons (make_ext_string (unwind.vals[i]->bv_val, + list = Fcons (make_ext_string ((Extbyte *) unwind.vals[i]->bv_val, unwind.vals[i]->bv_len, Qnative), list); @@ -558,11 +559,13 @@ } #if defined HAVE_LDAP_PARSE_RESULT - rc2 = ldap_parse_result (ld, unwind.res, - &rc, - NULL, NULL, NULL, NULL, 0); - if (rc2 != LDAP_SUCCESS) - rc = rc2; + { + int rc2 = ldap_parse_result (ld, unwind.res, + &rc, + NULL, NULL, NULL, NULL, 0); + if (rc2 != LDAP_SUCCESS) + rc = rc2; + } #else if (rc == 0) signal_ldap_error (ld, NULL, LDAP_TIMELIMIT_EXCEEDED); @@ -604,9 +607,12 @@ struct berval *bervals; int rc; int i, j; + size_t len; - Lisp_Object current, values; + Lisp_Object current = Qnil; + Lisp_Object values = Qnil; struct gcpro gcpro1, gcpro2; + GCPRO2 (current, values); /* Do all the parameter checking */ @@ -622,8 +628,9 @@ signal_simple_error ("Cannot add void entry", entry); /* Build the ldap_mods array */ - ldap_mods = alloca_array (LDAPMod, XINT (Flength (entry))); - ldap_mods_ptrs = alloca_array (LDAPMod *, 1 + XINT (Flength (entry))); + len = XINT (Flength (entry)); + ldap_mods = alloca_array (LDAPMod, len); + ldap_mods_ptrs = alloca_array (LDAPMod *, 1 + len); i = 0; EXTERNAL_LIST_LOOP (entry, entry) { @@ -638,10 +645,10 @@ values = XCDR (current); if (CONSP (values)) { - bervals = - alloca_array (struct berval, XINT (Flength (values))); + len = XINT (Flength (values)); + bervals = alloca_array (struct berval, len); ldap_mods[i].mod_vals.modv_bvals = - alloca_array (struct berval *, 1 + XINT (Flength (values))); + alloca_array (struct berval *, 1 + len); j = 0; EXTERNAL_LIST_LOOP (values, values) { @@ -676,6 +683,7 @@ signal_ldap_error (ld, NULL, rc); UNGCPRO; + return Qnil; } DEFUN ("ldap-modify", Fldap_modify, 3, 3, 0, /* @@ -686,7 +694,7 @@ A modification is a list of the form (MOD-OP ATTR VALUE1 VALUE2 ...) MOD-OP and ATTR are mandatory, VALUEs are optional depending on MOD-OP. MOD-OP is the type of modification, one of the symbols `add', `delete' -or `replace'. ATTR is the LDAP attribute type to modify +or `replace'. ATTR is the LDAP attribute type to modify. */ (ldap, dn, mods)) { @@ -694,8 +702,11 @@ LDAPMod *ldap_mods, **ldap_mods_ptrs; struct berval *bervals; int i, j, rc; + Lisp_Object mod_op; + size_t len; - Lisp_Object current, mod_op, values; + Lisp_Object current = Qnil; + Lisp_Object values = Qnil; struct gcpro gcpro1, gcpro2; GCPRO2 (current, values); @@ -713,8 +724,9 @@ return Qnil; /* Build the ldap_mods array */ - ldap_mods = alloca_array (LDAPMod, XINT (Flength (mods))); - ldap_mods_ptrs = alloca_array (LDAPMod *, 1 + XINT (Flength (mods))); + len = XINT (Flength (mods)); + ldap_mods = alloca_array (LDAPMod, len); + ldap_mods_ptrs = alloca_array (LDAPMod *, 1 + len); i = 0; EXTERNAL_LIST_LOOP (mods, mods) { @@ -738,9 +750,10 @@ C_STRING_ALLOCA, ldap_mods[i].mod_type, Qnative); values = XCDR (current); - bervals = alloca_array (struct berval, XINT (Flength (values))); + len = XINT (Flength (values)); + bervals = alloca_array (struct berval, len); ldap_mods[i].mod_vals.modv_bvals = - alloca_array (struct berval *, 1 + XINT (Flength (values))); + alloca_array (struct berval *, 1 + len); j = 0; EXTERNAL_LIST_LOOP (values, values) { @@ -762,6 +775,7 @@ signal_ldap_error (ld, NULL, rc); UNGCPRO; + return Qnil; } @@ -783,6 +797,8 @@ rc = ldap_delete_s (ld, (char *) XSTRING_DATA (dn)); if (rc != LDAP_SUCCESS) signal_ldap_error (ld, NULL, rc); + + return Qnil; } void diff -r 9f011ab08d48 -r 2f8bb876ab1d src/elhash.c --- a/src/elhash.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/elhash.c Mon Aug 13 11:16:07 2007 +0200 @@ -1218,6 +1218,15 @@ /************************************************************************/ /* garbage collecting weak hash tables */ /************************************************************************/ +#define MARK_OBJ(obj) do { \ + Lisp_Object mo_obj = (obj); \ + if (!marked_p (mo_obj)) \ + { \ + mark_object (mo_obj); \ + did_mark = 1; \ + } \ +} while (0) + /* Complete the marking for semi-weak hash tables. */ int @@ -1241,9 +1250,6 @@ /* Now, scan over all the pairs. For all pairs that are half-marked, we may need to mark the other half if we're keeping this pair. */ -#define MARK_OBJ(obj) \ -do { if (!marked_p (obj)) mark_object (obj), did_mark = 1; } while (0) - switch (ht->weakness) { case HASH_TABLE_KEY_WEAK: diff -r 9f011ab08d48 -r 2f8bb876ab1d src/emacs.c --- a/src/emacs.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/emacs.c Mon Aug 13 11:16:07 2007 +0200 @@ -44,6 +44,15 @@ #include "sysfile.h" #include "systime.h" +#ifdef PDUMP +#include "dump-id.h" +#include "dumper.h" +#endif + +#ifndef SEPCHAR +#define SEPCHAR ':' +#endif + #ifdef QUANTIFY #include #endif @@ -68,7 +77,7 @@ /* For PATH_EXEC */ #include -#ifdef HEAP_IN_DATA +#if defined (HEAP_IN_DATA) && !defined(PDUMP) void report_sheap_usage (int die_if_pure_storage_exceeded); #endif @@ -213,6 +222,10 @@ /* Nonzero means don't load package autoloads at startup */ int inhibit_autoloads; +/* Nonzero means don't load the dump file (ignored if not PDUMP) */ + +int nodumpfile; + /* Nonzero means print debug information about path searching */ int debug_paths; @@ -234,6 +247,14 @@ /* Nonzero if handling a fatal error already */ static int fatal_error_in_progress; +static JMP_BUF run_temacs_catch; + +static int run_temacs_argc; +static char **run_temacs_argv; +static char *run_temacs_args; +static size_t run_temacs_argv_size; +static size_t run_temacs_args_size; + static void shut_down_emacs (int sig, Lisp_Object stuff); /* Handle bus errors, illegal instruction, etc. */ @@ -274,61 +295,6 @@ } -DOESNT_RETURN -fatal (const char *fmt, ...) -{ - va_list args; - va_start (args, fmt); - - fprintf (stderr, "\nXEmacs: "); - vfprintf (stderr, GETTEXT (fmt), args); - fprintf (stderr, "\n"); - - va_end (args); - fflush (stderr); - exit (1); -} - -/* #### The following two functions should be replaced with - calls to emacs_doprnt_*() functions, with STREAM set to send out - to stdout or stderr. This is the only way to ensure that - I18N3 works properly (many implementations of the *printf() - functions, including the ones included in glibc, do not implement - the %###$ argument-positioning syntax). */ - -/* exactly equivalent to fprintf (stderr, fmt, ...) except that it calls - GETTEXT on the format string. */ - -int -stderr_out (const char *fmt, ...) -{ - int retval; - va_list args; - va_start (args, fmt); - - retval = vfprintf (stderr, GETTEXT (fmt), args); - - va_end (args); - /* fflush (stderr); */ - return retval; -} - -/* exactly equivalent to fprintf (stdout, fmt, ...) except that it calls - GETTEXT on the format string. */ - -int -stdout_out (const char *fmt, ...) -{ - int retval; - va_list args; - va_start (args, fmt); - - retval = vfprintf (stdout, GETTEXT (fmt), args); - - va_end (args); - return retval; -} - #ifdef SIGDANGER /* Handler for SIGDANGER. */ @@ -569,7 +535,7 @@ * But hey, it solves all NS related memory problems, so who's * complaining? */ if (initialized && malloc_jumpstart (malloc_cookie) != 0) - fprintf (stderr, "malloc jumpstart failed!\n"); + stderr_out ("malloc jumpstart failed!\n"); #endif /* NeXT */ /* @@ -645,6 +611,17 @@ inhibit_window_system = 1; #endif + /* Handle the -sd/--show-dump-id switch, which means show the hex dump_id and quit */ + if (argmatch (argv, argc, "-sd", "--show-dump-id", 9, NULL, &skip_args)) + { +#ifdef PDUMP + printf ("%08x\n", dump_id); +#else + printf ("*ERROR**\n"); +#endif + exit (0); + } + /* Handle the -t switch, which specifies filename to use as terminal */ { char *term; @@ -666,6 +643,12 @@ } } + /* Handle the --no-dump-file/-nd switch, which means don't load the dump file (ignored when not using pdump) */ + if (argmatch (argv, argc, "-nd", "--no-dump-file", 7, NULL, &skip_args)) + { + nodumpfile = 1; + } + /* Handle -nw switch */ if (argmatch (argv, argc, "-nw", "--no-windows", 6, NULL, &skip_args)) inhibit_window_system = 1; @@ -837,9 +820,15 @@ #ifdef PDUMP if (restart) initialized = 1; - else { - initialized = pdump_load (); - purify_flag = !initialized; + else if (nodumpfile) { + initialized = 0; + purify_flag = 1; + } else { + initialized = pdump_load (argv[0]); + if (initialized) + run_temacs_argc = -1; + else + purify_flag = 1; } #else if (!initialized) @@ -930,9 +919,7 @@ syms_of_glyphs (); syms_of_glyphs_eimage (); syms_of_glyphs_widget (); -#if defined (HAVE_MENUBARS) || defined (HAVE_SCROLLBARS) || defined (HAVE_DIALOGS) || defined (HAVE_TOOLBARS) syms_of_gui (); -#endif syms_of_gutter (); syms_of_indent (); syms_of_intl (); @@ -1084,6 +1071,10 @@ syms_of_gpmevent (); #endif +#ifdef HAVE_POSTGRESQL + syms_of_postgresql (); +#endif + /* Now create the subtypes for the types that have them. We do this before the vars_*() because more symbols may get initialized here. */ @@ -1264,7 +1255,7 @@ using a global variable that has been initialized earlier on in the same function - Any of the object-creating functions on alloc.c: e.g. + Any of the object-creating functions in alloc.c: e.g. make_pure_*() make_string() @@ -1337,9 +1328,7 @@ vars_of_glyphs (); vars_of_glyphs_eimage (); vars_of_glyphs_widget (); -#if defined (HAVE_MENUBARS) || defined (HAVE_SCROLLBARS) || defined (HAVE_DIALOGS) || defined (HAVE_TOOLBARS) vars_of_gui (); -#endif vars_of_gutter (); vars_of_indent (); vars_of_insdel (); @@ -1479,6 +1468,10 @@ vars_of_eldap (); #endif +#ifdef HAVE_POSTGRESQL + vars_of_postgresql(); +#endif + #ifdef HAVE_GPM vars_of_gpmevent (); #endif @@ -1680,6 +1673,7 @@ reinit_vars_of_event_stream (); reinit_vars_of_events (); reinit_vars_of_extents (); + reinit_vars_of_fileio (); reinit_vars_of_font_lock (); reinit_vars_of_glyphs (); reinit_vars_of_glyphs_widget (); @@ -1794,7 +1788,7 @@ #ifdef HAVE_TTY init_device_tty (); #endif - init_console_stream (); /* Create the first console */ + init_console_stream (restart); /* Create the first console */ /* try to get the actual pathname of the exec file we are running */ if (!restart) @@ -1897,8 +1891,9 @@ static const struct standard_args standard_args[] = { /* Handled by main_1 above: */ - { "-nl", "--no-shared-memory", 100, 0 }, - { "-t", "--terminal", 95, 1 }, + { "-sd", "--show-dump-id", 105, 0 }, + { "-t", "--terminal", 100, 1 }, + { "-nd", "--no-dump-file", 95, 0 }, { "-nw", "--no-windows", 90, 0 }, { "-batch", "--batch", 85, 0 }, { "-debug-paths", "--debug-paths", 82, 0 }, @@ -2093,14 +2088,6 @@ xfree (priority); } -static JMP_BUF run_temacs_catch; - -static int run_temacs_argc; -static char **run_temacs_argv; -static char *run_temacs_args; -static size_t run_temacs_argv_size; -static size_t run_temacs_args_size; - DEFUN ("running-temacs-p", Frunning_temacs_p, 0, 0, 0, /* True if running temacs. This means we are in the dumping stage. This is false during normal execution of the `xemacs' program, and @@ -2175,7 +2162,7 @@ unbind_to (0, Qnil); /* this closes loadup.el */ purify_flag = 0; run_temacs_argc = nargs + 1; -#ifdef HEAP_IN_DATA +#if defined (HEAP_IN_DATA) && !defined(PDUMP) report_sheap_usage (0); #endif LONGJMP (run_temacs_catch, 1); @@ -2281,7 +2268,7 @@ int rc = malloc_set_state (malloc_state_ptr); if (rc != 0) { - fprintf (stderr, "malloc_set_state failed, rc = %d\n", rc); + stderr_out ("malloc_set_state failed, rc = %d\n", rc); abort (); } #if 0 @@ -2559,7 +2546,7 @@ opurify = purify_flag; purify_flag = 0; -#ifdef HEAP_IN_DATA +#if defined (HEAP_IN_DATA) && !defined(PDUMP) report_sheap_usage (1); #endif @@ -2636,9 +2623,6 @@ #endif /* not CANNOT_DUMP */ -#ifndef SEPCHAR -#define SEPCHAR ':' -#endif /* Split STRING into a list of substrings. The substrings are the parts of original STRING separated by SEPCHAR. */ @@ -3164,7 +3148,8 @@ *Directory of architecture-independent files that come with XEmacs, intended for XEmacs to use. Use of this variable in new code is almost never correct. See the -function `locate-data-directory' and the variable `data-directory-list'. +functions `locate-data-file' and `locate-data-directory' and the variable +`data-directory-list'. */ ); Vdata_directory = Qnil; diff -r 9f011ab08d48 -r 2f8bb876ab1d src/eval.c --- a/src/eval.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/eval.c Mon Aug 13 11:16:07 2007 +0200 @@ -267,10 +267,16 @@ static Lisp_Object Vcondition_handlers; -#if 0 /* no longer used */ +#define DEFEND_AGAINST_THROW_RECURSION + +#ifdef DEFEND_AGAINST_THROW_RECURSION /* Used for error catching purposes by throw_or_bomb_out */ static int throw_level; -#endif /* unused */ +#endif + +#ifdef ERROR_CHECK_TYPECHECK +void check_error_state_sanity (void); +#endif /************************************************************************/ @@ -1304,6 +1310,9 @@ c.val = (*func) (arg); if (threw) *threw = 0; catchlist = c.next; +#ifdef ERROR_CHECK_TYPECHECK + check_error_state_sanity (); +#endif return c.val; } @@ -1360,19 +1369,25 @@ unbind_to (catchlist->pdlcount, Qnil); handlerlist = catchlist->handlerlist; catchlist = catchlist->next; +#ifdef ERROR_CHECK_TYPECHECK + check_error_state_sanity (); +#endif } while (! last_time); #else /* Actual XEmacs code */ /* Unwind the specpdl stack */ unbind_to (c->pdlcount, Qnil); catchlist = c->next; +#ifdef ERROR_CHECK_TYPECHECK + check_error_state_sanity (); +#endif #endif gcprolist = c->gcpro; backtrace_list = c->backlist; lisp_eval_depth = c->lisp_eval_depth; -#if 0 /* no longer used */ +#ifdef DEFEND_AGAINST_THROW_RECURSION throw_level = 0; #endif LONGJMP (c->jmp, 1); @@ -1382,7 +1397,7 @@ throw_or_bomb_out (Lisp_Object tag, Lisp_Object val, int bomb_out_p, Lisp_Object sig, Lisp_Object data) { -#if 0 +#ifdef DEFEND_AGAINST_THROW_RECURSION /* die if we recurse more than is reasonable */ if (++throw_level > 20) abort(); @@ -1635,6 +1650,9 @@ have this code here, and it doesn't cost anything, so I'm leaving it.*/ UNGCPRO; catchlist = c.next; +#ifdef ERROR_CHECK_TYPECHECK + check_error_state_sanity (); +#endif Vcondition_handlers = XCDR (c.tag); return unbind_to (speccount, c.val); @@ -1851,6 +1869,8 @@ { /* who knows how much has been initialized? Safest bet is just to bomb out immediately. */ + /* let's not use stderr_out() here, because that does a bunch of + things that might not be safe yet. */ fprintf (stderr, "Error before initialization is complete!\n"); abort (); } @@ -2036,16 +2056,25 @@ for (;;) Fsignal (sig, data); } - -static Lisp_Object -call_with_suspended_errors_1 (Lisp_Object opaque_arg) +#ifdef ERROR_CHECK_TYPECHECK +void +check_error_state_sanity (void) { - Lisp_Object val; - Lisp_Object *kludgy_args = (Lisp_Object *) get_opaque_ptr (opaque_arg); - PRIMITIVE_FUNCALL (val, get_opaque_ptr (kludgy_args[0]), - kludgy_args + 2, XINT (kludgy_args[1])); - return val; + struct catchtag *c; + int found_error_tag = 0; + + for (c = catchlist; c; c = c->next) + { + if (EQ (c->tag, Qunbound_suspended_errors_tag)) + { + found_error_tag = 1; + break; + } + } + + assert (found_error_tag || NILP (Vcurrent_error_state)); } +#endif static Lisp_Object restore_current_warning_class (Lisp_Object warning_class) @@ -2061,6 +2090,25 @@ return Qnil; } +static Lisp_Object +call_with_suspended_errors_1 (Lisp_Object opaque_arg) +{ + Lisp_Object val; + Lisp_Object *kludgy_args = (Lisp_Object *) get_opaque_ptr (opaque_arg); + Lisp_Object no_error = kludgy_args[2]; + int speccount = specpdl_depth (); + + if (!EQ (Vcurrent_error_state, no_error)) + { + record_unwind_protect (restore_current_error_state, + Vcurrent_error_state); + Vcurrent_error_state = no_error; + } + PRIMITIVE_FUNCALL (val, get_opaque_ptr (kludgy_args[0]), + kludgy_args + 3, XINT (kludgy_args[1])); + return unbind_to (speccount, val); +} + /* Many functions would like to do one of three things if an error occurs: @@ -2083,8 +2131,8 @@ { va_list vargs; int speccount; - Lisp_Object kludgy_args[22]; - Lisp_Object *args = kludgy_args + 2; + Lisp_Object kludgy_args[23]; + Lisp_Object *args = kludgy_args + 3; int i; Lisp_Object no_error; @@ -2126,7 +2174,7 @@ return val; } - speccount = specpdl_depth(); + speccount = specpdl_depth (); if (NILP (class) || NILP (Vcurrent_warning_class)) { /* If we're currently calling for no warnings, then make it so. @@ -2137,12 +2185,6 @@ Vcurrent_warning_class); Vcurrent_warning_class = class; } - if (!EQ (Vcurrent_error_state, no_error)) - { - record_unwind_protect (restore_current_error_state, - Vcurrent_error_state); - Vcurrent_error_state = no_error; - } { int threw; @@ -2154,6 +2196,7 @@ GCPRO2 (opaque1, opaque2); kludgy_args[0] = opaque2; kludgy_args[1] = make_int (nargs); + kludgy_args[2] = no_error; the_retval = internal_catch (Qunbound_suspended_errors_tag, call_with_suspended_errors_1, opaque1, &threw); @@ -5057,7 +5100,7 @@ /* XEmacs change: increase these values. */ max_specpdl_size = 3000; max_lisp_eval_depth = 500; -#if 0 /* no longer used */ +#ifdef DEFEND_AGAINST_THROW_RECURSION throw_level = 0; #endif } diff -r 9f011ab08d48 -r 2f8bb876ab1d src/event-Xt.c --- a/src/event-Xt.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/event-Xt.c Mon Aug 13 11:16:07 2007 +0200 @@ -65,16 +65,6 @@ #include "offix.h" #endif -#ifdef WINDOWSNT -/* Hmm, under unix we want X modifiers, under NT we want X modifiers if - we are running X and Windows modifiers otherwise. - gak. This is a kludge until we support multiple native GUIs! -*/ -#undef MOD_ALT -#undef MOD_CONTROL -#undef MOD_SHIFT -#endif - #include "events-mod.h" static void enqueue_Xt_dispatch_event (Lisp_Object event); @@ -1124,7 +1114,7 @@ case ButtonPress: case ButtonRelease: { - unsigned int modifiers = 0; + int modifiers = 0; int shift_p, lock_p; Bool key_event_p = (x_event->type == KeyPress); unsigned int *state = @@ -1151,11 +1141,11 @@ x_handle_sticky_modifiers (x_event, d); - if (*state & ControlMask) modifiers |= MOD_CONTROL; - if (*state & xd->MetaMask) modifiers |= MOD_META; - if (*state & xd->SuperMask) modifiers |= MOD_SUPER; - if (*state & xd->HyperMask) modifiers |= MOD_HYPER; - if (*state & xd->AltMask) modifiers |= MOD_ALT; + if (*state & ControlMask) modifiers |= XEMACS_MOD_CONTROL; + if (*state & xd->MetaMask) modifiers |= XEMACS_MOD_META; + if (*state & xd->SuperMask) modifiers |= XEMACS_MOD_SUPER; + if (*state & xd->HyperMask) modifiers |= XEMACS_MOD_HYPER; + if (*state & xd->AltMask) modifiers |= XEMACS_MOD_ALT; /* Ignore the Caps_Lock key if: - any other modifiers are down, so that Caps_Lock doesn't @@ -1168,7 +1158,7 @@ lock_p = *state & LockMask; if (shift_p || lock_p) - modifiers |= MOD_SHIFT; + modifiers |= XEMACS_MOD_SHIFT; if (key_event_p) { @@ -1200,7 +1190,7 @@ ! (CHAR_OR_CHAR_INTP (keysym) && keysym_obeys_caps_lock_p ((KeySym) XCHAR_OR_CHAR_INT (keysym), d))) - modifiers &= (~MOD_SHIFT); + modifiers &= (~XEMACS_MOD_SHIFT); /* If this key contains two distinct keysyms, that is, "shift" generates a different keysym than the @@ -1212,13 +1202,13 @@ in the modifiers slot. Neither the characters "a", "A", "2", nor "@" normally have the shift bit set. However, "F1" normally does. */ - if (modifiers & MOD_SHIFT) + if (modifiers & XEMACS_MOD_SHIFT) { int Mode_switch_p = *state & xd->ModeMask; KeySym bot = XLookupKeysym (ev, Mode_switch_p ? 2 : 0); KeySym top = XLookupKeysym (ev, Mode_switch_p ? 3 : 1); if (top && bot && top != bot) - modifiers &= ~MOD_SHIFT; + modifiers &= ~XEMACS_MOD_SHIFT; } emacs_event->event_type = key_press_event; emacs_event->timestamp = ev->time; @@ -1255,7 +1245,7 @@ { XMotionEvent *ev = &x_event->xmotion; struct frame *frame = x_window_to_frame (d, ev->window); - unsigned int modifiers = 0; + int modifiers = 0; XMotionEvent event2; if (! frame) @@ -1284,12 +1274,12 @@ emacs_event->timestamp = ev->time; emacs_event->event.motion.x = ev->x; emacs_event->event.motion.y = ev->y; - if (ev->state & ShiftMask) modifiers |= MOD_SHIFT; - if (ev->state & ControlMask) modifiers |= MOD_CONTROL; - if (ev->state & xd->MetaMask) modifiers |= MOD_META; - if (ev->state & xd->SuperMask) modifiers |= MOD_SUPER; - if (ev->state & xd->HyperMask) modifiers |= MOD_HYPER; - if (ev->state & xd->AltMask) modifiers |= MOD_ALT; + if (ev->state & ShiftMask) modifiers |= XEMACS_MOD_SHIFT; + if (ev->state & ControlMask) modifiers |= XEMACS_MOD_CONTROL; + if (ev->state & xd->MetaMask) modifiers |= XEMACS_MOD_META; + if (ev->state & xd->SuperMask) modifiers |= XEMACS_MOD_SUPER; + if (ev->state & xd->HyperMask) modifiers |= XEMACS_MOD_HYPER; + if (ev->state & xd->AltMask) modifiers |= XEMACS_MOD_ALT; /* Currently ignores Shift_Lock but probably shouldn't (but it definitely should ignore Caps_Lock). */ emacs_event->event.motion.modifiers = modifiers; @@ -1305,7 +1295,9 @@ #ifdef HAVE_OFFIX_DND if (DndIsDropMessage(x_event)) { - unsigned int state, modifiers = 0, button=0; + unsigned int state; + int modifiers = 0; + unsigned int button=0; struct frame *frame = x_any_window_to_frame (d, ev->window); Extbyte *data; unsigned long size, dtype; @@ -1324,12 +1316,12 @@ state=DndDragButtons(x_event); - if (state & ShiftMask) modifiers |= MOD_SHIFT; - if (state & ControlMask) modifiers |= MOD_CONTROL; - if (state & xd->MetaMask) modifiers |= MOD_META; - if (state & xd->SuperMask) modifiers |= MOD_SUPER; - if (state & xd->HyperMask) modifiers |= MOD_HYPER; - if (state & xd->AltMask) modifiers |= MOD_ALT; + if (state & ShiftMask) modifiers |= XEMACS_MOD_SHIFT; + if (state & ControlMask) modifiers |= XEMACS_MOD_CONTROL; + if (state & xd->MetaMask) modifiers |= XEMACS_MOD_META; + if (state & xd->SuperMask) modifiers |= XEMACS_MOD_SUPER; + if (state & xd->HyperMask) modifiers |= XEMACS_MOD_HYPER; + if (state & xd->AltMask) modifiers |= XEMACS_MOD_ALT; if (state & Button5Mask) button = Button5; if (state & Button4Mask) button = Button4; @@ -1463,6 +1455,7 @@ case FocusIn: case FocusOut: FROB(xfocus, window); break; case VisibilityNotify: FROB(xvisibility, window); break; + case CreateNotify: FROB(xcreatewindow, window); break; default: w = x_event->xany.window; *x_event_copy = *x_event; @@ -1722,6 +1715,25 @@ } static void +emacs_Xt_force_event_pending (struct frame* f) +{ + XEvent event; + + Display* dpy = DEVICE_X_DISPLAY (XDEVICE (FRAME_DEVICE (f))); + event.xclient.type = ClientMessage; + event.xclient.display = dpy; + event.xclient.message_type = XInternAtom (dpy, "BumpQueue", False); + event.xclient.format = 32; + event.xclient.window = 0; + + /* Send the drop message */ + XSendEvent(dpy, XtWindow (FRAME_X_SHELL_WIDGET (f)), + True, NoEventMask, &event); + /* Force event pending to check the X queue. */ + quit_check_signal_tick_count++; +} + +static void emacs_Xt_handle_magic_event (Lisp_Event *emacs_event) { /* This function can GC */ @@ -1834,6 +1846,9 @@ #endif break; + case CreateNotify: + printf ("window created\n"); + break; default: break; } @@ -2295,7 +2310,7 @@ char *buf = alloca_array (char, XSTRING_LENGTH (f->name) + 4); sprintf (buf, " \"%s\"", XSTRING_DATA (f->name)); write_string_to_stdio_stream (stderr, 0, (Bufbyte *) buf, 0, - strlen (buf), Qterminal); + strlen (buf), Qterminal, 1); } stderr_out ("\n"); } @@ -3080,6 +3095,7 @@ { Xt_event_stream = xnew (struct event_stream); Xt_event_stream->event_pending_p = emacs_Xt_event_pending_p; + Xt_event_stream->force_event_pending = emacs_Xt_force_event_pending; Xt_event_stream->next_event_cb = emacs_Xt_next_event; Xt_event_stream->handle_magic_event_cb = emacs_Xt_handle_magic_event; Xt_event_stream->add_timeout_cb = emacs_Xt_add_timeout; diff -r 9f011ab08d48 -r 2f8bb876ab1d src/event-msw.c --- a/src/event-msw.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/event-msw.c Mon Aug 13 11:16:07 2007 +0200 @@ -1,7 +1,7 @@ /* The mswindows event_stream interface. Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 1996 Ben Wing. + Copyright (C) 1996, 2000 Ben Wing. Copyright (C) 1997 Jonathan Harris. This file is part of XEmacs. @@ -41,6 +41,7 @@ #endif #ifdef HAVE_MENUBARS +# include "menubar.h" # include "menubar-msw.h" #endif @@ -73,6 +74,10 @@ #include #include +#if !(defined(__CYGWIN32__) || defined(__MINGW32__)) +# include /* For IShellLink */ +#endif + #if defined (__CYGWIN32__) && (CYGWIN_VERSION_DLL_MAJOR < 20) typedef NMHDR *LPNMHDR; #endif @@ -140,7 +145,7 @@ /* These are Lisp integers; see DEFVARS in this file for description. */ int mswindows_dynamic_frame_resize; -int mswindows_meta_activates_menu; +int mswindows_alt_by_itself_activates_menu; int mswindows_num_mouse_buttons; int mswindows_mouse_button_max_skew_x; int mswindows_mouse_button_max_skew_y; @@ -179,11 +184,11 @@ struct ntpipe_slurp_stream_shared_data { HANDLE hev_thread; /* Our thread blocks on this, signaled by caller */ - /* This is a manual-reset object. */ + /* This is a manual-reset object. */ HANDLE hev_caller; /* Caller blocks on this, and we signal it */ - /* This is a manual-reset object. */ + /* This is a manual-reset object. */ HANDLE hev_unsleep; /* Pipe read delay is canceled if this is set */ - /* This is a manual-reset object. */ + /* This is a manual-reset object. */ HANDLE hpipe; /* Pipe read end handle. */ LONG die_p; /* Thread must exit ASAP if non-zero */ BOOL eof_p : 1; /* Set when thread saw EOF */ @@ -222,7 +227,7 @@ } static struct ntpipe_slurp_stream_shared_data* -slurper_allocate_shared_data() +slurper_allocate_shared_data (void) { int i=0; for (i=0; ievent_type == timeout_event || match->event_type == key_press_event); @@ -1221,7 +1226,7 @@ GCPRO1 (result); if (NILP(mswindows_error_caught_in_modal_loop)) - result = mswindows_protect_modal_loop (mswindows_unsafe_pump_events, Qnil); + result = mswindows_protect_modal_loop (mswindows_unsafe_pump_events, Qnil); UNGCPRO; return result; } @@ -1231,7 +1236,7 @@ * QUITP, and are interesting in keyboard messages only. */ static void -mswindows_drain_windows_queue () +mswindows_drain_windows_queue (void) { MSG msg; @@ -1243,20 +1248,29 @@ /* We have to translate messages that are not sent to the main window. This is so that key presses work ok in things like edit fields. However, we *musn't* translate message for the - main window as this is handled in the wnd proc. */ - if (GetWindowLong (msg.hwnd, GWL_STYLE) & WS_CHILD) + main window as this is handled in the wnd proc. + We also have to avoid generating paint magic events for windows + that aren't XEmacs frames */ + if (GetWindowLong (msg.hwnd, GWL_STYLE) & (WS_CHILD|WS_POPUP)) { TranslateMessage (&msg); } else if (msg.message == WM_PAINT) { + struct mswindows_frame* msframe; + /* hdc will be NULL unless this is a subwindow - in which case we shouldn't have received a paint message for it here. */ assert (msg.wParam == 0); /* Queue a magic event for handling when safe */ - mswindows_enqueue_magic_event (msg.hwnd, WM_PAINT); - + msframe = FRAME_MSWINDOWS_DATA ( + XFRAME (mswindows_find_frame (msg.hwnd))); + if (!msframe->paint_pending) + { + msframe->paint_pending = 1; + mswindows_enqueue_magic_event (msg.hwnd, WM_PAINT); + } /* Don't dispatch. WM_PAINT is always the last message in the queue so it's OK to just return. */ return; @@ -1355,48 +1369,51 @@ { mswindows_drain_windows_queue (); } -#ifdef HAVE_TTY - /* Look for a TTY event */ - for (i = 0; i < MAXDESC-1; i++) + else { - /* To avoid race conditions (among other things, an infinite - loop when called from Fdiscard_input()), we must return - user events ahead of process events. */ - if (FD_ISSET (i, &temp_mask) && FD_ISSET (i, &tty_only_mask)) +#ifdef HAVE_TTY + /* Look for a TTY event */ + for (i = 0; i < MAXDESC-1; i++) { - struct console *c = tty_find_console_from_fd (i); - Lisp_Object emacs_event = Fmake_event (Qnil, Qnil); - Lisp_Event* event = XEVENT (emacs_event); - - assert (c); - if (read_event_from_tty_or_stream_desc (event, c, i)) + /* To avoid race conditions (among other things, an infinite + loop when called from Fdiscard_input()), we must return + user events ahead of process events. */ + if (FD_ISSET (i, &temp_mask) && FD_ISSET (i, &tty_only_mask)) { - mswindows_enqueue_dispatch_event (emacs_event); - return; + struct console *c = tty_find_console_from_fd (i); + Lisp_Object emacs_event = Fmake_event (Qnil, Qnil); + Lisp_Event* event = XEVENT (emacs_event); + + assert (c); + if (read_event_from_tty_or_stream_desc (event, c, i)) + { + mswindows_enqueue_dispatch_event (emacs_event); + return; + } } } - } #endif - /* Look for a process event */ - for (i = 0; i < MAXDESC-1; i++) - { - if (FD_ISSET (i, &temp_mask)) + /* Look for a process event */ + for (i = 0; i < MAXDESC-1; i++) { - if (FD_ISSET (i, &process_only_mask)) + if (FD_ISSET (i, &temp_mask)) { - Lisp_Process *p = - get_process_from_usid (FD_TO_USID(i)); - - mswindows_enqueue_process_event (p); - } - else - { - /* We might get here when a fake event came - through a signal. Return a dummy event, so - that a cycle of the command loop will - occur. */ - drain_signal_event_pipe (); - mswindows_enqueue_magic_event (NULL, XM_BUMPQUEUE); + if (FD_ISSET (i, &process_only_mask)) + { + Lisp_Process *p = + get_process_from_usid (FD_TO_USID(i)); + + mswindows_enqueue_process_event (p); + } + else + { + /* We might get here when a fake event came + through a signal. Return a dummy event, so + that a cycle of the command loop will + occur. */ + drain_signal_event_pipe (); + mswindows_enqueue_magic_event (NULL, XM_BUMPQUEUE); + } } } } @@ -1415,53 +1432,53 @@ } #else /* Now try getting a message or process event */ - active = MsgWaitForMultipleObjects (mswindows_waitable_count, - mswindows_waitable_handles, - FALSE, badly_p ? INFINITE : 0, - QS_ALLINPUT); - - /* This will assert if handle being waited for becomes abandoned. - Not the case currently tho */ - assert ((!badly_p && active == WAIT_TIMEOUT) || - (active >= WAIT_OBJECT_0 && - active <= WAIT_OBJECT_0 + mswindows_waitable_count)); - - if (active == WAIT_TIMEOUT) - { - /* No luck trying - just return what we've already got */ - return; - } - else if (active == WAIT_OBJECT_0 + mswindows_waitable_count) - { - /* Got your message, thanks */ - mswindows_drain_windows_queue (); - } - else - { - int ix = active - WAIT_OBJECT_0; - /* First, try to find which process' output has signaled */ - Lisp_Process *p = - get_process_from_usid (HANDLE_TO_USID (mswindows_waitable_handles[ix])); - if (p != NULL) - { - /* Found a signaled process input handle */ - mswindows_enqueue_process_event (p); - } - else - { - /* None. This means that the process handle itself has signaled. - Remove the handle from the wait vector, and make status_notify - note the exited process */ - mswindows_waitable_handles [ix] = - mswindows_waitable_handles [--mswindows_waitable_count]; - kick_status_notify (); - /* Have to return something: there may be no accompanying - process event */ - mswindows_enqueue_magic_event (NULL, XM_BUMPQUEUE); - } - } + active = MsgWaitForMultipleObjects (mswindows_waitable_count, + mswindows_waitable_handles, + FALSE, badly_p ? INFINITE : 0, + QS_ALLINPUT); + + /* This will assert if handle being waited for becomes abandoned. + Not the case currently tho */ + assert ((!badly_p && active == WAIT_TIMEOUT) || + (active >= WAIT_OBJECT_0 && + active <= WAIT_OBJECT_0 + mswindows_waitable_count)); + + if (active == WAIT_TIMEOUT) + { + /* No luck trying - just return what we've already got */ + return; + } + else if (active == WAIT_OBJECT_0 + mswindows_waitable_count) + { + /* Got your message, thanks */ + mswindows_drain_windows_queue (); + } + else + { + int ix = active - WAIT_OBJECT_0; + /* First, try to find which process' output has signaled */ + Lisp_Process *p = + get_process_from_usid (HANDLE_TO_USID (mswindows_waitable_handles[ix])); + if (p != NULL) + { + /* Found a signaled process input handle */ + mswindows_enqueue_process_event (p); + } + else + { + /* None. This means that the process handle itself has signaled. + Remove the handle from the wait vector, and make status_notify + note the exited process */ + mswindows_waitable_handles [ix] = + mswindows_waitable_handles [--mswindows_waitable_count]; + kick_status_notify (); + /* Have to return something: there may be no accompanying + process event */ + mswindows_enqueue_magic_event (NULL, XM_BUMPQUEUE); + } + } #endif - } /* while */ + } /* while */ } /************************************************************************/ @@ -1614,36 +1631,36 @@ * Helper to do repainting - repaints can happen both from the windows * procedure and from magic events */ -void +static void mswindows_handle_paint (struct frame *frame) - { - HWND hwnd = FRAME_MSWINDOWS_HANDLE (frame); - - /* According to the docs we need to check GetUpdateRect() before - actually doing a WM_PAINT */ - if (GetUpdateRect (hwnd, NULL, FALSE)) - { - PAINTSTRUCT paintStruct; - int x, y, width, height; - - BeginPaint (hwnd, &paintStruct); - x = paintStruct.rcPaint.left; - y = paintStruct.rcPaint.top; - width = paintStruct.rcPaint.right - paintStruct.rcPaint.left; - height = paintStruct.rcPaint.bottom - paintStruct.rcPaint.top; - /* Normally we want to ignore expose events when child - windows are unmapped, however once we are in the guts of - WM_PAINT we need to make sure that we don't register - unmaps then because they will not actually occur. */ - if (!check_for_ignored_expose (frame, x, y, width, height)) - { - hold_ignored_expose_registration = 1; - mswindows_redraw_exposed_area (frame, x, y, width, height); - hold_ignored_expose_registration = 0; - } - EndPaint (hwnd, &paintStruct); - } - } +{ + HWND hwnd = FRAME_MSWINDOWS_HANDLE (frame); + + /* According to the docs we need to check GetUpdateRect() before + actually doing a WM_PAINT */ + if (GetUpdateRect (hwnd, NULL, FALSE)) + { + PAINTSTRUCT paintStruct; + int x, y, width, height; + + BeginPaint (hwnd, &paintStruct); + x = paintStruct.rcPaint.left; + y = paintStruct.rcPaint.top; + width = paintStruct.rcPaint.right - paintStruct.rcPaint.left; + height = paintStruct.rcPaint.bottom - paintStruct.rcPaint.top; + /* Normally we want to ignore expose events when child + windows are unmapped, however once we are in the guts of + WM_PAINT we need to make sure that we don't register + unmaps then because they will not actually occur. */ + if (!check_for_ignored_expose (frame, x, y, width, height)) + { + hold_ignored_expose_registration = 1; + mswindows_redraw_exposed_area (frame, x, y, width, height); + hold_ignored_expose_registration = 0; + } + EndPaint (hwnd, &paintStruct); + } +} /* * Returns 1 if a key is a real modifier or special key, which @@ -1652,7 +1669,7 @@ static int key_needs_default_processing_p (UINT vkey) { - if (mswindows_meta_activates_menu && vkey == VK_MENU) + if (mswindows_alt_by_itself_activates_menu && vkey == VK_MENU) return 1; return 0; @@ -1673,742 +1690,821 @@ struct frame *frame; struct mswindows_frame* msframe; + assert (!GetWindowLong (hwnd, GWL_USERDATA)); switch (message) - { - case WM_DESTROYCLIPBOARD: - /* We own the clipboard and someone else wants it. Delete our - cached copy of the clipboard contents so we'll ask for it from - Windows again when someone does a paste. */ - handle_selection_clear(QCLIPBOARD); - break; - - case WM_ERASEBKGND: - /* Erase background only during non-dynamic sizing */ - msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); - if (msframe->sizing && !mswindows_dynamic_frame_resize) - goto defproc; - return 1; - - case WM_CLOSE: - fobj = mswindows_find_frame (hwnd); - mswindows_enqueue_misc_user_event (fobj, Qeval, list3 (Qdelete_frame, fobj, Qt)); - break; - - case WM_KEYUP: - case WM_SYSKEYUP: - /* See Win95 comment under WM_KEYDOWN */ - { - BYTE keymap[256]; - - if (wParam == VK_CONTROL) - { - GetKeyboardState (keymap); - keymap [(lParam & 0x1000000) ? VK_RCONTROL : VK_LCONTROL] &= ~0x80; - SetKeyboardState (keymap); - } - else if (wParam == VK_MENU) - { - GetKeyboardState (keymap); - keymap [(lParam & 0x1000000) ? VK_RMENU : VK_LMENU] &= ~0x80; - SetKeyboardState (keymap); - } - }; - if (key_needs_default_processing_p (wParam)) - goto defproc; - else - break; - - case WM_KEYDOWN: - case WM_SYSKEYDOWN: - /* In some locales the right-hand Alt key is labelled AltGr. This key - * should produce alternative charcaters when combined with another key. - * eg on a German keyboard pressing AltGr+q should produce '@'. - * AltGr generates exactly the same keystrokes as LCtrl+RAlt. But if - * TranslateMessage() is called with *any* combination of Ctrl+Alt down, - * it translates as if AltGr were down. - * We get round this by removing all modifiers from the keymap before - * calling TranslateMessage() unless AltGr is *really* down. */ { - BYTE keymap[256]; - int has_AltGr = mswindows_current_layout_has_AltGr (); - int mods; - int extendedp = lParam & 0x1000000; - Lisp_Object keysym; - - GetKeyboardState (keymap); - mods = mswindows_modifier_state (keymap, has_AltGr); - - /* Handle non-printables */ - if (!NILP (keysym = mswindows_key_to_emacs_keysym (wParam, mods, - extendedp))) - mswindows_enqueue_keypress_event (hwnd, keysym, mods); - else /* Normal keys & modifiers */ - { - int quit_ch = CONSOLE_QUIT_CHAR (XCONSOLE (mswindows_find_console (hwnd))); - BYTE keymap_orig[256]; - POINT pnt = { LOWORD (GetMessagePos()), HIWORD (GetMessagePos()) }; - MSG msg; - - msg.hwnd = hwnd; - msg.message = message; - msg.wParam = wParam; - msg.lParam = lParam; - msg.time = GetMessageTime(); - msg.pt = pnt; - - /* GetKeyboardState() does not work as documented on Win95. We have - * to loosely track Left and Right modifiers on behalf of the OS, - * without screwing up Windows NT which tracks them properly. */ - if (wParam == VK_CONTROL) - keymap [extendedp ? VK_RCONTROL : VK_LCONTROL] |= 0x80; - else if (wParam == VK_MENU) - keymap [extendedp ? VK_RMENU : VK_LMENU] |= 0x80; - - memcpy (keymap_orig, keymap, 256); - - /* Remove shift modifier from an ascii character */ - mods &= ~MOD_SHIFT; - - /* Clear control and alt modifiers unless AltGr is pressed */ - keymap [VK_RCONTROL] = 0; - keymap [VK_LMENU] = 0; - if (!has_AltGr || !(keymap [VK_LCONTROL] & 0x80) - || !(keymap [VK_RMENU] & 0x80)) - { - keymap [VK_LCONTROL] = 0; - keymap [VK_CONTROL] = 0; - keymap [VK_RMENU] = 0; - keymap [VK_MENU] = 0; - } - SetKeyboardState (keymap); - - /* Maybe generate some WM_[SYS]CHARs in the queue */ - TranslateMessage (&msg); - - while (PeekMessage (&msg, hwnd, WM_CHAR, WM_CHAR, PM_REMOVE) - || PeekMessage (&msg, hwnd, WM_SYSCHAR, WM_SYSCHAR, PM_REMOVE)) - { - int mods1 = mods; - WPARAM ch = msg.wParam; - - /* If a quit char with no modifiers other than control and - shift, then mark it with a fake modifier, which is removed - upon dequeueing the event */ - /* #### This might also not withstand localization, if - quit character is not a latin-1 symbol */ - if (((quit_ch < ' ' && (mods & MOD_CONTROL) && quit_ch + 'a' - 1 == ch) - || (quit_ch >= ' ' && !(mods & MOD_CONTROL) && quit_ch == ch)) - && ((mods & ~(MOD_CONTROL | MOD_SHIFT)) == 0)) - { - mods1 |= FAKE_MOD_QUIT; - ++mswindows_quit_chars_count; - } - - mswindows_enqueue_keypress_event (hwnd, make_char(ch), mods1); - } /* while */ - SetKeyboardState (keymap_orig); - } /* else */ - } - if (key_needs_default_processing_p (wParam)) - goto defproc; - else + case WM_DESTROYCLIPBOARD: + /* We own the clipboard and someone else wants it. Delete our + cached copy of the clipboard contents so we'll ask for it from + Windows again when someone does a paste. */ + handle_selection_clear(QCLIPBOARD); + break; + + case WM_ERASEBKGND: + /* Erase background only during non-dynamic sizing */ + msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); + if (msframe->sizing && !mswindows_dynamic_frame_resize) + goto defproc; + return 1; + + case WM_CLOSE: + fobj = mswindows_find_frame (hwnd); + mswindows_enqueue_misc_user_event (fobj, Qeval, list3 (Qdelete_frame, fobj, Qt)); break; - case WM_MBUTTONDOWN: - case WM_MBUTTONUP: - /* Real middle mouse button has nothing to do with emulated one: - if one wants to exercise fingers playing chords on the mouse, - he is allowed to do that! */ - mswindows_enqueue_mouse_button_event (hwnd, message, - MAKEPOINTS (lParam), GetMessageTime()); - break; - - case WM_LBUTTONUP: - msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); - msframe->last_click_time = GetMessageTime(); - - KillTimer (hwnd, BUTTON_2_TIMER_ID); - msframe->button2_need_lbutton = 0; - if (msframe->ignore_next_lbutton_up) + case WM_KEYUP: + case WM_SYSKEYUP: + /* See Win95 comment under WM_KEYDOWN */ { - msframe->ignore_next_lbutton_up = 0; - } - else if (msframe->button2_is_down) - { - msframe->button2_is_down = 0; - msframe->ignore_next_rbutton_up = 1; - mswindows_enqueue_mouse_button_event (hwnd, WM_MBUTTONUP, - MAKEPOINTS (lParam), GetMessageTime()); - } - else - { - if (msframe->button2_need_rbutton) + BYTE keymap[256]; + int should_set_keymap = 0; + + if (wParam == VK_CONTROL) { - msframe->button2_need_rbutton = 0; - mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONDOWN, - MAKEPOINTS (lParam), GetMessageTime()); + GetKeyboardState (keymap); + keymap [(lParam & 0x1000000) ? VK_RCONTROL : VK_LCONTROL] &= ~0x80; + should_set_keymap = 1; } - mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONUP, - MAKEPOINTS (lParam), GetMessageTime()); - } - break; - - case WM_RBUTTONUP: - msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); - msframe->last_click_time = GetMessageTime(); - - KillTimer (hwnd, BUTTON_2_TIMER_ID); - msframe->button2_need_rbutton = 0; - if (msframe->ignore_next_rbutton_up) - { - msframe->ignore_next_rbutton_up = 0; - } - else if (msframe->button2_is_down) - { - msframe->button2_is_down = 0; - msframe->ignore_next_lbutton_up = 1; - mswindows_enqueue_mouse_button_event (hwnd, WM_MBUTTONUP, - MAKEPOINTS (lParam), GetMessageTime()); - } - else - { - if (msframe->button2_need_lbutton) + else if (wParam == VK_MENU) { - msframe->button2_need_lbutton = 0; - mswindows_enqueue_mouse_button_event (hwnd, WM_RBUTTONDOWN, - MAKEPOINTS (lParam), GetMessageTime()); - } - mswindows_enqueue_mouse_button_event (hwnd, WM_RBUTTONUP, - MAKEPOINTS (lParam), GetMessageTime()); - } - break; - - case WM_LBUTTONDOWN: - msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); - - if (msframe->button2_need_lbutton) - { - KillTimer (hwnd, BUTTON_2_TIMER_ID); - msframe->button2_need_lbutton = 0; - msframe->button2_need_rbutton = 0; - if (mswindows_button2_near_enough (msframe->last_click_point, MAKEPOINTS (lParam))) - { - mswindows_enqueue_mouse_button_event (hwnd, WM_MBUTTONDOWN, - MAKEPOINTS (lParam), GetMessageTime()); - msframe->button2_is_down = 1; + GetKeyboardState (keymap); + keymap [(lParam & 0x1000000) ? VK_RMENU : VK_LMENU] &= ~0x80; + should_set_keymap = 1; } - else - { - mswindows_enqueue_mouse_button_event (hwnd, WM_RBUTTONDOWN, - msframe->last_click_point, msframe->last_click_time); - mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONDOWN, - MAKEPOINTS (lParam), GetMessageTime()); - } - } - else - { - mswindows_set_chord_timer (hwnd); - msframe->button2_need_rbutton = 1; - msframe->last_click_point = MAKEPOINTS (lParam); + + if (should_set_keymap + && (message != WM_SYSKEYUP + || NILP (Vmenu_accelerator_enabled))) + SetKeyboardState (keymap); + } - msframe->last_click_time = GetMessageTime(); - break; - - case WM_RBUTTONDOWN: - msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); - - if (msframe->button2_need_rbutton) - { - KillTimer (hwnd, BUTTON_2_TIMER_ID); - msframe->button2_need_lbutton = 0; - msframe->button2_need_rbutton = 0; - if (mswindows_button2_near_enough (msframe->last_click_point, MAKEPOINTS (lParam))) - { - mswindows_enqueue_mouse_button_event (hwnd, WM_MBUTTONDOWN, - MAKEPOINTS (lParam), GetMessageTime()); - msframe->button2_is_down = 1; - } - else - { - mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONDOWN, - msframe->last_click_point, msframe->last_click_time); - mswindows_enqueue_mouse_button_event (hwnd, WM_RBUTTONDOWN, - MAKEPOINTS (lParam), GetMessageTime()); - } - } - else + if (key_needs_default_processing_p (wParam)) + goto defproc; + else + break; + + case WM_KEYDOWN: + case WM_SYSKEYDOWN: + /* In some locales the right-hand Alt key is labelled AltGr. This key + * should produce alternative charcaters when combined with another key. + * eg on a German keyboard pressing AltGr+q should produce '@'. + * AltGr generates exactly the same keystrokes as LCtrl+RAlt. But if + * TranslateMessage() is called with *any* combination of Ctrl+Alt down, + * it translates as if AltGr were down. + * We get round this by removing all modifiers from the keymap before + * calling TranslateMessage() unless AltGr is *really* down. */ { - mswindows_set_chord_timer (hwnd); - msframe->button2_need_lbutton = 1; - msframe->last_click_point = MAKEPOINTS (lParam); - } - msframe->last_click_time = GetMessageTime(); - break; - - case WM_TIMER: - if (wParam == BUTTON_2_TIMER_ID) - { - msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); - KillTimer (hwnd, BUTTON_2_TIMER_ID); - - if (msframe->button2_need_lbutton) - { - msframe->button2_need_lbutton = 0; - mswindows_enqueue_mouse_button_event (hwnd, WM_RBUTTONDOWN, - msframe->last_click_point, msframe->last_click_time); - } - else if (msframe->button2_need_rbutton) + BYTE keymap[256]; + int has_AltGr = mswindows_current_layout_has_AltGr (); + int mods; + int extendedp = lParam & 0x1000000; + Lisp_Object keysym; + + frame = XFRAME (mswindows_find_frame (hwnd)); + GetKeyboardState (keymap); + mods = mswindows_modifier_state (keymap, has_AltGr); + + /* Handle non-printables */ + if (!NILP (keysym = mswindows_key_to_emacs_keysym (wParam, mods, + extendedp))) + mswindows_enqueue_keypress_event (hwnd, keysym, mods); + else /* Normal keys & modifiers */ { - msframe->button2_need_rbutton = 0; - mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONDOWN, - msframe->last_click_point, msframe->last_click_time); - } + Emchar quit_ch = CONSOLE_QUIT_CHAR (XCONSOLE (mswindows_find_console (hwnd))); + BYTE keymap_orig[256]; + POINT pnt = { LOWORD (GetMessagePos()), HIWORD (GetMessagePos()) }; + MSG msg, tranmsg; + int potential_accelerator = 0; + int got_accelerator = 0; + + msg.hwnd = hwnd; + msg.message = message; + msg.wParam = wParam; + msg.lParam = lParam; + msg.time = GetMessageTime(); + msg.pt = pnt; + + /* GetKeyboardState() does not work as documented on Win95. We have + * to loosely track Left and Right modifiers on behalf of the OS, + * without screwing up Windows NT which tracks them properly. */ + if (wParam == VK_CONTROL) + keymap [extendedp ? VK_RCONTROL : VK_LCONTROL] |= 0x80; + else if (wParam == VK_MENU) + keymap [extendedp ? VK_RMENU : VK_LMENU] |= 0x80; + + memcpy (keymap_orig, keymap, 256); + + if (!NILP (Vmenu_accelerator_enabled) && + !(mods & XEMACS_MOD_SHIFT) && message == WM_SYSKEYDOWN) + potential_accelerator = 1; + + /* Remove shift modifier from an ascii character */ + mods &= ~XEMACS_MOD_SHIFT; + + /* Clear control and alt modifiers unless AltGr is pressed */ + keymap [VK_RCONTROL] = 0; + keymap [VK_LMENU] = 0; + if (!has_AltGr || !(keymap [VK_LCONTROL] & 0x80) + || !(keymap [VK_RMENU] & 0x80)) + { + keymap [VK_LCONTROL] = 0; + keymap [VK_CONTROL] = 0; + keymap [VK_RMENU] = 0; + keymap [VK_MENU] = 0; + } + SetKeyboardState (keymap); + + /* Maybe generate some WM_[SYS]CHARs in the queue */ + TranslateMessage (&msg); + + while (PeekMessage (&tranmsg, hwnd, WM_CHAR, WM_CHAR, PM_REMOVE) + || PeekMessage (&tranmsg, hwnd, WM_SYSCHAR, WM_SYSCHAR, PM_REMOVE)) + { + int mods1 = mods; + WPARAM ch = tranmsg.wParam; + + /* If a quit char with no modifiers other than control and + shift, then mark it with a fake modifier, which is removed + upon dequeueing the event */ + /* #### This might also not withstand localization, if + quit character is not a latin-1 symbol */ + if (((quit_ch < ' ' && (mods & XEMACS_MOD_CONTROL) && quit_ch + 'a' - 1 == ch) + || (quit_ch >= ' ' && !(mods & XEMACS_MOD_CONTROL) && quit_ch == ch)) + && ((mods & ~(XEMACS_MOD_CONTROL | XEMACS_MOD_SHIFT)) == 0)) + { + mods1 |= FAKE_MOD_QUIT; + ++mswindows_quit_chars_count; + } + else if (potential_accelerator && !got_accelerator && + msw_char_is_accelerator (frame, ch)) + { + got_accelerator = 1; + break; + } + mswindows_enqueue_keypress_event (hwnd, make_char (ch), mods1); + } /* while */ + SetKeyboardState (keymap_orig); + /* This generates WM_SYSCHAR messages, which are interpreted + by DefWindowProc as the menu selections. */ + if (got_accelerator) + { + TranslateMessage (&msg); + goto defproc; + } + } /* else */ } - else - assert ("Spurious timer fired" == 0); - break; - - case WM_MOUSEMOVE: - /* Optimization: don't report mouse movement while size is changing */ - msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); - if (!msframe->sizing) - { - /* When waiting for the second mouse button to finish - button2 emulation, and have moved too far, just pretend - as if timer has expired. This improves drag-select feedback */ - if ((msframe->button2_need_lbutton || msframe->button2_need_rbutton) - && !mswindows_button2_near_enough (msframe->last_click_point, - MAKEPOINTS (lParam))) + if (key_needs_default_processing_p (wParam)) + goto defproc; + else + break; + + case WM_MBUTTONDOWN: + case WM_MBUTTONUP: + /* Real middle mouse button has nothing to do with emulated one: + if one wants to exercise fingers playing chords on the mouse, + he is allowed to do that! */ + mswindows_enqueue_mouse_button_event (hwnd, message, + MAKEPOINTS (lParam), GetMessageTime()); + break; + + case WM_LBUTTONUP: + msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); + msframe->last_click_time = GetMessageTime(); + + KillTimer (hwnd, BUTTON_2_TIMER_ID); + msframe->button2_need_lbutton = 0; + if (msframe->ignore_next_lbutton_up) + { + msframe->ignore_next_lbutton_up = 0; + } + else if (msframe->button2_is_down) + { + msframe->button2_is_down = 0; + msframe->ignore_next_rbutton_up = 1; + mswindows_enqueue_mouse_button_event (hwnd, WM_MBUTTONUP, + MAKEPOINTS (lParam), GetMessageTime()); + } + else + { + if (msframe->button2_need_rbutton) + { + msframe->button2_need_rbutton = 0; + mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONDOWN, + MAKEPOINTS (lParam), GetMessageTime()); + } + mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONUP, + MAKEPOINTS (lParam), GetMessageTime()); + } + break; + + case WM_RBUTTONUP: + msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); + msframe->last_click_time = GetMessageTime(); + + KillTimer (hwnd, BUTTON_2_TIMER_ID); + msframe->button2_need_rbutton = 0; + if (msframe->ignore_next_rbutton_up) + { + msframe->ignore_next_rbutton_up = 0; + } + else if (msframe->button2_is_down) + { + msframe->button2_is_down = 0; + msframe->ignore_next_lbutton_up = 1; + mswindows_enqueue_mouse_button_event (hwnd, WM_MBUTTONUP, + MAKEPOINTS (lParam), GetMessageTime()); + } + else + { + if (msframe->button2_need_lbutton) + { + msframe->button2_need_lbutton = 0; + mswindows_enqueue_mouse_button_event (hwnd, WM_RBUTTONDOWN, + MAKEPOINTS (lParam), GetMessageTime()); + } + mswindows_enqueue_mouse_button_event (hwnd, WM_RBUTTONUP, + MAKEPOINTS (lParam), GetMessageTime()); + } + break; + + case WM_LBUTTONDOWN: + msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); + + if (msframe->button2_need_lbutton) { KillTimer (hwnd, BUTTON_2_TIMER_ID); - SendMessage (hwnd, WM_TIMER, BUTTON_2_TIMER_ID, 0); + msframe->button2_need_lbutton = 0; + msframe->button2_need_rbutton = 0; + if (mswindows_button2_near_enough (msframe->last_click_point, MAKEPOINTS (lParam))) + { + mswindows_enqueue_mouse_button_event (hwnd, WM_MBUTTONDOWN, + MAKEPOINTS (lParam), GetMessageTime()); + msframe->button2_is_down = 1; + } + else + { + mswindows_enqueue_mouse_button_event (hwnd, WM_RBUTTONDOWN, + msframe->last_click_point, msframe->last_click_time); + mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONDOWN, + MAKEPOINTS (lParam), GetMessageTime()); + } } - - emacs_event = Fmake_event (Qnil, Qnil); - event = XEVENT(emacs_event); - - event->channel = mswindows_find_frame(hwnd); - event->timestamp = GetMessageTime(); - event->event_type = pointer_motion_event; - event->event.motion.x = MAKEPOINTS(lParam).x; - event->event.motion.y = MAKEPOINTS(lParam).y; - event->event.motion.modifiers = mswindows_modifier_state (NULL, 0); - - mswindows_enqueue_dispatch_event (emacs_event); - } - break; - - case WM_CANCELMODE: - ReleaseCapture (); - /* Queue a `cancel-mode-internal' misc user event, so mouse - selection would be canceled if any */ - mswindows_enqueue_misc_user_event (mswindows_find_frame (hwnd), - Qcancel_mode_internal, Qnil); - break; - - case WM_NOTIFY: - { - LPNMHDR nmhdr = (LPNMHDR)lParam; - - if (nmhdr->code == TTN_NEEDTEXT) + else { -#ifdef HAVE_TOOLBARS - LPTOOLTIPTEXT tttext = (LPTOOLTIPTEXT)lParam; - Lisp_Object btext; - - /* find out which toolbar */ - frame = XFRAME (mswindows_find_frame (hwnd)); - btext = mswindows_get_toolbar_button_text ( frame, - nmhdr->idFrom ); - - tttext->lpszText = NULL; - tttext->hinst = NULL; - - if (!NILP(btext)) - { - /* I think this is safe since the text will only go away - when the toolbar does...*/ - TO_EXTERNAL_FORMAT (LISP_STRING, btext, - C_STRING_ALLOCA, tttext->lpszText, - Qnative); - } -#endif + mswindows_set_chord_timer (hwnd); + msframe->button2_need_rbutton = 1; + msframe->last_click_point = MAKEPOINTS (lParam); } - /* handle tree view callbacks */ - else if (nmhdr->code == TVN_SELCHANGED) - { - NM_TREEVIEW* ptree = (NM_TREEVIEW*)lParam; - frame = XFRAME (mswindows_find_frame (hwnd)); - mswindows_handle_gui_wm_command (frame, 0, ptree->itemNew.lParam); - } - /* handle tab control callbacks */ - else if (nmhdr->code == TCN_SELCHANGE) + msframe->last_click_time = GetMessageTime(); + break; + + case WM_RBUTTONDOWN: + msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); + + if (msframe->button2_need_rbutton) { - TC_ITEM item; - int idx = SendMessage (nmhdr->hwndFrom, TCM_GETCURSEL, 0, 0); - frame = XFRAME (mswindows_find_frame (hwnd)); - - item.mask = TCIF_PARAM; - SendMessage (nmhdr->hwndFrom, TCM_GETITEM, (WPARAM)idx, - (LPARAM)&item); - - mswindows_handle_gui_wm_command (frame, 0, item.lParam); - } - } - break; - - case WM_PAINT: - /* hdc will be NULL unless this is a subwindow - in which case we - shouldn't have received a paint message for it here. */ - assert (wParam == 0); - - /* Can't queue a magic event because windows goes modal and sends paint - messages directly to the windows procedure when doing solid drags - and the message queue doesn't get processed. */ - mswindows_handle_paint (XFRAME (mswindows_find_frame (hwnd))); - break; - - case WM_SIZE: - /* We only care about this message if our size has really changed */ - if (wParam==SIZE_RESTORED || wParam==SIZE_MAXIMIZED || wParam==SIZE_MINIMIZED) - { - RECT rect; - int columns, rows; - - fobj = mswindows_find_frame (hwnd); - frame = XFRAME (fobj); - msframe = FRAME_MSWINDOWS_DATA (frame); - - /* We cannot handle frame map and unmap hooks right in - this routine, because these may throw. We queue - magic events to run these hooks instead - kkm */ - - if (wParam==SIZE_MINIMIZED) - { - /* Iconified */ - FRAME_VISIBLE_P (frame) = 0; - mswindows_enqueue_magic_event (hwnd, XM_UNMAPFRAME); + KillTimer (hwnd, BUTTON_2_TIMER_ID); + msframe->button2_need_lbutton = 0; + msframe->button2_need_rbutton = 0; + if (mswindows_button2_near_enough (msframe->last_click_point, MAKEPOINTS (lParam))) + { + mswindows_enqueue_mouse_button_event (hwnd, WM_MBUTTONDOWN, + MAKEPOINTS (lParam), GetMessageTime()); + msframe->button2_is_down = 1; + } + else + { + mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONDOWN, + msframe->last_click_point, msframe->last_click_time); + mswindows_enqueue_mouse_button_event (hwnd, WM_RBUTTONDOWN, + MAKEPOINTS (lParam), GetMessageTime()); + } } else { - GetClientRect(hwnd, &rect); - FRAME_PIXWIDTH(frame) = rect.right; - FRAME_PIXHEIGHT(frame) = rect.bottom; - - pixel_to_real_char_size (frame, rect.right, rect.bottom, - &FRAME_MSWINDOWS_CHARWIDTH (frame), - &FRAME_MSWINDOWS_CHARHEIGHT (frame)); - - pixel_to_char_size (frame, rect.right, rect.bottom, &columns, &rows); - change_frame_size (frame, rows, columns, 1); - - /* If we are inside frame creation, we have to apply geometric - properties now. */ - if (FRAME_MSWINDOWS_TARGET_RECT (frame)) + mswindows_set_chord_timer (hwnd); + msframe->button2_need_lbutton = 1; + msframe->last_click_point = MAKEPOINTS (lParam); + } + msframe->last_click_time = GetMessageTime(); + break; + + case WM_TIMER: + if (wParam == BUTTON_2_TIMER_ID) + { + msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); + KillTimer (hwnd, BUTTON_2_TIMER_ID); + + if (msframe->button2_need_lbutton) + { + msframe->button2_need_lbutton = 0; + mswindows_enqueue_mouse_button_event (hwnd, WM_RBUTTONDOWN, + msframe->last_click_point, msframe->last_click_time); + } + else if (msframe->button2_need_rbutton) + { + msframe->button2_need_rbutton = 0; + mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONDOWN, + msframe->last_click_point, msframe->last_click_time); + } + } + else + assert ("Spurious timer fired" == 0); + break; + + case WM_MOUSEMOVE: + /* Optimization: don't report mouse movement while size is changing */ + msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); + if (!msframe->sizing) + { + /* When waiting for the second mouse button to finish + button2 emulation, and have moved too far, just pretend + as if timer has expired. This improves drag-select feedback */ + if ((msframe->button2_need_lbutton || msframe->button2_need_rbutton) + && !mswindows_button2_near_enough (msframe->last_click_point, + MAKEPOINTS (lParam))) { - /* Yes, we have to size again */ - mswindows_size_frame_internal ( frame, - FRAME_MSWINDOWS_TARGET_RECT - (frame)); - /* Reset so we do not get here again. The SetWindowPos call in - * mswindows_size_frame_internal can cause recursion here. */ - if (FRAME_MSWINDOWS_TARGET_RECT (frame)) - { - xfree (FRAME_MSWINDOWS_TARGET_RECT (frame)); - FRAME_MSWINDOWS_TARGET_RECT (frame) = 0; - } + KillTimer (hwnd, BUTTON_2_TIMER_ID); + SendMessage (hwnd, WM_TIMER, BUTTON_2_TIMER_ID, 0); + } + + emacs_event = Fmake_event (Qnil, Qnil); + event = XEVENT(emacs_event); + + event->channel = mswindows_find_frame(hwnd); + event->timestamp = GetMessageTime(); + event->event_type = pointer_motion_event; + event->event.motion.x = MAKEPOINTS(lParam).x; + event->event.motion.y = MAKEPOINTS(lParam).y; + event->event.motion.modifiers = mswindows_modifier_state (NULL, 0); + + mswindows_enqueue_dispatch_event (emacs_event); + } + break; + + case WM_CANCELMODE: + ReleaseCapture (); + /* Queue a `cancel-mode-internal' misc user event, so mouse + selection would be canceled if any */ + mswindows_enqueue_misc_user_event (mswindows_find_frame (hwnd), + Qcancel_mode_internal, Qnil); + break; + + case WM_NOTIFY: + { + LPNMHDR nmhdr = (LPNMHDR)lParam; + + if (nmhdr->code == TTN_NEEDTEXT) + { +#ifdef HAVE_TOOLBARS + LPTOOLTIPTEXT tttext = (LPTOOLTIPTEXT)lParam; + Lisp_Object btext; + + /* find out which toolbar */ + frame = XFRAME (mswindows_find_frame (hwnd)); + btext = mswindows_get_toolbar_button_text ( frame, + nmhdr->idFrom ); + + tttext->lpszText = NULL; + tttext->hinst = NULL; + + if (!NILP(btext)) + { + /* I think this is safe since the text will only go away + when the toolbar does...*/ + TO_EXTERNAL_FORMAT (LISP_STRING, btext, + C_STRING_ALLOCA, tttext->lpszText, + Qnative); + } +#endif + } + /* handle tree view callbacks */ + else if (nmhdr->code == TVN_SELCHANGED) + { + NM_TREEVIEW* ptree = (NM_TREEVIEW*)lParam; + frame = XFRAME (mswindows_find_frame (hwnd)); + mswindows_handle_gui_wm_command (frame, 0, ptree->itemNew.lParam); + } + /* handle tab control callbacks */ + else if (nmhdr->code == TCN_SELCHANGE) + { + TC_ITEM item; + int idx = SendMessage (nmhdr->hwndFrom, TCM_GETCURSEL, 0, 0); + frame = XFRAME (mswindows_find_frame (hwnd)); + + item.mask = TCIF_PARAM; + SendMessage (nmhdr->hwndFrom, TCM_GETITEM, (WPARAM)idx, + (LPARAM)&item); + + mswindows_handle_gui_wm_command (frame, 0, item.lParam); + } + } + break; + + case WM_PAINT: + /* hdc will be NULL unless this is a subwindow - in which case we + shouldn't have received a paint message for it here. */ + assert (wParam == 0); + + /* Can't queue a magic event because windows goes modal and sends paint + messages directly to the windows procedure when doing solid drags + and the message queue doesn't get processed. */ + mswindows_handle_paint (XFRAME (mswindows_find_frame (hwnd))); + break; + + case WM_SIZE: + /* We only care about this message if our size has really changed */ + if (wParam==SIZE_RESTORED || wParam==SIZE_MAXIMIZED || wParam==SIZE_MINIMIZED) + { + RECT rect; + int columns, rows; + + fobj = mswindows_find_frame (hwnd); + frame = XFRAME (fobj); + msframe = FRAME_MSWINDOWS_DATA (frame); + + /* We cannot handle frame map and unmap hooks right in + this routine, because these may throw. We queue + magic events to run these hooks instead - kkm */ + + if (wParam==SIZE_MINIMIZED) + { + /* Iconified */ + FRAME_VISIBLE_P (frame) = 0; + mswindows_enqueue_magic_event (hwnd, XM_UNMAPFRAME); } else { - if (!msframe->sizing && !FRAME_VISIBLE_P (frame)) - mswindows_enqueue_magic_event (hwnd, XM_MAPFRAME); - FRAME_VISIBLE_P (frame) = 1; - - if (!msframe->sizing || mswindows_dynamic_frame_resize) - redisplay (); + GetClientRect(hwnd, &rect); + FRAME_PIXWIDTH(frame) = rect.right; + FRAME_PIXHEIGHT(frame) = rect.bottom; + + pixel_to_real_char_size (frame, rect.right, rect.bottom, + &FRAME_MSWINDOWS_CHARWIDTH (frame), + &FRAME_MSWINDOWS_CHARHEIGHT (frame)); + + pixel_to_char_size (frame, rect.right, rect.bottom, &columns, &rows); + change_frame_size (frame, rows, columns, 1); + + /* If we are inside frame creation, we have to apply geometric + properties now. */ + if (FRAME_MSWINDOWS_TARGET_RECT (frame)) + { + /* Yes, we have to size again */ + mswindows_size_frame_internal ( frame, + FRAME_MSWINDOWS_TARGET_RECT + (frame)); + /* Reset so we do not get here again. The SetWindowPos call in + * mswindows_size_frame_internal can cause recursion here. */ + if (FRAME_MSWINDOWS_TARGET_RECT (frame)) + { + xfree (FRAME_MSWINDOWS_TARGET_RECT (frame)); + FRAME_MSWINDOWS_TARGET_RECT (frame) = 0; + } + } + else + { + if (!msframe->sizing && !FRAME_VISIBLE_P (frame)) + mswindows_enqueue_magic_event (hwnd, XM_MAPFRAME); + FRAME_VISIBLE_P (frame) = 1; + + if (!msframe->sizing || mswindows_dynamic_frame_resize) + redisplay (); + } } } - } - break; - - /* Misc magic events which only require that the frame be identified */ - case WM_SETFOCUS: - case WM_KILLFOCUS: - mswindows_enqueue_magic_event (hwnd, message); - break; - - case WM_WINDOWPOSCHANGING: - { - WINDOWPOS *wp = (LPWINDOWPOS) lParam; - WINDOWPLACEMENT wpl = { sizeof(WINDOWPLACEMENT) }; - GetWindowPlacement(hwnd, &wpl); - - /* Only interested if size is changing and we're not being iconified */ - if (wpl.showCmd != SW_SHOWMINIMIZED - && wpl.showCmd != SW_SHOWMAXIMIZED - && !(wp->flags & SWP_NOSIZE)) + break; + + case WM_DISPLAYCHANGE: + { + struct device *d; + + fobj = mswindows_find_frame (hwnd); + frame = XFRAME (fobj); + d = XDEVICE (FRAME_DEVICE (frame)); + + DEVICE_MSWINDOWS_HORZRES(d) = LOWORD (lParam); + DEVICE_MSWINDOWS_VERTRES(d) = HIWORD (lParam); + DEVICE_MSWINDOWS_BITSPIXEL(d) = wParam; + break; + } + + /* Misc magic events which only require that the frame be identified */ + case WM_SETFOCUS: + case WM_KILLFOCUS: + mswindows_enqueue_magic_event (hwnd, message); + break; + + case WM_WINDOWPOSCHANGING: { - RECT ncsize = { 0, 0, 0, 0 }; - int pixwidth, pixheight; - AdjustWindowRectEx (&ncsize, GetWindowLong (hwnd, GWL_STYLE), - GetMenu(hwnd) != NULL, - GetWindowLong (hwnd, GWL_EXSTYLE)); - - round_size_to_real_char (XFRAME (mswindows_find_frame (hwnd)), - wp->cx - (ncsize.right - ncsize.left), - wp->cy - (ncsize.bottom - ncsize.top), - &pixwidth, &pixheight); - - /* Convert client sizes to window sizes */ - pixwidth += (ncsize.right - ncsize.left); - pixheight += (ncsize.bottom - ncsize.top); - - if (wpl.showCmd != SW_SHOWMAXIMIZED) + WINDOWPOS *wp = (LPWINDOWPOS) lParam; + WINDOWPLACEMENT wpl = { sizeof(WINDOWPLACEMENT) }; + GetWindowPlacement(hwnd, &wpl); + + /* Only interested if size is changing and we're not being iconified */ + if (wpl.showCmd != SW_SHOWMINIMIZED + && wpl.showCmd != SW_SHOWMAXIMIZED + && !(wp->flags & SWP_NOSIZE)) { - /* Adjust so that the bottom or right doesn't move if it's - * the top or left that's being changed */ - RECT rect; - GetWindowRect (hwnd, &rect); - - if (rect.left != wp->x) - wp->x += wp->cx - pixwidth; - if (rect.top != wp->y) - wp->y += wp->cy - pixheight; + RECT ncsize = { 0, 0, 0, 0 }; + int pixwidth, pixheight; + AdjustWindowRectEx (&ncsize, GetWindowLong (hwnd, GWL_STYLE), + GetMenu(hwnd) != NULL, + GetWindowLong (hwnd, GWL_EXSTYLE)); + + round_size_to_real_char (XFRAME (mswindows_find_frame (hwnd)), + wp->cx - (ncsize.right - ncsize.left), + wp->cy - (ncsize.bottom - ncsize.top), + &pixwidth, &pixheight); + + /* Convert client sizes to window sizes */ + pixwidth += (ncsize.right - ncsize.left); + pixheight += (ncsize.bottom - ncsize.top); + + if (wpl.showCmd != SW_SHOWMAXIMIZED) + { + /* Adjust so that the bottom or right doesn't move if it's + * the top or left that's being changed */ + RECT rect; + GetWindowRect (hwnd, &rect); + + if (rect.left != wp->x) + wp->x += wp->cx - pixwidth; + if (rect.top != wp->y) + wp->y += wp->cy - pixheight; + } + + wp->cx = pixwidth; + wp->cy = pixheight; } - - wp->cx = pixwidth; - wp->cy = pixheight; + /* DefWindowProc sends useful WM_GETMINMAXINFO message, and adjusts + window position if the user tries to track window too small */ } - /* DefWindowProc sends useful WM_GETMINMAXINFO message, and adjusts - window position if the user tries to track window too small */ - } - goto defproc; - - case WM_ENTERSIZEMOVE: - msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); - msframe->sizing = 1; - return 0; - - case WM_EXITSIZEMOVE: - msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); - msframe->sizing = 0; - /* Queue noop event */ - mswindows_enqueue_magic_event (NULL, XM_BUMPQUEUE); - return 0; + goto defproc; + + case WM_ENTERSIZEMOVE: + msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); + msframe->sizing = 1; + return 0; + + case WM_EXITSIZEMOVE: + msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); + msframe->sizing = 0; + /* Queue noop event */ + mswindows_enqueue_magic_event (NULL, XM_BUMPQUEUE); + return 0; #ifdef HAVE_SCROLLBARS - case WM_VSCROLL: - case WM_HSCROLL: - { - /* Direction of scroll is determined by scrollbar instance. */ - int code = (int) LOWORD(wParam); - int pos = (short int) HIWORD(wParam); - HWND hwndScrollBar = (HWND) lParam; - struct gcpro gcpro1, gcpro2; - - mswindows_handle_scrollbar_event (hwndScrollBar, code, pos); - GCPRO2 (emacs_event, fobj); - if (UNBOUNDP(mswindows_pump_outstanding_events())) /* Can GC */ - { - /* Error during event pumping - cancel scroll */ - SendMessage (hwndScrollBar, WM_CANCELMODE, 0, 0); - } - UNGCPRO; - break; - } - - case WM_MOUSEWHEEL: - { - int keys = LOWORD (wParam); /* Modifier key flags */ - int delta = (short) HIWORD (wParam); /* Wheel rotation amount */ - struct gcpro gcpro1, gcpro2; - - if (mswindows_handle_mousewheel_event (mswindows_find_frame (hwnd), keys, delta)) - { - GCPRO2 (emacs_event, fobj); - mswindows_pump_outstanding_events (); /* Can GC */ - UNGCPRO; - } - else - goto defproc; - break; - } + case WM_VSCROLL: + case WM_HSCROLL: + { + /* Direction of scroll is determined by scrollbar instance. */ + int code = (int) LOWORD(wParam); + int pos = (short int) HIWORD(wParam); + HWND hwndScrollBar = (HWND) lParam; + struct gcpro gcpro1, gcpro2; + + mswindows_handle_scrollbar_event (hwndScrollBar, code, pos); + GCPRO2 (emacs_event, fobj); + if (UNBOUNDP(mswindows_pump_outstanding_events())) /* Can GC */ + { + /* Error during event pumping - cancel scroll */ + SendMessage (hwndScrollBar, WM_CANCELMODE, 0, 0); + } + UNGCPRO; + break; + } + + case WM_MOUSEWHEEL: + { + int keys = LOWORD (wParam); /* Modifier key flags */ + int delta = (short) HIWORD (wParam); /* Wheel rotation amount */ + struct gcpro gcpro1, gcpro2; + + if (mswindows_handle_mousewheel_event (mswindows_find_frame (hwnd), keys, delta)) + { + GCPRO2 (emacs_event, fobj); + mswindows_pump_outstanding_events (); /* Can GC */ + UNGCPRO; + } + else + goto defproc; + break; + } #endif #ifdef HAVE_MENUBARS - case WM_INITMENU: - if (UNBOUNDP (mswindows_handle_wm_initmenu ( - (HMENU) wParam, - XFRAME (mswindows_find_frame (hwnd))))) - SendMessage (hwnd, WM_CANCELMODE, 0, 0); - break; - - case WM_INITMENUPOPUP: - if (!HIWORD(lParam)) - { - if (UNBOUNDP (mswindows_handle_wm_initmenupopup ( - (HMENU) wParam, - XFRAME (mswindows_find_frame (hwnd))))) - SendMessage (hwnd, WM_CANCELMODE, 0, 0); - } - break; + case WM_INITMENU: + if (UNBOUNDP (mswindows_handle_wm_initmenu ( + (HMENU) wParam, + XFRAME (mswindows_find_frame (hwnd))))) + SendMessage (hwnd, WM_CANCELMODE, 0, 0); + break; + + case WM_INITMENUPOPUP: + if (!HIWORD(lParam)) + { + if (UNBOUNDP (mswindows_handle_wm_initmenupopup ( + (HMENU) wParam, + XFRAME (mswindows_find_frame (hwnd))))) + SendMessage (hwnd, WM_CANCELMODE, 0, 0); + } + break; #endif /* HAVE_MENUBARS */ - case WM_COMMAND: - { - WORD id = LOWORD (wParam); - WORD nid = HIWORD (wParam); - HWND cid = (HWND)lParam; - frame = XFRAME (mswindows_find_frame (hwnd)); + case WM_COMMAND: + { + WORD id = LOWORD (wParam); + WORD nid = HIWORD (wParam); + HWND cid = (HWND)lParam; + frame = XFRAME (mswindows_find_frame (hwnd)); #ifdef HAVE_TOOLBARS - if (!NILP (mswindows_handle_toolbar_wm_command (frame, cid, id))) - break; + if (!NILP (mswindows_handle_toolbar_wm_command (frame, cid, id))) + break; #endif - /* widgets in a buffer only eval a callback for suitable events.*/ - switch (nid) - { - case BN_CLICKED: - case EN_CHANGE: - case CBN_EDITCHANGE: - case CBN_SELCHANGE: - if (!NILP (mswindows_handle_gui_wm_command (frame, cid, id))) - return 0; - } - /* menubars always must come last since the hashtables do not - always exist*/ + /* widgets in a buffer only eval a callback for suitable events.*/ + switch (nid) + { + case BN_CLICKED: + case EN_CHANGE: + case CBN_EDITCHANGE: + case CBN_SELCHANGE: + if (!NILP (mswindows_handle_gui_wm_command (frame, cid, id))) + return 0; + } + /* menubars always must come last since the hashtables do not + always exist*/ #ifdef HAVE_MENUBARS - if (!NILP (mswindows_handle_wm_command (frame, id))) - break; + if (!NILP (mswindows_handle_wm_command (frame, id))) + break; #endif - return DefWindowProc (hwnd, message, wParam, lParam); - /* Bite me - a spurious command. This used to not be able to - happen but with the introduction of widgets its now - possible. */ - } - break; - - case WM_CTLCOLORBTN: - case WM_CTLCOLORLISTBOX: - case WM_CTLCOLOREDIT: - case WM_CTLCOLORSTATIC: - case WM_CTLCOLORSCROLLBAR: - { - /* if we get an opportunity to paint a widget then do so if - there is an appropriate face */ - HWND crtlwnd = (HWND)lParam; - LONG ii = GetWindowLong (crtlwnd, GWL_USERDATA); - if (ii) - { - Lisp_Object image_instance; - VOID_TO_LISP (image_instance, ii); - if (IMAGE_INSTANCEP (image_instance) - && - IMAGE_INSTANCE_TYPE_P (image_instance, IMAGE_WIDGET)) - { - /* set colors for the buttons */ - HDC hdc = (HDC)wParam; - if (last_widget_brushed != ii) - { - if (widget_brush) - DeleteObject (widget_brush); - widget_brush = CreateSolidBrush - (COLOR_INSTANCE_MSWINDOWS_COLOR - (XCOLOR_INSTANCE - (FACE_BACKGROUND - (XIMAGE_INSTANCE_WIDGET_FACE (image_instance), - XIMAGE_INSTANCE_SUBWINDOW_FRAME (image_instance))))); - } - last_widget_brushed = ii; - SetTextColor - (hdc, - COLOR_INSTANCE_MSWINDOWS_COLOR - (XCOLOR_INSTANCE - (FACE_FOREGROUND - (XIMAGE_INSTANCE_WIDGET_FACE (image_instance), - XIMAGE_INSTANCE_SUBWINDOW_FRAME (image_instance))))); - SetBkMode (hdc, OPAQUE); - SetBkColor - (hdc, - COLOR_INSTANCE_MSWINDOWS_COLOR - (XCOLOR_INSTANCE - (FACE_BACKGROUND - (XIMAGE_INSTANCE_WIDGET_FACE (image_instance), - XIMAGE_INSTANCE_SUBWINDOW_FRAME (image_instance))))); - return (LRESULT)widget_brush; - } - } - } - goto defproc; + return DefWindowProc (hwnd, message, wParam, lParam); + /* Bite me - a spurious command. This used to not be able to + happen but with the introduction of widgets its now + possible. */ + } + break; + + case WM_CTLCOLORBTN: + case WM_CTLCOLORLISTBOX: + case WM_CTLCOLOREDIT: + case WM_CTLCOLORSTATIC: + case WM_CTLCOLORSCROLLBAR: + { + /* if we get an opportunity to paint a widget then do so if + there is an appropriate face */ + HWND crtlwnd = (HWND)lParam; + LONG ii = GetWindowLong (crtlwnd, GWL_USERDATA); + if (ii) + { + Lisp_Object image_instance; + VOID_TO_LISP (image_instance, ii); + if (IMAGE_INSTANCEP (image_instance) + && + IMAGE_INSTANCE_TYPE_P (image_instance, IMAGE_WIDGET)) + { + /* set colors for the buttons */ + HDC hdc = (HDC)wParam; + if (last_widget_brushed != ii) + { + if (widget_brush) + DeleteObject (widget_brush); + widget_brush = CreateSolidBrush + (COLOR_INSTANCE_MSWINDOWS_COLOR + (XCOLOR_INSTANCE + (FACE_BACKGROUND + (XIMAGE_INSTANCE_WIDGET_FACE (image_instance), + XIMAGE_INSTANCE_SUBWINDOW_FRAME (image_instance))))); + } + last_widget_brushed = ii; + SetTextColor + (hdc, + COLOR_INSTANCE_MSWINDOWS_COLOR + (XCOLOR_INSTANCE + (FACE_FOREGROUND + (XIMAGE_INSTANCE_WIDGET_FACE (image_instance), + XIMAGE_INSTANCE_SUBWINDOW_FRAME (image_instance))))); + SetBkMode (hdc, OPAQUE); + SetBkColor + (hdc, + COLOR_INSTANCE_MSWINDOWS_COLOR + (XCOLOR_INSTANCE + (FACE_BACKGROUND + (XIMAGE_INSTANCE_WIDGET_FACE (image_instance), + XIMAGE_INSTANCE_SUBWINDOW_FRAME (image_instance))))); + return (LRESULT)widget_brush; + } + } + } + goto defproc; #ifdef HAVE_DRAGNDROP - case WM_DROPFILES: /* implementation ripped-off from event-Xt.c */ - { - UINT filecount, i, len; - POINT point; - char* filename; -#ifdef __CYGWIN32__ - char* fname; + case WM_DROPFILES: /* implementation ripped-off from event-Xt.c */ + { + UINT filecount, i, len; + POINT point; + char* filename; + char* fname; + + Lisp_Object l_dndlist = Qnil, l_item = Qnil; + struct gcpro gcpro1, gcpro2, gcpro3; + + emacs_event = Fmake_event (Qnil, Qnil); + event = XEVENT(emacs_event); + + GCPRO3 (emacs_event, l_dndlist, l_item); + + if (!DragQueryPoint ((HDROP) wParam, &point)) + point.x = point.y = -1; /* outside client area */ + + event->event_type = misc_user_event; + event->channel = mswindows_find_frame(hwnd); + event->timestamp = GetMessageTime(); + event->event.misc.button = 1; /* #### Should try harder */ + event->event.misc.modifiers = mswindows_modifier_state (NULL, 0); + event->event.misc.x = point.x; + event->event.misc.y = point.y; + event->event.misc.function = Qdragdrop_drop_dispatch; + + filecount = DragQueryFile ((HDROP) wParam, 0xffffffff, NULL, 0); + for (i=0; i/ part and + * because they may contain reserved characters. But that's OK - + * they just need to be good enough to keep dragdrop.el happy. */ + fname = (char *)xmalloc (len+1); + DragQueryFile ((HANDLE) wParam, i, fname, len+1); + + /* May be a shell link aka "shortcut" - replace fname if so */ +#if !(defined(__CYGWIN32__) || defined(__MINGW32__)) + /* cygwin doesn't define this COM stuff */ + if (!stricmp (fname + strlen (fname) - 4, ".LNK")) + { + IShellLink* psl; + + if (CoCreateInstance (&CLSID_ShellLink, NULL, + CLSCTX_INPROC_SERVER, &IID_IShellLink, &psl) == S_OK) + { + IPersistFile* ppf; + + if (psl->lpVtbl->QueryInterface (psl, &IID_IPersistFile, + &ppf) == S_OK) + { + WORD wsz[MAX_PATH]; + WIN32_FIND_DATA wfd; + LPSTR resolved = (char *) xmalloc (MAX_PATH+1); + + MultiByteToWideChar (CP_ACP,0, fname, -1, wsz, MAX_PATH); + + if ((ppf->lpVtbl->Load (ppf, wsz, STGM_READ) == S_OK) && + (psl->lpVtbl->GetPath (psl, resolved, MAX_PATH, + &wfd, 0)==S_OK)) + { + xfree (fname); + fname = resolved; + len = strlen (fname); + } + + ppf->lpVtbl->Release (ppf); + } + + psl->lpVtbl->Release (psl); + } + } #endif - Lisp_Object l_dndlist = Qnil, l_item = Qnil; - struct gcpro gcpro1, gcpro2, gcpro3; - - emacs_event = Fmake_event (Qnil, Qnil); - event = XEVENT(emacs_event); - - GCPRO3 (emacs_event, l_dndlist, l_item); - - if (!DragQueryPoint ((HDROP) wParam, &point)) - point.x = point.y = -1; /* outside client area */ - - event->event_type = misc_user_event; - event->channel = mswindows_find_frame(hwnd); - event->timestamp = GetMessageTime(); - event->event.misc.button = 1; /* #### Should try harder */ - event->event.misc.modifiers = mswindows_modifier_state (NULL, 0); - event->event.misc.x = point.x; - event->event.misc.y = point.y; - event->event.misc.function = Qdragdrop_drop_dispatch; - - filecount = DragQueryFile ((HDROP) wParam, 0xffffffff, NULL, 0); - for (i=0; i/ part and - * because they may contain reserved characters. But that's OK. */ + #ifdef __CYGWIN32__ - fname = (char *)xmalloc (len+1); - DragQueryFile ((HANDLE) wParam, i, fname, len+1); - filename = xmalloc (cygwin32_win32_to_posix_path_list_buf_size (fname) + 5); - strcpy (filename, "file:"); - cygwin32_win32_to_posix_path_list (fname, filename+5); - xfree (fname); + filename = xmalloc (cygwin32_win32_to_posix_path_list_buf_size (fname) + 5); + strcpy (filename, "file:"); + cygwin32_win32_to_posix_path_list (fname, filename+5); #else - filename = (char *)xmalloc (len+6); - strcpy (filename, "file:"); - DragQueryFile ((HDROP) wParam, i, filename+5, len+1); - dostounix_filename (filename+5); + filename = (char *)xmalloc (len+6); + strcat (strcpy (filename, "file:"), fname); + dostounix_filename (filename+5); #endif - l_item = make_string (filename, strlen (filename)); - l_dndlist = Fcons (l_item, l_dndlist); - xfree (filename); - } - DragFinish ((HDROP) wParam); - - event->event.misc.object = Fcons (Qdragdrop_URL, l_dndlist); - mswindows_enqueue_dispatch_event (emacs_event); - UNGCPRO; + xfree (fname); + l_item = make_string (filename, strlen (filename)); + l_dndlist = Fcons (l_item, l_dndlist); + xfree (filename); + } + DragFinish ((HDROP) wParam); + + event->event.misc.object = Fcons (Qdragdrop_URL, l_dndlist); + mswindows_enqueue_dispatch_event (emacs_event); + UNGCPRO; + } + break; +#endif + + defproc: + default: + return DefWindowProc (hwnd, message, wParam, lParam); } - break; -#endif - - defproc: - default: - return DefWindowProc (hwnd, message, wParam, lParam); - } return (0); } @@ -2487,16 +2583,16 @@ if (has_AltGr && (keymap [VK_LCONTROL] & 0x80) && (keymap [VK_RMENU] & 0x80)) { - mods |= (keymap [VK_LMENU] & 0x80) ? MOD_META : 0; - mods |= (keymap [VK_RCONTROL] & 0x80) ? MOD_CONTROL : 0; + mods |= (keymap [VK_LMENU] & 0x80) ? XEMACS_MOD_META : 0; + mods |= (keymap [VK_RCONTROL] & 0x80) ? XEMACS_MOD_CONTROL : 0; } else { - mods |= (keymap [VK_MENU] & 0x80) ? MOD_META : 0; - mods |= (keymap [VK_CONTROL] & 0x80) ? MOD_CONTROL : 0; + mods |= (keymap [VK_MENU] & 0x80) ? XEMACS_MOD_META : 0; + mods |= (keymap [VK_CONTROL] & 0x80) ? XEMACS_MOD_CONTROL : 0; } - mods |= (keymap [VK_SHIFT] & 0x80) ? MOD_SHIFT : 0; + mods |= (keymap [VK_SHIFT] & 0x80) ? XEMACS_MOD_SHIFT : 0; return mods; } @@ -2554,8 +2650,8 @@ case VK_DELETE: return KEYSYM ("kp-delete"); case VK_HELP: return KEYSYM ("help"); #if 0 /* FSF Emacs allows these to return configurable syms/mods */ - case VK_LWIN return KEYSYM (""); - case VK_RWIN return KEYSYM (""); + case VK_LWIN return KEYSYM (""); + case VK_RWIN return KEYSYM (""); #endif case VK_APPS: return KEYSYM ("menu"); case VK_NUMPAD0: return KEYSYM ("kp-0"); @@ -2717,7 +2813,11 @@ break; case WM_PAINT: - mswindows_handle_paint (XFRAME (EVENT_CHANNEL (emacs_event))); + { + struct frame *f = XFRAME (EVENT_CHANNEL (emacs_event)); + mswindows_handle_paint (f); + (FRAME_MSWINDOWS_DATA (f))->paint_pending = 0; + } break; case WM_SETFOCUS: @@ -2778,7 +2878,7 @@ ? get_winsock_stream_waitable (XLSTREAM (instr)) : get_ntpipe_input_stream_waitable (XLSTREAM (instr))); #else - return get_ntpipe_input_stream_waitable (XLSTREAM (instr)); + return get_ntpipe_input_stream_waitable (XLSTREAM (instr)); #endif } @@ -2866,7 +2966,7 @@ emacs_event = mswindows_cancel_dispatch_event (&match_against); assert (!NILP (emacs_event)); - if (XEVENT(emacs_event)->event.key.modifiers & MOD_SHIFT) + if (XEVENT(emacs_event)->event.key.modifiers & XEMACS_MOD_SHIFT) critical_p = 1; Fdeallocate_event(emacs_event); @@ -2950,7 +3050,7 @@ USID emacs_mswindows_delete_stream_pair (Lisp_Object instream, - Lisp_Object outstream) + Lisp_Object outstream) { /* Oh nothing special here for Win32 at all */ #if defined (HAVE_UNIX_PROCESSES) @@ -3012,6 +3112,7 @@ mswindows_event_stream = xnew (struct event_stream); mswindows_event_stream->event_pending_p = emacs_mswindows_event_pending_p; + mswindows_event_stream->force_event_pending = 0; mswindows_event_stream->next_event_cb = emacs_mswindows_next_event; mswindows_event_stream->handle_magic_event_cb = emacs_mswindows_handle_magic_event; mswindows_event_stream->add_timeout_cb = emacs_mswindows_add_timeout; @@ -3052,13 +3153,16 @@ mswindows_error_caught_in_modal_loop = Qnil; staticpro (&mswindows_error_caught_in_modal_loop); - DEFVAR_BOOL ("mswindows-meta-activates-menu", &mswindows_meta_activates_menu /* -*Controls whether pressing and releasing the Meta (Alt) key should -activate the menubar. + DEFVAR_BOOL ("mswindows-alt-by-itself-activates-menu", + &mswindows_alt_by_itself_activates_menu /* +*Controls whether pressing and releasing the Alt key activates the menubar. +This applies only if no intervening key was pressed. See also +`menu-accelerator-enabled', which is probably the behavior you actually want. Default is t. */ ); - DEFVAR_BOOL ("mswindows-dynamic-frame-resize", &mswindows_dynamic_frame_resize /* + DEFVAR_BOOL ("mswindows-dynamic-frame-resize", + &mswindows_dynamic_frame_resize /* *Controls redrawing frame contents during mouse-drag or keyboard resize operation. When non-nil, the frame is redrawn while being resized. When nil, frame is not redrawn, and exposed areas are filled with default @@ -3068,8 +3172,8 @@ Default is t on fast machines, nil on slow. */ ); -/* The description copied verbatim from nt-emacs. (C) Geoff Voelker */ - DEFVAR_INT ("mswindows-mouse-button-tolerance", &mswindows_mouse_button_tolerance /* + DEFVAR_INT ("mswindows-mouse-button-tolerance", + &mswindows_mouse_button_tolerance /* *Analogue of double click interval for faking middle mouse events. The value is the minimum time in milliseconds that must elapse between left/right button down events before they are considered distinct events. @@ -3078,12 +3182,12 @@ If negative or zero, currently set system default is used instead. */ ); -/* The description copied verbatim from nt-emacs. (C) Geoff Voelker */ DEFVAR_INT ("mswindows-num-mouse-buttons", &mswindows_num_mouse_buttons /* Number of physical mouse buttons. */ ); - DEFVAR_INT ("mswindows-mouse-button-max-skew-x", &mswindows_mouse_button_max_skew_x /* + DEFVAR_INT ("mswindows-mouse-button-max-skew-x", + &mswindows_mouse_button_max_skew_x /* *Maximum horizontal distance in pixels between points in which left and right button clicks occurred for them to be translated into single middle button event. Clicks must occur in time not longer than defined @@ -3091,7 +3195,8 @@ If negative or zero, currently set system default is used instead. */ ); - DEFVAR_INT ("mswindows-mouse-button-max-skew-y", &mswindows_mouse_button_max_skew_y /* + DEFVAR_INT ("mswindows-mouse-button-max-skew-y", + &mswindows_mouse_button_max_skew_y /* *Maximum vertical distance in pixels between points in which left and right button clicks occurred for them to be translated into single middle button event. Clicks must occur in time not longer than defined @@ -3102,7 +3207,7 @@ mswindows_mouse_button_max_skew_x = 0; mswindows_mouse_button_max_skew_y = 0; mswindows_mouse_button_tolerance = 0; - mswindows_meta_activates_menu = 1; + mswindows_alt_by_itself_activates_menu = 1; } void diff -r 9f011ab08d48 -r 2f8bb876ab1d src/event-stream.c --- a/src/event-stream.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/event-stream.c Mon Aug 13 11:16:07 2007 +0200 @@ -23,6 +23,20 @@ /* Synched up with: Not in FSF. */ +/* Authorship: + + Created 1991 by Jamie Zawinski. + A great deal of work over the ages by Ben Wing (Mule-ization for 19.12, + device abstraction for 19.12/19.13, async timers for 19.14, + rewriting of focus code for 19.12, pre-idle hook for 19.12, + redoing of signal and quit handling for 19.9 and 19.12, + misc-user events to clean up menu/scrollbar handling for 19.11, + function-key-map/key-translation-map/keyboard-translate-table for + 19.13/19.14, open-dribble-file for 19.13, much other cleanup). + focus-follows-mouse from Chuck Thompson, 1995. + XIM stuff by Martin Buchholz, c. 1996?. +*/ + /* This file has been Mule-ized. */ /* @@ -38,8 +52,6 @@ /* TODO: This stuff is way too hard to maintain - needs rework. - (global-set-key "\C-p" global-map) causes a crash - need recursion check. - C-x @ h x causes a crash. The command builder should deal only with key and button events. @@ -62,14 +74,6 @@ #include #include "lisp.h" -#ifdef HAVE_X_WINDOWS -#include "console-x.h" /* for menu accelerators ... */ -#include "gui-x.h" -#include "../lwlib/lwlib.h" -#else -#define lw_menu_active 0 -#endif - #include "blocktype.h" #include "buffer.h" #include "commands.h" @@ -81,6 +85,7 @@ #include "keymap.h" #include "lstream.h" #include "macros.h" /* for defining_keyboard_macro */ +#include "menubar.h" /* #### for evil kludges. */ #include "process.h" #include "window.h" @@ -107,21 +112,22 @@ Lisp_Object Vpre_command_hook, Vpost_command_hook; Lisp_Object Qpre_command_hook, Qpost_command_hook; +/* See simple.el */ +Lisp_Object Qhandle_pre_motion_command, Qhandle_post_motion_command; + /* Hook run when XEmacs is about to be idle. */ Lisp_Object Qpre_idle_hook, Vpre_idle_hook; /* Control gratuitous keyboard focus throwing. */ int focus_follows_mouse; -#ifdef ILL_CONCEIVED_HOOK +#if 0 /* FSF Emacs crap */ /* Hook run after a command if there's no more input soon. */ Lisp_Object Qpost_command_idle_hook, Vpost_command_idle_hook; /* Delay time in microseconds before running post-command-idle-hook. */ int post_command_idle_delay; -#endif /* ILL_CONCEIVED_HOOK */ - -#ifdef DEFERRED_ACTION_CRAP + /* List of deferred actions to be performed at a later time. The precise format isn't relevant here; we just check whether it is nil. */ Lisp_Object Vdeferred_action_list; @@ -129,7 +135,7 @@ /* Function to call to handle deferred actions, when there are any. */ Lisp_Object Vdeferred_action_function; Lisp_Object Qdeferred_action_function; -#endif /* DEFERRED_ACTION_CRAP */ +#endif /* FSF Emacs crap */ /* Non-nil disable property on a command means do not execute it; call disabled-command-hook's value instead. */ @@ -164,13 +170,20 @@ static Lisp_Object Qunread_command_events, Qunread_command_event; /* Previous command, represented by a Lisp object. - Does not include prefix commands and arg setting commands */ + Does not include prefix commands and arg setting commands. */ Lisp_Object Vlast_command; +/* Contents of this-command-properties for the last command. */ +Lisp_Object Vlast_command_properties; + /* If a command sets this, the value goes into - previous-command for the next command. */ + last-command for the next command. */ Lisp_Object Vthis_command; +/* If a command sets this, the value goes into + last-command-properties for the next command. */ +Lisp_Object Vthis_command_properties; + /* The value of point when the last command was executed. */ Bufpos last_point_position; @@ -235,30 +248,6 @@ recent-keys. */ int inhibit_input_event_recording; -/* prefix key(s) that must match in order to activate menu. - This is ugly. fix me. - */ -Lisp_Object Vmenu_accelerator_prefix; - -/* list of modifier keys to match accelerator for top level menus */ -Lisp_Object Vmenu_accelerator_modifiers; - -/* whether menu accelerators are enabled */ -Lisp_Object Vmenu_accelerator_enabled; - -/* keymap for auxiliary menu accelerator functions */ -Lisp_Object Vmenu_accelerator_map; - -Lisp_Object Qmenu_force; -Lisp_Object Qmenu_fallback; -Lisp_Object Qmenu_quit; -Lisp_Object Qmenu_up; -Lisp_Object Qmenu_down; -Lisp_Object Qmenu_left; -Lisp_Object Qmenu_right; -Lisp_Object Qmenu_select; -Lisp_Object Qmenu_escape; - Lisp_Object Qself_insert_defer_undo; /* this is in keymap.c */ @@ -288,60 +277,6 @@ /* The callback routines for the window system or terminal driver */ struct event_stream *event_stream; -/* This structure is what we use to encapsulate the state of a command sequence - being composed; key events are executed by adding themselves to the command - builder; if the command builder is then complete (does not still represent - a prefix key sequence) it executes the corresponding command. - */ -struct command_builder -{ - struct lcrecord_header header; - Lisp_Object console; /* back pointer to the console this command - builder is for */ - /* Qnil, or a Lisp_Event representing the first event read - * after the last command completed. Threaded. */ - /* #### NYI */ - Lisp_Object prefix_events; - /* Qnil, or a Lisp_Event representing event in the current - * keymap-lookup sequence. Subsequent events are threaded via - * the event's next slot */ - Lisp_Object current_events; - /* Last elt of above */ - Lisp_Object most_current_event; - /* Last elt before function map code took over. What this means is: - All prefixes up to (but not including) this event have non-nil - bindings, but the prefix including this event has a nil binding. - Any events in the chain after this one were read solely because - we're part of a possible function key. If we end up with - something that's not part of a possible function key, we have to - unread all of those events. */ - Lisp_Object last_non_munged_event; - /* One set of values for function-key-map, one for key-translation-map */ - struct munging_key_translation - { - /* First event that can begin a possible function key sequence - (to be translated according to function-key-map). Normally - this is the first event in the chain. However, once we've - translated a sequence through function-key-map, this will point - to the first event after the translated sequence: we don't ever - want to translate any events twice through function-key-map, or - things could get really screwed up (e.g. if the user created a - translation loop). If this is nil, then the next-read event is - the first that can begin a function key sequence. */ - Lisp_Object first_mungeable_event; - } munge_me[2]; - - Bufbyte *echo_buf; - Bytecount echo_buf_length; /* size of echo_buf */ - Bytecount echo_buf_index; /* index into echo_buf - * -1 before doing echoing for new cmd */ - /* Self-insert-command is magic in that it doesn't always push an undo- - boundary: up to 20 consecutive self-inserts can happen before an undo- - boundary is pushed. This variable is that counter. - */ - int self_insert_countdown; -}; - static void echo_key_event (struct command_builder *, Lisp_Object event); static void maybe_kbd_translate (Lisp_Object event); @@ -507,6 +442,13 @@ return event_stream && event_stream->event_pending_p (user); } +static void +event_stream_force_event_pending (struct frame* f) +{ + if (event_stream->force_event_pending) + event_stream->force_event_pending (f); +} + static int maybe_read_quit_event (Lisp_Event *event) { @@ -734,7 +676,10 @@ if (minibuf_level == 0 && echo_keystrokes > 0.0 - && !lw_menu_active) +#if defined (HAVE_X_WINDOWS) && defined (LWLIB_MENUBARS_LUCID) + && !x_kludge_lw_menu_active () +#endif + ) { if (!no_snooze) { @@ -2123,9 +2068,6 @@ XCOMMAND_BUILDER (con->command_builder); int store_this_key = 0; struct gcpro gcpro1; -#ifdef LWLIB_MENUBARS_LUCID - extern int in_menu_callback; /* defined in menubar-x.c */ -#endif /* LWLIB_MENUBARS_LUCID */ GCPRO1 (event); /* DO NOT do QUIT anywhere within this function or the functions it calls. @@ -2401,6 +2343,56 @@ return event; } +DEFUN ("dispatch-non-command-events", Fdispatch_non_command_events, 0, 0, 0, /* +Dispatch any pending "magic" events. + +This function is useful for forcing the redisplay of native +widgets. Normally these are redisplayed through a native window-system +event encoded as magic event, rather than by the redisplay code. This +function does not call redisplay or do any of the other things that +`next-event' does. +*/ + ()) +{ + /* This function can GC */ + Lisp_Object event = Qnil; + struct gcpro gcpro1; + GCPRO1 (event); + event = Fmake_event (Qnil, Qnil); + + /* Make sure that there will be something in the native event queue + so that externally managed things (e.g. widgets) get some CPU + time. */ + event_stream_force_event_pending (selected_frame ()); + + while (event_stream_event_pending_p (0)) + { + QUIT; /* next_event_internal() does not QUIT. */ + + /* We're a generator of the command_event_queue, so we can't be a + consumer as well. Also, we have no reason to consult the + command_event_queue; there are only user and eval-events there, + and we'd just have to put them back anyway. + */ + next_event_internal (event, 0); /* blocks */ + /* See the comment in accept-process-output about Vquit_flag */ + if (XEVENT_TYPE (event) == magic_event || + XEVENT_TYPE (event) == timeout_event || + XEVENT_TYPE (event) == process_event || + XEVENT_TYPE (event) == pointer_motion_event) + execute_internal_event (event); + else + { + enqueue_command_event_1 (event); + break; + } + } + + Fdeallocate_event (event); + UNGCPRO; + return Qnil; +} + static void reset_current_events (struct command_builder *command_builder) { @@ -3096,502 +3088,6 @@ return event_binding (event0, 1); } -#if defined(HAVE_X_WINDOWS) && defined(LWLIB_MENUBARS_LUCID) -static void -menu_move_up (void) -{ - widget_value *current = lw_get_entries (False); - widget_value *entries = lw_get_entries (True); - widget_value *prev = NULL; - - while (entries != current) - { - if (entries->name /*&& entries->enabled*/) prev = entries; - entries = entries->next; - assert (entries); - } - - if (!prev) - /* move to last item */ - { - while (entries->next) - { - if (entries->name /*&& entries->enabled*/) prev = entries; - entries = entries->next; - } - if (prev) - { - if (entries->name /*&& entries->enabled*/) - prev = entries; - } - else - { - /* no selectable items in this menu, pop up to previous level */ - lw_pop_menu (); - return; - } - } - lw_set_item (prev); -} - -static void -menu_move_down (void) -{ - widget_value *current = lw_get_entries (False); - widget_value *new = current; - - while (new->next) - { - new = new->next; - if (new->name /*&& new->enabled*/) break; - } - - if (new==current||!(new->name/*||new->enabled*/)) - { - new = lw_get_entries (True); - while (new!=current) - { - if (new->name /*&& new->enabled*/) break; - new = new->next; - } - if (new==current&&!(new->name /*|| new->enabled*/)) - { - lw_pop_menu (); - return; - } - } - - lw_set_item (new); -} - -static void -menu_move_left (void) -{ - int level = lw_menu_level (); - int l = level; - widget_value *current; - - while (level-- >= 3) - lw_pop_menu (); - - menu_move_up (); - current = lw_get_entries (False); - if (l > 2 && current->contents) - lw_push_menu (current->contents); -} - -static void -menu_move_right (void) -{ - int level = lw_menu_level (); - int l = level; - widget_value *current; - - while (level-- >= 3) - lw_pop_menu (); - - menu_move_down (); - current = lw_get_entries (False); - if (l > 2 && current->contents) - lw_push_menu (current->contents); -} - -static void -menu_select_item (widget_value *val) -{ - if (val == NULL) - val = lw_get_entries (False); - - /* is match a submenu? */ - - if (val->contents) - { - /* enter the submenu */ - - lw_set_item (val); - lw_push_menu (val->contents); - } - else - { - /* Execute the menu entry by calling the menu's `select' - callback function - */ - lw_kill_menus (val); - } -} - -static Lisp_Object -command_builder_operate_menu_accelerator (struct command_builder *builder) -{ - /* this function can GC */ - - struct console *con = XCONSOLE (Vselected_console); - Lisp_Object evee = builder->most_current_event; - Lisp_Object binding; - widget_value *entries; - - extern int lw_menu_accelerate; /* lwlib.c */ - -#if 0 - { - int i; - Lisp_Object t; - char buf[50]; - - t = builder->current_events; - i = 0; - while (!NILP (t)) - { - i++; - sprintf (buf,"OPERATE (%d): ",i); - write_c_string (buf, Qexternal_debugging_output); - print_internal (t, Qexternal_debugging_output, 1); - write_c_string ("\n", Qexternal_debugging_output); - t = XEVENT_NEXT (t); - } - } -#endif /* 0 */ - - /* menu accelerator keys don't go into keyboard macros */ - if (!NILP (con->defining_kbd_macro) && NILP (Vexecuting_macro)) - con->kbd_macro_ptr = con->kbd_macro_end; - - /* don't echo menu accelerator keys */ - /*reset_key_echo (builder, 1);*/ - - if (!lw_menu_accelerate) - { - /* `convert' mouse display to keyboard display - by entering the open submenu - */ - entries = lw_get_entries (False); - if (entries->contents) - { - lw_push_menu (entries->contents); - lw_display_menu (CurrentTime); - } - } - - /* compare event to the current menu accelerators */ - - entries=lw_get_entries (True); - - while (entries) - { - Lisp_Object accel; - VOID_TO_LISP (accel, entries->accel); - if (entries->name && !NILP (accel)) - { - if (event_matches_key_specifier_p (XEVENT (evee), accel)) - { - /* a match! */ - - menu_select_item (entries); - - if (lw_menu_active) lw_display_menu (CurrentTime); - - reset_this_command_keys (Vselected_console, 1); - /*reset_command_builder_event_chain (builder);*/ - return Vmenu_accelerator_map; - } - } - entries = entries->next; - } - - /* try to look up event in menu-accelerator-map */ - - binding = event_binding_in (evee, Vmenu_accelerator_map, 1); - - if (NILP (binding)) - { - /* beep at user for undefined key */ - return Qnil; - } - else - { - if (EQ (binding, Qmenu_quit)) - { - /* turn off menus and set quit flag */ - lw_kill_menus (NULL); - Vquit_flag = Qt; - } - else if (EQ (binding, Qmenu_up)) - { - int level = lw_menu_level (); - if (level > 2) - menu_move_up (); - } - else if (EQ (binding, Qmenu_down)) - { - int level = lw_menu_level (); - if (level > 2) - menu_move_down (); - else - menu_select_item (NULL); - } - else if (EQ (binding, Qmenu_left)) - { - int level = lw_menu_level (); - if (level > 3) - { - lw_pop_menu (); - lw_display_menu (CurrentTime); - } - else - menu_move_left (); - } - else if (EQ (binding, Qmenu_right)) - { - int level = lw_menu_level (); - if (level > 2 && - lw_get_entries (False)->contents) - { - widget_value *current = lw_get_entries (False); - if (current->contents) - menu_select_item (NULL); - } - else - menu_move_right (); - } - else if (EQ (binding, Qmenu_select)) - menu_select_item (NULL); - else if (EQ (binding, Qmenu_escape)) - { - int level = lw_menu_level (); - - if (level > 2) - { - lw_pop_menu (); - lw_display_menu (CurrentTime); - } - else - { - /* turn off menus quietly */ - lw_kill_menus (NULL); - } - } - else if (KEYMAPP (binding)) - { - /* prefix key */ - reset_this_command_keys (Vselected_console, 1); - /*reset_command_builder_event_chain (builder);*/ - return binding; - } - else - { - /* turn off menus and execute binding */ - lw_kill_menus (NULL); - reset_this_command_keys (Vselected_console, 1); - /*reset_command_builder_event_chain (builder);*/ - return binding; - } - } - - if (lw_menu_active) lw_display_menu (CurrentTime); - - reset_this_command_keys (Vselected_console, 1); - /*reset_command_builder_event_chain (builder);*/ - - return Vmenu_accelerator_map; -} - -static Lisp_Object -menu_accelerator_junk_on_error (Lisp_Object errordata, Lisp_Object ignored) -{ - Vmenu_accelerator_prefix = Qnil; - Vmenu_accelerator_modifiers = Qnil; - Vmenu_accelerator_enabled = Qnil; - if (!NILP (errordata)) - { - Lisp_Object args[2]; - - args[0] = build_string ("Error in menu accelerators (setting to nil)"); - /* #### This should call - (with-output-to-string (display-error errordata)) - but that stuff is all in Lisp currently. */ - args[1] = errordata; - warn_when_safe_lispobj - (Qerror, Qwarning, - emacs_doprnt_string_lisp ((const Bufbyte *) "%s: %s", - Qnil, -1, 2, args)); - } - - return Qnil; -} - -static Lisp_Object -menu_accelerator_safe_compare (Lisp_Object event0) -{ - if (CONSP (Vmenu_accelerator_prefix)) - { - Lisp_Object t; - t=Vmenu_accelerator_prefix; - while (!NILP (t) - && !NILP (event0) - && event_matches_key_specifier_p (XEVENT (event0), Fcar (t))) - { - t = Fcdr (t); - event0 = XEVENT_NEXT (event0); - } - if (!NILP (t)) - return Qnil; - } - else if (NILP (event0)) - return Qnil; - else if (event_matches_key_specifier_p (XEVENT (event0), Vmenu_accelerator_prefix)) - event0 = XEVENT_NEXT (event0); - else - return Qnil; - return event0; -} - -static Lisp_Object -menu_accelerator_safe_mod_compare (Lisp_Object cons) -{ - return (event_matches_key_specifier_p (XEVENT (XCAR (cons)), XCDR (cons)) - ? Qt - : Qnil); -} - -static Lisp_Object -command_builder_find_menu_accelerator (struct command_builder *builder) -{ - /* this function can GC */ - Lisp_Object event0 = builder->current_events; - struct console *con = XCONSOLE (Vselected_console); - struct frame *f = XFRAME (CONSOLE_SELECTED_FRAME (con)); - Widget menubar_widget; - - /* compare entries in event0 against the menu prefix */ - - if ((!CONSOLE_X_P (XCONSOLE (builder->console))) || NILP (event0) || - XEVENT (event0)->event_type != key_press_event) - return Qnil; - - if (!NILP (Vmenu_accelerator_prefix)) - { - event0 = condition_case_1 (Qerror, - menu_accelerator_safe_compare, - event0, - menu_accelerator_junk_on_error, - Qnil); - } - - if (NILP (event0)) - return Qnil; - - menubar_widget = FRAME_X_MENUBAR_WIDGET (f); - if (menubar_widget - && CONSP (Vmenu_accelerator_modifiers)) - { - Lisp_Object fake; - Lisp_Object last = Qnil; - struct gcpro gcpro1; - Lisp_Object matchp; - - widget_value *val; - LWLIB_ID id = XPOPUP_DATA (f->menubar_data)->id; - - val = lw_get_all_values (id); - if (val) - { - val = val->contents; - - fake = Fcopy_sequence (Vmenu_accelerator_modifiers); - last = fake; - - while (!NILP (Fcdr (last))) - last = Fcdr (last); - - Fsetcdr (last, Fcons (Qnil, Qnil)); - last = Fcdr (last); - } - - fake = Fcons (Qnil, fake); - - GCPRO1 (fake); - - while (val) - { - Lisp_Object accel; - VOID_TO_LISP (accel, val->accel); - if (val->name && !NILP (accel)) - { - Fsetcar (last, accel); - Fsetcar (fake, event0); - matchp = condition_case_1 (Qerror, - menu_accelerator_safe_mod_compare, - fake, - menu_accelerator_junk_on_error, - Qnil); - if (!NILP (matchp)) - { - /* we found one! */ - - lw_set_menu (menubar_widget, val); - /* yah - yet another hack. - pretend emacs timestamp is the same as an X timestamp, - which for the moment it is. (read events.h) - */ - lw_map_menu (XEVENT (event0)->timestamp); - - if (val->contents) - lw_push_menu (val->contents); - - lw_display_menu (CurrentTime); - - /* menu accelerator keys don't go into keyboard macros */ - if (!NILP (con->defining_kbd_macro) && NILP (Vexecuting_macro)) - con->kbd_macro_ptr = con->kbd_macro_end; - - /* don't echo menu accelerator keys */ - /*reset_key_echo (builder, 1);*/ - reset_this_command_keys (Vselected_console, 1); - UNGCPRO; - - return Vmenu_accelerator_map; - } - } - - val = val->next; - } - - UNGCPRO; - } - return Qnil; -} - - -DEFUN ("accelerate-menu", Faccelerate_menu, 0, 0, "_", /* -Make the menubar active. Menu items can be selected using menu accelerators -or by actions defined in menu-accelerator-map. -*/ - ()) -{ - struct console *con = XCONSOLE (Vselected_console); - struct frame *f = XFRAME (CONSOLE_SELECTED_FRAME (con)); - LWLIB_ID id; - widget_value *val; - - if (NILP (f->menubar_data)) - error ("Frame has no menubar."); - - id = XPOPUP_DATA (f->menubar_data)->id; - val = lw_get_all_values (id); - val = val->contents; - lw_set_menu (FRAME_X_MENUBAR_WIDGET (f), val); - lw_map_menu (CurrentTime); - - lw_display_menu (CurrentTime); - - /* menu accelerator keys don't go into keyboard macros */ - if (!NILP (con->defining_kbd_macro) && NILP (Vexecuting_macro)) - con->kbd_macro_ptr = con->kbd_macro_end; - - return Qnil; -} -#endif /* HAVE_X_WINDOWS && HAVE_MENUBARS */ - /* See if we can do function-key-map or key-translation-map translation on the current events in the command builder. If so, do this, and return the resulting binding, if any. */ @@ -3713,9 +3209,11 @@ return Qnil; } - /* if we're currently in a menu accelerator, check there for further events */ + /* if we're currently in a menu accelerator, check there for further + events */ + /* #### fuck me! who wrote this crap? think "abstraction", baby. */ #if defined(HAVE_X_WINDOWS) && defined(LWLIB_MENUBARS_LUCID) - if (lw_menu_active) + if (x_kludge_lw_menu_active ()) { return command_builder_operate_menu_accelerator (builder); } @@ -3766,14 +3264,14 @@ Lisp_Object terminal = builder->most_current_event; struct key_data* key = & XEVENT (terminal)->event.key; Emchar c = 0; - if ((key->modifiers & MOD_SHIFT) + if ((key->modifiers & XEMACS_MOD_SHIFT) || (CHAR_OR_CHAR_INTP (key->keysym) && ((c = XCHAR_OR_CHAR_INT (key->keysym)), c >= 'A' && c <= 'Z'))) { Lisp_Event terminal_copy = *XEVENT (terminal); - if (key->modifiers & MOD_SHIFT) - key->modifiers &= (~ MOD_SHIFT); + if (key->modifiers & XEMACS_MOD_SHIFT) + key->modifiers &= (~ XEMACS_MOD_SHIFT); else key->keysym = make_char (c + 'a' - 'A'); @@ -4174,10 +3672,10 @@ Fcopy_event (event, recent); e = XEVENT (recent); if (e->event_type == key_press_event) - e->event.key.modifiers |= MOD_META; + e->event.key.modifiers |= XEMACS_MOD_META; else if (e->event_type == button_press_event || e->event_type == button_release_event) - e->event.button.modifiers |= MOD_META; + e->event.button.modifiers |= XEMACS_MOD_META; else abort (); @@ -4208,7 +3706,11 @@ if (KEYMAPP (leaf)) { - if (!lw_menu_active) +#if defined (HAVE_X_WINDOWS) && defined (LWLIB_MENUBARS_LUCID) + if (!x_kludge_lw_menu_active ()) +#else + if (1) +#endif { Lisp_Object prompt = Fkeymap_prompt (leaf, Qt); if (STRINGP (prompt)) @@ -4228,19 +3730,20 @@ else maybe_echo_keys (command_builder, 0); } - else if (!NILP (Vquit_flag)) { - Lisp_Object quit_event = Fmake_event(Qnil, Qnil); - Lisp_Event *e = XEVENT (quit_event); - /* if quit happened during menu acceleration, pretend we read it */ - struct console *con = XCONSOLE (Fselected_console ()); - int ch = CONSOLE_QUIT_CHAR (con); - - character_to_event (ch, e, con, 1, 1); - e->channel = make_console (con); - - enqueue_command_event (quit_event); - Vquit_flag = Qnil; - } + else if (!NILP (Vquit_flag)) + { + Lisp_Object quit_event = Fmake_event (Qnil, Qnil); + Lisp_Event *e = XEVENT (quit_event); + /* if quit happened during menu acceleration, pretend we read it */ + struct console *con = XCONSOLE (Fselected_console ()); + int ch = CONSOLE_QUIT_CHAR (con); + + character_to_event (ch, e, con, 1, 1); + e->channel = make_console (con); + + enqueue_command_event (quit_event); + Vquit_flag = Qnil; + } } else if (!NILP (leaf)) { @@ -4359,6 +3862,9 @@ { /* Start a new command next time */ Vlast_command = Vthis_command; + Vlast_command_properties = Vthis_command_properties; + Vthis_command_properties = Qnil; + /* Emacs 18 doesn't unconditionally clear the echoed keystrokes, so we don't either */ reset_this_command_keys (make_console (con), 0); @@ -4379,6 +3885,9 @@ safe_run_hook_trapping_errors ("Error in `pre-command-hook' (setting hook to nil)", Qpre_command_hook, 1); + + /* This is a kludge, but necessary; see simple.el */ + call0 (Qhandle_pre_motion_command); } /* Run the post command hook. */ @@ -4398,14 +3907,18 @@ Lisp_Object win = Fselected_window (Qnil); -#if 0 /* If the last command deleted the frame, `win' might be nil. It seems safest to do nothing in this case. */ + /* Note: Someone added the following comment and put #if 0's around + this code, not realizing that doing this invites a crash in the + line after. */ /* #### This doesn't really fix the problem, if delete-frame is called by some hook */ if (NILP (win)) return; -#endif + + /* This is a kludge, but necessary; see simple.el */ + call0 (Qhandle_post_motion_command); if (! zmacs_region_stays && (!MINI_WINDOW_P (XWINDOW (win)) @@ -4418,12 +3931,10 @@ ("Error in `post-command-hook' (setting hook to nil)", Qpost_command_hook, 1); -#ifdef DEFERRED_ACTION_CRAP +#if 0 /* FSF Emacs crap */ if (!NILP (Vdeferred_action_list)) call0 (Vdeferred_action_function); -#endif - -#ifdef ILL_CONCEIVED_HOOK + if (NILP (Vunread_command_events) && NILP (Vexecuting_macro) && !NILP (Vpost_command_idle_hook) @@ -4432,9 +3943,9 @@ safe_run_hook_trapping_errors ("Error in `post-command-idle-hook' (setting hook to nil)", Qpost_command_idle_hook, 1); -#endif - -#if 0 /* FSFmacs */ +#endif /* FSF Emacs crap */ + +#if 0 /* FSF Emacs */ if (!NILP (current_buffer->mark_active)) { if (!NILP (Vdeactivate_mark) && !NILP (Vtransient_mark_mode)) @@ -4446,7 +3957,7 @@ BUF_MODIFF (current_buffer) != prev_modiff) run_hook (intern ("activate-mark-hook")); } -#endif /* FSFmacs */ +#endif /* FSF Emacs */ /* #### Kludge!!! This is necessary to make sure that things are properly positioned even if post-command-hook moves point. @@ -4935,23 +4446,21 @@ DEFSUBR (Fadd_async_timeout); DEFSUBR (Fdisable_async_timeout); DEFSUBR (Fdispatch_event); + DEFSUBR (Fdispatch_non_command_events); DEFSUBR (Fread_key_sequence); DEFSUBR (Fthis_command_keys); DEFSUBR (Freset_this_command_lengths); DEFSUBR (Fopen_dribble_file); -#if defined(HAVE_X_WINDOWS) && defined(LWLIB_MENUBARS_LUCID) - DEFSUBR (Faccelerate_menu); -#endif defsymbol (&Qpre_command_hook, "pre-command-hook"); defsymbol (&Qpost_command_hook, "post-command-hook"); defsymbol (&Qunread_command_events, "unread-command-events"); defsymbol (&Qunread_command_event, "unread-command-event"); defsymbol (&Qpre_idle_hook, "pre-idle-hook"); -#ifdef ILL_CONCEIVED_HOOK + defsymbol (&Qhandle_pre_motion_command, "handle-pre-motion-command"); + defsymbol (&Qhandle_post_motion_command, "handle-post-motion-command"); +#if 0 /* FSF Emacs crap */ defsymbol (&Qpost_command_idle_hook, "post-command-idle-hook"); -#endif -#ifdef DEFERRED_ACTION_CRAP defsymbol (&Qdeferred_action_function, "deferred-action-function"); #endif defsymbol (&Qretry_undefined_key_binding_unshifted, @@ -4959,17 +4468,6 @@ defsymbol (&Qauto_show_make_point_visible, "auto-show-make-point-visible"); - defsymbol (&Qmenu_force, "menu-force"); - defsymbol (&Qmenu_fallback, "menu-fallback"); - - defsymbol (&Qmenu_quit, "menu-quit"); - defsymbol (&Qmenu_up, "menu-up"); - defsymbol (&Qmenu_down, "menu-down"); - defsymbol (&Qmenu_left, "menu-left"); - defsymbol (&Qmenu_right, "menu-right"); - defsymbol (&Qmenu_select, "menu-select"); - defsymbol (&Qmenu_escape, "menu-escape"); - defsymbol (&Qself_insert_defer_undo, "self-insert-defer-undo"); defsymbol (&Qcancel_mode_internal, "cancel-mode-internal"); } @@ -5063,7 +4561,7 @@ */ ); focus_follows_mouse = 0; -#ifdef ILL_CONCEIVED_HOOK +#if 0 /* FSF Emacs crap */ /* Ill-conceived because it's not run in all sorts of cases where XEmacs is blocking. That's what `pre-idle-hook' is designed to solve. */ @@ -5080,9 +4578,7 @@ This is measured in microseconds. */ ); post_command_idle_delay = 5000; -#endif /* ILL_CONCEIVED_HOOK */ - -#ifdef DEFERRED_ACTION_CRAP + /* Random FSFmacs crap. There is absolutely nothing to gain, and a great deal to lose, in using this in place of just setting `post-command-hook'. */ @@ -5098,7 +4594,7 @@ whenever `deferred-action-list' is non-nil. */ ); Vdeferred_action_function = Qnil; -#endif /* DEFERRED_ACTION_CRAP */ +#endif /* FSF Emacs crap */ DEFVAR_LISP ("last-command-event", &Vlast_command_event /* Last keyboard or mouse button event that was part of a command. This @@ -5188,6 +4684,23 @@ */ ); Vthis_command = Qnil; + DEFVAR_LISP ("last-command-properties", &Vlast_command_properties /* +Value of `this-command-properties' for the last command. +Used by commands to help synchronize consecutive commands, in preference +to looking at `last-command' directly. +*/ ); + Vlast_command_properties = Qnil; + + DEFVAR_LISP ("this-command-properties", &Vthis_command_properties /* +Properties set by the current command. +At the beginning of each command, the current value of this variable is +copied to `last-command-properties', and then it is set to nil. Use `putf' +to add properties to this variable. Commands should use this to communicate +with pre/post-command hooks, subsequent commands, wrapping commands, etc. +in preference to looking at and/or setting `this-command'. +*/ ); + Vthis_command_properties = Qnil; + DEFVAR_LISP ("help-char", &Vhelp_char /* Character to recognize as meaning Help. When it is read, do `(eval help-form)', and display result if it's a string. @@ -5301,41 +4814,6 @@ Non-nil inhibits recording of input-events to recent-keys ring. */ ); inhibit_input_event_recording = 0; - - DEFVAR_LISP("menu-accelerator-prefix", &Vmenu_accelerator_prefix /* -Prefix key(s) that must be typed before menu accelerators will be activated. -Set this to a value acceptable by define-key. -*/ ); - Vmenu_accelerator_prefix = Qnil; - - DEFVAR_LISP ("menu-accelerator-modifiers", &Vmenu_accelerator_modifiers /* -Modifier keys which must be pressed to get to the top level menu accelerators. -This is a list of modifier key symbols. All modifier keys must be held down -while a valid menu accelerator key is pressed in order for the top level -menu to become active. - -See also menu-accelerator-enabled and menu-accelerator-prefix. -*/ ); - Vmenu_accelerator_modifiers = list1 (Qmeta); - - DEFVAR_LISP ("menu-accelerator-enabled", &Vmenu_accelerator_enabled /* -Whether menu accelerator keys can cause the menubar to become active. -If 'menu-force or 'menu-fallback, then menu accelerator keys can -be used to activate the top level menu. Once the menubar becomes active, the -accelerator keys can be used regardless of the value of this variable. - -menu-force is used to indicate that the menu accelerator key takes -precedence over bindings in the current keymap(s). menu-fallback means -that bindings in the current keymap take precedence over menu accelerator keys. -Thus a top level menu with an accelerator of "T" would be activated on a -keypress of Meta-t if menu-accelerator-enabled is menu-force. -However, if menu-accelerator-enabled is menu-fallback, then -Meta-t will not activate the menubar and will instead run the function -transpose-words, to which it is normally bound. - -See also menu-accelerator-modifiers and menu-accelerator-prefix. -*/ ); - Vmenu_accelerator_enabled = Qnil; } void @@ -5343,41 +4821,6 @@ { Vkeyboard_translate_table = make_lisp_hash_table (100, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ); - - DEFVAR_LISP ("menu-accelerator-map", &Vmenu_accelerator_map /* -Keymap for use when the menubar is active. -The actions menu-quit, menu-up, menu-down, menu-left, menu-right, -menu-select and menu-escape can be mapped to keys in this map. - -menu-quit Immediately deactivate the menubar and any open submenus without - selecting an item. -menu-up Move the menu cursor up one row in the current menu. If the - move extends past the top of the menu, wrap around to the bottom. -menu-down Move the menu cursor down one row in the current menu. If the - move extends past the bottom of the menu, wrap around to the top. - If executed while the cursor is in the top level menu, move down - into the selected menu. -menu-left Move the cursor from a submenu into the parent menu. If executed - while the cursor is in the top level menu, move the cursor to the - left. If the move extends past the left edge of the menu, wrap - around to the right edge. -menu-right Move the cursor into a submenu. If the cursor is located in the - top level menu or is not currently on a submenu heading, then move - the cursor to the next top level menu entry. If the move extends - past the right edge of the menu, wrap around to the left edge. -menu-select Activate the item under the cursor. If the cursor is located on - a submenu heading, then move the cursor into the submenu. -menu-escape Pop up to the next level of menus. Moves from a submenu into its - parent menu. From the top level menu, this deactivates the - menubar. - -This keymap can also contain normal key-command bindings, in which case the -menubar is deactivated and the corresponding command is executed. - -The action bindings used by the menu accelerator code are designed to mimic -the actions of menu traversal keys in a commonly used PC operating system. -*/ ); - Vmenu_accelerator_map = Fmake_keymap(Qnil); } void diff -r 9f011ab08d48 -r 2f8bb876ab1d src/event-tty.c --- a/src/event-tty.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/event-tty.c Mon Aug 13 11:16:07 2007 +0200 @@ -249,6 +249,7 @@ tty_event_stream = xnew (struct event_stream); tty_event_stream->event_pending_p = emacs_tty_event_pending_p; + tty_event_stream->force_event_pending = 0; tty_event_stream->next_event_cb = emacs_tty_next_event; tty_event_stream->handle_magic_event_cb = emacs_tty_handle_magic_event; tty_event_stream->add_timeout_cb = emacs_tty_add_timeout; diff -r 9f011ab08d48 -r 2f8bb876ab1d src/event-unixoid.c --- a/src/event-unixoid.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/event-unixoid.c Mon Aug 13 11:16:07 2007 +0200 @@ -225,7 +225,7 @@ { /* Something went seriously wrong; don't abort since maybe the TTY just died at the wrong time. */ - fprintf (stderr, "xemacs: select failed: errno = %d\n", errno); + stderr_out ("xemacs: select failed: errno = %d\n", errno); return 0; } /* else, we got interrupted by a signal, so try again. */ diff -r 9f011ab08d48 -r 2f8bb876ab1d src/events-mod.h --- a/src/events-mod.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/events-mod.h Mon Aug 13 11:16:07 2007 +0200 @@ -1,8 +1,8 @@ /* The modifiers XEmacs knows about; these appear in key and button events. */ -#define MOD_CONTROL (1<<0) -#define MOD_META (1<<1) -#define MOD_SUPER (1<<2) -#define MOD_HYPER (1<<3) -#define MOD_ALT (1<<4) -#define MOD_SHIFT (1<<5) /* not used for dual-case characters */ +#define XEMACS_MOD_CONTROL (1<<0) +#define XEMACS_MOD_META (1<<1) +#define XEMACS_MOD_SUPER (1<<2) +#define XEMACS_MOD_HYPER (1<<3) +#define XEMACS_MOD_ALT (1<<4) +#define XEMACS_MOD_SHIFT (1<<5) /* not used for dual-case characters */ diff -r 9f011ab08d48 -r 2f8bb876ab1d src/events.c --- a/src/events.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/events.c Mon Aug 13 11:16:07 2007 +0200 @@ -37,17 +37,6 @@ #include "keymap.h" /* for key_desc_list_to_event() */ #include "redisplay.h" #include "window.h" - -#ifdef WINDOWSNT -/* Hmm, under unix we want X modifiers, under NT we want X modifiers if - we are running X and Windows modifiers otherwise. - gak. This is a kludge until we support multiple native GUIs! -*/ -#undef MOD_ALT -#undef MOD_CONTROL -#undef MOD_SHIFT -#endif - #include "events-mod.h" /* Where old events go when they are explicitly deallocated. @@ -87,7 +76,7 @@ ((int *) event) [i] = 0xdeadbeef; event->event_type = dead_event; event->channel = Qnil; - set_lheader_implementation (&(event->lheader), &lrecord_event); + set_lheader_implementation (&event->lheader, &lrecord_event); XSET_EVENT_NEXT (ev, Qnil); } @@ -96,7 +85,7 @@ zero_event (Lisp_Event *e) { xzero (*e); - set_lheader_implementation (&(e->lheader), &lrecord_event); + set_lheader_implementation (&e->lheader, &lrecord_event); e->event_type = empty_event; e->next = Qnil; e->channel = Qnil; @@ -551,13 +540,13 @@ EXTERNAL_LIST_LOOP_2 (sym, value) { - if (EQ (sym, Qcontrol)) modifiers |= MOD_CONTROL; - else if (EQ (sym, Qmeta)) modifiers |= MOD_META; - else if (EQ (sym, Qsuper)) modifiers |= MOD_SUPER; - else if (EQ (sym, Qhyper)) modifiers |= MOD_HYPER; - else if (EQ (sym, Qalt)) modifiers |= MOD_ALT; - else if (EQ (sym, Qsymbol)) modifiers |= MOD_ALT; - else if (EQ (sym, Qshift)) modifiers |= MOD_SHIFT; + if (EQ (sym, Qcontrol)) modifiers |= XEMACS_MOD_CONTROL; + else if (EQ (sym, Qmeta)) modifiers |= XEMACS_MOD_META; + else if (EQ (sym, Qsuper)) modifiers |= XEMACS_MOD_SUPER; + else if (EQ (sym, Qhyper)) modifiers |= XEMACS_MOD_HYPER; + else if (EQ (sym, Qalt)) modifiers |= XEMACS_MOD_ALT; + else if (EQ (sym, Qsymbol)) modifiers |= XEMACS_MOD_ALT; + else if (EQ (sym, Qshift)) modifiers |= XEMACS_MOD_SHIFT; else signal_simple_error ("Invalid key modifier", sym); } @@ -977,7 +966,7 @@ int use_console_meta_flag, int do_backspace_mapping) { Lisp_Object k = Qnil; - unsigned int m = 0; + int m = 0; if (event->event_type == dead_event) error ("character-to-event called with a deallocated event!"); @@ -996,21 +985,21 @@ break; case 1: /* top bit is meta */ c -= 128; - m = MOD_META; + m = XEMACS_MOD_META; break; default: /* this is a real character */ break; } } - if (c < ' ') c += '@', m |= MOD_CONTROL; - if (m & MOD_CONTROL) + if (c < ' ') c += '@', m |= XEMACS_MOD_CONTROL; + if (m & XEMACS_MOD_CONTROL) { switch (c) { - case 'I': k = QKtab; m &= ~MOD_CONTROL; break; - case 'J': k = QKlinefeed; m &= ~MOD_CONTROL; break; - case 'M': k = QKreturn; m &= ~MOD_CONTROL; break; - case '[': k = QKescape; m &= ~MOD_CONTROL; break; + case 'I': k = QKtab; m &= ~XEMACS_MOD_CONTROL; break; + case 'J': k = QKlinefeed; m &= ~XEMACS_MOD_CONTROL; break; + case 'M': k = QKreturn; m &= ~XEMACS_MOD_CONTROL; break; + case '[': k = QKescape; m &= ~XEMACS_MOD_CONTROL; break; default: #if defined(HAVE_TTY) if (do_backspace_mapping && @@ -1018,7 +1007,7 @@ c - '@' == XCHAR (con->tty_erase_char)) { k = QKbackspace; - m &= ~MOD_CONTROL; + m &= ~XEMACS_MOD_CONTROL; } #endif /* defined(HAVE_TTY) && !defined(__CYGWIN32__) */ break; @@ -1067,7 +1056,7 @@ return -1; } if (!allow_extra_modifiers && - event->event.key.modifiers & (MOD_SUPER|MOD_HYPER|MOD_ALT)) + event->event.key.modifiers & (XEMACS_MOD_SUPER|XEMACS_MOD_HYPER|XEMACS_MOD_ALT)) return -1; if (CHAR_OR_CHAR_INTP (event->event.key.keysym)) c = XCHAR_OR_CHAR_INT (event->event.key.keysym); @@ -1086,7 +1075,7 @@ else return -1; - if (event->event.key.modifiers & MOD_CONTROL) + if (event->event.key.modifiers & XEMACS_MOD_CONTROL) { if (c >= 'a' && c <= 'z') c -= ('a' - 'A'); @@ -1104,7 +1093,7 @@ if (! allow_extra_modifiers) return -1; } - if (event->event.key.modifiers & MOD_META) + if (event->event.key.modifiers & XEMACS_MOD_META) { if (! allow_meta) return -1; if (c & 0200) return -1; /* don't allow M-oslash (overlap) */ @@ -1244,13 +1233,13 @@ key = event->event.key.keysym; /* Hack. */ if (! brief && CHARP (key) && - mod & (MOD_CONTROL | MOD_META | MOD_SUPER | MOD_HYPER)) + mod & (XEMACS_MOD_CONTROL | XEMACS_MOD_META | XEMACS_MOD_SUPER | XEMACS_MOD_HYPER)) { int k = XCHAR (key); if (k >= 'a' && k <= 'z') key = make_char (k - ('a' - 'A')); else if (k >= 'A' && k <= 'Z') - mod |= MOD_SHIFT; + mod |= XEMACS_MOD_SHIFT; } break; } @@ -1292,12 +1281,12 @@ } #define modprint1(x) do { strcpy (buf, (x)); buf += sizeof (x)-1; } while (0) #define modprint(x,y) do { if (brief) modprint1 (y); else modprint1 (x); } while (0) - if (mod & MOD_CONTROL) modprint ("control-", "C-"); - if (mod & MOD_META) modprint ("meta-", "M-"); - if (mod & MOD_SUPER) modprint ("super-", "S-"); - if (mod & MOD_HYPER) modprint ("hyper-", "H-"); - if (mod & MOD_ALT) modprint ("alt-", "A-"); - if (mod & MOD_SHIFT) modprint ("shift-", "Sh-"); + if (mod & XEMACS_MOD_CONTROL) modprint ("control-", "C-"); + if (mod & XEMACS_MOD_META) modprint ("meta-", "M-"); + if (mod & XEMACS_MOD_SUPER) modprint ("super-", "S-"); + if (mod & XEMACS_MOD_HYPER) modprint ("hyper-", "H-"); + if (mod & XEMACS_MOD_ALT) modprint ("alt-", "A-"); + if (mod & XEMACS_MOD_SHIFT) modprint ("shift-", "Sh-"); if (mouse_p) { modprint1 ("button"); @@ -1554,12 +1543,12 @@ { int mod = XINT (Fevent_modifier_bits (event)); Lisp_Object result = Qnil; - if (mod & MOD_SHIFT) result = Fcons (Qshift, result); - if (mod & MOD_ALT) result = Fcons (Qalt, result); - if (mod & MOD_HYPER) result = Fcons (Qhyper, result); - if (mod & MOD_SUPER) result = Fcons (Qsuper, result); - if (mod & MOD_META) result = Fcons (Qmeta, result); - if (mod & MOD_CONTROL) result = Fcons (Qcontrol, result); + if (mod & XEMACS_MOD_SHIFT) result = Fcons (Qshift, result); + if (mod & XEMACS_MOD_ALT) result = Fcons (Qalt, result); + if (mod & XEMACS_MOD_HYPER) result = Fcons (Qhyper, result); + if (mod & XEMACS_MOD_SUPER) result = Fcons (Qsuper, result); + if (mod & XEMACS_MOD_META) result = Fcons (Qmeta, result); + if (mod & XEMACS_MOD_CONTROL) result = Fcons (Qcontrol, result); return result; } diff -r 9f011ab08d48 -r 2f8bb876ab1d src/events.h --- a/src/events.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/events.h Mon Aug 13 11:16:07 2007 +0200 @@ -329,6 +329,7 @@ void (*select_process_cb) (Lisp_Process *); void (*unselect_process_cb) (Lisp_Process *); void (*quit_p_cb) (void); + void (*force_event_pending) (struct frame* f); USID (*create_stream_pair_cb) (void* /* inhandle*/, void* /*outhandle*/ , Lisp_Object* /* instream */, Lisp_Object* /* outstream */, @@ -366,20 +367,20 @@ struct key_data { Lisp_Object keysym; - unsigned char modifiers; + int modifiers; }; struct button_data { int button; - unsigned char modifiers; + int modifiers; int x, y; }; struct motion_data { int x, y; - unsigned char modifiers; + int modifiers; }; struct process_data @@ -406,7 +407,7 @@ Lisp_Object function; Lisp_Object object; int button; - unsigned char modifiers; + int modifiers; int x, y; }; @@ -532,9 +533,9 @@ extern Lisp_Object QKspace, QKtab, Qmouse_event_p, Vcharacter_set_property; extern Lisp_Object Qcancel_mode_internal; -/* Note: under X Windows, MOD_ALT is generated by the Alt key if there are +/* Note: under X Windows, XEMACS_MOD_ALT is generated by the Alt key if there are both Alt and Meta keys. If there are no Meta keys, then Alt generates - MOD_META instead. + XEMACS_MOD_META instead. */ #ifdef emacs @@ -661,4 +662,60 @@ #endif /* emacs */ +/* #### a hack, until accelerator shit is cleaned up */ + +/* This structure is what we use to encapsulate the state of a command sequence + being composed; key events are executed by adding themselves to the command + builder; if the command builder is then complete (does not still represent + a prefix key sequence) it executes the corresponding command. + */ +struct command_builder +{ + struct lcrecord_header header; + Lisp_Object console; /* back pointer to the console this command + builder is for */ + /* Qnil, or a Lisp_Event representing the first event read + * after the last command completed. Threaded. */ + /* #### NYI */ + Lisp_Object prefix_events; + /* Qnil, or a Lisp_Event representing event in the current + * keymap-lookup sequence. Subsequent events are threaded via + * the event's next slot */ + Lisp_Object current_events; + /* Last elt of above */ + Lisp_Object most_current_event; + /* Last elt before function map code took over. What this means is: + All prefixes up to (but not including) this event have non-nil + bindings, but the prefix including this event has a nil binding. + Any events in the chain after this one were read solely because + we're part of a possible function key. If we end up with + something that's not part of a possible function key, we have to + unread all of those events. */ + Lisp_Object last_non_munged_event; + /* One set of values for function-key-map, one for key-translation-map */ + struct munging_key_translation + { + /* First event that can begin a possible function key sequence + (to be translated according to function-key-map). Normally + this is the first event in the chain. However, once we've + translated a sequence through function-key-map, this will point + to the first event after the translated sequence: we don't ever + want to translate any events twice through function-key-map, or + things could get really screwed up (e.g. if the user created a + translation loop). If this is nil, then the next-read event is + the first that can begin a function key sequence. */ + Lisp_Object first_mungeable_event; + } munge_me[2]; + + Bufbyte *echo_buf; + Bytecount echo_buf_length; /* size of echo_buf */ + Bytecount echo_buf_index; /* index into echo_buf + * -1 before doing echoing for new cmd */ + /* Self-insert-command is magic in that it doesn't always push an undo- + boundary: up to 20 consecutive self-inserts can happen before an undo- + boundary is pushed. This variable is that counter. + */ + int self_insert_countdown; +}; + #endif /* INCLUDED_events_h_ */ diff -r 9f011ab08d48 -r 2f8bb876ab1d src/extents.c --- a/src/extents.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/extents.c Mon Aug 13 11:16:07 2007 +0200 @@ -227,6 +227,7 @@ #include "opaque.h" #include "process.h" #include "redisplay.h" +#include "gutter.h" /* ------------------------------- */ /* gap array */ @@ -461,7 +462,6 @@ /* FSFmacs bogosity */ Lisp_Object Vdefault_text_properties; - EXFUN (Fextent_properties, 1); EXFUN (Fset_extent_property, 3); @@ -1589,33 +1589,46 @@ object = extent_object (extent); - if (!BUFFERP (object) || extent_detached_p (extent)) - /* #### Can changes to string extents affect redisplay? - I will have to think about this. What about string glyphs? - Things in the modeline? etc. */ - /* #### changes to string extents can certainly affect redisplay - if the extent is in some generated-modeline-string: when - we change an extent in generated-modeline-string, this changes - its parent, which is in `modeline-format', so we should - force the modeline to be updated. But how to determine whether - a string is a `generated-modeline-string'? Looping through - all buffers is not very efficient. Should we add all - `generated-modeline-string' strings to a hash table? - Maybe efficiency is not the greatest concern here and there's - no big loss in looping over the buffers. */ + if (extent_detached_p (extent)) return; - { - struct buffer *b; - b = XBUFFER (object); - BUF_FACECHANGE (b)++; - MARK_EXTENTS_CHANGED; - if (invisibility_change) - MARK_CLIP_CHANGED; - buffer_extent_signal_changed_region (b, - extent_endpoint_bufpos (extent, 0), - extent_endpoint_bufpos (extent, 1)); - } + else if (STRINGP (object)) + { + /* #### Changes to string extents can affect redisplay if they are + in the modeline or in the gutters. + + If the extent is in some generated-modeline-string: when we + change an extent in generated-modeline-string, this changes its + parent, which is in `modeline-format', so we should force the + modeline to be updated. But how to determine whether a string + is a `generated-modeline-string'? Looping through all buffers + is not very efficient. Should we add all + `generated-modeline-string' strings to a hash table? Maybe + efficiency is not the greatest concern here and there's no big + loss in looping over the buffers. + + If the extent is in a gutter we mark the gutter as + changed. This means (a) we can update extents in the gutters + when we need it. (b) we don't have to update the gutters when + only extents attached to buffers have changed. */ + + MARK_EXTENTS_CHANGED; + gutter_extent_signal_changed_region_maybe (object, + extent_endpoint_bufpos (extent, 0), + extent_endpoint_bufpos (extent, 1)); + } + else if (BUFFERP (object)) + { + struct buffer *b; + b = XBUFFER (object); + BUF_FACECHANGE (b)++; + MARK_EXTENTS_CHANGED; + if (invisibility_change) + MARK_CLIP_CHANGED; + buffer_extent_signal_changed_region (b, + extent_endpoint_bufpos (extent, 0), + extent_endpoint_bufpos (extent, 1)); + } } /* A change to an extent occurred that might affect redisplay. @@ -4989,7 +5002,7 @@ set_extent_glyph_1 (Lisp_Object extent_obj, Lisp_Object glyph, int endp, Lisp_Object layout_obj) { - EXTENT extent = decode_extent (extent_obj, DE_MUST_HAVE_BUFFER); + EXTENT extent = decode_extent (extent_obj, 0); glyph_layout layout = symbol_to_glyph_layout (layout_obj); /* Make sure we've actually been given a valid glyph or it's nil diff -r 9f011ab08d48 -r 2f8bb876ab1d src/extents.h --- a/src/extents.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/extents.h Mon Aug 13 11:16:07 2007 +0200 @@ -177,8 +177,8 @@ #define extent_no_chase_normal_field(e, field) ((e)->flags.field) -INLINE struct extent_auxiliary *extent_aux_or_default (EXTENT e); -INLINE struct extent_auxiliary * +INLINE_HEADER struct extent_auxiliary *extent_aux_or_default (EXTENT e); +INLINE_HEADER struct extent_auxiliary * extent_aux_or_default (EXTENT e) { return e->flags.has_aux ? @@ -259,8 +259,8 @@ #define extent_internal_p(e) extent_normal_field (e, internal) #define extent_in_red_event_p(e) extent_normal_field (e, in_red_event) -INLINE Lisp_Object * extent_no_chase_plist_addr (EXTENT e); -INLINE Lisp_Object * +INLINE_HEADER Lisp_Object * extent_no_chase_plist_addr (EXTENT e); +INLINE_HEADER Lisp_Object * extent_no_chase_plist_addr (EXTENT e) { return e->flags.has_aux ? &XCDR (e->plist) : &e->plist; @@ -339,8 +339,8 @@ /* extent_ancestor() chases all the parent links until there aren't any more. extent_ancestor_1() does the same thing but it a function; the following optimizes the most common case. */ -INLINE EXTENT extent_ancestor (EXTENT e); -INLINE EXTENT +INLINE_HEADER EXTENT extent_ancestor (EXTENT e); +INLINE_HEADER EXTENT extent_ancestor (EXTENT e) { return e->flags.has_parent ? extent_ancestor_1 (e) : e; diff -r 9f011ab08d48 -r 2f8bb876ab1d src/faces.c --- a/src/faces.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/faces.c Mon Aug 13 11:16:07 2007 +0200 @@ -2034,9 +2034,7 @@ Fget (Vgui_element_face, Qforeground, Qunbound)); set_specifier_fallback (Fget (Vwidget_face, Qbackground, Qunbound), Fget (Vgui_element_face, Qbackground, Qunbound)); - set_specifier_fallback (Fget (Vwidget_face, Qbackground_pixmap, Qnil), - Fget (Vgui_element_face, Qbackground_pixmap, - Qunbound)); + /* We don't want widgets to have a default background pixmap. */ Vleft_margin_face = Fmake_face (Qleft_margin, build_string ("left margin face"), diff -r 9f011ab08d48 -r 2f8bb876ab1d src/faces.h --- a/src/faces.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/faces.h Mon Aug 13 11:16:07 2007 +0200 @@ -125,7 +125,7 @@ corresponding single-face cachels. Formerly we didn't bother to keep track of the faces used for - merging. We do know because we need to do so because there is no + merging. We do now because we need to do so because there is no other way to properly handle multiple charsets for Mule in the presence of display tables short of always computing the values for all charsets, which is very expensive. Instead, we use a diff -r 9f011ab08d48 -r 2f8bb876ab1d src/file-coding.c --- a/src/file-coding.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/file-coding.c Mon Aug 13 11:16:07 2007 +0200 @@ -2239,6 +2239,13 @@ } str->counter = 0; #endif /* MULE */ + if (CODING_SYSTEM_TYPE (str->codesys) == CODESYS_AUTODETECT + || CODING_SYSTEM_EOL_TYPE (str->codesys) == EOL_AUTODETECT) + { + xzero (str->decst); + str->decst.eol_type = EOL_AUTODETECT; + str->decst.mask = ~0; + } str->flags = str->ch = 0; } diff -r 9f011ab08d48 -r 2f8bb876ab1d src/fileio.c --- a/src/fileio.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/fileio.c Mon Aug 13 11:16:07 2007 +0200 @@ -635,8 +635,10 @@ This implementation is better than what one usually finds in libc. --hniksic */ +static unsigned int temp_name_rand; + DEFUN ("make-temp-name", Fmake_temp_name, 1, 1, 0, /* -Generate temporary file name starting with PREFIX. +Generate a temporary file name starting with PREFIX. The Emacs process number forms part of the result, so there is no danger of generating a name being used by another process. @@ -646,7 +648,8 @@ */ (prefix)) { - static char tbl[64] = { + static const char tbl[64] = + { 'A','B','C','D','E','F','G','H', 'I','J','K','L','M','N','O','P', 'Q','R','S','T','U','V','W','X', @@ -654,13 +657,12 @@ 'g','h','i','j','k','l','m','n', 'o','p','q','r','s','t','u','v', 'w','x','y','z','0','1','2','3', - '4','5','6','7','8','9','-','_' }; - static unsigned count, count_initialized_p; + '4','5','6','7','8','9','-','_' + }; Lisp_Object val; Bytecount len; Bufbyte *p, *data; - unsigned pid; CHECK_STRING (prefix); @@ -686,40 +688,33 @@ /* VAL is created by adding 6 characters to PREFIX. The first three are the PID of this process, in base 64, and the second three are - incremented if the file already exists. This ensures 262144 - unique file names per PID per PREFIX. */ - - pid = (unsigned)getpid (); - *p++ = tbl[pid & 63], pid >>= 6; - *p++ = tbl[pid & 63], pid >>= 6; - *p++ = tbl[pid & 63], pid >>= 6; + a pseudo-random number seeded from process startup time. This + ensures 262144 unique file names per PID per PREFIX per machine. */ + + { + unsigned int pid = (unsigned int) getpid (); + *p++ = tbl[(pid >> 0) & 63]; + *p++ = tbl[(pid >> 6) & 63]; + *p++ = tbl[(pid >> 12) & 63]; + } /* Here we try to minimize useless stat'ing when this function is invoked many times successively with the same PREFIX. We achieve - this by initializing count to a random value, and incrementing it - afterwards. */ - if (!count_initialized_p) - { - count = (unsigned)time (NULL); - /* Dumping temacs with a non-zero count_initialized_p wouldn't - make much sense. */ - if (NILP (Frunning_temacs_p ())) - count_initialized_p = 1; - } + this by using a very pseudo-random number generator to generate + file names unique to this process, with a very long cycle. */ while (1) { struct stat ignored; - unsigned num = count; - - p[0] = tbl[num & 63], num >>= 6; - p[1] = tbl[num & 63], num >>= 6; - p[2] = tbl[num & 63], num >>= 6; + + p[0] = tbl[(temp_name_rand >> 0) & 63]; + p[1] = tbl[(temp_name_rand >> 6) & 63]; + p[2] = tbl[(temp_name_rand >> 12) & 63]; /* Poor man's congruential RN generator. Replace with ++count for debugging. */ - count += 25229; - count %= 225307; + temp_name_rand += 25229; + temp_name_rand %= 225307; QUIT; @@ -1846,7 +1841,7 @@ { return Fsignal (Qfile_error, list3 (build_translated_string ("Creating directory"), - build_translated_string ("pathame too long"), + build_translated_string ("pathname too long"), dirname_)); } strncpy (dir, (char *) XSTRING_DATA (dirname_), @@ -2075,7 +2070,6 @@ return Qnil; } -#ifdef S_IFLNK DEFUN ("make-symbolic-link", Fmake_symbolic_link, 2, 3, "FMake symbolic link to file: \nFMake symbolic link to file %s: \np", /* Make a symbolic link to FILENAME, named LINKNAME. Both args strings. @@ -2087,6 +2081,7 @@ (filename, linkname, ok_if_already_exists)) { /* This function can GC. GC checked 1997.06.04. */ + /* XEmacs change: run handlers even if local machine doesn't have symlinks */ Lisp_Object handler; struct gcpro gcpro1, gcpro2; @@ -2114,6 +2109,7 @@ RETURN_UNGCPRO (call4 (handler, Qmake_symbolic_link, filename, linkname, ok_if_already_exists)); +#ifdef S_IFLNK if (NILP (ok_if_already_exists) || INTP (ok_if_already_exists)) barf_or_query_if_file_exists (linkname, "make it a link", @@ -2126,10 +2122,11 @@ report_file_error ("Making symbolic link", list2 (filename, linkname)); } +#endif /* S_IFLNK */ + UNGCPRO; return Qnil; } -#endif /* S_IFLNK */ #ifdef HPUX_NET @@ -2351,11 +2348,13 @@ (filename)) { /* This function can GC. GC checked 1997.04.10. */ + /* XEmacs change: run handlers even if local machine doesn't have symlinks */ #ifdef S_IFLNK char *buf; int bufsize; int valsize; Lisp_Object val; +#endif Lisp_Object handler; struct gcpro gcpro1; @@ -2370,6 +2369,7 @@ if (!NILP (handler)) return call2 (handler, Qfile_symlink_p, filename); +#ifdef S_IFLNK bufsize = 100; while (1) { @@ -4185,9 +4185,7 @@ DEFSUBR (Fdelete_file); DEFSUBR (Frename_file); DEFSUBR (Fadd_name_to_file); -#ifdef S_IFLNK DEFSUBR (Fmake_symbolic_link); -#endif /* S_IFLNK */ #ifdef HPUX_NET DEFSUBR (Fsysnetunam); #endif /* HPUX_NET */ @@ -4316,6 +4314,28 @@ #ifdef WINDOWSNT Vdirectory_sep_char = make_char ('\\'); #else - Vdirectory_sep_char = make_char ('/'); + Vdirectory_sep_char = make_char ('/'); #endif + + reinit_vars_of_fileio (); } + +void +reinit_vars_of_fileio (void) +{ + /* We want temp_name_rand to be initialized to a value likely to be + unique to the process, not to the executable. The danger is that + two different XEmacs processes using the same binary on different + machines creating temp files in the same directory will be + unlucky enough to have the same pid. If we randomize using + process startup time, then in practice they will be unlikely to + collide. We use the microseconds field so that scripts that start + simultaneous XEmacs processes on multiple machines will have less + chance of collision. */ + { + EMACS_TIME thyme; + + EMACS_GET_TIME (thyme); + temp_name_rand = (unsigned int) (EMACS_SECS (thyme) ^ EMACS_USECS (thyme)); + } +} diff -r 9f011ab08d48 -r 2f8bb876ab1d src/filelock.c --- a/src/filelock.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/filelock.c Mon Aug 13 11:16:07 2007 +0200 @@ -366,7 +366,7 @@ } void -unlock_all_files () +unlock_all_files (void) { register Lisp_Object tail; register struct buffer *b; diff -r 9f011ab08d48 -r 2f8bb876ab1d src/filemode.c --- a/src/filemode.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/filemode.c Mon Aug 13 11:16:07 2007 +0200 @@ -79,9 +79,9 @@ mode_string (unsigned short mode, char *str) { str[0] = ftypelet (mode); - rwx ((mode & 0700) << 0, &str[1]); - rwx ((mode & 0070) << 3, &str[4]); - rwx ((mode & 0007) << 6, &str[7]); + rwx ((unsigned short) ((mode & 0700) << 0), &str[1]); + rwx ((unsigned short) ((mode & 0070) << 3), &str[4]); + rwx ((unsigned short) ((mode & 0007) << 6), &str[7]); setst (mode, str); } diff -r 9f011ab08d48 -r 2f8bb876ab1d src/frame-msw.c --- a/src/frame-msw.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/frame-msw.c Mon Aug 13 11:16:07 2007 +0200 @@ -58,7 +58,7 @@ #define POPUP_WIDTH 30 #define POPUP_HEIGHT 10 -/* Default popup size, in characters */ +/* Default regular frame size, in characters */ #define DEFAULT_FRAME_WIDTH 80 #define DEFAULT_FRAME_HEIGHT 35 @@ -133,6 +133,7 @@ FRAME_MSWINDOWS_DATA(f)->ignore_next_lbutton_up = 0; FRAME_MSWINDOWS_DATA(f)->ignore_next_rbutton_up = 0; FRAME_MSWINDOWS_DATA(f)->sizing = 0; + FRAME_MSWINDOWS_DATA(f)->paint_pending = 0; FRAME_MSWINDOWS_MENU_HASH_TABLE(f) = Qnil; #ifdef HAVE_TOOLBARS FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE(f) = @@ -203,7 +204,6 @@ SetWindowLong (hwnd, XWL_FRAMEOBJ, (LONG)LISP_TO_VOID(frame_obj)); FRAME_MSWINDOWS_DC(f) = GetDC (hwnd); - FRAME_MSWINDOWS_CDC(f) = CreateCompatibleDC (FRAME_MSWINDOWS_CDC(f)); SetTextAlign (FRAME_MSWINDOWS_DC(f), TA_BASELINE | TA_LEFT | TA_NOUPDATECP); } @@ -273,7 +273,6 @@ { if (f->frame_data) { - DeleteDC(FRAME_MSWINDOWS_CDC(f)); ReleaseDC(FRAME_MSWINDOWS_HANDLE(f), FRAME_MSWINDOWS_DC(f)); DestroyWindow(FRAME_MSWINDOWS_HANDLE(f)); xfree (f->frame_data); @@ -610,11 +609,10 @@ void mswindows_size_frame_internal (struct frame* f, XEMACS_RECT_WH* dest) { - RECT rect; + RECT rect, ws_rect; int pixel_width, pixel_height; int size_p = (dest->width >=0 || dest->height >=0); int move_p = (dest->top >=0 || dest->left >=0); - struct device* d = XDEVICE (FRAME_DEVICE (f)); char_to_real_pixel_size (f, dest->width, dest->height, &pixel_width, &pixel_height); if (dest->width < 0) @@ -637,32 +635,44 @@ GetMenu (FRAME_MSWINDOWS_HANDLE(f)) != NULL, GetWindowLong (FRAME_MSWINDOWS_HANDLE(f), GWL_EXSTYLE)); - /* resize and move the window so that it fits on the screen. This is + /* resize and move the window so that it fits in the workspace. This is not restrictive since this will happen later anyway in WM_SIZE. We have to do this after adjusting the rect to account for menubar etc. */ + msw_get_workspace_coords (&ws_rect); pixel_width = rect.right - rect.left; pixel_height = rect.bottom - rect.top; - if (pixel_width > DEVICE_MSWINDOWS_HORZRES(d)) + if (pixel_width > ws_rect.right - ws_rect.left) { - pixel_width = DEVICE_MSWINDOWS_HORZRES(d); + pixel_width = ws_rect.right - ws_rect.left; size_p=1; } - if (pixel_height > DEVICE_MSWINDOWS_VERTRES(d)) + if (pixel_height > ws_rect.bottom - ws_rect.top) { - pixel_height = DEVICE_MSWINDOWS_VERTRES(d); + pixel_height = ws_rect.bottom - ws_rect.top; size_p=1; } - /* adjust position so window is on screen */ - if (dest->left + pixel_width > DEVICE_MSWINDOWS_HORZRES(d)) + /* adjust position so window is in workspace */ + if (dest->left + pixel_width > ws_rect.right) { - dest->left = DEVICE_MSWINDOWS_HORZRES(d) - pixel_width; + dest->left = ws_rect.right - pixel_width; move_p=1; } - if (dest->top + pixel_height > DEVICE_MSWINDOWS_VERTRES(d)) + if (dest->left < ws_rect.left) { - dest->top = DEVICE_MSWINDOWS_VERTRES(d) - pixel_height; + dest->left = ws_rect.left; + move_p=1; + } + + if (dest->top + pixel_height > ws_rect.bottom) + { + dest->top = ws_rect.bottom - pixel_height; + move_p=1; + } + if (dest->top < ws_rect.top) + { + dest->top = ws_rect.top; move_p=1; } @@ -766,7 +776,7 @@ { DOCINFO di; struct device *device = XDEVICE (FRAME_DEVICE (f)); - HDC hdc = DEVICE_MSPRINTER_HDC (device); + HDC hdc; int frame_left, frame_top, frame_width, frame_height; /* Change printer parameters */ @@ -798,9 +808,14 @@ abort(); } + assert (!FRAME_MSPRINTER_PAGE_STARTED (f)); msprinter_apply_devmode (device, devmode); } + /* DC might be recreated in msprinter_apply_devmode, + so do not initialize until now */ + hdc = DEVICE_MSPRINTER_HDC (device); + /* Compute geometry properties */ frame_left = (MulDiv (GetDeviceCaps (hdc, LOGPIXELSX), FRAME_MSPRINTER_LEFT_MARGIN(f), 1440) @@ -878,7 +893,6 @@ error ("Cannot start print job"); /* Finish frame setup */ - FRAME_MSPRINTER_CDC(f) = CreateCompatibleDC (hdc); FRAME_MSPRINTER_JOB_STARTED (f) = 1; FRAME_VISIBLE_P(f) = 0; } @@ -904,8 +918,6 @@ EndPage (hdc); if (FRAME_MSPRINTER_JOB_STARTED (f)) EndDoc (hdc); - if (FRAME_MSPRINTER_CDC(f)) - DeleteDC (FRAME_MSPRINTER_CDC(f)); xfree (f->frame_data); } diff -r 9f011ab08d48 -r 2f8bb876ab1d src/frame-x.c --- a/src/frame-x.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/frame-x.c Mon Aug 13 11:16:07 2007 +0200 @@ -50,6 +50,7 @@ #include "faces.h" #include "frame.h" #include "window.h" +#include "gutter.h" #ifdef HAVE_DRAGNDROP #include "dragdrop.h" @@ -1146,12 +1147,12 @@ x_event.xbutton.y_root = lisp_event->event.button.y; } modifier = lisp_event->event.button.modifiers; - if (modifier & MOD_SHIFT) state |= ShiftMask; - if (modifier & MOD_CONTROL) state |= ControlMask; - if (modifier & MOD_META) state |= xd->MetaMask; - if (modifier & MOD_SUPER) state |= xd->SuperMask; - if (modifier & MOD_HYPER) state |= xd->HyperMask; - if (modifier & MOD_ALT) state |= xd->AltMask; + if (modifier & XEMACS_MOD_SHIFT) state |= ShiftMask; + if (modifier & XEMACS_MOD_CONTROL) state |= ControlMask; + if (modifier & XEMACS_MOD_META) state |= xd->MetaMask; + if (modifier & XEMACS_MOD_SUPER) state |= xd->SuperMask; + if (modifier & XEMACS_MOD_HYPER) state |= xd->HyperMask; + if (modifier & XEMACS_MOD_ALT) state |= xd->AltMask; state |= Button1Mask << (lisp_event->event.button.button-1); x_event.xbutton.state = state; @@ -1412,12 +1413,12 @@ } modifier = lisp_event->event.button.modifiers; - if (modifier & MOD_SHIFT) state |= ShiftMask; - if (modifier & MOD_CONTROL) state |= ControlMask; - if (modifier & MOD_META) state |= xd->MetaMask; - if (modifier & MOD_SUPER) state |= xd->SuperMask; - if (modifier & MOD_HYPER) state |= xd->HyperMask; - if (modifier & MOD_ALT) state |= xd->AltMask; + if (modifier & XEMACS_MOD_SHIFT) state |= ShiftMask; + if (modifier & XEMACS_MOD_CONTROL) state |= ControlMask; + if (modifier & XEMACS_MOD_META) state |= xd->MetaMask; + if (modifier & XEMACS_MOD_SUPER) state |= xd->SuperMask; + if (modifier & XEMACS_MOD_HYPER) state |= xd->HyperMask; + if (modifier & XEMACS_MOD_ALT) state |= xd->AltMask; state |= Button1Mask << (lisp_event->event.button.button-1); x_event.xbutton.state = state; @@ -1550,13 +1551,16 @@ { struct window *win = XWINDOW (f->root_window); - WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f); - WINDOW_TOP (win) = FRAME_TOP_BORDER_END (f); + WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f) + + FRAME_LEFT_GUTTER_BOUNDS (f); + WINDOW_TOP (win) = FRAME_TOP_BORDER_END (f) + + FRAME_TOP_GUTTER_BOUNDS (f); if (!NILP (f->minibuffer_window)) { win = XWINDOW (f->minibuffer_window); - WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f); + WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f) + + FRAME_LEFT_GUTTER_BOUNDS (f); } } diff -r 9f011ab08d48 -r 2f8bb876ab1d src/frame.c --- a/src/frame.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/frame.c Mon Aug 13 11:16:07 2007 +0200 @@ -467,19 +467,14 @@ reset_face_cachels (XWINDOW (FRAME_SELECTED_WINDOW (f))); reset_glyph_cachels (XWINDOW (FRAME_SELECTED_WINDOW (f))); reset_subwindow_cachels (f); + change_frame_size (f, f->height, f->width, 0); - } MAYBE_FRAMEMETH (f, init_frame_2, (f, props)); Fset_frame_properties (frame, props); MAYBE_FRAMEMETH (f, init_frame_3, (f)); - /* now initialise the gutters, this won't change the frame size - so is ok here. */ - if (!DEVICE_STREAM_P (d)) - init_frame_gutters (f); - /* Hallelujah, praise the lord. */ f->init_finished = 1; @@ -505,6 +500,18 @@ MAYBE_FRAMEMETH (f, after_init_frame, (f, first_frame_on_device, first_frame_on_console)); + if (!DEVICE_STREAM_P (d)) + { + /* Now initialise the gutters. This won't change the frame size, + but is needed as input to the layout that change_frame_size + will eventually do. Unfortunately gutter sizing code relies + on the frame in question being visible so we can't do this + earlier. */ + init_frame_gutters (f); + + change_frame_size (f, f->height, f->width, 0); + } + if (first_frame_on_device) { if (first_frame_on_console) @@ -905,13 +912,13 @@ f->selected_window = window; if (!MINI_WINDOW_P (XWINDOW (window)) || FRAME_MINIBUF_ONLY_P (f)) { -#ifdef HAVE_TOOLBARS if (!EQ (f->last_nonminibuf_window, window)) { +#ifdef HAVE_TOOLBARS MARK_TOOLBAR_CHANGED; +#endif MARK_GUTTER_CHANGED; } -#endif f->last_nonminibuf_window = window; } } @@ -2864,6 +2871,9 @@ - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) - 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f); + new_pixheight -= + (FRAME_TOP_GUTTER_BOUNDS (f) + FRAME_BOTTOM_GUTTER_BOUNDS (f)); + new_pixwidth += + FRAME_THEORETICAL_LEFT_TOOLBAR_WIDTH (f) + 2 * FRAME_THEORETICAL_LEFT_TOOLBAR_BORDER_WIDTH (f) @@ -2876,6 +2886,9 @@ - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) - 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f); + new_pixwidth -= + (FRAME_LEFT_GUTTER_BOUNDS (f) + FRAME_RIGHT_GUTTER_BOUNDS (f)); + /* Adjust the width for the end glyph which may be a different width than the default character width. */ { @@ -2897,7 +2910,8 @@ if (new_pixheight) { - XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_top = FRAME_TOP_BORDER_END (f); + XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_top + = FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f); if (FRAME_HAS_MINIBUF_P (f) && ! FRAME_MINIBUF_ONLY_P (f)) @@ -2923,7 +2937,10 @@ new_pixheight - minibuf_height, 0); XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_top = - new_pixheight - minibuf_height + FRAME_TOP_BORDER_END (f); + FRAME_TOP_BORDER_END (f) + + FRAME_TOP_GUTTER_BOUNDS (f) + + FRAME_BOTTOM_GUTTER_BOUNDS (f) + + new_pixheight - minibuf_height; set_window_pixheight (FRAME_MINIBUF_WINDOW (f), minibuf_height, 0); } @@ -2938,13 +2955,14 @@ if (new_pixwidth) { - XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_left = FRAME_LEFT_BORDER_END (f); + XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_left = + FRAME_LEFT_BORDER_END (f) + FRAME_LEFT_GUTTER_BOUNDS (f); set_window_pixwidth (FRAME_ROOT_WINDOW (f), new_pixwidth, 0); if (FRAME_HAS_MINIBUF_P (f)) { XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_left = - FRAME_LEFT_BORDER_END (f); + FRAME_LEFT_BORDER_END (f) + FRAME_LEFT_GUTTER_BOUNDS (f); set_window_pixwidth (FRAME_MINIBUF_WINDOW (f), new_pixwidth, 0); } @@ -2963,6 +2981,7 @@ } MARK_FRAME_TOOLBARS_CHANGED (f); + MARK_FRAME_GUTTERS_CHANGED (f); MARK_FRAME_CHANGED (f); f->echo_area_garbaged = 1; } @@ -3372,11 +3391,17 @@ Vsynchronize_minibuffers = Qnil; DEFVAR_LISP ("frame-title-format", &Vframe_title_format /* -Controls the title of the X window corresponding to the selected frame. +Controls the title of the window-system window of the selected frame. This is the same format as `modeline-format' with the exception that %- is ignored. */ ); +/* #### I would change this unilaterally but for the wrath of the Kyles +of the world. */ +#ifdef WINDOWSNT + Vframe_title_format = build_string ("%b - XEmacs"); +#else Vframe_title_format = build_string ("%S: %b"); +#endif DEFVAR_LISP ("frame-icon-title-format", &Vframe_icon_title_format /* Controls the title of the icon corresponding to the selected frame. @@ -3386,8 +3411,9 @@ DEFVAR_LISP ("default-frame-name", &Vdefault_frame_name /* The default name to assign to newly-created frames. -This can be overridden by arguments to `make-frame'. -This must be a string. +This can be overridden by arguments to `make-frame'. This must be a string. +This is used primarily for picking up X resources, and is *not* the title +of the frame. (See `frame-title-format'.) */ ); #ifndef INFODOCK Vdefault_frame_name = build_string ("emacs"); diff -r 9f011ab08d48 -r 2f8bb876ab1d src/frame.h --- a/src/frame.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/frame.h Mon Aug 13 11:16:07 2007 +0200 @@ -116,9 +116,14 @@ unsigned int current_toolbar_size[4]; #endif - /* Dynamic array of display lines for gutters */ - display_line_dynarr *current_display_lines; - display_line_dynarr *desired_display_lines; + /* Size of gutters as seen by redisplay. This is used to determine + whether to re-layout windows by a call to change_frame_size early + in redisplay_frame. */ + unsigned int current_gutter_bounds[4]; + + /* Dynamic arrays of display lines for gutters */ + display_line_dynarr *current_display_lines[4]; + display_line_dynarr *desired_display_lines[4]; /* A structure of auxiliary data specific to the device type. struct x_frame is used for X window frames; defined in console-x.h */ @@ -258,9 +263,9 @@ #define FRAME_TYPE_P(f, type) EQ (FRAME_TYPE (f), Q##type) #ifdef ERROR_CHECK_TYPECHECK -INLINE struct frame * +INLINE_HEADER struct frame * error_check_frame_type (struct frame * f, Lisp_Object sym); -INLINE struct frame * +INLINE_HEADER struct frame * error_check_frame_type (struct frame * f, Lisp_Object sym) { assert (EQ (FRAME_TYPE (f), sym)); diff -r 9f011ab08d48 -r 2f8bb876ab1d src/glyphs-eimage.c --- a/src/glyphs-eimage.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/glyphs-eimage.c Mon Aug 13 11:16:07 2007 +0200 @@ -949,9 +949,9 @@ rgblist = MAYBE_LISP_DEVMETH (XDEVICE (c->device), color_instance_rgb_components, (c)); - my_background.red = XINT (XCAR (rgblist)); - my_background.green = XINT (XCAR (XCDR (rgblist))); - my_background.blue = XINT (XCAR (XCDR (XCDR (rgblist)))); + my_background.red = (unsigned short) XINT (XCAR (rgblist)); + my_background.green = (unsigned short) XINT (XCAR (XCDR (rgblist))); + my_background.blue = (unsigned short) XINT (XCAR (XCDR (XCDR (rgblist)))); } if (png_get_bKGD (png_ptr, info_ptr, &image_background)) diff -r 9f011ab08d48 -r 2f8bb876ab1d src/glyphs-msw.c --- a/src/glyphs-msw.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/glyphs-msw.c Mon Aug 13 11:16:07 2007 +0200 @@ -72,10 +72,13 @@ #endif #ifdef HAVE_XPM DEFINE_DEVICE_IIFORMAT (mswindows, xpm); +DEFINE_DEVICE_IIFORMAT (msprinter, xpm); #endif DEFINE_DEVICE_IIFORMAT (mswindows, xbm); +DEFINE_DEVICE_IIFORMAT (msprinter, xbm); #ifdef HAVE_XFACE DEFINE_DEVICE_IIFORMAT (mswindows, xface); +DEFINE_DEVICE_IIFORMAT (msprinter, xface); #endif DEFINE_DEVICE_IIFORMAT (mswindows, button); DEFINE_DEVICE_IIFORMAT (mswindows, edit_field); @@ -103,7 +106,20 @@ enum image_instance_type type); static void mswindows_initialize_image_instance_mask (Lisp_Image_Instance* image, - struct frame* f); + HDC hcdc); + +/* + * Given device D, retrieve compatible device context. D can be either + * mswindows or an msprinter device. + */ +inline static HDC +get_device_compdc (struct device *d) +{ + if (DEVICE_MSWINDOWS_P (d)) + return DEVICE_MSWINDOWS_HCDC (d); + else + return DEVICE_MSPRINTER_HCDC (d); +} #define BPLINE(width) ((int)(~3UL & (unsigned long)((width) +3))) @@ -124,7 +140,7 @@ BITMAPINFO* bmp_info; unsigned char *ip, *dp; - if (DEVICE_MSWINDOWS_BITSPIXEL (d) > 0) + if (GetDeviceCaps (get_device_compdc (d), BITSPIXEL) > 0) { int bpline = BPLINE(width * 3); /* FIXME: we can do this because 24bpp implies no color table, once @@ -206,25 +222,28 @@ } /* build up an RGBQUAD colortable */ - for (i = 0; i < qtable->num_active_colors; i++) { - colortbl[i].rgbRed = (BYTE) qtable->rm[i]; - colortbl[i].rgbGreen = (BYTE) qtable->gm[i]; - colortbl[i].rgbBlue = (BYTE) qtable->bm[i]; - colortbl[i].rgbReserved = 0; - } + for (i = 0; i < qtable->num_active_colors; i++) + { + colortbl[i].rgbRed = (BYTE) qtable->rm[i]; + colortbl[i].rgbGreen = (BYTE) qtable->gm[i]; + colortbl[i].rgbBlue = (BYTE) qtable->bm[i]; + colortbl[i].rgbReserved = 0; + } /* now build up the data. picture has to be upside-down and back-to-front for msw bitmaps */ ip = pic; - for (i = height-1; i >= 0; i--) { - dp = (*bmp_data) + (i * bpline); - for (j = 0; j < width; j++) { - rd = *ip++; - gr = *ip++; - bl = *ip++; - *dp++ = QUANT_GET_COLOR (qtable,rd,gr,bl); + for (i = height-1; i >= 0; i--) + { + dp = (*bmp_data) + (i * bpline); + for (j = 0; j < width; j++) + { + rd = *ip++; + gr = *ip++; + bl = *ip++; + *dp++ = QUANT_GET_COLOR (qtable,rd,gr,bl); + } } - } xfree (qtable); } /* fix up the standard stuff */ @@ -296,20 +315,11 @@ { Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); struct device *d = XDEVICE (device); - struct frame *f; void* bmp_buf=0; enum image_instance_type type; HBITMAP bitmap; HDC hdc; - if (!DEVICE_MSWINDOWS_P (d)) - signal_simple_error ("Not an mswindows device", device); - - if (NILP (DEVICE_SELECTED_FRAME (d))) - signal_simple_error ("No selected frame on mswindows device", device); - - f = XFRAME (DEVICE_SELECTED_FRAME (d)); - if (dest_mask & IMAGE_COLOR_PIXMAP_MASK) type = IMAGE_COLOR_PIXMAP; else if (dest_mask & IMAGE_POINTER_MASK) @@ -317,13 +327,13 @@ else incompatible_image_types (instantiator, dest_mask, IMAGE_COLOR_PIXMAP_MASK | IMAGE_POINTER_MASK); - hdc = FRAME_MSWINDOWS_CDC (f); - - bitmap=CreateDIBSection (hdc, - bmp_info, - DIB_RGB_COLORS, - &bmp_buf, - 0,0); + + hdc = get_device_compdc (d); + bitmap = CreateDIBSection (hdc, + bmp_info, + DIB_RGB_COLORS, + &bmp_buf, + 0, 0); if (!bitmap || !bmp_buf) signal_simple_error ("Unable to create bitmap", instantiator); @@ -340,15 +350,15 @@ IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii) = bitmap; IMAGE_INSTANCE_MSWINDOWS_MASK (ii) = NULL; - IMAGE_INSTANCE_PIXMAP_WIDTH (ii) = bmp_info->bmiHeader.biWidth; - IMAGE_INSTANCE_PIXMAP_HEIGHT (ii) = bmp_info->bmiHeader.biHeight; - IMAGE_INSTANCE_PIXMAP_DEPTH (ii) = bmp_info->bmiHeader.biBitCount; + IMAGE_INSTANCE_PIXMAP_WIDTH (ii) = bmp_info->bmiHeader.biWidth; + IMAGE_INSTANCE_PIXMAP_HEIGHT (ii) = bmp_info->bmiHeader.biHeight; + IMAGE_INSTANCE_PIXMAP_DEPTH (ii) = bmp_info->bmiHeader.biBitCount; XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii), x_hot); XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii), y_hot); if (create_mask) { - mswindows_initialize_image_instance_mask (ii, f); + mswindows_initialize_image_instance_mask (ii, hdc); } if (type == IMAGE_POINTER) @@ -365,12 +375,10 @@ int slice, Lisp_Object instantiator) { - Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); - struct device *d = XDEVICE (device); - struct frame *f = XFRAME (DEVICE_SELECTED_FRAME (d)); + struct device *d = XDEVICE (IMAGE_INSTANCE_DEVICE (ii)); void* bmp_buf=0; - HDC hdc = FRAME_MSWINDOWS_CDC (f); - HBITMAP bitmap = CreateDIBSection (hdc, + + HBITMAP bitmap = CreateDIBSection (get_device_compdc (d), bmp_info, DIB_RGB_COLORS, &bmp_buf, @@ -400,8 +408,7 @@ COLORREF bkcolor; int slice; - if (!DEVICE_MSWINDOWS_P (XDEVICE (device))) - signal_simple_error ("Not an mswindows device", device); + CHECK_MSGDI_DEVICE (device); /* this is a hack but MaskBlt and TransparentBlt are not supported on most windows variants */ @@ -433,38 +440,38 @@ } } -static void set_mono_pixel ( unsigned char* bits, - int bpline, int height, - int x, int y, int white ) +inline static void +set_mono_pixel (unsigned char* bits, + int bpline, int height, + int x, int y, int white) { int i; - unsigned char bitnum; + unsigned char bitnum; /* Find the byte on which this scanline begins */ i = (height - y - 1) * bpline; /* Find the byte containing this pixel */ i += (x >> 3); /* Which bit is it? */ - bitnum = (unsigned char)( 7 - (x % 8) ); - if( white ) /* Turn it on */ - bits[i] |= (1<bmiHeader.biWidth=IMAGE_INSTANCE_PIXMAP_WIDTH (image); bmp_info->bmiHeader.biHeight = height; - bmp_info->bmiHeader.biPlanes=1; + bmp_info->bmiHeader.biPlanes = 1; bmp_info->bmiHeader.biSize=sizeof(BITMAPINFOHEADER); - bmp_info->bmiHeader.biBitCount=1; - bmp_info->bmiHeader.biCompression=BI_RGB; + bmp_info->bmiHeader.biBitCount = 1; + bmp_info->bmiHeader.biCompression = BI_RGB; bmp_info->bmiHeader.biClrUsed = 2; bmp_info->bmiHeader.biClrImportant = 2; bmp_info->bmiHeader.biSizeImage = height * maskbpline; @@ -504,10 +511,10 @@ bmp_info->bmiHeader.biWidth=IMAGE_INSTANCE_PIXMAP_WIDTH (image); bmp_info->bmiHeader.biHeight = -height; - bmp_info->bmiHeader.biPlanes=1; + bmp_info->bmiHeader.biPlanes = 1; bmp_info->bmiHeader.biSize=sizeof(BITMAPINFOHEADER); - bmp_info->bmiHeader.biBitCount=24; - bmp_info->bmiHeader.biCompression=BI_RGB; + bmp_info->bmiHeader.biBitCount = 24; + bmp_info->bmiHeader.biCompression = BI_RGB; bmp_info->bmiHeader.biClrUsed = 0; bmp_info->bmiHeader.biClrImportant = 0; bmp_info->bmiHeader.biSizeImage = height * bpline; @@ -578,17 +585,18 @@ CreateIconIndirect (&x_icon); } -HBITMAP -mswindows_create_resized_bitmap (Lisp_Image_Instance* ii, - struct frame* f, - int newx, int newy) +static HBITMAP +create_resized_bitmap (HBITMAP curbmp, struct frame *f, + int curx, int cury, + int newx, int newy) { HBITMAP newbmp; HGDIOBJ old1, old2; - HDC hcdc = FRAME_MSWINDOWS_CDC (f); + + HDC hcdc = get_device_compdc (XDEVICE (FRAME_DEVICE (f))); HDC hdcDst = CreateCompatibleDC (hcdc); - old1 = SelectObject (hcdc, IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii)); + old1 = SelectObject (hcdc, curbmp); newbmp = CreateCompatibleBitmap (hcdc, newx, newy); @@ -596,8 +604,8 @@ if (!StretchBlt (hdcDst, 0, 0, newx, newy, hcdc, 0, 0, - IMAGE_INSTANCE_PIXMAP_WIDTH (ii), - IMAGE_INSTANCE_PIXMAP_HEIGHT (ii), + curx, + cury, SRCCOPY)) { DeleteObject (newbmp); @@ -613,43 +621,33 @@ } HBITMAP +mswindows_create_resized_bitmap (Lisp_Image_Instance* ii, + struct frame* f, + int newx, int newy) +{ + return create_resized_bitmap (IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii), + f, + IMAGE_INSTANCE_PIXMAP_WIDTH (ii), + IMAGE_INSTANCE_PIXMAP_HEIGHT (ii), + newx, newy); +} + +HBITMAP mswindows_create_resized_mask (Lisp_Image_Instance* ii, struct frame* f, int newx, int newy) { - if (IMAGE_INSTANCE_MSWINDOWS_MASK (ii)) - { - HBITMAP newmask; - HGDIOBJ old1, old2; - HDC hcdc = FRAME_MSWINDOWS_CDC (f); - HDC hdcDst = CreateCompatibleDC (hcdc); - - old1 = SelectObject (hcdc, IMAGE_INSTANCE_MSWINDOWS_MASK (ii)); - newmask = CreateCompatibleBitmap(hcdc, newx, newy); - old2 = SelectObject (hdcDst, newmask); - - if (!StretchBlt(hdcDst, 0, 0, newx, newy, - hcdc, 0, 0, - IMAGE_INSTANCE_PIXMAP_WIDTH (ii), - IMAGE_INSTANCE_PIXMAP_HEIGHT (ii), - SRCCOPY)) - { - DeleteObject (newmask); - DeleteDC (hdcDst); - return NULL; - } - - SelectObject (hdcDst, old2); - SelectObject (hcdc, old1); - - DeleteDC (hdcDst); - - return newmask; - } - - return NULL; + if (IMAGE_INSTANCE_MSWINDOWS_MASK (ii) == NULL) + return NULL; + + return create_resized_bitmap (IMAGE_INSTANCE_MSWINDOWS_MASK (ii), + f, + IMAGE_INSTANCE_PIXMAP_WIDTH (ii), + IMAGE_INSTANCE_PIXMAP_HEIGHT (ii), + newx, newy); } +#if 0 /* Currently unused */ int mswindows_resize_dibitmap_instance (Lisp_Image_Instance* ii, struct frame* f, @@ -673,6 +671,7 @@ return TRUE; } +#endif /********************************************************************** * XPM * @@ -791,7 +790,7 @@ default: { signal_double_file_error_2 ("Parsing pixmap data", - "unknown error code", + "unknown error", make_int (result), image); } } @@ -921,8 +920,7 @@ Lisp_Object color_symbol_alist = find_keyword_in_vector (instantiator, Q_color_symbols); - if (!DEVICE_MSWINDOWS_P (XDEVICE (device))) - signal_simple_error ("Not an mswindows device", device); + CHECK_MSGDI_DEVICE (device); assert (!NILP (data)); @@ -1007,8 +1005,7 @@ int bmp_bits; Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); - if (!DEVICE_MSWINDOWS_P (XDEVICE (device))) - signal_simple_error ("Not an mswindows device", device); + CHECK_MSGDI_DEVICE (device); assert (!NILP (data)); @@ -1233,8 +1230,7 @@ xzero (iconinfo); - if (!DEVICE_MSWINDOWS_P (XDEVICE (device))) - signal_simple_error ("Not an mswindows device", device); + CHECK_MSGDI_DEVICE (device); type = resource_symbol_to_type (resource_type); @@ -1407,7 +1403,8 @@ * Table index for the hex values. Initialized once, first time. * Used for translation value or delimiter significance lookup. */ -static void initHexTable() +static void +initHexTable (void) { /* * We build the table at run time for several reasons: @@ -1440,7 +1437,8 @@ /* * read next hex value in the input stream, return -1 if EOF */ -static int NextInt ( FILE *fstream ) +static int +NextInt (FILE *fstream) { int ch; int value = 0; @@ -1730,17 +1728,16 @@ Lisp_Object mask_filename) { Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); - struct frame* f = XFRAME (DEVICE_SELECTED_FRAME (XDEVICE (device))); Lisp_Object foreground = find_keyword_in_vector (instantiator, Q_foreground); Lisp_Object background = find_keyword_in_vector (instantiator, Q_background); enum image_instance_type type; COLORREF black = PALETTERGB (0,0,0); COLORREF white = PALETTERGB (255,255,255); - - HDC hdc = FRAME_MSWINDOWS_CDC (f); - - if (!DEVICE_MSWINDOWS_P (XDEVICE (device))) - signal_simple_error ("Not an MS-Windows device", device); + HDC hdc; + + CHECK_MSGDI_DEVICE (device); + + hdc = get_device_compdc (XDEVICE (device)); if ((dest_mask & IMAGE_MONO_PIXMAP_MASK) && (dest_mask & IMAGE_COLOR_PIXMAP_MASK)) @@ -1855,9 +1852,7 @@ Lisp_Object mask_data = find_keyword_in_vector (instantiator, Q_mask_data); Lisp_Object mask_file = find_keyword_in_vector (instantiator, Q_mask_file); Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - struct frame* f = XFRAME (DEVICE_SELECTED_FRAME - (XDEVICE (IMAGE_INSTANCE_DEVICE (ii)))); - HDC hdc = FRAME_MSWINDOWS_CDC (f); + HDC hdc = get_device_compdc (XDEVICE (IMAGE_INSTANCE_DEVICE (ii))); HBITMAP mask = 0; if (!NILP (mask_data)) @@ -2230,12 +2225,10 @@ { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); - struct device* d = XDEVICE (device); Lisp_Object frame = FW_FRAME (domain); HWND wnd; - if (!DEVICE_MSWINDOWS_P (d)) - signal_simple_error ("Not an mswindows device", device); + CHECK_MSWINDOWS_DEVICE (device); /* have to set the type this late in case there is no device instantiation for a widget */ @@ -2354,7 +2347,6 @@ /* this function can call lisp */ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii), style; - struct device* d = XDEVICE (device); Lisp_Object frame = FW_FRAME (domain); Extbyte* nm=0; HWND wnd; @@ -2362,8 +2354,7 @@ Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii); Lisp_Gui_Item* pgui = XGUI_ITEM (gui); - if (!DEVICE_MSWINDOWS_P (d)) - signal_simple_error ("Not an mswindows device", device); + CHECK_MSWINDOWS_DEVICE (device); if (!gui_item_active_p (gui)) flags |= WS_DISABLED; @@ -2440,7 +2431,7 @@ Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain) { - /* this function can call lisp */ + /* This function can call lisp */ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); HWND wnd; int flags = WS_TABSTOP;/* BS_NOTIFY #### is needed to get exotic feedback @@ -2686,9 +2677,10 @@ Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain) { + /* This function can call lisp */ Lisp_Object rest; HWND wnd; - int i = 0; + int i = 0, selected = 0; Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object orient = find_keyword_in_vector (instantiator, Q_orientation); unsigned int flags = WS_TABSTOP; @@ -2706,38 +2698,49 @@ pointer_bg, dest_mask, domain, WC_TABCONTROL, /* borders don't suit tabs so well */ flags, 0); - wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); /* add items to the tab */ LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))) { add_tab_item (image_instance, wnd, XCAR (rest), domain, i); + if (gui_item_selected_p (XCAR (rest))) + selected = i; i++; } + SendMessage (wnd, TCM_SETCURSEL, selected, 0); } /* set the properties of a tab control */ static void mswindows_tab_control_update (Lisp_Object image_instance) { + /* This function can GC if IN_REDISPLAY is false. */ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii)) { HWND wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); - int i = 0; + int i = 0, selected = 0; Lisp_Object rest; /* delete the pre-existing items */ SendMessage (wnd, TCM_DELETEALLITEMS, 0, 0); + /* Pick up the items we recorded earlier. We do this here so + that the callbacks get set up with the new items. */ + IMAGE_INSTANCE_WIDGET_ITEMS (ii) = + IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii); + IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii) = Qnil; /* add items to the tab */ LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))) { add_tab_item (image_instance, wnd, XCAR (rest), IMAGE_INSTANCE_SUBWINDOW_FRAME (ii), i); + if (gui_item_selected_p (XCAR (rest))) + selected = i; i++; } + SendMessage (wnd, TCM_SETCURSEL, selected, 0); } } @@ -2926,51 +2929,64 @@ void console_type_create_glyphs_mswindows (void) { - /* image methods */ - + /* image methods - display */ CONSOLE_HAS_METHOD (mswindows, print_image_instance); CONSOLE_HAS_METHOD (mswindows, finalize_image_instance); CONSOLE_HAS_METHOD (mswindows, unmap_subwindow); CONSOLE_HAS_METHOD (mswindows, map_subwindow); CONSOLE_HAS_METHOD (mswindows, update_subwindow); + CONSOLE_HAS_METHOD (mswindows, resize_subwindow); CONSOLE_HAS_METHOD (mswindows, update_widget); CONSOLE_HAS_METHOD (mswindows, image_instance_equal); CONSOLE_HAS_METHOD (mswindows, image_instance_hash); CONSOLE_HAS_METHOD (mswindows, init_image_instance_from_eimage); CONSOLE_HAS_METHOD (mswindows, locate_pixmap_file); - CONSOLE_HAS_METHOD (mswindows, resize_subwindow); + + /* image methods - printer */ + CONSOLE_INHERITS_METHOD (msprinter, mswindows, print_image_instance); + CONSOLE_INHERITS_METHOD (msprinter, mswindows, finalize_image_instance); + CONSOLE_INHERITS_METHOD (msprinter, mswindows, image_instance_equal); + CONSOLE_INHERITS_METHOD (msprinter, mswindows, image_instance_hash); + CONSOLE_INHERITS_METHOD (msprinter, mswindows, init_image_instance_from_eimage); + CONSOLE_INHERITS_METHOD (msprinter, mswindows, locate_pixmap_file); } void image_instantiator_format_create_glyphs_mswindows (void) { - IIFORMAT_VALID_CONSOLE (mswindows, nothing); - IIFORMAT_VALID_CONSOLE (mswindows, string); - IIFORMAT_VALID_CONSOLE (mswindows, layout); - IIFORMAT_VALID_CONSOLE (mswindows, formatted_string); - IIFORMAT_VALID_CONSOLE (mswindows, inherit); + IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, nothing); + IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, string); + IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, layout); + IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, formatted_string); + IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, inherit); /* image-instantiator types */ + INITIALIZE_DEVICE_IIFORMAT (mswindows, xbm); + INITIALIZE_DEVICE_IIFORMAT (msprinter, xbm); + IIFORMAT_HAS_DEVMETHOD (mswindows, xbm, instantiate); + IIFORMAT_INHERITS_DEVMETHOD (msprinter, mswindows, xbm, instantiate); #ifdef HAVE_XPM INITIALIZE_DEVICE_IIFORMAT (mswindows, xpm); + INITIALIZE_DEVICE_IIFORMAT (msprinter, xpm); IIFORMAT_HAS_DEVMETHOD (mswindows, xpm, instantiate); + IIFORMAT_INHERITS_DEVMETHOD (msprinter, mswindows, xpm, instantiate); #endif - INITIALIZE_DEVICE_IIFORMAT (mswindows, xbm); - IIFORMAT_HAS_DEVMETHOD (mswindows, xbm, instantiate); #ifdef HAVE_XFACE INITIALIZE_DEVICE_IIFORMAT (mswindows, xface); + INITIALIZE_DEVICE_IIFORMAT (msprinter, xface); IIFORMAT_HAS_DEVMETHOD (mswindows, xface, instantiate); + IIFORMAT_INHERITS_DEVMETHOD (msprinter, mswindows, xface, instantiate); #endif #ifdef HAVE_JPEG - IIFORMAT_VALID_CONSOLE (mswindows, jpeg); + IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, jpeg); #endif #ifdef HAVE_TIFF - IIFORMAT_VALID_CONSOLE (mswindows, tiff); + IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, tiff); #endif #ifdef HAVE_PNG - IIFORMAT_VALID_CONSOLE (mswindows, png); + IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, png); #endif #ifdef HAVE_GIF - IIFORMAT_VALID_CONSOLE (mswindows, gif); + IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, gif); #endif #ifdef HAVE_WIDGETS /* button widget */ @@ -3025,7 +3041,7 @@ IIFORMAT_VALID_KEYWORD (bmp, Q_data, check_valid_string); IIFORMAT_VALID_KEYWORD (bmp, Q_file, check_valid_string); - IIFORMAT_VALID_CONSOLE (mswindows, bmp); + IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, bmp); /* mswindows resources */ INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (mswindows_resource, @@ -3040,7 +3056,7 @@ check_valid_resource_symbol); IIFORMAT_VALID_KEYWORD (mswindows_resource, Q_resource_id, check_valid_resource_id); IIFORMAT_VALID_KEYWORD (mswindows_resource, Q_file, check_valid_string); - IIFORMAT_VALID_CONSOLE (mswindows, mswindows_resource); + IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, mswindows_resource); } void diff -r 9f011ab08d48 -r 2f8bb876ab1d src/glyphs-widget.c --- a/src/glyphs-widget.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/glyphs-widget.c Mon Aug 13 11:16:07 2007 +0200 @@ -149,6 +149,13 @@ } static void +check_valid_int_or_function (Lisp_Object data) +{ + if (!INTP (data) && !CONSP (data)) + signal_simple_error ("must be an integer or expresssion", data); +} + +static void check_valid_symbol (Lisp_Object data) { CHECK_SYMBOL (data); @@ -360,6 +367,8 @@ { Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance); struct image_instantiator_methods* meths; + Lisp_Object dynamic_width = Qnil; + Lisp_Object dynamic_height = Qnil; /* First just set up what we already have. */ if (width) *width = IMAGE_INSTANCE_WIDTH (ii); @@ -402,6 +411,19 @@ *height = h + 2 * WIDGET_BORDER_HEIGHT; } } + /* Finish off with dynamic sizing. */ + if (!NILP (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii))) + { + dynamic_width = Feval (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii)); + if (INTP (dynamic_width)) + *width = XINT (dynamic_width); + } + if (!NILP (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii))) + { + dynamic_height = Feval (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii)); + if (INTP (dynamic_height)) + *height = XINT (dynamic_height); + } } } @@ -484,6 +506,9 @@ IMAGE_INSTANCE_WIDGET_PROPS (ii) = Qnil; SET_IMAGE_INSTANCE_WIDGET_FACE (ii, Qnil); IMAGE_INSTANCE_WIDGET_ITEMS (ii) = allocate_gui_item (); + IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii) = Qnil; + IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii) = Qnil; + IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii) = Qnil; IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii) = 1; IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii) = 1; IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) = 0; @@ -618,8 +643,13 @@ geometry gets called. */ if (!NILP (pixwidth)) /* pixwidth takes precendent */ { - pw = XINT (pixwidth); - IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii) = 0; + if (!INTP (pixwidth)) + IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii) = pixwidth; + else + { + pw = XINT (pixwidth); + IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii) = 0; + } } else if (!NILP (width)) { @@ -629,8 +659,13 @@ if (!NILP (pixheight)) { - ph = XINT (pixheight); - IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii) = 0; + if (!INTP (pixwidth)) + IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii) = pixheight; + else + { + ph = XINT (pixheight); + IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii) = 0; + } } else if (!NILP (height) && XINT (height) > 1) { @@ -756,12 +791,16 @@ if (EQ (prop, Q_items)) { Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance); + check_valid_item_list_1 (val); - - IMAGE_INSTANCE_WIDGET_ITEMS (ii) = - Fcons (XCAR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)), + + /* Don't set the actual items since we might decide not to use + the new ones (because nothing has really changed). If we did + set them and didn't use them then we would get into whole + heaps of trouble when the old items get GC'd. */ + IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii) = + Fcons (XCAR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)), parse_gui_item_tree_children (val)); - IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii) = 1; return Qt; @@ -1099,8 +1138,8 @@ #define VALID_WIDGET_KEYWORDS(type) do { \ IIFORMAT_VALID_KEYWORD (type, Q_width, check_valid_int); \ IIFORMAT_VALID_KEYWORD (type, Q_height, check_valid_int); \ - IIFORMAT_VALID_KEYWORD (type, Q_pixel_width, check_valid_int); \ - IIFORMAT_VALID_KEYWORD (type, Q_pixel_height, check_valid_int); \ + IIFORMAT_VALID_KEYWORD (type, Q_pixel_width, check_valid_int_or_function);\ + IIFORMAT_VALID_KEYWORD (type, Q_pixel_height, check_valid_int_or_function);\ IIFORMAT_VALID_KEYWORD (type, Q_face, check_valid_face); \ } while (0) @@ -1146,7 +1185,7 @@ IIFORMAT_VALID_KEYWORD (combo_box, Q_width, check_valid_int); IIFORMAT_VALID_KEYWORD (combo_box, Q_height, check_valid_int); - IIFORMAT_VALID_KEYWORD (combo_box, Q_pixel_width, check_valid_int); + IIFORMAT_VALID_KEYWORD (combo_box, Q_pixel_width, check_valid_int_or_function); IIFORMAT_VALID_KEYWORD (combo_box, Q_face, check_valid_face); IIFORMAT_VALID_KEYWORD (combo_box, Q_properties, check_valid_item_list); } @@ -1159,8 +1198,8 @@ IIFORMAT_HAS_SHARED_METHOD (scrollbar, instantiate, widget); VALID_GUI_KEYWORDS (scrollbar); - IIFORMAT_VALID_KEYWORD (scrollbar, Q_pixel_width, check_valid_int); - IIFORMAT_VALID_KEYWORD (scrollbar, Q_pixel_height, check_valid_int); + IIFORMAT_VALID_KEYWORD (scrollbar, Q_pixel_width, check_valid_int_or_function); + IIFORMAT_VALID_KEYWORD (scrollbar, Q_pixel_height, check_valid_int_or_function); IIFORMAT_VALID_KEYWORD (scrollbar, Q_face, check_valid_face); } @@ -1218,8 +1257,8 @@ IIFORMAT_HAS_METHOD (layout, normalize); IIFORMAT_HAS_METHOD (layout, query_geometry); IIFORMAT_HAS_METHOD (layout, layout); - IIFORMAT_VALID_KEYWORD (layout, Q_pixel_width, check_valid_int); - IIFORMAT_VALID_KEYWORD (layout, Q_pixel_height, check_valid_int); + IIFORMAT_VALID_KEYWORD (layout, Q_pixel_width, check_valid_int_or_function); + IIFORMAT_VALID_KEYWORD (layout, Q_pixel_height, check_valid_int_or_function); IIFORMAT_VALID_KEYWORD (layout, Q_orientation, check_valid_orientation); IIFORMAT_VALID_KEYWORD (layout, Q_justify, check_valid_justification); IIFORMAT_VALID_KEYWORD (layout, Q_border, check_valid_border); diff -r 9f011ab08d48 -r 2f8bb876ab1d src/glyphs-x.c --- a/src/glyphs-x.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/glyphs-x.c Mon Aug 13 11:16:07 2007 +0200 @@ -2189,6 +2189,12 @@ need to update most other things after the items have changed.*/ if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (p)) { + /* Pick up the items we recorded earlier. We do this here so + that the callbacks get set up with the new items. */ + IMAGE_INSTANCE_WIDGET_ITEMS (p) = + IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (p); + IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (p) = Qnil; + wv = gui_items_to_widget_values (IMAGE_INSTANCE_WIDGET_ITEMS (p)); wv->change = STRUCTURAL_CHANGE; @@ -2201,6 +2207,9 @@ /* Now do non structural updates. */ wv = lw_get_all_values (IMAGE_INSTANCE_X_WIDGET_LWID (p)); + if (!wv) + return; + /* Possibly update the colors and font */ if (IMAGE_INSTANCE_WIDGET_FACE_CHANGED (p) || @@ -2692,6 +2701,11 @@ IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii)) { widget_value* wv = lw_get_all_values (IMAGE_INSTANCE_X_WIDGET_LWID (ii)); + + /* #### I don't know why this can occur. */ + if (!wv) + return; + update_tab_widget_face (wv, ii, IMAGE_INSTANCE_SUBWINDOW_FRAME (ii)); diff -r 9f011ab08d48 -r 2f8bb876ab1d src/glyphs.c --- a/src/glyphs.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/glyphs.c Mon Aug 13 11:16:07 2007 +0200 @@ -59,6 +59,7 @@ Lisp_Object Qpointer_image_instance_p; Lisp_Object Qsubwindow_image_instance_p; Lisp_Object Qlayout_image_instance_p; +Lisp_Object Qupdate_widget_instances; Lisp_Object Qwidget_image_instance_p; Lisp_Object Qconst_glyph_variable; Lisp_Object Qmono_pixmap, Qcolor_pixmap, Qsubwindow; @@ -138,6 +139,7 @@ EXFUN (Fimage_instance_type, 1); EXFUN (Fglyph_type, 1); +EXFUN (Fnext_window, 4); /**************************************************************************** @@ -660,6 +662,9 @@ mark_object (IMAGE_INSTANCE_WIDGET_PROPS (i)); mark_object (IMAGE_INSTANCE_WIDGET_FACE (i)); mark_object (IMAGE_INSTANCE_WIDGET_ITEMS (i)); + mark_object (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (i)); + mark_object (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (i)); + mark_object (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (i)); case IMAGE_SUBWINDOW: mark_object (IMAGE_INSTANCE_SUBWINDOW_FRAME (i)); break; @@ -897,12 +902,21 @@ IMAGE_INSTANCE_WIDGET_TYPE (i2)) && IMAGE_INSTANCE_SUBWINDOW_ID (i1) == IMAGE_INSTANCE_SUBWINDOW_ID (i2) + && + EQ (IMAGE_INSTANCE_WIDGET_FACE (i1), + IMAGE_INSTANCE_WIDGET_TYPE (i2)) && internal_equal (IMAGE_INSTANCE_WIDGET_ITEMS (i1), IMAGE_INSTANCE_WIDGET_ITEMS (i2), depth + 1) && internal_equal (IMAGE_INSTANCE_WIDGET_PROPS (i1), IMAGE_INSTANCE_WIDGET_PROPS (i2), depth + 1) + && internal_equal (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (i1), + IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (i2), + depth + 1) + && internal_equal (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (i1), + IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (i2), + depth + 1) )) return 0; break; @@ -921,6 +935,22 @@ } static unsigned long +full_list_hash (Lisp_Object obj, int depth) +{ + unsigned long hash = 0; + Lisp_Object rest; + + if (!CONSP (obj)) + return internal_hash (obj, depth + 1); + + LIST_LOOP (rest, obj) + { + hash = HASH2 (internal_hash (XCAR (rest), depth + 1), hash); + } + return hash; +} + +static unsigned long image_instance_hash (Lisp_Object obj, int depth) { Lisp_Image_Instance *i = XIMAGE_INSTANCE (obj); @@ -950,10 +980,16 @@ case IMAGE_WIDGET: case IMAGE_LAYOUT: + /* We need the hash to be equivalent to what should be + displayed. */ hash = HASH4 (hash, - internal_hash (IMAGE_INSTANCE_WIDGET_TYPE (i), depth + 1), - internal_hash (IMAGE_INSTANCE_WIDGET_PROPS (i), depth + 1), - internal_hash (IMAGE_INSTANCE_WIDGET_ITEMS (i), depth + 1)); + LISP_HASH (IMAGE_INSTANCE_WIDGET_TYPE (i)), + full_list_hash (IMAGE_INSTANCE_WIDGET_PROPS (i), depth + 1), + full_list_hash + (NILP (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (i)) + ? IMAGE_INSTANCE_WIDGET_ITEMS (i) + : IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (i), + depth + 1)); case IMAGE_SUBWINDOW: hash = HASH2 (hash, (int) IMAGE_INSTANCE_SUBWINDOW_ID (i)); break; @@ -2748,6 +2784,19 @@ Lisp_Object pointer_fg = Qnil; Lisp_Object pointer_bg = Qnil; + if (dest_mask & (IMAGE_SUBWINDOW_MASK + | IMAGE_WIDGET_MASK + | IMAGE_TEXT_MASK)) + { + if (!WINDOWP (domain)) + signal_simple_error ("Can't instantiate text or subwindow outside a window", + instantiator); + else if ((dest_mask & (IMAGE_SUBWINDOW_MASK + | IMAGE_WIDGET_MASK)) + && MINI_WINDOW_P (XWINDOW (domain))) + domain = Fnext_window (domain, Qnil, Qnil, Qnil); + } + if (pointerp) { pointer_fg = FACE_FOREGROUND (Vpointer_face, domain); @@ -2803,9 +2852,6 @@ | IMAGE_WIDGET_MASK | IMAGE_TEXT_MASK)) { - if (!WINDOWP (domain)) - signal_simple_error ("Can't instantiate text or subwindow outside a window", - instantiator); instance = Fgethash (instantiator, XWINDOW (domain)->subwindow_instance_cache, Qunbound); @@ -2841,13 +2887,11 @@ cache. */ if (image_instance_type_to_mask (XIMAGE_INSTANCE_TYPE (instance)) & - (IMAGE_SUBWINDOW_MASK | IMAGE_WIDGET_MASK)) + (IMAGE_SUBWINDOW_MASK + | IMAGE_WIDGET_MASK + | IMAGE_TEXT_MASK )) { - if (!WINDOWP (domain)) - signal_simple_error ("Can't instantiate subwindow outside a window", - instantiator); - - Fsetcdr (XCDR (locative), XWINDOW (domain)->subwindow_instance_cache ); + Fsetcdr (XCDR (locative), XWINDOW (domain)->subwindow_instance_cache); } unbind_to (speccount, Qnil); } @@ -4268,17 +4312,14 @@ /* Update the displayed characteristics of a subwindow. This function should generally only get called if the subwindow is actually - dirty. The only other time it gets called is if subwindow state - changed, when we can't actually tell whether its going to be dirty - or not. - #### I suspect what we should really do is re-evaluate all the - gui slots that could affect this and then mark the instance as - dirty. Right now, updating everything is safe but expensive. */ + dirty. */ void update_subwindow (Lisp_Object subwindow) { Lisp_Image_Instance* ii = XIMAGE_INSTANCE (subwindow); int count = specpdl_depth (); + unsigned long display_hash = internal_hash (subwindow, + IMAGE_INSTANCE_HASH_DEPTH); /* The update method is allowed to call eval. Since it is quite common for this function to get called from somewhere in @@ -4290,8 +4331,14 @@ || IMAGE_INSTANCE_TYPE (ii) == IMAGE_LAYOUT) { - if (IMAGE_INSTANCE_TYPE (ii) == IMAGE_WIDGET) - update_widget (subwindow); + if (IMAGE_INSTANCE_TYPE (ii) == IMAGE_WIDGET + && + (display_hash != IMAGE_INSTANCE_DISPLAY_HASH (ii) + || + IMAGE_INSTANCE_DISPLAY_HASH (ii) == 0)) + { + update_widget (subwindow); + } /* Reset the changed flags. */ IMAGE_INSTANCE_WIDGET_FACE_CHANGED (ii) = 0; IMAGE_INSTANCE_WIDGET_PERCENT_CHANGED (ii) = 0; @@ -4306,35 +4353,54 @@ } IMAGE_INSTANCE_SIZE_CHANGED (ii) = 0; + /* This function is typically called by redisplay just before + outputting the information to the screen. Thus we record a hash + of the output to determine whether on-screen is the same as + recorded structure. This approach has limitations in there is a + good chance that hash values will be different for the same + visual appearance. However, we would rather that then the other + way round - it simply means that we will get more displays than + we might need. We can get better hashing by making the depth + negative - currently it will recurse down 5 levels.*/ + IMAGE_INSTANCE_DISPLAY_HASH (ii) = display_hash; unbind_to (count, Qnil); } /* Update all the subwindows on a frame. */ -void -update_frame_subwindows (struct frame *f) +DEFUN ("update-widget-instances", Fupdate_widget_instances,1, 1, 0, /* +Given a FRAME, re-evaluate the display hash code for all widgets in the frame. +Don't use this. +*/ + (frame)) { int elt; - - /* #### Checking all of these might be overkill now that we update - subwindows in the actual redisplay code. */ - if (f->subwindows_changed || f->subwindows_state_changed || f->faces_changed) - for (elt = 0; elt < Dynarr_length (f->subwindow_cachels); elt++) + struct frame* f; + CHECK_FRAME (frame); + f = XFRAME (frame); + + /* If we get called we know something has changed. */ + for (elt = 0; elt < Dynarr_length (f->subwindow_cachels); elt++) { struct subwindow_cachel *cachel = Dynarr_atp (f->subwindow_cachels, elt); - if (cachel->being_displayed - && - /* We only want to update if something has really - changed. */ - (f->subwindows_state_changed - || - XIMAGE_INSTANCE_DIRTYP (cachel->subwindow))) + if (cachel->being_displayed && + XIMAGE_INSTANCE_TYPE (cachel->subwindow) + == IMAGE_WIDGET) { - update_subwindow (cachel->subwindow); + /* If a subwindow hash changed mark it so that redisplay + will fix it. */ + if (internal_hash (cachel->subwindow, + IMAGE_INSTANCE_HASH_DEPTH) != + XIMAGE_INSTANCE_DISPLAY_HASH (cachel->subwindow)) + { + set_image_instance_dirty_p (cachel->subwindow, 1); + MARK_FRAME_GLYPHS_CHANGED (f); + } } } + return Qnil; } /* remove a subwindow from its frame */ @@ -4435,26 +4501,25 @@ actually really dumb now that we have dynamic geometry calculations. What should really happen is that the subwindow should query its child for an appropriate geometry. */ - if (NILP (width)) - IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii) = 20; - else + if (INTP (width)) { int w = 1; - CHECK_INT (width); if (XINT (width) > 1) w = XINT (width); IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii) = w; } - if (NILP (height)) - IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii) = 20; else + IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii) = 20; + + if (INTP (height)) { int h = 1; - CHECK_INT (height); if (XINT (height) > 1) h = XINT (height); IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii) = h; } + else + IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii) = 20; } DEFUN ("subwindowp", Fsubwindowp, 1, 1, 0, /* @@ -4696,6 +4761,7 @@ DEFSUBR (Fvalid_image_instantiator_format_p); DEFSUBR (Fset_console_type_image_conversion_list); DEFSUBR (Fconsole_type_image_conversion_list); + DEFSUBR (Fupdate_widget_instances); defkeyword (&Q_file, ":file"); defkeyword (&Q_data, ":data"); @@ -4731,6 +4797,7 @@ defsymbol (&Qwidget_image_instance_p, "widget-image-instance-p"); defsymbol (&Qsubwindow_image_instance_p, "subwindow-image-instance-p"); defsymbol (&Qlayout_image_instance_p, "layout-image-instance-p"); + defsymbol (&Qupdate_widget_instances, "update-widget-instances"); DEFSUBR (Fmake_image_instance); DEFSUBR (Fimage_instance_p); diff -r 9f011ab08d48 -r 2f8bb876ab1d src/glyphs.h --- a/src/glyphs.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/glyphs.h Mon Aug 13 11:16:07 2007 +0200 @@ -269,6 +269,10 @@ entry); \ } while (0) +#define IIFORMAT_VALID_CONSOLE2(con1, con2, format) \ + IIFORMAT_VALID_CONSOLE (con1, format); \ + IIFORMAT_VALID_CONSOLE (con2, format); + #define DEFINE_DEVICE_IIFORMAT(type, format) \ DECLARE_IMAGE_INSTANTIATOR_FORMAT(format); \ struct image_instantiator_methods *type##_##format##_image_instantiator_methods @@ -295,6 +299,11 @@ #define IIFORMAT_HAS_SHARED_DEVMETHOD(type, format, m, fromformat) \ (type##_##format##_image_instantiator_methods->m##_method = type##_##fromformat##_##m) +#define IIFORMAT_INHERITS_DEVMETHOD(type, from, format, m) \ + (type##_##format##_image_instantiator_methods->m##_method = from##_##format##_##m) +#define IIFORMAT_INHERITS_SHARED_DEVMETHOD(type, from, format, m, fromformat) \ + (type##_##format##_image_instantiator_methods->m##_method = from##_##fromformat##_##m) + struct image_instantiator_methods * decode_device_ii_format (Lisp_Object device, Lisp_Object format, Error_behavior errb); @@ -488,10 +497,14 @@ enum image_instance_type type; unsigned int x_offset, y_offset; /* for layout purposes */ unsigned int width, height; + unsigned long display_hash; /* Hash value representing the structure + of the image_instance when it was + last displayed. */ unsigned int dirty : 1; unsigned int size_changed : 1; unsigned int text_changed : 1; unsigned int layout_changed : 1; + unsigned int optimize_output : 1; /* For outputting layouts. */ union { @@ -531,6 +544,9 @@ Lisp_Object type; Lisp_Object props; /* properties or border*/ Lisp_Object items; /* a list of gui_items or children */ + Lisp_Object pending_items; /* gui_items that should be displayed */ + Lisp_Object width; /* dynamic width spec. */ + Lisp_Object height; /* dynamic height spec. */ /* Change flags to augment dirty. */ unsigned int face_changed : 1; unsigned int items_changed : 1; @@ -550,6 +566,8 @@ #define LAYOUT_JUSTIFY_RIGHT 1 #define LAYOUT_JUSTIFY_CENTER 2 +#define IMAGE_INSTANCE_HASH_DEPTH -2 + /* Accessor macros. */ #define IMAGE_INSTANCE_DEVICE(i) ((i)->device) #define IMAGE_INSTANCE_NAME(i) ((i)->name) @@ -560,6 +578,7 @@ #define IMAGE_INSTANCE_YOFFSET(i) ((i)->y_offset) #define IMAGE_INSTANCE_WIDTH(i) ((i)->width) #define IMAGE_INSTANCE_HEIGHT(i) ((i)->height) +#define IMAGE_INSTANCE_DISPLAY_HASH(i) ((i)->display_hash) #define IMAGE_INSTANCE_PIXMAP_TYPE_P(i) \ ((IMAGE_INSTANCE_TYPE (i) == IMAGE_MONO_PIXMAP) \ || (IMAGE_INSTANCE_TYPE (i) == IMAGE_COLOR_PIXMAP)) @@ -567,7 +586,8 @@ #define IMAGE_INSTANCE_NEEDS_LAYOUT(i) \ (IMAGE_INSTANCE_DIRTYP (i) && IMAGE_INSTANCE_LAYOUT_CHANGED (i)) #define IMAGE_INSTANCE_FACE(i) \ - XGLYPH_FACE (IMAGE_INSTANCE_GLYPH (i)) + (GLYPHP (IMAGE_INSTANCE_GLYPH (i)) ? \ + XGLYPH_FACE (IMAGE_INSTANCE_GLYPH (i)) : Qnil) /* Changed flags */ #define IMAGE_INSTANCE_TEXT_CHANGED(i) ((i)->text_changed) @@ -578,8 +598,8 @@ ((i)->u.subwindow.items_changed) #define IMAGE_INSTANCE_WIDGET_PERCENT_CHANGED(i) \ ((i)->u.subwindow.percent_changed) -#define IMAGE_INSTANCE_LAYOUT_CHANGED(i) \ - ((i)->layout_changed) +#define IMAGE_INSTANCE_LAYOUT_CHANGED(i) ((i)->layout_changed) +#define IMAGE_INSTANCE_OPTIMIZE_OUTPUT(i) ((i)->optimize_output) /* Text properties */ #define IMAGE_INSTANCE_TEXT_STRING(i) ((i)->u.text.string) @@ -632,6 +652,8 @@ IMAGE_INSTANCE_WIDTH(i) #define IMAGE_INSTANCE_WIDGET_HEIGHT(i) \ IMAGE_INSTANCE_HEIGHT(i) +#define IMAGE_INSTANCE_WIDGET_WIDTH_SUBR(i) ((i)->u.subwindow.width) +#define IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR(i) ((i)->u.subwindow.height) #define IMAGE_INSTANCE_WIDGET_TYPE(i) ((i)->u.subwindow.type) #define IMAGE_INSTANCE_WIDGET_PROPS(i) ((i)->u.subwindow.props) #define SET_IMAGE_INSTANCE_WIDGET_FACE(i,f) \ @@ -641,6 +663,8 @@ !NILP (IMAGE_INSTANCE_FACE (i)) ? IMAGE_INSTANCE_FACE (i) : \ Vwidget_face) #define IMAGE_INSTANCE_WIDGET_ITEMS(i) ((i)->u.subwindow.items) +#define IMAGE_INSTANCE_WIDGET_PENDING_ITEMS(i) \ + ((i)->u.subwindow.pending_items) #define IMAGE_INSTANCE_WIDGET_ITEM(i) \ (CONSP (IMAGE_INSTANCE_WIDGET_ITEMS (i)) ? \ XCAR (IMAGE_INSTANCE_WIDGET_ITEMS (i)) : \ @@ -661,6 +685,8 @@ IMAGE_INSTANCE_PARENT (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_TYPE(i) \ IMAGE_INSTANCE_TYPE (XIMAGE_INSTANCE (i)) +#define XIMAGE_INSTANCE_DISPLAY_HASH(i) \ + IMAGE_INSTANCE_DISPLAY_HASH (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_XOFFSET(i) \ IMAGE_INSTANCE_XOFFSET (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_YOFFSET(i) \ @@ -718,6 +744,10 @@ IMAGE_INSTANCE_WIDGET_WIDTH (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_WIDGET_HEIGHT(i) \ IMAGE_INSTANCE_WIDGET_HEIGHT (XIMAGE_INSTANCE (i)) +#define XIMAGE_INSTANCE_WIDGET_WIDTH_SUBR(i) \ + IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (XIMAGE_INSTANCE (i)) +#define XIMAGE_INSTANCE_WIDGET_HEIGHT_SUBR(i) \ + IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_WIDGET_TYPE(i) \ IMAGE_INSTANCE_WIDGET_TYPE (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_WIDGET_PROPS(i) \ @@ -730,6 +760,8 @@ IMAGE_INSTANCE_WIDGET_ITEM (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_WIDGET_ITEMS(i) \ IMAGE_INSTANCE_WIDGET_ITEMS (XIMAGE_INSTANCE (i)) +#define XIMAGE_INSTANCE_WIDGET_PENDING_ITEMS(i) \ + IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_WIDGET_TEXT(i) \ IMAGE_INSTANCE_WIDGET_TEXT (XIMAGE_INSTANCE (i)) @@ -854,7 +886,7 @@ extern Lisp_Object Q_foreground, Q_background, Q_face, Q_descriptor, Q_group; extern Lisp_Object Q_width, Q_height, Q_pixel_width, Q_pixel_height, Q_text; extern Lisp_Object Q_items, Q_properties, Q_image, Q_percent, Qimage_conversion_error; -extern Lisp_Object Q_orientation; +extern Lisp_Object Q_orientation, Qupdate_widget_instances; extern Lisp_Object Vcontinuation_glyph, Vcontrol_arrow_glyph, Vhscroll_glyph; extern Lisp_Object Vinvisible_text_glyph, Voctal_escape_glyph, Vtruncation_glyph; extern Lisp_Object Vxemacs_logo; @@ -977,7 +1009,6 @@ void unmap_subwindow (Lisp_Object subwindow); void map_subwindow (Lisp_Object subwindow, int x, int y, struct display_glyph_area *dga); -void update_frame_subwindows (struct frame *f); int find_matching_subwindow (struct frame* f, int x, int y, int width, int height); void update_widget (Lisp_Object widget); void update_subwindow (Lisp_Object subwindow); diff -r 9f011ab08d48 -r 2f8bb876ab1d src/gmalloc.c --- a/src/gmalloc.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/gmalloc.c Mon Aug 13 11:16:07 2007 +0200 @@ -367,7 +367,7 @@ #endif /* How to really get more memory. */ -#ifdef HEAP_IN_DATA +#if defined (HEAP_IN_DATA) && !defined(PDUMP) /* once dumped, free() & realloc() on static heap space will fail */ #define PURE_DATA(x) \ ((static_heap_dumped && (char*)x >= static_heap_base \ @@ -446,7 +446,7 @@ static int initialize () { -#ifdef HEAP_IN_DATA +#if defined (HEAP_IN_DATA) && !defined(PDUMP) if (static_heap_dumped && __morecore == more_static_core) { __morecore = __default_morecore; diff -r 9f011ab08d48 -r 2f8bb876ab1d src/gpmevent.c --- a/src/gpmevent.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/gpmevent.c Mon Aug 13 11:16:07 2007 +0200 @@ -140,10 +140,10 @@ /* Whow, wouldn't named defines be NICE!?!?! */ modifiers = 0; - if (ev.modifiers & 1) modifiers |= MOD_SHIFT; - if (ev.modifiers & 2) modifiers |= MOD_META; - if (ev.modifiers & 4) modifiers |= MOD_CONTROL; - if (ev.modifiers & 8) modifiers |= MOD_META; + if (ev.modifiers & 1) modifiers |= XEMACS_MOD_SHIFT; + if (ev.modifiers & 2) modifiers |= XEMACS_MOD_META; + if (ev.modifiers & 4) modifiers |= XEMACS_MOD_CONTROL; + if (ev.modifiers & 8) modifiers |= XEMACS_MOD_META; if (ev.buttons & GPM_B_LEFT) { diff -r 9f011ab08d48 -r 2f8bb876ab1d src/gui-msw.c --- a/src/gui-msw.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/gui-msw.c Mon Aug 13 11:16:07 2007 +0200 @@ -36,7 +36,7 @@ * command if we return nil */ Lisp_Object -mswindows_handle_gui_wm_command (struct frame* f, HWND ctrl, DWORD id) +mswindows_handle_gui_wm_command (struct frame* f, HWND ctrl, LPARAM id) { /* Try to map the command id through the proper hash table */ Lisp_Object data, fn, arg, frame; @@ -50,11 +50,14 @@ if (NILP (data) || UNBOUNDP (data)) return Qnil; - MARK_SUBWINDOWS_STATE_CHANGED; /* Ok, this is our one. Enqueue it. */ get_gui_callback (data, &fn, &arg); XSETFRAME (frame, f); mswindows_enqueue_misc_user_event (frame, fn, arg); + /* The result of this evaluation could cause other instances to change so + enqueue an update callback to check this. */ + mswindows_enqueue_misc_user_event (frame, Qeval, + list2 (Qupdate_widget_instances, frame)); return Qt; } @@ -137,9 +140,9 @@ if (ret > 32) return Qt; - if (ret == ERROR_FILE_NOT_FOUND || ret == SE_ERR_FNF) + if (ret == ERROR_FILE_NOT_FOUND) signal_simple_error ("file not found", document); - else if (ret == ERROR_PATH_NOT_FOUND || ret == SE_ERR_PNF) + else if (ret == ERROR_PATH_NOT_FOUND) signal_simple_error ("path not found", current_dir); else if (ret == ERROR_BAD_FORMAT) signal_simple_error ("bad executable format", document); diff -r 9f011ab08d48 -r 2f8bb876ab1d src/gui-x.c --- a/src/gui-x.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/gui-x.c Mon Aug 13 11:16:07 2007 +0200 @@ -213,6 +213,7 @@ Lisp_Object fn, arg; Lisp_Object data; Lisp_Object frame; + int update_subwindows_p = 0; struct device *d = get_device_from_display (XtDisplay (widget)); struct frame *f = x_any_widget_or_parent_to_frame (d, widget); @@ -245,7 +246,7 @@ } else { - MARK_SUBWINDOWS_STATE_CHANGED; + update_subwindows_p = 1; get_gui_callback (data, &fn, &arg); } @@ -258,6 +259,11 @@ DEVICE_X_MOUSE_TIMESTAMP (d) = DEVICE_X_GLOBAL_MOUSE_TIMESTAMP (d); #endif signal_special_Xt_user_event (frame, fn, arg); + /* The result of this evaluation could cause other instances to change so + enqueue an update callback to check this. */ + if (update_subwindows_p) + signal_special_Xt_user_event (frame, Qeval, + list2 (Qupdate_widget_instances, frame)); } #if 1 @@ -303,6 +309,30 @@ return NULL; } +char * +strdup_and_add_accel (char *name) +{ + int i; + int found_accel = 0; + + for (i=0; name[i]; ++i) + if (name[i] == '%' && name[i+1] == '_') + { + found_accel = 1; + break; + } + + if (found_accel) + return xstrdup (name); + else + { + char *chars = (char *) alloca (strlen (name) + 3); + chars[0] = '%'; + chars[1] = '_'; + memcpy (chars+2, name, strlen (name) + 1); + return xstrdup (chars); + } +} /* This does the dirty work. gc_currently_forbidden is 1 when this is called. */ @@ -320,7 +350,7 @@ { wv->type = TEXT_TYPE; wv->name = (char *) XSTRING_DATA (gui_item); - wv->name = xstrdup (wv->name); + wv->name = strdup_and_add_accel (wv->name); return 1; } else if (!GUI_ITEMP (gui_item)) @@ -339,6 +369,9 @@ } #endif /* HAVE_MENUBARS */ + if (!STRINGP (pgui->name)) + pgui->name = Feval (pgui->name); + CHECK_STRING (pgui->name); wv->name = (char *) XSTRING_DATA (pgui->name); wv->name = xstrdup (wv->name); @@ -388,7 +421,7 @@ } else if (SYMBOLP (pgui->callback)) /* Show the binding of this command. */ { - char buf [1024]; + char buf[1024]; /* #### */ /* #### Warning, dependency here on current_buffer and point */ where_is_to_char (pgui->callback, buf); if (buf [0]) diff -r 9f011ab08d48 -r 2f8bb876ab1d src/gui-x.h --- a/src/gui-x.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/gui-x.h Mon Aug 13 11:16:07 2007 +0200 @@ -68,6 +68,7 @@ void free_popup_widget_value_tree (widget_value *wv); void popup_selection_callback (Widget widget, LWLIB_ID ignored_id, XtPointer client_data); +char *strdup_and_add_accel (char *name); int button_item_to_widget_value (Lisp_Object desc, widget_value *wv, int allow_text_field_p, int no_keys_p); widget_value * gui_items_to_widget_values (Lisp_Object items); diff -r 9f011ab08d48 -r 2f8bb876ab1d src/gui.c --- a/src/gui.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/gui.c Mon Aug 13 11:16:07 2007 +0200 @@ -27,6 +27,7 @@ #include "lisp.h" #include "gui.h" #include "elhash.h" +#include "buffer.h" #include "bytecode.h" Lisp_Object Q_active, Q_suffix, Q_keys, Q_style, Q_selected; @@ -108,7 +109,7 @@ Lisp_Object key, Lisp_Object val, Error_behavior errb) { - Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item); + Lisp_Gui_Item *pgui_item = XGUI_ITEM (gui_item); if (!KEYWORDP (key)) signal_simple_error_2 ("Non-keyword in gui item", key, pgui_item->name); @@ -132,7 +133,8 @@ signal_simple_error ("Bad keyboard accelerator", val); } else if (ERRB_EQ (errb, ERROR_ME)) - signal_simple_error_2 ("Unknown keyword in gui item", key, pgui_item->name); + signal_simple_error_2 ("Unknown keyword in gui item", key, + pgui_item->name); } void @@ -179,7 +181,7 @@ int length, plist_p, start; Lisp_Object *contents; Lisp_Object gui_item = allocate_gui_item (); - Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item); + Lisp_Gui_Item *pgui_item = XGUI_ITEM (gui_item); CHECK_VECTOR (item); length = XVECTOR_LENGTH (item); @@ -251,7 +253,7 @@ void gui_add_item_keywords_to_plist (Lisp_Object plist, Lisp_Object gui_item) { - Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item); + Lisp_Gui_Item *pgui_item = XGUI_ITEM (gui_item); if (!NILP (pgui_item->callback)) Fplist_put (plist, Q_callback, pgui_item->callback); @@ -293,7 +295,7 @@ Lisp_Object gui_item_accelerator (Lisp_Object gui_item) { - Lisp_Gui_Item* pgui = XGUI_ITEM (gui_item); + Lisp_Gui_Item *pgui = XGUI_ITEM (gui_item); if (!NILP (pgui->accelerator)) return pgui->accelerator; @@ -305,23 +307,26 @@ Lisp_Object gui_name_accelerator (Lisp_Object nm) { - /* !!#### This function has not been Mule-ized */ - char* name = (char*)XSTRING_DATA (nm); + Bufbyte *name = XSTRING_DATA (nm); - while (*name) { - if (*name=='%') { - ++name; - if (!(*name)) - return Qnil; - if (*name=='_' && *(name+1)) + while (*name) + { + if (*name == '%') { - int accelerator = (int) (unsigned char) (*(name+1)); - return make_char (tolower (accelerator)); + ++name; + if (!(*name)) + return Qnil; + if (*name == '_' && *(name + 1)) + { + Emchar accelerator = charptr_emchar (name + 1); + /* #### bogus current_buffer dependency */ + return make_char (DOWNCASE (current_buffer, accelerator)); + } } + INC_CHARPTR (name); } - ++name; - } - return Qnil; + return make_char (DOWNCASE (current_buffer, + charptr_emchar (XSTRING_DATA (nm)))); } /* @@ -347,7 +352,7 @@ gui_item_included_p (Lisp_Object gui_item, Lisp_Object conflist) { /* This function can call lisp */ - Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item); + Lisp_Gui_Item *pgui_item = XGUI_ITEM (gui_item); /* Evaluate :included first. Shortcut to avoid evaluating Qt each time */ if (!EQ (pgui_item->included, Qt) @@ -379,13 +384,13 @@ * buffer. */ unsigned int -gui_item_display_flush_left (Lisp_Object gui_item, - char* buf, Bytecount buf_len) +gui_item_display_flush_left (Lisp_Object gui_item, + char *buf, Bytecount buf_len) { /* This function can call lisp */ char *p = buf; Bytecount len; - Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item); + Lisp_Gui_Item *pgui_item = XGUI_ITEM (gui_item); /* Copy item name first */ CHECK_STRING (pgui_item->name); @@ -429,9 +434,9 @@ */ unsigned int gui_item_display_flush_right (Lisp_Object gui_item, - char* buf, Bytecount buf_len) + char *buf, Bytecount buf_len) { - Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item); + Lisp_Gui_Item *pgui_item = XGUI_ITEM (gui_item); *buf = 0; #ifdef HAVE_MENUBARS @@ -444,16 +449,17 @@ if (!NILP (pgui_item->keys)) { CHECK_STRING (pgui_item->keys); - if (XSTRING_LENGTH (pgui_item->keys) > buf_len) + if (XSTRING_LENGTH (pgui_item->keys) + 1 > buf_len) signal_too_long_error (pgui_item->name); - strcpy (buf, (const char *) XSTRING_DATA (pgui_item->keys)); + memcpy (buf, XSTRING_DATA (pgui_item->keys), + XSTRING_LENGTH (pgui_item->keys) + 1); return XSTRING_LENGTH (pgui_item->keys); } /* See if we can derive keys out of callback symbol */ if (SYMBOLP (pgui_item->callback)) { - char buf2 [1024]; + char buf2[1024]; /* #### */ Bytecount len; where_is_to_char (pgui_item->callback, buf2); @@ -491,7 +497,7 @@ } static unsigned long -gui_item_hash (Lisp_Object obj, int depth) +gui_item_hash_internal (Lisp_Object obj, int depth) { Lisp_Gui_Item *p = XGUI_ITEM (obj); @@ -507,10 +513,29 @@ internal_hash (p->keys, depth + 1))); } +static unsigned long +gui_item_hash (Lisp_Object obj, int depth) +{ + Lisp_Gui_Item *p = XGUI_ITEM (obj); + + /* Note that this evaluates the active and selected slots so that + the hash changes when the result of these changes. */ + return HASH2 (HASH5 (internal_hash (p->name, depth + 1), + internal_hash (p->callback, depth + 1), + internal_hash (p->suffix, depth + 1), + gui_item_active_p (obj), + internal_hash (p->included, depth + 1)), + HASH5 (internal_hash (p->config, depth + 1), + internal_hash (p->filter, depth + 1), + internal_hash (p->style, depth + 1), + gui_item_selected_p (obj), + internal_hash (p->keys, depth + 1))); +} + int gui_item_id_hash (Lisp_Object hashtable, Lisp_Object gitem, int slot) { - int hashid = gui_item_hash (gitem, 0); + int hashid = gui_item_hash_internal (gitem, 0); int id = GUI_ITEM_ID_BITS (hashid, slot); while (!NILP (Fgethash (make_int (id), hashtable, Qnil))) @@ -570,12 +595,17 @@ The gui_item slot of an image instance can be a single item or an arbitrarily nested hierarchy of item lists. */ -static Lisp_Object parse_gui_item_tree_item (Lisp_Object entry) +static Lisp_Object +parse_gui_item_tree_item (Lisp_Object entry) { Lisp_Object ret = entry; + struct gcpro gcpro1; + + GCPRO1 (ret); + if (VECTORP (entry)) { - ret = gui_parse_item_keywords_no_errors (entry); + ret = gui_parse_item_keywords_no_errors (entry); } else if (STRINGP (entry)) { @@ -584,17 +614,20 @@ else signal_simple_error ("item must be a vector or a string", entry); - return ret; + RETURN_UNGCPRO (ret); } -Lisp_Object parse_gui_item_tree_children (Lisp_Object list) +Lisp_Object +parse_gui_item_tree_children (Lisp_Object list) { - Lisp_Object rest, ret = Qnil; + Lisp_Object rest, ret = Qnil, sub = Qnil; + struct gcpro gcpro1, gcpro2; + + GCPRO2 (ret, sub); CHECK_CONS (list); /* recursively add items to the tree view */ LIST_LOOP (rest, list) { - Lisp_Object sub; if (CONSP (XCAR (rest))) sub = parse_gui_item_tree_list (XCAR (rest)); else @@ -603,21 +636,30 @@ ret = Fcons (sub, ret); } /* make the order the same as the items we have parsed */ - return Fnreverse (ret); + RETURN_UNGCPRO (Fnreverse (ret)); } -static Lisp_Object parse_gui_item_tree_list (Lisp_Object list) +static Lisp_Object +parse_gui_item_tree_list (Lisp_Object list) { Lisp_Object ret; + struct gcpro gcpro1; CHECK_CONS (list); /* first one can never be a list */ ret = parse_gui_item_tree_item (XCAR (list)); - return Fcons (ret, parse_gui_item_tree_children (XCDR (list))); + GCPRO1 (ret); + ret = Fcons (ret, parse_gui_item_tree_children (XCDR (list))); + RETURN_UNGCPRO (ret); +} + +static void +finalize_gui_item (void* header, int for_disksave) +{ } DEFINE_LRECORD_IMPLEMENTATION ("gui-item", gui_item, mark_gui_item, print_gui_item, - 0, gui_item_equal, + finalize_gui_item, gui_item_equal, gui_item_hash, 0, Lisp_Gui_Item); diff -r 9f011ab08d48 -r 2f8bb876ab1d src/gutter.c --- a/src/gutter.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/gutter.c Mon Aug 13 11:16:07 2007 +0200 @@ -1,5 +1,5 @@ /* Gutter implementation. - Copyright (C) 1999 Andy Piper. + Copyright (C) 1999, 2000 Andy Piper. This file is part of XEmacs. @@ -47,6 +47,8 @@ Lisp_Object Vdefault_gutter_position; Lisp_Object Qgutter_size; +Lisp_Object Qgutter_visible; +Lisp_Object Qdefault_gutter_position_changed_hook; #define SET_GUTTER_WAS_VISIBLE_FLAG(frame, pos, flag) \ do { \ @@ -86,6 +88,7 @@ } } +#if 0 static Lisp_Object frame_topmost_window (struct frame *f) { @@ -100,6 +103,7 @@ return w; } +#endif static Lisp_Object frame_bottommost_window (struct frame *f) @@ -167,7 +171,6 @@ int *width, int *height) { struct window - * top = XWINDOW (frame_topmost_window (f)), * bot = XWINDOW (frame_bottommost_window (f)); /* The top and bottom gutters take precedence over the left and right. */ @@ -183,8 +186,7 @@ case BOTTOM_GUTTER: *x = FRAME_LEFT_BORDER_END (f); - *y = WINDOW_BOTTOM (bot) - - FRAME_BOTTOM_GUTTER_BOUNDS (f); + *y = WINDOW_BOTTOM (bot); *width = FRAME_RIGHT_BORDER_START (f) - FRAME_LEFT_BORDER_END (f); *height = FRAME_BOTTOM_GUTTER_BOUNDS (f); @@ -192,21 +194,19 @@ case LEFT_GUTTER: *x = FRAME_LEFT_BORDER_END (f); - *y = WINDOW_TEXT_TOP (top); + *y = FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f); *width = FRAME_LEFT_GUTTER_BOUNDS (f); *height = WINDOW_BOTTOM (bot) - - (WINDOW_TEXT_TOP (top) - + FRAME_BOTTOM_GUTTER_BOUNDS (f)); + - (FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f)); break; case RIGHT_GUTTER: *x = FRAME_RIGHT_BORDER_START (f) - FRAME_RIGHT_GUTTER_BOUNDS (f); - *y = WINDOW_TEXT_TOP (top); + *y = FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f); *width = FRAME_RIGHT_GUTTER_BOUNDS (f); *height = WINDOW_BOTTOM (bot) - - (WINDOW_TEXT_TOP (top) - + FRAME_BOTTOM_GUTTER_BOUNDS (f)); + - (FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f)); break; default: @@ -214,8 +214,39 @@ } } +/* Convert the gutter specifier into something we can actually + display. */ +static Lisp_Object construct_window_gutter_spec (struct window* w, + enum gutter_pos pos) +{ + Lisp_Object rest, *args; + int nargs = 0; + Lisp_Object gutter = RAW_WINDOW_GUTTER (w, pos); + + if (STRINGP (gutter) || NILP (gutter)) + return gutter; + + GET_LIST_LENGTH (gutter, nargs); + args = alloca_array (Lisp_Object, nargs >> 1); + nargs = 0; + + for (rest = gutter; !NILP (rest); rest = XCDR (XCDR (rest))) + { + /* We only put things in the real gutter that are declared to be + visible. */ + if (!CONSP (WINDOW_GUTTER_VISIBLE (w, pos)) + || + !NILP (Fmemq (XCAR (rest), WINDOW_GUTTER_VISIBLE (w, pos)))) + { + args [nargs++] = XCAR (XCDR (rest)); + } + } + + return Fconcat (nargs, args); +} + static void -output_gutter (struct frame *f, enum gutter_pos pos) +output_gutter (struct frame *f, enum gutter_pos pos, int force) { Lisp_Object frame; Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f); @@ -232,15 +263,15 @@ return; border_width = FRAME_GUTTER_BORDER_WIDTH (f, pos); - findex = get_builtin_face_cache_index (w, Vgui_element_face); + findex = get_builtin_face_cache_index (w, Vwidget_face); - if (!f->current_display_lines) - f->current_display_lines = Dynarr_new (display_line); - if (!f->desired_display_lines) - f->desired_display_lines = Dynarr_new (display_line); + if (!f->current_display_lines[pos]) + f->current_display_lines[pos] = Dynarr_new (display_line); + if (!f->desired_display_lines[pos]) + f->desired_display_lines[pos] = Dynarr_new (display_line); - ddla = f->desired_display_lines; - cdla = f->current_display_lines; + ddla = f->desired_display_lines[pos]; + cdla = f->current_display_lines[pos]; cdla_len = Dynarr_length (cdla); XSETFRAME (frame, f); @@ -251,40 +282,78 @@ x + border_width, y + border_width, width - 2 * border_width, height - 2 * border_width, ddla, 0, findex); - /* Output each line. */ - for (line = 0; line < Dynarr_length (ddla); line++) + + /* We only output the gutter if we think something of significance + has changed. This is, for example, because redisplay can cause + new face cache elements to get added causing compare_runes to + fail because the findex for a particular face has changed. */ + if (force || f->faces_changed || f->frame_changed || + f->gutter_changed || f->glyphs_changed || + f->size_changed || f->subwindows_changed || + w->windows_changed || f->windows_structure_changed || + cdla_len != Dynarr_length (ddla) || + (f->extents_changed && w->gutter_extent_modiff[pos])) { - output_display_line (w, cdla, ddla, line, -1, -1); +#ifdef DEBUG_GUTTERS + printf ("gutter redisplay triggered by %s\n", force ? "force" : + f->faces_changed ? "f->faces_changed" : + f->frame_changed ? "f->frame_changed" : + f->gutter_changed ? "f->gutter_changed" : + f->glyphs_changed ? "f->glyphs_changed" : + f->size_changed ? "f->size_changed" : + f->subwindows_changed ? "f->subwindows_changed" : + w->windows_changed ? "w->windows_changed" : + f->windows_structure_changed ? "f->windows_structure_changed" : + cdla_len != Dynarr_length (ddla) ? "different display structures" : + f->extents_changed && w->gutter_extent_modiff[pos] ? + "f->extents_changed && w->gutter_extent_modiff[pos]" : ""); +#endif + /* Output each line. */ + for (line = 0; line < Dynarr_length (ddla); line++) + { + output_display_line (w, cdla, ddla, line, -1, -1); + } + + /* If the number of display lines has shrunk, adjust. */ + if (cdla_len > Dynarr_length (ddla)) + { + Dynarr_length (cdla) = Dynarr_length (ddla); + } + + /* grab coordinates of last line and blank after it. */ + dl = Dynarr_atp (ddla, Dynarr_length (ddla) - 1); + ypos = dl->ypos + dl->descent - dl->clip; + redisplay_clear_region (window, findex, x + border_width , ypos, + width - 2 * border_width, height - (ypos - y) - border_width); + /* bevel the gutter area if so desired */ + if (border_width != 0) + { + MAYBE_DEVMETH (d, bevel_area, + (w, findex, x, y, width, height, border_width, + EDGE_ALL, EDGE_BEVEL_OUT)); + } } - - /* If the number of display lines has shrunk, adjust. */ - if (cdla_len > Dynarr_length (ddla)) + else { - Dynarr_length (cdla) = Dynarr_length (ddla); + /* Nothing of significance happened so sync the display line + structs. */ + for (line = 0; line < Dynarr_length (ddla); line++) + { + sync_display_line_structs (w, line, 1, cdla, ddla); + } } - /* grab coordinates of last line and blank after it. */ - dl = Dynarr_atp (ddla, Dynarr_length (ddla) - 1); - ypos = dl->ypos + dl->descent - dl->clip; - redisplay_clear_region (window, findex, x + border_width , ypos, - width - 2 * border_width, height - (ypos - y) - border_width); - /* bevel the gutter area if so desired */ - if (border_width != 0) - { - MAYBE_DEVMETH (d, bevel_area, - (w, findex, x, y, width, height, border_width, - EDGE_ALL, EDGE_BEVEL_OUT)); - } + w->gutter_extent_modiff [pos] = 0; } -/* sizing gutters is a pain so we try and help the user by detemining +/* Sizing gutters is a pain so we try and help the user by detemining what height will accommodate all lines. This is useless on left and right gutters as we always have a maximal number of lines. */ static Lisp_Object calculate_gutter_size (struct window *w, enum gutter_pos pos) { struct frame* f = XFRAME (WINDOW_FRAME (w)); - int ypos; + int ypos, count; display_line_dynarr* ddla; struct display_line *dl; @@ -292,13 +361,20 @@ is no reasonable metric to use */ assert (pos == TOP_GUTTER || pos == BOTTOM_GUTTER); /* degenerate case */ - if (NILP (WINDOW_GUTTER (w, pos)) + if (NILP (RAW_WINDOW_GUTTER (w, pos)) || !FRAME_VISIBLE_P (f) || NILP (w->buffer)) return Qnil; + /* Redisplay code that we use relies on GC not happening. Make it + so. */ + count = specpdl_depth (); + record_unwind_protect (restore_gc_inhibit, + make_int (gc_currently_forbidden)); + gc_currently_forbidden = 1; + ddla = Dynarr_new (display_line); /* generate some display lines */ generate_displayable_area (w, WINDOW_GUTTER (w, pos), @@ -308,6 +384,10 @@ - FRAME_LEFT_BORDER_END (f), 200, ddla, 0, 0); + + /* Let GC happen again. */ + unbind_to (count, Qnil); + /* grab coordinates of last line */ if (Dynarr_length (ddla)) { @@ -329,7 +409,7 @@ int x, y, width, height; Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f); face_index findex = get_builtin_face_cache_index (XWINDOW (window), - Vgui_element_face); + Vwidget_face); get_gutter_coords (f, pos, &x, &y, &width, &height); SET_GUTTER_WAS_VISIBLE_FLAG (f, pos, 0); @@ -347,19 +427,86 @@ void mark_gutters (struct frame* f) { - if (f->current_display_lines) - mark_redisplay_structs (f->current_display_lines); - if (f->desired_display_lines) - mark_redisplay_structs (f->desired_display_lines); + enum gutter_pos pos; + GUTTER_POS_LOOP (pos) + { + if (f->current_display_lines[pos]) + mark_redisplay_structs (f->current_display_lines[pos]); + /* #### Do we really need to mark the desired lines? */ + if (f->desired_display_lines[pos]) + mark_redisplay_structs (f->desired_display_lines[pos]); + } +} + +/* This is called by extent_changed_for_redisplay, so that redisplay + knows exactly what extents have changed. */ +void +gutter_extent_signal_changed_region_maybe (Lisp_Object obj, + Bufpos start, Bufpos end) +{ + /* #### Start and end are currently ignored but could be used by a + more optimal gutter redisplay. We currently loop over all frames + here, this could be optimized. */ + Lisp_Object frmcons, devcons, concons; + + FRAME_LOOP_NO_BREAK (frmcons, devcons, concons) + { + struct frame *f = XFRAME (XCAR (frmcons)); + enum gutter_pos pos; + Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f); + struct window* w = XWINDOW (window); + + GUTTER_POS_LOOP (pos) + { + if (EQ (WINDOW_GUTTER (w, pos), obj)) + { + w->gutter_extent_modiff[pos]++; + } + } + } +} + +/* We have to change the gutter geometry separately to the gutter + update since it needs to occur outside of redisplay proper. */ +void +update_frame_gutter_geometry (struct frame *f) +{ + if (f->gutter_changed || f->windows_structure_changed) + { + enum gutter_pos pos; + + /* If the gutter geometry has changed then re-layout the + frame. If we are in display there is almost no point in doing + anything else since the frame size changes will be delayed + until we are out of redisplay proper. */ + GUTTER_POS_LOOP (pos) + { + if (FRAME_GUTTER_BOUNDS (f, pos) != f->current_gutter_bounds[pos]) + { + int width, height; + pixel_to_char_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f), + &width, &height); + change_frame_size (f, height, width, 0); + break; + } + } + + GUTTER_POS_LOOP (pos) + { + /* Mark sizes as up-to-date. */ + f->current_gutter_bounds[pos] = FRAME_GUTTER_BOUNDS (f, pos); + } + } } void update_frame_gutters (struct frame *f) { - if (f->gutter_changed || f->clear || - f->glyphs_changed || f->subwindows_changed || - f->windows_changed || f->windows_structure_changed || - f->extents_changed || f->faces_changed) + if (f->faces_changed || f->frame_changed || + f->gutter_changed || f->glyphs_changed || + f->size_changed || f->subwindows_changed || + f->windows_changed || f->windows_structure_changed || + f->extents_changed) { enum gutter_pos pos; @@ -374,10 +521,12 @@ GUTTER_POS_LOOP (pos) { if (FRAME_GUTTER_VISIBLE (f, pos)) - output_gutter (f, pos); + output_gutter (f, pos, 0); + else if (gutter_was_visible (f, pos)) - clear_gutter (f, pos); + clear_gutter (f, pos); } + f->clip_changed = local_clip_changed; f->buffers_changed = local_buffers_changed; f->gutter_changed = 0; @@ -387,8 +536,12 @@ void reset_gutter_display_lines (struct frame* f) { - if (f->current_display_lines) - Dynarr_reset (f->current_display_lines); + enum gutter_pos pos; + GUTTER_POS_LOOP (pos) + { + if (f->current_display_lines[pos]) + Dynarr_reset (f->current_display_lines[pos]); + } } static void @@ -412,7 +565,7 @@ /* Even if none of the gutter is in the area, the blank region at the very least must be because the first thing we did is verify that some portion of the gutter is in the exposed region. */ - output_gutter (f, pos); + output_gutter (f, pos, 1); } void @@ -430,15 +583,19 @@ void free_frame_gutters (struct frame *f) { - if (f->current_display_lines) + enum gutter_pos pos; + GUTTER_POS_LOOP (pos) { - free_display_lines (f->current_display_lines); - f->current_display_lines = 0; - } - if (f->desired_display_lines) - { - free_display_lines (f->desired_display_lines); - f->desired_display_lines = 0; + if (f->current_display_lines[pos]) + { + free_display_lines (f->current_display_lines[pos]); + f->current_display_lines[pos] = 0; + } + if (f->desired_display_lines[pos]) + { + free_display_lines (f->desired_display_lines[pos]); + f->desired_display_lines[pos] = 0; + } } } @@ -482,14 +639,21 @@ list1 (Fcons (Qnil, Qzero))); set_specifier_fallback (Vgutter_border_width[new], Vdefault_gutter_border_width); + /* We don't realy want the left and right gutters to default to + visible. */ set_specifier_fallback (Vgutter_visible_p[cur], - list1 (Fcons (Qnil, Qt))); + cur == TOP_GUTTER || cur == BOTTOM_GUTTER ? + list1 (Fcons (Qnil, Qt)) + : list1 (Fcons (Qnil, Qnil))); set_specifier_fallback (Vgutter_visible_p[new], Vdefault_gutter_visible_p); + Vdefault_gutter_position = position; unhold_frame_size_changes (); } + run_hook (Qdefault_gutter_position_changed_hook); + return position; } @@ -558,9 +722,22 @@ { if (NILP (instantiator)) return; + + /* Must be a string or a plist. */ + if (!STRINGP (instantiator) && NILP (Fvalid_plist_p (instantiator))) + signal_simple_error ("Gutter spec must be string, plist or nil", instantiator); if (!STRINGP (instantiator)) - signal_simple_error ("Gutter spec must be string or nil", instantiator); + { + Lisp_Object rest; + + for (rest = instantiator; !NILP (rest); rest = XCDR (XCDR (rest))) + { + if (!SYMBOLP (XCAR (rest)) + || !STRINGP (XCAR (XCDR (rest)))) + signal_simple_error ("Gutter plist spec must contain strings", instantiator); + } + } } DEFUN ("gutter-specifier-p", Fgutter_specifier_p, 1, 1, 0, /* @@ -570,9 +747,9 @@ `left-gutter', `right-gutter', and `bottom-gutter' are always gutter specifiers. -Valid gutter instantiators are called "gutter descriptors" -and are lists of vectors. See `default-gutter' for a description -of the exact format. +Valid gutter instantiators are called "gutter descriptors" and are +either strings or property-lists of strings. See `default-gutter' for +a description of the exact format. */ (object)) { @@ -593,22 +770,50 @@ static void gutter_specs_changed (Lisp_Object specifier, struct window *w, - Lisp_Object oldval) + Lisp_Object oldval, enum gutter_pos pos) { - enum gutter_pos pos; - GUTTER_POS_LOOP (pos) + w->real_gutter[pos] = construct_window_gutter_spec (w, pos); + w->real_gutter_size[pos] = w->gutter_size[pos]; + + if (EQ (w->real_gutter_size[pos], Qautodetect) + && !NILP (w->gutter_visible_p[pos])) { - w->real_gutter_size[pos] = w->gutter_size[pos]; - if (EQ (w->real_gutter_size[pos], Qautodetect) - && !NILP (w->gutter_visible_p[pos])) - { - w->real_gutter_size [pos] = calculate_gutter_size (w, pos); - } + w->real_gutter_size [pos] = calculate_gutter_size (w, pos); } MARK_GUTTER_CHANGED; + MARK_MODELINE_CHANGED; MARK_WINDOWS_CHANGED (w); } +/* We define all of these so we can access which actual gutter changed. */ +static void +top_gutter_specs_changed (Lisp_Object specifier, struct window *w, + Lisp_Object oldval) +{ + gutter_specs_changed (specifier, w, oldval, TOP_GUTTER); +} + +static void +bottom_gutter_specs_changed (Lisp_Object specifier, struct window *w, + Lisp_Object oldval) +{ + gutter_specs_changed (specifier, w, oldval, BOTTOM_GUTTER); +} + +static void +left_gutter_specs_changed (Lisp_Object specifier, struct window *w, + Lisp_Object oldval) +{ + gutter_specs_changed (specifier, w, oldval, LEFT_GUTTER); +} + +static void +right_gutter_specs_changed (Lisp_Object specifier, struct window *w, + Lisp_Object oldval) +{ + gutter_specs_changed (specifier, w, oldval, RIGHT_GUTTER); +} + static void default_gutter_specs_changed (Lisp_Object specifier, struct window *w, Lisp_Object oldval) @@ -632,6 +837,7 @@ } MARK_GUTTER_CHANGED; + MARK_MODELINE_CHANGED; MARK_WINDOWS_CHANGED (w); } @@ -656,6 +862,9 @@ Lisp_Object oldval) { recompute_overlaying_specifier (Vgutter_visible_p); + /* Need to reconstruct the gutter specifier as it is affected by the + visibility. */ + recompute_overlaying_specifier (Vgutter); } @@ -675,12 +884,69 @@ DEFUN ("gutter-size-specifier-p", Fgutter_size_specifier_p, 1, 1, 0, /* Return non-nil if OBJECT is a gutter-size specifier. + +Gutter-size specifiers are used to specify the size of a gutter. The +values of the variables `default-gutter-size', `top-gutter-size', +`left-gutter-size', `right-gutter-size', and `bottom-gutter-size' are +always gutter-size specifiers. + +Valid gutter-size instantiators are either integers or the special +symbol 'autodetect. If a gutter-size is set to 'autodetect them the +size of the gutter will be adjusted to just accomodate the gutters +contents. 'autodetect only works for top and bottom gutters. */ (object)) { return GUTTER_SIZE_SPECIFIERP (object) ? Qt : Qnil; } +DECLARE_SPECIFIER_TYPE (gutter_visible); +#define GUTTER_VISIBLE_SPECIFIERP(x) SPECIFIER_TYPEP (x, gutter_visible) +DEFINE_SPECIFIER_TYPE (gutter_visible); + +static void +gutter_visible_validate (Lisp_Object instantiator) +{ + if (NILP (instantiator)) + return; + + if (!NILP (instantiator) && !EQ (instantiator, Qt) && !CONSP (instantiator)) + signal_simple_error ("Gutter visibility must be a boolean or list of symbols", + instantiator); + + if (CONSP (instantiator)) + { + Lisp_Object rest; + + EXTERNAL_LIST_LOOP (rest, instantiator) + { + if (!SYMBOLP (XCAR (rest))) + signal_simple_error ("Gutter visibility must be a boolean or list of symbols", + instantiator); + } + } +} + +DEFUN ("gutter-visible-specifier-p", Fgutter_visible_specifier_p, 1, 1, 0, /* +Return non-nil if OBJECT is a gutter-visible specifier. + +Gutter-visible specifiers are used to specify the visibility of a +gutter. The values of the variables `default-gutter-visible-p', +`top-gutter-visible-p', `left-gutter-visible-p', +`right-gutter-visible-p', and `bottom-gutter-visible-p' are always +gutter-visible specifiers. + +Valid gutter-visible instantiators are t, nil or a list of symbols. +If a gutter-visible instantiator is set to a list of symbols, and the +correspondong gutter specification is a property-list strings, then +elements of the gutter specification will only be visible if the +corresponding symbol occurs in the gutter-visible instantiator. +*/ + (object)) +{ + return GUTTER_VISIBLE_SPECIFIERP (object) ? Qt : Qnil; +} + DEFUN ("redisplay-gutter-area", Fredisplay_gutter_area, 0, 0, 0, /* Ensure that all gutters are correctly showing their gutter specifier. */ @@ -696,20 +962,46 @@ DEVICE_FRAME_LOOP (frmcons, d) { struct frame *f = XFRAME (XCAR (frmcons)); + + /* Sequence is quite important here. We not only want to + redisplay the gutter area but we also want to flush any + frame size changes out so that the gutter redisplay happens + in a kosha environment. - if (FRAME_REPAINT_P (f)) + This is not only so that things look right but so that + glyph redisplay optimization kicks in, by default display + lines will be completely re-output if + f->windows_structure_changed is 1, and this is true if + frame size changes haven't been flushed out. Once frame + size changes have been flushed out we then need to + redisplay the frame in order to flush out pending window + size changes. */ + update_frame_gutter_geometry (f); + + if (f->windows_structure_changed) + redisplay_frame (f, 1); + else if (FRAME_REPAINT_P (f)) { + /* We have to be "in display" when we output the gutter + - make it so. */ + hold_frame_size_changes (); update_frame_gutters (f); + unhold_one_frame_size_changes (f); } } - /* We now call the output_end routine for tty frames. We delay doing so in order to avoid cursor flicker. So much for 100% encapsulation. */ if (DEVICE_TTY_P (d)) DEVMETH (d, output_end, (d)); + + d->gutter_changed = 0; } + /* This is so that further changes to the gutters will trigger redisplay. */ + gutter_changed_set = 0; + gutter_changed = 0; + return Qnil; } @@ -723,6 +1015,7 @@ initialization. We need to recalculate autodetected gutters. */ GUTTER_POS_LOOP (pos) { + w->real_gutter[pos] = construct_window_gutter_spec (w, pos); w->real_gutter_size[pos] = w->gutter_size[pos]; if (EQ (w->gutter_size[pos], Qautodetect) && !NILP (w->gutter_visible_p[pos])) @@ -732,6 +1025,12 @@ MARK_WINDOWS_CHANGED (w); } } + + /* Keep a record of the current sizes of things. */ + GUTTER_POS_LOOP (pos) + { + f->current_gutter_bounds[pos] = FRAME_GUTTER_BOUNDS (f, pos); + } } void @@ -739,6 +1038,7 @@ { DEFSUBR (Fgutter_specifier_p); DEFSUBR (Fgutter_size_specifier_p); + DEFSUBR (Fgutter_visible_specifier_p); DEFSUBR (Fset_default_gutter_position); DEFSUBR (Fdefault_gutter_position); DEFSUBR (Fgutter_pixel_height); @@ -746,6 +1046,9 @@ DEFSUBR (Fredisplay_gutter_area); defsymbol (&Qgutter_size, "gutter-size"); + defsymbol (&Qgutter_visible, "gutter-visible"); + defsymbol (&Qdefault_gutter_position_changed_hook, + "default-gutter-position-changed"); } void @@ -761,13 +1064,14 @@ specifier_type_create_gutter (void) { INITIALIZE_SPECIFIER_TYPE (gutter, "gutter", "gutter-specifier-p"); - SPECIFIER_HAS_METHOD (gutter, validate); SPECIFIER_HAS_METHOD (gutter, after_change); INITIALIZE_SPECIFIER_TYPE (gutter_size, "gutter-size", "gutter-size-specifier-p"); + SPECIFIER_HAS_METHOD (gutter_size, validate); - SPECIFIER_HAS_METHOD (gutter_size, validate); + INITIALIZE_SPECIFIER_TYPE (gutter_visible, "gutter-visible", "gutter-visible-specifier-p"); + SPECIFIER_HAS_METHOD (gutter_visible, validate); } void @@ -775,6 +1079,7 @@ { REINITIALIZE_SPECIFIER_TYPE (gutter); REINITIALIZE_SPECIFIER_TYPE (gutter_size); + REINITIALIZE_SPECIFIER_TYPE (gutter_visible); } void @@ -815,11 +1120,11 @@ using position-specific specifiers. That way, you will get sane behavior if the user changes the default gutter position. -The gutter value should be a string or nil. You can attach extents and -glyphs to the string and hence display glyphs and text in other fonts -in the gutter area. - -*/ ); +The gutter value should be a string, a property list of strings or +nil. You can attach extents and glyphs to the string and hence display +glyphs and text in other fonts in the gutter area. If the gutter value +is a property list then the strings will be concatenated together +before being displayed. */ ); Vdefault_gutter = Fmake_specifier (Qgutter); /* #### It would be even nicer if the specifier caching @@ -839,7 +1144,7 @@ Vgutter[TOP_GUTTER] = Fmake_specifier (Qgutter); set_specifier_caching (Vgutter[TOP_GUTTER], offsetof (struct window, gutter[TOP_GUTTER]), - gutter_specs_changed, + top_gutter_specs_changed, 0, 0); DEFVAR_SPECIFIER ("bottom-gutter", @@ -856,7 +1161,7 @@ Vgutter[BOTTOM_GUTTER] = Fmake_specifier (Qgutter); set_specifier_caching (Vgutter[BOTTOM_GUTTER], offsetof (struct window, gutter[BOTTOM_GUTTER]), - gutter_specs_changed, + bottom_gutter_specs_changed, 0, 0); DEFVAR_SPECIFIER ("left-gutter", @@ -873,7 +1178,7 @@ Vgutter[LEFT_GUTTER] = Fmake_specifier (Qgutter); set_specifier_caching (Vgutter[LEFT_GUTTER], offsetof (struct window, gutter[LEFT_GUTTER]), - gutter_specs_changed, + left_gutter_specs_changed, 0, 0); DEFVAR_SPECIFIER ("right-gutter", @@ -890,7 +1195,7 @@ Vgutter[RIGHT_GUTTER] = Fmake_specifier (Qgutter); set_specifier_caching (Vgutter[RIGHT_GUTTER], offsetof (struct window, gutter[RIGHT_GUTTER]), - gutter_specs_changed, + right_gutter_specs_changed, 0, 0); /* initially, top inherits from default; this can be @@ -955,8 +1260,7 @@ Vgutter_size[TOP_GUTTER] = Fmake_specifier (Qgutter_size); set_specifier_caching (Vgutter_size[TOP_GUTTER], offsetof (struct window, gutter_size[TOP_GUTTER]), - gutter_geometry_changed_in_window, - 0, 0); + gutter_geometry_changed_in_window, 0, 0); DEFVAR_SPECIFIER ("bottom-gutter-height", &Vgutter_size[BOTTOM_GUTTER] /* @@ -968,8 +1272,7 @@ Vgutter_size[BOTTOM_GUTTER] = Fmake_specifier (Qgutter_size); set_specifier_caching (Vgutter_size[BOTTOM_GUTTER], offsetof (struct window, gutter_size[BOTTOM_GUTTER]), - gutter_geometry_changed_in_window, - 0, 0); + gutter_geometry_changed_in_window, 0, 0); DEFVAR_SPECIFIER ("left-gutter-width", &Vgutter_size[LEFT_GUTTER] /* @@ -981,8 +1284,7 @@ Vgutter_size[LEFT_GUTTER] = Fmake_specifier (Qnatnum); set_specifier_caching (Vgutter_size[LEFT_GUTTER], offsetof (struct window, gutter_size[LEFT_GUTTER]), - gutter_geometry_changed_in_window, - 0, 0); + gutter_geometry_changed_in_window, 0, 0); DEFVAR_SPECIFIER ("right-gutter-width", &Vgutter_size[RIGHT_GUTTER] /* @@ -994,8 +1296,7 @@ Vgutter_size[RIGHT_GUTTER] = Fmake_specifier (Qnatnum); set_specifier_caching (Vgutter_size[RIGHT_GUTTER], offsetof (struct window, gutter_size[RIGHT_GUTTER]), - gutter_geometry_changed_in_window, - 0, 0); + gutter_geometry_changed_in_window, 0, 0); fb = Qnil; #ifdef HAVE_TTY @@ -1063,8 +1364,7 @@ set_specifier_caching (Vgutter_border_width[TOP_GUTTER], offsetof (struct window, gutter_border_width[TOP_GUTTER]), - gutter_geometry_changed_in_window, - 0, 0); + gutter_geometry_changed_in_window, 0, 0); DEFVAR_SPECIFIER ("bottom-gutter-border-width", &Vgutter_border_width[BOTTOM_GUTTER] /* @@ -1077,8 +1377,7 @@ set_specifier_caching (Vgutter_border_width[BOTTOM_GUTTER], offsetof (struct window, gutter_border_width[BOTTOM_GUTTER]), - gutter_geometry_changed_in_window, - 0, 0); + gutter_geometry_changed_in_window, 0, 0); DEFVAR_SPECIFIER ("left-gutter-border-width", &Vgutter_border_width[LEFT_GUTTER] /* @@ -1091,8 +1390,7 @@ set_specifier_caching (Vgutter_border_width[LEFT_GUTTER], offsetof (struct window, gutter_border_width[LEFT_GUTTER]), - gutter_geometry_changed_in_window, - 0, 0); + gutter_geometry_changed_in_window, 0, 0); DEFVAR_SPECIFIER ("right-gutter-border-width", &Vgutter_border_width[RIGHT_GUTTER] /* @@ -1105,8 +1403,7 @@ set_specifier_caching (Vgutter_border_width[RIGHT_GUTTER], offsetof (struct window, gutter_border_width[RIGHT_GUTTER]), - gutter_geometry_changed_in_window, - 0, 0); + gutter_geometry_changed_in_window, 0, 0); fb = Qnil; #ifdef HAVE_TTY @@ -1143,7 +1440,7 @@ `default-gutter-visible-p' and all of the position-specific gutter visibility specifiers have a fallback value of true. */ ); - Vdefault_gutter_visible_p = Fmake_specifier (Qboolean); + Vdefault_gutter_visible_p = Fmake_specifier (Qgutter_visible); set_specifier_caching (Vdefault_gutter_visible_p, offsetof (struct window, default_gutter_visible_p), @@ -1157,12 +1454,11 @@ See `default-gutter-visible-p' for more information. */ ); - Vgutter_visible_p[TOP_GUTTER] = Fmake_specifier (Qboolean); + Vgutter_visible_p[TOP_GUTTER] = Fmake_specifier (Qgutter_visible); set_specifier_caching (Vgutter_visible_p[TOP_GUTTER], offsetof (struct window, gutter_visible_p[TOP_GUTTER]), - gutter_geometry_changed_in_window, - 0, 0); + top_gutter_specs_changed, 0, 0); DEFVAR_SPECIFIER ("bottom-gutter-visible-p", &Vgutter_visible_p[BOTTOM_GUTTER] /* @@ -1171,12 +1467,11 @@ See `default-gutter-visible-p' for more information. */ ); - Vgutter_visible_p[BOTTOM_GUTTER] = Fmake_specifier (Qboolean); + Vgutter_visible_p[BOTTOM_GUTTER] = Fmake_specifier (Qgutter_visible); set_specifier_caching (Vgutter_visible_p[BOTTOM_GUTTER], offsetof (struct window, gutter_visible_p[BOTTOM_GUTTER]), - gutter_geometry_changed_in_window, - 0, 0); + bottom_gutter_specs_changed, 0, 0); DEFVAR_SPECIFIER ("left-gutter-visible-p", &Vgutter_visible_p[LEFT_GUTTER] /* @@ -1185,12 +1480,11 @@ See `default-gutter-visible-p' for more information. */ ); - Vgutter_visible_p[LEFT_GUTTER] = Fmake_specifier (Qboolean); + Vgutter_visible_p[LEFT_GUTTER] = Fmake_specifier (Qgutter_visible); set_specifier_caching (Vgutter_visible_p[LEFT_GUTTER], offsetof (struct window, gutter_visible_p[LEFT_GUTTER]), - gutter_geometry_changed_in_window, - 0, 0); + left_gutter_specs_changed, 0, 0); DEFVAR_SPECIFIER ("right-gutter-visible-p", &Vgutter_visible_p[RIGHT_GUTTER] /* @@ -1199,12 +1493,11 @@ See `default-gutter-visible-p' for more information. */ ); - Vgutter_visible_p[RIGHT_GUTTER] = Fmake_specifier (Qboolean); + Vgutter_visible_p[RIGHT_GUTTER] = Fmake_specifier (Qgutter_visible); set_specifier_caching (Vgutter_visible_p[RIGHT_GUTTER], offsetof (struct window, gutter_visible_p[RIGHT_GUTTER]), - gutter_geometry_changed_in_window, - 0, 0); + right_gutter_specs_changed, 0, 0); /* initially, top inherits from default; this can be changed with `set-default-gutter-position'. */ diff -r 9f011ab08d48 -r 2f8bb876ab1d src/gutter.h --- a/src/gutter.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/gutter.h Mon Aug 13 11:16:07 2007 +0200 @@ -54,6 +54,7 @@ extern Lisp_Object Vgutter_size[4]; extern Lisp_Object Vgutter_border_width[4]; void update_frame_gutters (struct frame *f); +void update_frame_gutter_geometry (struct frame *f); void mark_gutters (struct frame* f); void init_frame_gutters (struct frame *f); void init_device_gutters (struct device *d); @@ -62,17 +63,21 @@ void redraw_exposed_gutters (struct frame *f, int x, int y, int width, int height); void reset_gutter_display_lines (struct frame* f); +void gutter_extent_signal_changed_region_maybe (Lisp_Object obj, + Bufpos start, Bufpos end); #define WINDOW_GUTTER_BORDER_WIDTH(w, pos) \ -(NILP ((w)->gutter_border_width[pos]) ? 0 : XINT ((w)->gutter_border_width[pos])) + (INTP ((w)->gutter_border_width[pos]) ? XINT ((w)->gutter_border_width[pos]) : 0) #define WINDOW_GUTTER_SIZE(w, pos) \ -(NILP ((w)->gutter_size[pos]) ? 0 : XINT ((w)->gutter_size[pos])) + (INTP ((w)->gutter_size[pos]) ? XINT ((w)->gutter_size[pos]) : 0) #define WINDOW_GUTTER_SIZE_INTERNAL(w, pos) \ -(NILP ((w)->real_gutter_size[pos]) ? 0 : XINT ((w)->real_gutter_size[pos])) + (INTP ((w)->real_gutter_size[pos]) ? XINT ((w)->real_gutter_size[pos]) : 0) #define WINDOW_GUTTER_VISIBLE(w, pos) \ -((w)->gutter_visible_p[pos]) + ((w)->gutter_visible_p[pos]) #define WINDOW_GUTTER(w, pos) \ -((w)->gutter[pos]) + ((w)->real_gutter[pos]) +#define RAW_WINDOW_GUTTER(w, pos) \ + ((w)->gutter[pos]) #define WINDOW_REAL_GUTTER_SIZE(w, pos) \ (!NILP (WINDOW_GUTTER_VISIBLE (w, pos)) \ @@ -91,17 +96,13 @@ /* these macros predicate size on position and type of window */ #define WINDOW_REAL_TOP_GUTTER_BOUNDS(w) \ - ((!MINI_WINDOW_P (w) && window_is_highest (w)) ? \ - WINDOW_REAL_GUTTER_BOUNDS (w,TOP_GUTTER) : 0) + WINDOW_REAL_GUTTER_BOUNDS (w,TOP_GUTTER) #define WINDOW_REAL_BOTTOM_GUTTER_BOUNDS(w) \ - ((!MINI_WINDOW_P (w) && window_is_lowest (w)) ? \ - WINDOW_REAL_GUTTER_BOUNDS (w,BOTTOM_GUTTER) : 0) + WINDOW_REAL_GUTTER_BOUNDS (w,BOTTOM_GUTTER) #define WINDOW_REAL_LEFT_GUTTER_BOUNDS(w) \ - ((!MINI_WINDOW_P (w) && window_is_leftmost (w)) ? \ - WINDOW_REAL_GUTTER_BOUNDS (w,LEFT_GUTTER) : 0) + WINDOW_REAL_GUTTER_BOUNDS (w,LEFT_GUTTER) #define WINDOW_REAL_RIGHT_GUTTER_BOUNDS(w) \ - ((!MINI_WINDOW_P (w) && window_is_rightmost (w)) ? \ - WINDOW_REAL_GUTTER_BOUNDS (w,RIGHT_GUTTER) : 0) + WINDOW_REAL_GUTTER_BOUNDS (w,RIGHT_GUTTER) #define FRAME_GUTTER_VISIBLE(f, pos) \ WINDOW_REAL_GUTTER_VISIBLE (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)), pos) diff -r 9f011ab08d48 -r 2f8bb876ab1d src/inline.c --- a/src/inline.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/inline.c Mon Aug 13 11:16:07 2007 +0200 @@ -22,23 +22,23 @@ /* The purpose of this file is so that there is at least one actual definition of each inline function. This is needed under GCC. The - reason is that under GCC we declare our inline functions `extern - inline', which causes the inlined version to get used only for + reason is that under GCC we declare our inline functions `inline + extern', which causes the inlined version to get used only for inlining, and in other cases to generate an external reference to the function. This is more efficient than declaring our inline - functions `static inline', which (in many cases) would cause a separate + functions `inline static', which (in many cases) would cause a separate version of the function to get inserted into every source file that - included the corresponding header file. + included the corresponding header file. See internals.texi. Some compilers that recognize `inline' may not do the same - `extern inline' business, so on those we just do `static inline'. + `inline extern' business, so on those we just do `inline static'. */ /* Note to maintainers: This file contains a list of all header files that use the INLINE macro, either directly, or by using DECLARE_LRECORD. - i.e. the output of ``grep -l -w 'DECLARE_LRECORD|INLINE' *.h'' */ + i.e. the output of ``grep -l -w 'DECLARE_LRECORD|INLINE_HEADER' *.h'' */ -#define DONT_EXTERN_INLINE_FUNCTIONS +#define DONT_EXTERN_INLINE_HEADER_FUNCTIONS #include #include "lisp.h" @@ -53,6 +53,7 @@ #include "faces.h" #include "frame.h" #include "glyphs.h" +#include "gui.h" #include "keymap.h" #include "lstream.h" #include "objects.h" @@ -67,6 +68,11 @@ #include "eldap.h" #endif +#ifdef HAVE_POSTGRESQL +#include +#include "postgresql.h" +#endif + #ifdef HAVE_TOOLBARS #include "toolbar.h" #endif diff -r 9f011ab08d48 -r 2f8bb876ab1d src/keymap.c --- a/src/keymap.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/keymap.c Mon Aug 13 11:16:07 2007 +0200 @@ -37,17 +37,6 @@ #include "insdel.h" #include "keymap.h" #include "window.h" - -#ifdef WINDOWSNT -/* Hmm, under unix we want X modifiers, under NT we want X modifiers if - we are running X and Windows modifiers otherwise. - gak. This is a kludge until we support multiple native GUIs! -*/ -#undef MOD_ALT -#undef MOD_CONTROL -#undef MOD_SHIFT -#endif - #include "events-mod.h" @@ -99,25 +88,25 @@ If the key `C-a' was bound to some command, the hierarchy would look like - keymap-1: associates the integer MOD_CONTROL with keymap-2 + keymap-1: associates the integer XEMACS_MOD_CONTROL with keymap-2 keymap-2: associates "a" with the command Similarly, if the key `C-H-a' was bound to some command, the hierarchy would look like - keymap-1: associates the integer (MOD_CONTROL | MOD_HYPER) + keymap-1: associates the integer (XEMACS_MOD_CONTROL | XEMACS_MOD_HYPER) with keymap-2 keymap-2: associates "a" with the command Note that a special exception is made for the meta modifier, in order to deal with ESC/meta lossage. Any key combination containing the meta modifier is first indexed off of the main map into the meta - submap (with hash key MOD_META) and then indexed off of the + submap (with hash key XEMACS_MOD_META) and then indexed off of the meta submap with the meta modifier removed from the key combination. For example, when associating a command with C-M-H-a, we'd have - keymap-1: associates the integer MOD_META with keymap-2 - keymap-2: associates the integer (MOD_CONTROL | MOD_HYPER) + keymap-1: associates the integer XEMACS_MOD_META with keymap-2 + keymap-2: associates the integer (XEMACS_MOD_CONTROL | XEMACS_MOD_HYPER) with keymap-3 keymap-3: associates "a" with the command @@ -131,7 +120,7 @@ Note that this new model of keymaps takes much of the magic away from the Escape key: the value of the variable `esc-map' is no longer indexed in the `global-map' under the ESC key. It's indexed under the integer - MOD_META. This is not user-visible, however; none of the "bucky" + XEMACS_MOD_META. This is not user-visible, however; none of the "bucky" maps are. There is a hack in Flookup_key() that makes (lookup-key global-map "\^[") @@ -406,32 +395,32 @@ /* Some low-level functions */ /************************************************************************/ -static unsigned int +static int bucky_sym_to_bucky_bit (Lisp_Object sym) { - if (EQ (sym, Qcontrol)) return MOD_CONTROL; - if (EQ (sym, Qmeta)) return MOD_META; - if (EQ (sym, Qsuper)) return MOD_SUPER; - if (EQ (sym, Qhyper)) return MOD_HYPER; - if (EQ (sym, Qalt)) return MOD_ALT; - if (EQ (sym, Qsymbol)) return MOD_ALT; /* #### - reverse compat */ - if (EQ (sym, Qshift)) return MOD_SHIFT; + if (EQ (sym, Qcontrol)) return XEMACS_MOD_CONTROL; + if (EQ (sym, Qmeta)) return XEMACS_MOD_META; + if (EQ (sym, Qsuper)) return XEMACS_MOD_SUPER; + if (EQ (sym, Qhyper)) return XEMACS_MOD_HYPER; + if (EQ (sym, Qalt)) return XEMACS_MOD_ALT; + if (EQ (sym, Qsymbol)) return XEMACS_MOD_ALT; /* #### - reverse compat */ + if (EQ (sym, Qshift)) return XEMACS_MOD_SHIFT; return 0; } static Lisp_Object -control_meta_superify (Lisp_Object frob, unsigned int modifiers) +control_meta_superify (Lisp_Object frob, int modifiers) { if (modifiers == 0) return frob; frob = Fcons (frob, Qnil); - if (modifiers & MOD_SHIFT) frob = Fcons (Qshift, frob); - if (modifiers & MOD_ALT) frob = Fcons (Qalt, frob); - if (modifiers & MOD_HYPER) frob = Fcons (Qhyper, frob); - if (modifiers & MOD_SUPER) frob = Fcons (Qsuper, frob); - if (modifiers & MOD_CONTROL) frob = Fcons (Qcontrol, frob); - if (modifiers & MOD_META) frob = Fcons (Qmeta, frob); + if (modifiers & XEMACS_MOD_SHIFT) frob = Fcons (Qshift, frob); + if (modifiers & XEMACS_MOD_ALT) frob = Fcons (Qalt, frob); + if (modifiers & XEMACS_MOD_HYPER) frob = Fcons (Qhyper, frob); + if (modifiers & XEMACS_MOD_SUPER) frob = Fcons (Qsuper, frob); + if (modifiers & XEMACS_MOD_CONTROL) frob = Fcons (Qcontrol, frob); + if (modifiers & XEMACS_MOD_META) frob = Fcons (Qmeta, frob); return frob; } @@ -439,7 +428,7 @@ make_key_description (const struct key_data *key, int prettify) { Lisp_Object keysym = key->keysym; - unsigned int modifiers = key->modifiers; + int modifiers = key->modifiers; if (prettify && CHARP (keysym)) { @@ -470,12 +459,12 @@ /* Relies on caller to gc-protect args */ static Lisp_Object keymap_lookup_directly (Lisp_Object keymap, - Lisp_Object keysym, unsigned int modifiers) + Lisp_Object keysym, int modifiers) { Lisp_Keymap *k; - if ((modifiers & ~(MOD_CONTROL | MOD_META | MOD_SUPER | MOD_HYPER - | MOD_ALT | MOD_SHIFT)) != 0) + if ((modifiers & ~(XEMACS_MOD_CONTROL | XEMACS_MOD_META | XEMACS_MOD_SUPER | XEMACS_MOD_HYPER + | XEMACS_MOD_ALT | XEMACS_MOD_SHIFT)) != 0) abort (); k = XKEYMAP (keymap); @@ -488,14 +477,14 @@ keysym = i_fart_on_gcc; } - if (modifiers & MOD_META) /* Utterly hateful ESC lossage */ + if (modifiers & XEMACS_MOD_META) /* Utterly hateful ESC lossage */ { - Lisp_Object submap = Fgethash (MAKE_MODIFIER_HASH_KEY (MOD_META), + Lisp_Object submap = Fgethash (MAKE_MODIFIER_HASH_KEY (XEMACS_MOD_META), k->table, Qnil); if (NILP (submap)) return Qnil; k = XKEYMAP (submap); - modifiers &= ~MOD_META; + modifiers &= ~XEMACS_MOD_META; } if (modifiers != 0) @@ -629,7 +618,7 @@ static Lisp_Object -create_bucky_submap (Lisp_Keymap *k, unsigned int modifiers, +create_bucky_submap (Lisp_Keymap *k, int modifiers, Lisp_Object parent_for_debugging_info) { Lisp_Object submap = Fmake_sparse_keymap (Qnil); @@ -649,24 +638,25 @@ Lisp_Object value) { Lisp_Object keysym = key->keysym; - unsigned int modifiers = key->modifiers; + int modifiers = key->modifiers; Lisp_Keymap *k = XKEYMAP (keymap); - assert ((modifiers & ~(MOD_CONTROL | MOD_META | MOD_SUPER | MOD_HYPER - | MOD_ALT | MOD_SHIFT)) == 0); + assert ((modifiers & ~(XEMACS_MOD_CONTROL | XEMACS_MOD_META + | XEMACS_MOD_SUPER | XEMACS_MOD_HYPER + | XEMACS_MOD_ALT | XEMACS_MOD_SHIFT)) == 0); /* If the keysym is a one-character symbol, use the char code instead. */ if (SYMBOLP (keysym) && string_char_length (XSYMBOL (keysym)->name) == 1) keysym = make_char (string_char (XSYMBOL (keysym)->name, 0)); - if (modifiers & MOD_META) /* Utterly hateful ESC lossage */ + if (modifiers & XEMACS_MOD_META) /* Utterly hateful ESC lossage */ { - Lisp_Object submap = Fgethash (MAKE_MODIFIER_HASH_KEY (MOD_META), + Lisp_Object submap = Fgethash (MAKE_MODIFIER_HASH_KEY (XEMACS_MOD_META), k->table, Qnil); if (NILP (submap)) - submap = create_bucky_submap (k, MOD_META, keymap); + submap = create_bucky_submap (k, XEMACS_MOD_META, keymap); k = XKEYMAP (submap); - modifiers &= ~MOD_META; + modifiers &= ~XEMACS_MOD_META; } if (modifiers != 0) @@ -1258,7 +1248,7 @@ static void define_key_check_and_coerce_keysym (Lisp_Object spec, Lisp_Object *keysym, - unsigned int modifiers) + int modifiers) { /* Now, check and massage the trailing keysym specifier. */ if (SYMBOLP (*keysym)) @@ -1281,7 +1271,7 @@ problems ... */ signal_simple_error ("keysym char must be printable", *keysym); /* #### This bites! I want to be able to write (control shift a) */ - if (modifiers & MOD_SHIFT) + if (modifiers & XEMACS_MOD_SHIFT) signal_simple_error ("The `shift' modifier may not be applied to ASCII keysyms", spec); @@ -1458,14 +1448,14 @@ } else if (CONSP (spec)) { - unsigned int modifiers = 0; + int modifiers = 0; Lisp_Object keysym = Qnil; Lisp_Object rest = spec; /* First, parse out the leading modifier symbols. */ while (CONSP (rest)) { - unsigned int modifier; + int modifier; keysym = XCAR (rest); modifier = bucky_sym_to_bucky_bit (keysym); @@ -1635,12 +1625,12 @@ struct key_data *returned_value) { Lisp_Object keysym = key->keysym; - unsigned int modifiers = key->modifiers; - unsigned int modifiers_sans_control = (modifiers & (~MOD_CONTROL)); - unsigned int modifiers_sans_meta = (modifiers & (~MOD_META)); + int modifiers = key->modifiers; + int modifiers_sans_control = (modifiers & (~XEMACS_MOD_CONTROL)); + int modifiers_sans_meta = (modifiers & (~XEMACS_MOD_META)); returned_value->keysym = Qnil; /* By default, no "alternate" key */ returned_value->modifiers = 0; - if (modifiers_sans_meta == MOD_CONTROL) + if (modifiers_sans_meta == XEMACS_MOD_CONTROL) { if EQ (keysym, QKspace) MACROLET (make_char ('@'), modifiers); @@ -1667,15 +1657,15 @@ else if (modifiers_sans_meta != 0) return; else if (EQ (keysym, QKbackspace)) /* backspace => c-h */ - MACROLET (make_char ('h'), (modifiers | MOD_CONTROL)); + MACROLET (make_char ('h'), (modifiers | XEMACS_MOD_CONTROL)); else if (EQ (keysym, QKtab)) /* tab => c-i */ - MACROLET (make_char ('i'), (modifiers | MOD_CONTROL)); + MACROLET (make_char ('i'), (modifiers | XEMACS_MOD_CONTROL)); else if (EQ (keysym, QKlinefeed)) /* linefeed => c-j */ - MACROLET (make_char ('j'), (modifiers | MOD_CONTROL)); + MACROLET (make_char ('j'), (modifiers | XEMACS_MOD_CONTROL)); else if (EQ (keysym, QKreturn)) /* return => c-m */ - MACROLET (make_char ('m'), (modifiers | MOD_CONTROL)); + MACROLET (make_char ('m'), (modifiers | XEMACS_MOD_CONTROL)); else if (EQ (keysym, QKescape)) /* escape => c-[ */ - MACROLET (make_char ('['), (modifiers | MOD_CONTROL)); + MACROLET (make_char ('['), (modifiers | XEMACS_MOD_CONTROL)); else return; #undef MACROLET @@ -1908,7 +1898,7 @@ struct gcpro ngcpro1; NGCPRO1 (c); - meta_map = Fgethash (MAKE_MODIFIER_HASH_KEY (MOD_META), + meta_map = Fgethash (MAKE_MODIFIER_HASH_KEY (XEMACS_MOD_META), XKEYMAP (keymap)->table, Qnil); if (!NILP (meta_map) && keymap_fullness (meta_map) != 0) @@ -1935,14 +1925,14 @@ if (metized) { - raw_key1.modifiers |= MOD_META; - raw_key2.modifiers |= MOD_META; + raw_key1.modifiers |= XEMACS_MOD_META; + raw_key2.modifiers |= XEMACS_MOD_META; metized = 0; } /* This crap is to make sure that someone doesn't bind something like "C-x M-a" while "C-x ESC" has a non-keymap binding. */ - if (raw_key1.modifiers & MOD_META) + if (raw_key1.modifiers & XEMACS_MOD_META) ensure_meta_prefix_char_keymapp (keys, idx, keymap); if (++idx == len) @@ -2065,7 +2055,7 @@ if (NILP (cmd)) { /* Do kludgy return of the meta-map */ - cmd = Fgethash (MAKE_MODIFIER_HASH_KEY (MOD_META), + cmd = Fgethash (MAKE_MODIFIER_HASH_KEY (XEMACS_MOD_META), XKEYMAP (k)->table, Qnil); } } @@ -2077,11 +2067,11 @@ if (!NILP (cmd)) cmd = raw_lookup_key (cmd, raw_keys + 1, remaining, keys_so_far + 1, accept_default); - else if ((raw_keys[1].modifiers & MOD_META) == 0) + else if ((raw_keys[1].modifiers & XEMACS_MOD_META) == 0) { struct key_data metified; metified.keysym = raw_keys[1].keysym; - metified.modifiers = raw_keys[1].modifiers | MOD_META; + metified.modifiers = raw_keys[1].modifiers | XEMACS_MOD_META; /* Search for meta-next-char sequence directly */ cmd = keymap_lookup_1 (k, &metified, accept_default); @@ -2743,7 +2733,7 @@ { void (*fn) (const struct key_data *, Lisp_Object binding, void *arg); void *arg; - unsigned int modifiers; + int modifiers; }; /* used by map_keymap() */ @@ -2754,8 +2744,8 @@ /* This function can GC */ struct map_keymap_unsorted_closure *closure = (struct map_keymap_unsorted_closure *) map_keymap_unsorted_closure; - unsigned int modifiers = closure->modifiers; - unsigned int mod_bit; + int modifiers = closure->modifiers; + int mod_bit; mod_bit = MODIFIER_HASH_KEY_BITS (keysym); if (mod_bit != 0) { @@ -2805,7 +2795,7 @@ { /* obj1 and obj2 are conses with keysyms in their cars. Cdrs are ignored. */ - unsigned int bit1, bit2; + int bit1, bit2; int sym1_p = 0; int sym2_p = 0; obj1 = XCAR (obj1); @@ -2879,7 +2869,7 @@ /* used by map_keymap() */ static void map_keymap_sorted (Lisp_Object keymap_table, - unsigned int modifiers, + int modifiers, void (*function) (const struct key_data *key, Lisp_Object binding, void *map_keymap_sorted_closure), @@ -2904,7 +2894,7 @@ { Lisp_Object keysym = XCAR (XCAR (contents)); Lisp_Object binding = XCDR (XCAR (contents)); - unsigned int sub_bits = MODIFIER_HASH_KEY_BITS (keysym); + int sub_bits = MODIFIER_HASH_KEY_BITS (keysym); if (sub_bits != 0) map_keymap_sorted (XKEYMAP (get_keymap (binding, 1, 1))->table, @@ -3010,11 +3000,11 @@ static void accessible_keymaps_mapper_1 (Lisp_Object keysym, Lisp_Object contents, - unsigned int modifiers, + int modifiers, struct accessible_keymaps_closure *closure) { /* This function can GC */ - unsigned int subbits = MODIFIER_HASH_KEY_BITS (keysym); + int subbits = MODIFIER_HASH_KEY_BITS (keysym); if (subbits != 0) { @@ -3492,7 +3482,7 @@ keys_so_far and modifiers_so_far describe which map we're looking in; If we're in the "meta" submap of the map that "C-x 4" is bound to, then keys_so_far will be {(control x), \4}, and modifiers_so_far - will be MOD_META. That is, keys_so_far is the chain of keys that we + will be XEMACS_MOD_META. That is, keys_so_far is the chain of keys that we have followed, and modifiers_so_far_so_far is the bits (partial keys) beyond that. @@ -3510,7 +3500,7 @@ int shadow_count; int firstonly; int keys_count; - unsigned int modifiers_so_far; + int modifiers_so_far; char *target_buffer; struct key_data *keys_so_far; int keys_so_far_total_size; @@ -3526,8 +3516,8 @@ struct where_is_closure *c = (struct where_is_closure *) arg; Lisp_Object definition = c->definition; const int firstonly = c->firstonly; - const unsigned int keys_count = c->keys_count; - const unsigned int modifiers_so_far = c->modifiers_so_far; + const int keys_count = c->keys_count; + const int modifiers_so_far = c->modifiers_so_far; char *target_buffer = c->target_buffer; Lisp_Object keys = Fgethash (definition, XKEYMAP (map)->inverse_table, @@ -3600,9 +3590,9 @@ { Lisp_Object key = XCAR (XCAR (submaps)); Lisp_Object submap = XCDR (XCAR (submaps)); - unsigned int lower_modifiers; + int lower_modifiers; int lower_keys_count = keys_count; - unsigned int bucky; + int bucky; submap = get_keymap (submap, 0, 0); @@ -3933,7 +3923,7 @@ struct describe_map_closure *closure = (struct describe_map_closure *) describe_map_closure; Lisp_Object keysym = key->keysym; - unsigned int modifiers = key->modifiers; + int modifiers = key->modifiers; /* Don't mention suppressed commands. */ if (SYMBOLP (binding) @@ -4007,7 +3997,7 @@ ( ( . ) . ) keysym and modifiers are used, binding is ignored. */ - unsigned int bit1, bit2; + int bit1, bit2; obj1 = XCAR (obj1); obj2 = XCAR (obj2); bit1 = XINT (XCDR (obj1)); @@ -4127,17 +4117,17 @@ { Lisp_Object elt = XCAR (XCAR (list)); Lisp_Object keysym = XCAR (elt); - unsigned int modifiers = XINT (XCDR (elt)); + int modifiers = XINT (XCDR (elt)); if (!NILP (elt_prefix)) buffer_insert_lisp_string (buf, elt_prefix); - if (modifiers & MOD_META) buffer_insert_c_string (buf, "M-"); - if (modifiers & MOD_CONTROL) buffer_insert_c_string (buf, "C-"); - if (modifiers & MOD_SUPER) buffer_insert_c_string (buf, "S-"); - if (modifiers & MOD_HYPER) buffer_insert_c_string (buf, "H-"); - if (modifiers & MOD_ALT) buffer_insert_c_string (buf, "Alt-"); - if (modifiers & MOD_SHIFT) buffer_insert_c_string (buf, "Sh-"); + if (modifiers & XEMACS_MOD_META) buffer_insert_c_string (buf, "M-"); + if (modifiers & XEMACS_MOD_CONTROL) buffer_insert_c_string (buf, "C-"); + if (modifiers & XEMACS_MOD_SUPER) buffer_insert_c_string (buf, "S-"); + if (modifiers & XEMACS_MOD_HYPER) buffer_insert_c_string (buf, "H-"); + if (modifiers & XEMACS_MOD_ALT) buffer_insert_c_string (buf, "Alt-"); + if (modifiers & XEMACS_MOD_SHIFT) buffer_insert_c_string (buf, "Sh-"); if (SYMBOLP (keysym)) { Lisp_Object code = Fget (keysym, Vcharacter_set_property, Qnil); @@ -4357,7 +4347,7 @@ meta_disgustitute = Fmake_keymap (Qnil); Ffset (ESC_prefix, meta_disgustitute); /* no need to protect meta_disgustitute, though */ - keymap_store_internal (MAKE_MODIFIER_HASH_KEY (MOD_META), + keymap_store_internal (MAKE_MODIFIER_HASH_KEY (XEMACS_MOD_META), XKEYMAP (Vcurrent_global_map), meta_disgustitute); XKEYMAP (Vcurrent_global_map)->sub_maps_cache = Qt; diff -r 9f011ab08d48 -r 2f8bb876ab1d src/line-number.c --- a/src/line-number.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/line-number.c Mon Aug 13 11:16:07 2007 +0200 @@ -293,7 +293,7 @@ get_nearest_line_number (b, &beg, pos, &cached_lines); } - scan_buffer (b, '\n', beg, pos, pos > beg ? EMACS_INT_MAX : -EMACS_INT_MAX, + scan_buffer (b, '\n', beg, pos, pos > beg ? EMACS_INT_MAX : EMACS_INT_MIN, &shortage, 0); line = EMACS_INT_MAX - shortage; diff -r 9f011ab08d48 -r 2f8bb876ab1d src/lisp-union.h --- a/src/lisp-union.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/lisp-union.h Mon Aug 13 11:16:07 2007 +0200 @@ -100,8 +100,8 @@ } while (0) # define XPNTRVAL(x) ((x).ui) -INLINE Lisp_Object make_int (EMACS_INT val); -INLINE Lisp_Object +INLINE_HEADER Lisp_Object make_int (EMACS_INT val); +INLINE_HEADER Lisp_Object make_int (EMACS_INT val) { Lisp_Object obj; @@ -109,8 +109,8 @@ return obj; } -INLINE Lisp_Object make_char (Emchar val); -INLINE Lisp_Object +INLINE_HEADER Lisp_Object make_char (Emchar val); +INLINE_HEADER Lisp_Object make_char (Emchar val) { Lisp_Object obj; diff -r 9f011ab08d48 -r 2f8bb876ab1d src/lisp.h --- a/src/lisp.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/lisp.h Mon Aug 13 11:16:07 2007 +0200 @@ -510,7 +510,8 @@ #define INT_VALBITS (BITS_PER_EMACS_INT - INT_GCBITS) #define VALBITS (BITS_PER_EMACS_INT - GCBITS) -#define EMACS_INT_MAX ((1UL << INT_VALBITS) -1UL) +#define EMACS_INT_MAX ((EMACS_INT) ((1UL << INT_VALBITS) -1UL)) +#define EMACS_INT_MIN (-(EMACS_INT_MAX) - 1) #ifdef USE_UNION_TYPE # include "lisp-union.h" @@ -855,8 +856,8 @@ ) /* Return 1 if LIST is properly acyclic and nil-terminated, else 0. */ -INLINE int TRUE_LIST_P (Lisp_Object object); -INLINE int +INLINE_HEADER int TRUE_LIST_P (Lisp_Object object); +INLINE_HEADER int TRUE_LIST_P (Lisp_Object object) { Lisp_Object hare, tortoise; @@ -947,8 +948,8 @@ #ifdef MULE -INLINE Charcount string_char_length (Lisp_String *s); -INLINE Charcount +INLINE_HEADER Charcount string_char_length (Lisp_String *s); +INLINE_HEADER Charcount string_char_length (Lisp_String *s) { return bytecount_to_charcount (string_data (s), string_length (s)); @@ -1040,16 +1041,16 @@ #define bit_vector_length(v) ((v)->size) #define bit_vector_next(v) ((v)->next) -INLINE int bit_vector_bit (Lisp_Bit_Vector *v, size_t n); -INLINE int +INLINE_HEADER int bit_vector_bit (Lisp_Bit_Vector *v, size_t n); +INLINE_HEADER int bit_vector_bit (Lisp_Bit_Vector *v, size_t n) { return ((v->bits[n >> LONGBITS_LOG2] >> (n & (LONGBITS_POWER_OF_2 - 1))) & 1); } -INLINE void set_bit_vector_bit (Lisp_Bit_Vector *v, size_t n, int value); -INLINE void +INLINE_HEADER void set_bit_vector_bit (Lisp_Bit_Vector *v, size_t n, int value); +INLINE_HEADER void set_bit_vector_bit (Lisp_Bit_Vector *v, size_t n, int value) { if (value) @@ -1157,8 +1158,8 @@ #ifdef ERROR_CHECK_TYPECHECK -INLINE Emchar XCHAR (Lisp_Object obj); -INLINE Emchar +INLINE_HEADER Emchar XCHAR (Lisp_Object obj); +INLINE_HEADER Emchar XCHAR (Lisp_Object obj) { assert (CHARP (obj)); @@ -1236,16 +1237,16 @@ #ifdef ERROR_CHECK_TYPECHECK -INLINE EMACS_INT XINT (Lisp_Object obj); -INLINE EMACS_INT +INLINE_HEADER EMACS_INT XINT (Lisp_Object obj); +INLINE_HEADER EMACS_INT XINT (Lisp_Object obj) { assert (INTP (obj)); return XREALINT (obj); } -INLINE EMACS_INT XCHAR_OR_INT (Lisp_Object obj); -INLINE EMACS_INT +INLINE_HEADER EMACS_INT XCHAR_OR_INT (Lisp_Object obj); +INLINE_HEADER EMACS_INT XCHAR_OR_INT (Lisp_Object obj) { assert (INTP (obj) || CHARP (obj)); @@ -2018,7 +2019,7 @@ #endif #ifdef PDUMP void pdump (void); -int pdump_load (void); +int pdump_load (const char *); extern char *pdump_start, *pdump_end; #define DUMPEDP(adr) ((((char *)(adr)) < pdump_end) && (((char *)(adr)) >= pdump_start)) @@ -2407,7 +2408,7 @@ /* Defined in print.c */ void write_string_to_stdio_stream (FILE *, struct console *, const Bufbyte *, Bytecount, Bytecount, - Lisp_Object); + Lisp_Object, int); void debug_print (Lisp_Object); void debug_short_backtrace (int); void temp_output_buffer_setup (Lisp_Object); @@ -2550,6 +2551,7 @@ EXFUN (Fchar_after, 2); EXFUN (Fchar_to_string, 1); EXFUN (Fcheck_valid_plist, 1); +EXFUN (Fvalid_plist_p, 1); EXFUN (Fclear_range_table, 1); EXFUN (Fcoding_category_list, 0); EXFUN (Fcoding_category_system, 1); diff -r 9f011ab08d48 -r 2f8bb876ab1d src/lread.c --- a/src/lread.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/lread.c Mon Aug 13 11:16:07 2007 +0200 @@ -259,9 +259,9 @@ #ifdef DEBUG_XEMACS /* testing Mule */ static int testing_mule = 0; /* Change via debugger */ if (testing_mule) { - if (c >= 0x20 && c <= 0x7E) fprintf (stderr, "%c", c); - else if (c == '\n') fprintf (stderr, "\\n\n"); - else fprintf (stderr, "\\%o ", c); + if (c >= 0x20 && c <= 0x7E) stderr_out ("%c", c); + else if (c == '\n') stderr_out ("\\n\n"); + else stderr_out ("\\%o ", c); } #endif return c; diff -r 9f011ab08d48 -r 2f8bb876ab1d src/lrecord.h --- a/src/lrecord.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/lrecord.h Mon Aug 13 11:16:07 2007 +0200 @@ -184,7 +184,10 @@ lrecord_type_tooltalk_message, lrecord_type_tooltalk_pattern, lrecord_type_ldap, - lrecord_type_count + lrecord_type_pgconn, + lrecord_type_pgresult, + lrecord_type_pgsetenv, + lrecord_type_count /* must be last */ }; struct lrecord_implementation @@ -479,8 +482,9 @@ # define DECLARE_LRECORD(c_name, structtype) \ extern const struct lrecord_implementation lrecord_##c_name; \ -INLINE structtype *error_check_##c_name (Lisp_Object obj); \ -INLINE structtype * \ +INLINE_HEADER structtype * \ +error_check_##c_name (Lisp_Object obj); \ +INLINE_HEADER structtype * \ error_check_##c_name (Lisp_Object obj) \ { \ assert (RECORD_TYPEP (obj, lrecord_type_##c_name)); \ @@ -489,8 +493,9 @@ extern Lisp_Object Q##c_name##p # define DECLARE_NONRECORD(c_name, type_enum, structtype) \ -INLINE structtype *error_check_##c_name (Lisp_Object obj); \ -INLINE structtype * \ +INLINE_HEADER structtype * \ +error_check_##c_name (Lisp_Object obj); \ +INLINE_HEADER structtype * \ error_check_##c_name (Lisp_Object obj) \ { \ assert (XTYPE (obj) == type_enum); \ diff -r 9f011ab08d48 -r 2f8bb876ab1d src/lstream.h --- a/src/lstream.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/lstream.h Mon Aug 13 11:16:07 2007 +0200 @@ -175,10 +175,10 @@ ((lstr)->imp == lstream_##type) #ifdef ERROR_CHECK_TYPECHECK -INLINE struct lstream * +INLINE_HEADER struct lstream * error_check_lstream_type (struct lstream *stream, const Lstream_implementation *imp); -INLINE struct lstream * +INLINE_HEADER struct lstream * error_check_lstream_type (struct lstream *stream, const Lstream_implementation *imp) { @@ -268,8 +268,8 @@ #include "mule-charset.h" #endif -INLINE Emchar Lstream_get_emchar (Lstream *stream); -INLINE Emchar +INLINE_HEADER Emchar Lstream_get_emchar (Lstream *stream); +INLINE_HEADER Emchar Lstream_get_emchar (Lstream *stream) { int c = Lstream_getc (stream); @@ -277,8 +277,8 @@ Lstream_get_emchar_1 (stream, c); } -INLINE int Lstream_put_emchar (Lstream *stream, Emchar ch); -INLINE int +INLINE_HEADER int Lstream_put_emchar (Lstream *stream, Emchar ch); +INLINE_HEADER int Lstream_put_emchar (Lstream *stream, Emchar ch) { return CHAR_ASCII_P (ch) ? @@ -286,8 +286,8 @@ Lstream_fput_emchar (stream, ch); } -INLINE void Lstream_unget_emchar (Lstream *stream, Emchar ch); -INLINE void +INLINE_HEADER void Lstream_unget_emchar (Lstream *stream, Emchar ch); +INLINE_HEADER void Lstream_unget_emchar (Lstream *stream, Emchar ch) { if (CHAR_ASCII_P (ch)) diff -r 9f011ab08d48 -r 2f8bb876ab1d src/malloc.c --- a/src/malloc.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/malloc.c Mon Aug 13 11:16:07 2007 +0200 @@ -738,7 +738,7 @@ return v; } int -malloc_mem_used () +malloc_mem_used (void) { int i; int size_used; @@ -757,7 +757,7 @@ } int -malloc_mem_free () +malloc_mem_free (void) { int i; int size_unused; @@ -787,7 +787,7 @@ #ifdef USG static void -get_lim_data () +get_lim_data (void) { #ifdef ULIMIT_BREAK_VALUE lim_data = ULIMIT_BREAK_VALUE; @@ -802,7 +802,7 @@ #ifndef BSD4_2 static void -get_lim_data () +get_lim_data (void) { lim_data = vlimit (LIM_DATA, -1); } @@ -810,7 +810,7 @@ #else /* BSD4_2 */ static void -get_lim_data () +get_lim_data (void) { struct rlimit XXrlimit; diff -r 9f011ab08d48 -r 2f8bb876ab1d src/mem-limits.h --- a/src/mem-limits.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/mem-limits.h Mon Aug 13 11:16:07 2007 +0200 @@ -123,7 +123,7 @@ /* Number of bytes of writable memory we can expect to be able to get */ extern unsigned int lim_data; -#ifdef HEAP_IN_DATA +#if defined (HEAP_IN_DATA) && !defined(PDUMP) extern unsigned long static_heap_size; extern int initialized; static void diff -r 9f011ab08d48 -r 2f8bb876ab1d src/menubar-msw.c --- a/src/menubar-msw.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/menubar-msw.c Mon Aug 13 11:16:07 2007 +0200 @@ -1,7 +1,8 @@ /* Implements an elisp-programmable menubar -- Win32 Copyright (C) 1993, 1994 Free Software Foundation, Inc. Copyright (C) 1995 Tinker Systems and INS Engineering Corp. - Copyright (C) 1997 Kirill M. Katsnelson + Copyright (C) 1997 Kirill M. Katsnelson . + Copyright (C) 2000 Ben Wing. This file is part of XEmacs. @@ -70,7 +71,7 @@ * particular knowledge is bad because this may break in Windows NT * 5.0, or Windows 98, or other future version. Instead, I allow the * hash tables to hang around, and not clear them, unless WM_COMMAND is - * received. This is worthy some memory but more safe. Hacks welcome, + * received. This is worth some memory but more safe. Hacks welcome, * anyways! * */ @@ -93,7 +94,7 @@ #include "window.h" /* #### */ -#define REPLACE_ME_WITH_GLOBAL_VARIABLE_WHICH_CONTROLS_RIHGT_FLUSH 0 +#define REPLACE_ME_WITH_GLOBAL_VARIABLE_WHICH_CONTROLS_RIGHT_FLUSH 0 #define EMPTY_ITEM_ID ((UINT)LISP_TO_VOID (Qunbound)) #define EMPTY_ITEM_NAME "(empty)" @@ -116,52 +117,107 @@ #define MENU_ITEM_ID_BITS(x) (((x) & 0x7FFF) | 0x8000) static HMENU top_level_menu; +/* Translate (in place) %_ to &, %% to %. + Return new length, and (through accel) the accelerator character. + (If there is no accelerator, it will be added on the first character.) + len = number of bytes (not including zero terminator). + maxlen = size of buffer. + We assume and maintain zero-termination. To be absolutely sure + of not hitting an error, maxlen should be >= 2*len + 3. */ + +Bytecount +msw_translate_menu_or_dialog_item (Bufbyte *item, Bytecount len, + Bytecount maxlen, Emchar *accel, + Lisp_Object error_name) +{ + Bufbyte *ptr; + + *accel = '\0'; + + /* Escape '&' as '&&' */ + + ptr = item; + while ((ptr = (Bufbyte *) memchr (ptr, '&', len - (ptr - item))) != NULL) + { + if (len + 2 > maxlen) + signal_simple_error ("Menu item produces too long displayable string", + error_name); + memmove (ptr + 1, ptr, (len - (ptr - item)) + 1); + len++; + ptr += 2; + } + + /* Replace XEmacs accelerator '%_' with Windows accelerator '&' + and `%%' with `%'. */ + ptr = item; + while ((ptr = memchr (ptr, '%', len - (ptr - item))) != NULL) + { + if (*(ptr + 1) == '_') + { + *ptr = '&'; + if (!*accel) + /* #### urk ! We need a reference translation table for + case changes that aren't buffer-specific. */ + *accel = DOWNCASE (current_buffer, charptr_emchar (ptr + 2)); + memmove (ptr + 1, ptr + 2, len - (ptr - item + 2) + 1); + len--; + } + else if (*(ptr + 1) == '%') + { + memmove (ptr + 1, ptr + 2, len - (ptr - item + 2) + 1); + len--; + } + ptr++; + } + + if (!*accel) + { + if (len + 2 > maxlen) + signal_simple_error ("Menu item produces too long displayable string", + error_name); + ptr = item; + memmove (ptr + 1, ptr, len + 1); + /* #### urk ! We need a reference translation table for + case changes that aren't buffer-specific. */ + *accel = DOWNCASE (current_buffer, charptr_emchar (ptr + 1)); + *ptr = '&'; + + len++; + } + + return len; +} + /* * This returns Windows-style menu item string: * "Left Flush\tRight Flush" */ + +/* #### This is junk. Need correct handling of sizes. Use a Bufbyte_dynarr, + not a static buffer. */ static char* -displayable_menu_item (Lisp_Object gui_item, int bar_p) +displayable_menu_item (Lisp_Object gui_item, int bar_p, Emchar *accel) { + unsigned int ll; + /* We construct the name in a static buffer. That's fine, because menu items longer than 128 chars are probably programming errors, and better be caught than displayed! */ static char buf[MAX_MENUITEM_LENGTH+2]; - char *ptr; - unsigned int ll, lr; /* Left flush part of the string */ ll = gui_item_display_flush_left (gui_item, buf, MAX_MENUITEM_LENGTH); - /* Escape '&' as '&&' */ - ptr = buf; - while ((ptr = (char*) memchr (ptr, '&', ll - (ptr - buf))) != NULL) - { - if (ll + 2 >= MAX_MENUITEM_LENGTH) - signal_simple_error ("Menu item produces too long displayable string", - XGUI_ITEM (gui_item)->name); - memmove (ptr + 1, ptr, (ll - (ptr - buf)) + 1); - ll++; - ptr += 2; - } - - /* Replace XEmacs accelerator '%_' with Windows accelerator '&' */ - ptr = buf; - while ((ptr = (char*) memchr (ptr, '%', ll - (ptr - buf))) != NULL) - { - if (*(ptr + 1) == '_') - { - *ptr = '&'; - memmove (ptr + 1, ptr + 2, ll - (ptr - buf + 2)); - ll--; - } - ptr++; - } + ll = msw_translate_menu_or_dialog_item ((Bufbyte *) buf, ll, + MAX_MENUITEM_LENGTH, accel, + XGUI_ITEM (gui_item)->name); /* Right flush part, unless we're at the top-level where it's not allowed */ if (!bar_p) { + unsigned int lr; + assert (MAX_MENUITEM_LENGTH > ll + 1); lr = gui_item_display_flush_right (gui_item, buf + ll + 1, MAX_MENUITEM_LENGTH - ll - 1); @@ -251,6 +307,7 @@ static void populate_menu_add_item (HMENU menu, Lisp_Object path, Lisp_Object hash_tab, Lisp_Object item, + Lisp_Object *accel_list, int flush_right, int bar_p) { MENUITEMINFO item_info; @@ -278,63 +335,75 @@ /* Submenu */ HMENU submenu; Lisp_Object gui_item = allocate_gui_item (); - Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item); - struct gcpro gcpro1; + Lisp_Gui_Item *pgui_item = XGUI_ITEM (gui_item); + struct gcpro gcpro1, gcpro2, gcpro3; + Emchar accel; - GCPRO1 (gui_item); + GCPRO3 (gui_item, path, *accel_list); menu_parse_submenu_keywords (item, gui_item); if (!STRINGP (pgui_item->name)) - signal_simple_error ("Menu name (first element) must be a string", item); + signal_simple_error ("Menu name (first element) must be a string", + item); if (!gui_item_included_p (gui_item, Vmenubar_configuration)) - return; + { + UNGCPRO; + goto done; + } if (!gui_item_active_p (gui_item)) item_info.fState = MFS_GRAYED; /* Temptation is to put 'else' right here. Although, the displayed item won't have an arrow indicating that it is a popup. So we go ahead a little bit more and create a popup */ - submenu = create_empty_popup_menu(); + submenu = create_empty_popup_menu (); item_info.fMask |= MIIM_SUBMENU; - item_info.dwTypeData = displayable_menu_item (gui_item, bar_p); + item_info.dwTypeData = displayable_menu_item (gui_item, bar_p, &accel); item_info.hSubMenu = submenu; + if (accel && bar_p) + *accel_list = Fcons (make_char (accel), *accel_list); + if (!(item_info.fState & MFS_GRAYED)) { /* Now add the full submenu path as a value to the hash table, keyed by menu handle */ if (NILP(path)) - /* list1 cannot GC */ path = list1 (pgui_item->name); else { Lisp_Object arg[2]; arg[0] = path; arg[1] = list1 (pgui_item->name); - /* Fappend gcpro'es its arg */ path = Fappend (2, arg); } - /* Fputhash GCPRO'es PATH */ Fputhash (hmenu_to_lisp_object (submenu), path, hash_tab); } - UNGCPRO; /* gui_item */ + UNGCPRO; } else if (VECTORP (item)) { /* An ordinary item */ Lisp_Object style, id; Lisp_Object gui_item = gui_parse_item_keywords (item); - Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item); - struct gcpro gcpro1; + Lisp_Gui_Item *pgui_item = XGUI_ITEM (gui_item); + struct gcpro gcpro1, gcpro2; + Emchar accel; - GCPRO1 (gui_item); + GCPRO2 (gui_item, *accel_list); if (!gui_item_included_p (gui_item, Vmenubar_configuration)) - return; + { + UNGCPRO; + goto done; + } + + if (!STRINGP (pgui_item->name)) + pgui_item->name = Feval (pgui_item->name); if (!gui_item_active_p (gui_item)) item_info.fState = MFS_GRAYED; @@ -356,11 +425,14 @@ pgui_item->suffix); Fputhash (id, pgui_item->callback, hash_tab); - item_info.wID = (UINT) XINT(id); + item_info.wID = (UINT) XINT (id); item_info.fType |= MFT_STRING; - item_info.dwTypeData = displayable_menu_item (gui_item, bar_p); + item_info.dwTypeData = displayable_menu_item (gui_item, bar_p, &accel); - UNGCPRO; /* gui_item */ + if (accel && bar_p) + *accel_list = Fcons (make_char (accel), *accel_list); + + UNGCPRO; } else { @@ -371,6 +443,8 @@ item_info.fType |= MFT_RIGHTJUSTIFY; InsertMenuItem (menu, UINT_MAX, TRUE, &item_info); + +done:; } /* @@ -390,16 +464,18 @@ { Lisp_Object item_desc; int deep_p, flush_right; - struct gcpro gcpro1; + struct gcpro gcpro1, gcpro2, gcpro3; unsigned long checksum; Lisp_Object gui_item = allocate_gui_item (); - Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item); - GCPRO1 (gui_item); + Lisp_Object accel_list = Qnil; + Lisp_Gui_Item *pgui_item = XGUI_ITEM (gui_item); + + GCPRO3 (gui_item, accel_list, desc); /* We are sometimes called with the menubar unchanged, and with changed right flush. We have to update the menubar in this case, so account for the compliance setting in the hash value */ - checksum = REPLACE_ME_WITH_GLOBAL_VARIABLE_WHICH_CONTROLS_RIHGT_FLUSH; + checksum = REPLACE_ME_WITH_GLOBAL_VARIABLE_WHICH_CONTROLS_RIGHT_FLUSH; /* Will initially contain only "(empty)" */ if (populate_p) @@ -426,14 +502,15 @@ if (NILP (XCAR (item_desc))) { /* Do not flush right menubar items when MS style compliant */ - if (bar_p && !REPLACE_ME_WITH_GLOBAL_VARIABLE_WHICH_CONTROLS_RIHGT_FLUSH) + if (bar_p && !REPLACE_ME_WITH_GLOBAL_VARIABLE_WHICH_CONTROLS_RIGHT_FLUSH) flush_right = 1; if (!populate_p) checksum = HASH2 (checksum, LISP_HASH (Qnil)); } else if (populate_p) populate_menu_add_item (menu, path, hash_tab, - XCAR (item_desc), flush_right, bar_p); + XCAR (item_desc), &accel_list, + flush_right, bar_p); else checksum = HASH2 (checksum, checksum_menu_item (XCAR (item_desc))); @@ -447,8 +524,8 @@ /* Add the header to the popup, if told so. The same as in X - an insensitive item, and a separator (Seems to me, there were - two separators in X... In Windows this looks ugly, anyways. */ - if (!bar_p && !deep_p && popup_menu_titles && !NILP(pgui_item->name)) + two separators in X... In Windows this looks ugly, anyways.) */ + if (!bar_p && !deep_p && popup_menu_titles && !NILP (pgui_item->name)) { CHECK_STRING (pgui_item->name); InsertMenu (menu, 0, MF_BYPOSITION | MF_STRING | MF_DISABLED, @@ -457,13 +534,17 @@ SetMenuDefaultItem (menu, 0, MF_BYPOSITION); } } - UNGCPRO; /* gui_item */ + + if (bar_p) + Fputhash (Qt, accel_list, hash_tab); + + UNGCPRO; return checksum; } static void populate_menu (HMENU menu, Lisp_Object path, Lisp_Object desc, - Lisp_Object hash_tab, int bar_p) + Lisp_Object hash_tab, int bar_p) { populate_or_checksum_helper (menu, path, desc, hash_tab, bar_p, 1); } @@ -475,23 +556,28 @@ } static void -update_frame_menubar_maybe (struct frame* f) +update_frame_menubar_maybe (struct frame *f) { HMENU menubar = GetMenu (FRAME_MSWINDOWS_HANDLE (f)); struct window *w = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)); Lisp_Object desc = (!NILP (w->menubar_visible_p) ? symbol_value_in_buffer (Qcurrent_menubar, w->buffer) : Qnil); + struct gcpro gcpro1; + + GCPRO1 (desc); /* it's safest to do this, just in case some filter + or something changes the value of current-menubar */ top_level_menu = menubar; if (NILP (desc) && menubar != NULL) { /* Menubar has gone */ - FRAME_MSWINDOWS_MENU_HASH_TABLE(f) = Qnil; + FRAME_MSWINDOWS_MENU_HASH_TABLE (f) = Qnil; SetMenu (FRAME_MSWINDOWS_HANDLE (f), NULL); DestroyMenu (menubar); DrawMenuBar (FRAME_MSWINDOWS_HANDLE (f)); + UNGCPRO; return; } @@ -505,29 +591,35 @@ if (NILP (desc)) { /* We did not have the bar and are not going to */ + UNGCPRO; return; } /* Now we bail out if the menubar has not changed */ - if (FRAME_MSWINDOWS_MENU_CHECKSUM(f) == checksum_menu (desc)) - return; + if (FRAME_MSWINDOWS_MENU_CHECKSUM (f) == checksum_menu (desc)) + { + UNGCPRO; + return; + } populate: /* Come with empty hash table */ - if (NILP (FRAME_MSWINDOWS_MENU_HASH_TABLE(f))) - FRAME_MSWINDOWS_MENU_HASH_TABLE(f) = + if (NILP (FRAME_MSWINDOWS_MENU_HASH_TABLE (f))) + FRAME_MSWINDOWS_MENU_HASH_TABLE (f) = make_lisp_hash_table (50, HASH_TABLE_NON_WEAK, HASH_TABLE_EQUAL); else - Fclrhash (FRAME_MSWINDOWS_MENU_HASH_TABLE(f)); + Fclrhash (FRAME_MSWINDOWS_MENU_HASH_TABLE (f)); Fputhash (hmenu_to_lisp_object (menubar), Qnil, - FRAME_MSWINDOWS_MENU_HASH_TABLE(f)); + FRAME_MSWINDOWS_MENU_HASH_TABLE (f)); populate_menu (menubar, Qnil, desc, - FRAME_MSWINDOWS_MENU_HASH_TABLE(f), 1); + FRAME_MSWINDOWS_MENU_HASH_TABLE (f), 1); SetMenu (FRAME_MSWINDOWS_HANDLE (f), menubar); DrawMenuBar (FRAME_MSWINDOWS_HANDLE (f)); - FRAME_MSWINDOWS_MENU_CHECKSUM(f) = checksum_menu (desc); + FRAME_MSWINDOWS_MENU_CHECKSUM (f) = checksum_menu (desc); + + UNGCPRO; } static void @@ -535,6 +627,8 @@ { HMENU menubar = GetMenu (FRAME_MSWINDOWS_HANDLE (f)); Lisp_Object desc = current_frame_menubar (f); + struct gcpro gcpro1; + if (menubar == NULL) return; @@ -542,20 +636,22 @@ triggers. To resolve, we must prevent filters explicitly from mangling with the active menu. In apply_filter probably? Is copy-tree on the whole menu too expensive? */ - if (NILP(desc)) + if (NILP (desc)) /* abort(); */ return; + GCPRO1 (desc); /* just to be safe -- see above */ /* We do the trick by removing all items and re-populating top level */ empty_menu (menubar, 0); - assert (HASH_TABLEP (FRAME_MSWINDOWS_MENU_HASH_TABLE(f))); - Fclrhash (FRAME_MSWINDOWS_MENU_HASH_TABLE(f)); + assert (HASH_TABLEP (FRAME_MSWINDOWS_MENU_HASH_TABLE (f))); + Fclrhash (FRAME_MSWINDOWS_MENU_HASH_TABLE (f)); Fputhash (hmenu_to_lisp_object (menubar), Qnil, - FRAME_MSWINDOWS_MENU_HASH_TABLE(f)); + FRAME_MSWINDOWS_MENU_HASH_TABLE (f)); populate_menu (menubar, Qnil, desc, - FRAME_MSWINDOWS_MENU_HASH_TABLE(f), 1); + FRAME_MSWINDOWS_MENU_HASH_TABLE (f), 1); + UNGCPRO; } /* @@ -570,13 +666,24 @@ current_hash_table = Qnil; prune_menubar (f); } + +int +msw_char_is_accelerator (struct frame *f, Emchar ch) +{ + Lisp_Object hash = FRAME_MSWINDOWS_MENU_HASH_TABLE (f); + + assert (HASH_TABLEP (hash)); + /* !!#### not Mule-ized */ + return !NILP (memq_no_quit (make_char (tolower (ch)), + Fgethash (Qt, hash, Qnil))); +} /*------------------------------------------------------------------------*/ /* Message handlers */ /*------------------------------------------------------------------------*/ static Lisp_Object -unsafe_handle_wm_initmenupopup_1 (HMENU menu, struct frame* f) +unsafe_handle_wm_initmenupopup_1 (HMENU menu, struct frame *f) { /* This function can call lisp, beat dogs and stick chewing gum to everything! */ @@ -608,7 +715,7 @@ } static Lisp_Object -unsafe_handle_wm_initmenu_1 (struct frame* f) +unsafe_handle_wm_initmenu_1 (struct frame *f) { /* This function can call lisp */ @@ -625,7 +732,7 @@ update_frame_menubar_maybe (f); current_menudesc = current_frame_menubar (f); - current_hash_table = FRAME_MSWINDOWS_MENU_HASH_TABLE(f); + current_hash_table = FRAME_MSWINDOWS_MENU_HASH_TABLE (f); assert (HASH_TABLEP (current_hash_table)); return Qt; @@ -638,7 +745,7 @@ * command if we return nil */ Lisp_Object -mswindows_handle_wm_command (struct frame* f, WORD id) +mswindows_handle_wm_command (struct frame *f, WORD id) { /* Try to map the command id through the proper hash table */ Lisp_Object data, fn, arg, frame; @@ -680,7 +787,7 @@ /*------------------------------------------------------------------------*/ static HMENU wm_initmenu_menu; -static struct frame* wm_initmenu_frame; +static struct frame *wm_initmenu_frame; static Lisp_Object unsafe_handle_wm_initmenupopup (Lisp_Object u_n_u_s_e_d) @@ -695,7 +802,7 @@ } Lisp_Object -mswindows_handle_wm_initmenupopup (HMENU hmenu, struct frame* frm) +mswindows_handle_wm_initmenupopup (HMENU hmenu, struct frame *frm) { /* We cannot pass hmenu as a lisp object. Use static var */ wm_initmenu_menu = hmenu; @@ -704,10 +811,10 @@ } Lisp_Object -mswindows_handle_wm_initmenu (HMENU hmenu, struct frame* f) +mswindows_handle_wm_initmenu (HMENU hmenu, struct frame *f) { /* Handle only frame menubar, ignore if from popup or system menu */ - if (GetMenu (FRAME_MSWINDOWS_HANDLE(f)) == hmenu) + if (GetMenu (FRAME_MSWINDOWS_HANDLE (f)) == hmenu) { wm_initmenu_frame = f; return mswindows_protect_modal_loop (unsafe_handle_wm_initmenu, Qnil); @@ -721,15 +828,15 @@ /*------------------------------------------------------------------------*/ static void -mswindows_update_frame_menubars (struct frame* f) +mswindows_update_frame_menubars (struct frame *f) { update_frame_menubar_maybe (f); } static void -mswindows_free_frame_menubars (struct frame* f) +mswindows_free_frame_menubars (struct frame *f) { - FRAME_MSWINDOWS_MENU_HASH_TABLE(f) = Qnil; + FRAME_MSWINDOWS_MENU_HASH_TABLE (f) = Qnil; } static void @@ -740,6 +847,9 @@ HMENU menu; POINT pt; int ok; + struct gcpro gcpro1; + + GCPRO1 (menu_desc); /* to be safe -- see above */ if (!NILP (event)) { @@ -777,7 +887,7 @@ current_menudesc = menu_desc; current_hash_table = make_lisp_hash_table (10, HASH_TABLE_NON_WEAK, HASH_TABLE_EQUAL); - menu = create_empty_popup_menu(); + menu = create_empty_popup_menu (); Fputhash (hmenu_to_lisp_object (menu), Qnil, current_hash_table); top_level_menu = menu; @@ -796,11 +906,13 @@ mswindows_unmodalize_signal_maybe (); /* This is probably the only real reason for failure */ - if (!ok) { - menu_cleanup (f); - signal_simple_error ("Cannot track popup menu while in menu", - menu_desc); - } + if (!ok) + { + menu_cleanup (f); + signal_simple_error ("Cannot track popup menu while in menu", + menu_desc); + } + UNGCPRO; } diff -r 9f011ab08d48 -r 2f8bb876ab1d src/menubar-x.c --- a/src/menubar-x.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/menubar-x.c Mon Aug 13 11:16:07 2007 +0200 @@ -21,7 +21,14 @@ /* Synched up with: Not in FSF. */ -/* created 16-dec-91 by jwz */ +/* Authorship: + + Created 16-dec-91 by Jamie Zawinski. + Menu filters and many other keywords added by Stig for 19.12. + Original device-abstraction work and GC cleanup work by Ben Wing for 19.13. + Menu accelerators c. 1997? by ??. Moved here from event-stream.c. + Other work post-1996 by ??. +*/ #include #include "lisp.h" @@ -29,12 +36,15 @@ #include "console-x.h" #include "EmacsFrame.h" #include "gui-x.h" +#include "../lwlib/lwlib.h" #include "buffer.h" #include "commands.h" /* zmacs_regions */ -#include "gui.h" #include "events.h" #include "frame.h" +#include "gui.h" +#include "keymap.h" +#include "menubar.h" #include "opaque.h" #include "window.h" @@ -154,7 +164,7 @@ wv->type = CASCADE_TYPE; wv->enabled = 1; wv->name = (char *) XSTRING_DATA (LISP_GETTEXT (XCAR (desc))); - wv->name = xstrdup (wv->name); + wv->name = strdup_and_add_accel (wv->name); accel = gui_name_accelerator (LISP_GETTEXT (XCAR (desc))); wv->accel = LISP_TO_VOID (accel); @@ -267,7 +277,7 @@ dummy->next = NULL; goto menu_item_done; - } + } } else if (menubar_root_p) @@ -292,7 +302,7 @@ { if (partition_seen) error ( - "More than one partition (nil) in menubar description"); + "More than one partition (nil) in menubar description"); partition_seen = 1; next = xmalloc_widget_value (); next->type = PUSHRIGHT_TYPE; @@ -319,7 +329,7 @@ else signal_simple_error ("Unrecognized menu descriptor", desc); -menu_item_done: + menu_item_done: if (wv) { @@ -336,7 +346,7 @@ static widget_value * menu_item_descriptor_to_widget_value (Lisp_Object desc, int menu_type, /* if this is a menubar, - popup or sub menu */ + popup or sub menu */ int deep_p, /* */ int filter_p) /* if :filter forms should run now */ @@ -360,8 +370,8 @@ static Lisp_Object restore_in_menu_callback (Lisp_Object val) { - in_menu_callback = XINT (val); - return Qnil; + in_menu_callback = XINT (val); + return Qnil; } #endif /* LWLIB_MENUBARS_LUCID || LWLIB_MENUBARS_MOTIF */ @@ -830,7 +840,7 @@ them. We don't want the *first* command event to alter the state of the region, so that the region can be available as an argument for the second command. - */ + */ if (zmacs_regions) zmacs_region_stays = 1; @@ -841,9 +851,516 @@ } + +#if defined(LWLIB_MENUBARS_LUCID) +static void +menu_move_up (void) +{ + widget_value *current = lw_get_entries (False); + widget_value *entries = lw_get_entries (True); + widget_value *prev = NULL; + + while (entries != current) + { + if (entries->name /*&& entries->enabled*/) prev = entries; + entries = entries->next; + assert (entries); + } + + if (!prev) + /* move to last item */ + { + while (entries->next) + { + if (entries->name /*&& entries->enabled*/) prev = entries; + entries = entries->next; + } + if (prev) + { + if (entries->name /*&& entries->enabled*/) + prev = entries; + } + else + { + /* no selectable items in this menu, pop up to previous level */ + lw_pop_menu (); + return; + } + } + lw_set_item (prev); +} + +static void +menu_move_down (void) +{ + widget_value *current = lw_get_entries (False); + widget_value *new = current; + + while (new->next) + { + new = new->next; + if (new->name /*&& new->enabled*/) break; + } + + if (new==current||!(new->name/*||new->enabled*/)) + { + new = lw_get_entries (True); + while (new!=current) + { + if (new->name /*&& new->enabled*/) break; + new = new->next; + } + if (new==current&&!(new->name /*|| new->enabled*/)) + { + lw_pop_menu (); + return; + } + } + + lw_set_item (new); +} + +static void +menu_move_left (void) +{ + int level = lw_menu_level (); + int l = level; + widget_value *current; + + while (level-- >= 3) + lw_pop_menu (); + + menu_move_up (); + current = lw_get_entries (False); + if (l > 2 && current->contents) + lw_push_menu (current->contents); +} + +static void +menu_move_right (void) +{ + int level = lw_menu_level (); + int l = level; + widget_value *current; + + while (level-- >= 3) + lw_pop_menu (); + + menu_move_down (); + current = lw_get_entries (False); + if (l > 2 && current->contents) + lw_push_menu (current->contents); +} + +static void +menu_select_item (widget_value *val) +{ + if (val == NULL) + val = lw_get_entries (False); + + /* is match a submenu? */ + + if (val->contents) + { + /* enter the submenu */ + + lw_set_item (val); + lw_push_menu (val->contents); + } + else + { + /* Execute the menu entry by calling the menu's `select' + callback function + */ + lw_kill_menus (val); + } +} + +Lisp_Object +command_builder_operate_menu_accelerator (struct command_builder *builder) +{ + /* this function can GC */ + + struct console *con = XCONSOLE (Vselected_console); + Lisp_Object evee = builder->most_current_event; + Lisp_Object binding; + widget_value *entries; + + extern int lw_menu_accelerate; /* lwlib.c */ + +#if 0 + { + int i; + Lisp_Object t; + char buf[50]; + + t = builder->current_events; + i = 0; + while (!NILP (t)) + { + i++; + sprintf (buf,"OPERATE (%d): ",i); + write_c_string (buf, Qexternal_debugging_output); + print_internal (t, Qexternal_debugging_output, 1); + write_c_string ("\n", Qexternal_debugging_output); + t = XEVENT_NEXT (t); + } + } +#endif /* 0 */ + + /* menu accelerator keys don't go into keyboard macros */ + if (!NILP (con->defining_kbd_macro) && NILP (Vexecuting_macro)) + con->kbd_macro_ptr = con->kbd_macro_end; + + /* don't echo menu accelerator keys */ + /*reset_key_echo (builder, 1);*/ + + if (!lw_menu_accelerate) + { + /* `convert' mouse display to keyboard display + by entering the open submenu + */ + entries = lw_get_entries (False); + if (entries->contents) + { + lw_push_menu (entries->contents); + lw_display_menu (CurrentTime); + } + } + + /* compare event to the current menu accelerators */ + + entries=lw_get_entries (True); + + while (entries) + { + Lisp_Object accel; + VOID_TO_LISP (accel, entries->accel); + if (entries->name && !NILP (accel)) + { + if (event_matches_key_specifier_p (XEVENT (evee), accel)) + { + /* a match! */ + + menu_select_item (entries); + + if (lw_menu_active) lw_display_menu (CurrentTime); + + reset_this_command_keys (Vselected_console, 1); + /*reset_command_builder_event_chain (builder);*/ + return Vmenu_accelerator_map; + } + } + entries = entries->next; + } + + /* try to look up event in menu-accelerator-map */ + + binding = event_binding_in (evee, Vmenu_accelerator_map, 1); + + if (NILP (binding)) + { + /* beep at user for undefined key */ + return Qnil; + } + else + { + if (EQ (binding, Qmenu_quit)) + { + /* turn off menus and set quit flag */ + lw_kill_menus (NULL); + Vquit_flag = Qt; + } + else if (EQ (binding, Qmenu_up)) + { + int level = lw_menu_level (); + if (level > 2) + menu_move_up (); + } + else if (EQ (binding, Qmenu_down)) + { + int level = lw_menu_level (); + if (level > 2) + menu_move_down (); + else + menu_select_item (NULL); + } + else if (EQ (binding, Qmenu_left)) + { + int level = lw_menu_level (); + if (level > 3) + { + lw_pop_menu (); + lw_display_menu (CurrentTime); + } + else + menu_move_left (); + } + else if (EQ (binding, Qmenu_right)) + { + int level = lw_menu_level (); + if (level > 2 && + lw_get_entries (False)->contents) + { + widget_value *current = lw_get_entries (False); + if (current->contents) + menu_select_item (NULL); + } + else + menu_move_right (); + } + else if (EQ (binding, Qmenu_select)) + menu_select_item (NULL); + else if (EQ (binding, Qmenu_escape)) + { + int level = lw_menu_level (); + + if (level > 2) + { + lw_pop_menu (); + lw_display_menu (CurrentTime); + } + else + { + /* turn off menus quietly */ + lw_kill_menus (NULL); + } + } + else if (KEYMAPP (binding)) + { + /* prefix key */ + reset_this_command_keys (Vselected_console, 1); + /*reset_command_builder_event_chain (builder);*/ + return binding; + } + else + { + /* turn off menus and execute binding */ + lw_kill_menus (NULL); + reset_this_command_keys (Vselected_console, 1); + /*reset_command_builder_event_chain (builder);*/ + return binding; + } + } + + if (lw_menu_active) lw_display_menu (CurrentTime); + + reset_this_command_keys (Vselected_console, 1); + /*reset_command_builder_event_chain (builder);*/ + + return Vmenu_accelerator_map; +} + +static Lisp_Object +menu_accelerator_junk_on_error (Lisp_Object errordata, Lisp_Object ignored) +{ + Vmenu_accelerator_prefix = Qnil; + Vmenu_accelerator_modifiers = Qnil; + Vmenu_accelerator_enabled = Qnil; + if (!NILP (errordata)) + { + Lisp_Object args[2]; + + args[0] = build_string ("Error in menu accelerators (setting to nil)"); + /* #### This should call + (with-output-to-string (display-error errordata)) + but that stuff is all in Lisp currently. */ + args[1] = errordata; + warn_when_safe_lispobj + (Qerror, Qwarning, + emacs_doprnt_string_lisp ((const Bufbyte *) "%s: %s", + Qnil, -1, 2, args)); + } + + return Qnil; +} + +static Lisp_Object +menu_accelerator_safe_compare (Lisp_Object event0) +{ + if (CONSP (Vmenu_accelerator_prefix)) + { + Lisp_Object t; + t=Vmenu_accelerator_prefix; + while (!NILP (t) + && !NILP (event0) + && event_matches_key_specifier_p (XEVENT (event0), Fcar (t))) + { + t = Fcdr (t); + event0 = XEVENT_NEXT (event0); + } + if (!NILP (t)) + return Qnil; + } + else if (NILP (event0)) + return Qnil; + else if (event_matches_key_specifier_p (XEVENT (event0), Vmenu_accelerator_prefix)) + event0 = XEVENT_NEXT (event0); + else + return Qnil; + return event0; +} + +static Lisp_Object +menu_accelerator_safe_mod_compare (Lisp_Object cons) +{ + return (event_matches_key_specifier_p (XEVENT (XCAR (cons)), XCDR (cons)) + ? Qt + : Qnil); +} + +Lisp_Object +command_builder_find_menu_accelerator (struct command_builder *builder) +{ + /* this function can GC */ + Lisp_Object event0 = builder->current_events; + struct console *con = XCONSOLE (Vselected_console); + struct frame *f = XFRAME (CONSOLE_SELECTED_FRAME (con)); + Widget menubar_widget; + + /* compare entries in event0 against the menu prefix */ + + if ((!CONSOLE_X_P (XCONSOLE (builder->console))) || NILP (event0) || + XEVENT (event0)->event_type != key_press_event) + return Qnil; + + if (!NILP (Vmenu_accelerator_prefix)) + { + event0 = condition_case_1 (Qerror, + menu_accelerator_safe_compare, + event0, + menu_accelerator_junk_on_error, + Qnil); + } + + if (NILP (event0)) + return Qnil; + + menubar_widget = FRAME_X_MENUBAR_WIDGET (f); + if (menubar_widget + && CONSP (Vmenu_accelerator_modifiers)) + { + Lisp_Object fake; + Lisp_Object last = Qnil; + struct gcpro gcpro1; + Lisp_Object matchp; + + widget_value *val; + LWLIB_ID id = XPOPUP_DATA (f->menubar_data)->id; + + val = lw_get_all_values (id); + if (val) + { + val = val->contents; + + fake = Fcopy_sequence (Vmenu_accelerator_modifiers); + last = fake; + + while (!NILP (Fcdr (last))) + last = Fcdr (last); + + Fsetcdr (last, Fcons (Qnil, Qnil)); + last = Fcdr (last); + } + + fake = Fcons (Qnil, fake); + + GCPRO1 (fake); + + while (val) + { + Lisp_Object accel; + VOID_TO_LISP (accel, val->accel); + if (val->name && !NILP (accel)) + { + Fsetcar (last, accel); + Fsetcar (fake, event0); + matchp = condition_case_1 (Qerror, + menu_accelerator_safe_mod_compare, + fake, + menu_accelerator_junk_on_error, + Qnil); + if (!NILP (matchp)) + { + /* we found one! */ + + lw_set_menu (menubar_widget, val); + /* yah - yet another hack. + pretend emacs timestamp is the same as an X timestamp, + which for the moment it is. (read events.h) + */ + lw_map_menu (XEVENT (event0)->timestamp); + + if (val->contents) + lw_push_menu (val->contents); + + lw_display_menu (CurrentTime); + + /* menu accelerator keys don't go into keyboard macros */ + if (!NILP (con->defining_kbd_macro) + && NILP (Vexecuting_macro)) + con->kbd_macro_ptr = con->kbd_macro_end; + + /* don't echo menu accelerator keys */ + /*reset_key_echo (builder, 1);*/ + reset_this_command_keys (Vselected_console, 1); + UNGCPRO; + + return Vmenu_accelerator_map; + } + } + + val = val->next; + } + + UNGCPRO; + } + return Qnil; +} + +int +x_kludge_lw_menu_active (void) +{ + return lw_menu_active; +} + +DEFUN ("accelerate-menu", Faccelerate_menu, 0, 0, "_", /* +Make the menubar active. Menu items can be selected using menu accelerators +or by actions defined in menu-accelerator-map. +*/ + ()) +{ + struct console *con = XCONSOLE (Vselected_console); + struct frame *f = XFRAME (CONSOLE_SELECTED_FRAME (con)); + LWLIB_ID id; + widget_value *val; + + if (NILP (f->menubar_data)) + error ("Frame has no menubar."); + + id = XPOPUP_DATA (f->menubar_data)->id; + val = lw_get_all_values (id); + val = val->contents; + lw_set_menu (FRAME_X_MENUBAR_WIDGET (f), val); + lw_map_menu (CurrentTime); + + lw_display_menu (CurrentTime); + + /* menu accelerator keys don't go into keyboard macros */ + if (!NILP (con->defining_kbd_macro) && NILP (Vexecuting_macro)) + con->kbd_macro_ptr = con->kbd_macro_end; + + return Qnil; +} +#endif /* LWLIB_MENUBARS_LUCID */ + + void syms_of_menubar_x (void) { +#if defined(LWLIB_MENUBARS_LUCID) + DEFSUBR (Faccelerate_menu); +#endif } void diff -r 9f011ab08d48 -r 2f8bb876ab1d src/menubar.c --- a/src/menubar.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/menubar.c Mon Aug 13 11:16:07 2007 +0200 @@ -21,8 +21,13 @@ /* Synched up with: Not in FSF. */ -/* #### There ain't much here because menubars have not been - properly abstracted yet. */ +/* Authorship: + + Created by Ben Wing as part of device-abstraction work for 19.12. + Menu filters and many other keywords added by Stig for 19.12. + Menu accelerators c. 1997? by ??. Moved here from event-stream.c. + Much other work post-1996 by ??. +*/ #include #include "lisp.h" @@ -31,6 +36,7 @@ #include "device.h" #include "frame.h" #include "gui.h" +#include "keymap.h" #include "menubar.h" #include "redisplay.h" #include "window.h" @@ -54,6 +60,30 @@ Lisp_Object Vmenubar_pointer_glyph; +/* prefix key(s) that must match in order to activate menu. + This is ugly. fix me. + */ +Lisp_Object Vmenu_accelerator_prefix; + +/* list of modifier keys to match accelerator for top level menus */ +Lisp_Object Vmenu_accelerator_modifiers; + +/* whether menu accelerators are enabled */ +Lisp_Object Vmenu_accelerator_enabled; + +/* keymap for auxiliary menu accelerator functions */ +Lisp_Object Vmenu_accelerator_map; + +Lisp_Object Qmenu_force; +Lisp_Object Qmenu_fallback; +Lisp_Object Qmenu_quit; +Lisp_Object Qmenu_up; +Lisp_Object Qmenu_down; +Lisp_Object Qmenu_left; +Lisp_Object Qmenu_right; +Lisp_Object Qmenu_select; +Lisp_Object Qmenu_escape; + static int menubar_variable_changed (Lisp_Object sym, Lisp_Object *val, Lisp_Object in_object, int flags) @@ -104,7 +134,7 @@ Lisp_Object menu_parse_submenu_keywords (Lisp_Object desc, Lisp_Object gui_item) { - Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item); + Lisp_Gui_Item *pgui_item = XGUI_ITEM (gui_item); /* Menu descriptor should be a list */ CHECK_CONS (desc); @@ -153,11 +183,11 @@ (desc, path)) { Lisp_Object path_entry, submenu_desc, submenu; - struct gcpro gcpro1; + struct gcpro gcpro1, gcpro2; Lisp_Object gui_item = allocate_gui_item (); Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item); - GCPRO1 (gui_item); + GCPRO2 (gui_item, desc); EXTERNAL_LIST_LOOP (path_entry, path) { @@ -292,6 +322,7 @@ DEFUN ("normalize-menu-item-name", Fnormalize_menu_item_name, 1, 2, 0, /* Convert a menu item name string into normal form, and return the new string. Menu item names should be converted to normal form before being compared. +This removes %_'s (accelerator indications) and converts %% to %. */ (name, buffer)) { @@ -347,6 +378,18 @@ syms_of_menubar (void) { defsymbol (&Qcurrent_menubar, "current-menubar"); + + defsymbol (&Qmenu_force, "menu-force"); + defsymbol (&Qmenu_fallback, "menu-fallback"); + + defsymbol (&Qmenu_quit, "menu-quit"); + defsymbol (&Qmenu_up, "menu-up"); + defsymbol (&Qmenu_down, "menu-down"); + defsymbol (&Qmenu_left, "menu-left"); + defsymbol (&Qmenu_right, "menu-right"); + defsymbol (&Qmenu_select, "menu-select"); + defsymbol (&Qmenu_escape, "menu-escape"); + DEFSUBR (Fpopup_menu); DEFSUBR (Fnormalize_menu_item_name); DEFSUBR (Fmenu_find_real_submenu); @@ -397,8 +440,18 @@ toplevel menus, it is ignored. This string is not displayed in the menu itself. -Immediately following the name string of the menu, any of three -optional keyword-value pairs is permitted. +Menu accelerators can be indicated in the string by putting the +sequence "%_" before the character corresponding to the key that will +invoke the menu or menu item. Uppercase and lowercase accelerators +are equivalent. The sequence "%%" is also special, and is translated +into a single %. + +If no menu accelerator is present in the string, XEmacs will act as if +the first character has been tagged as an accelerator. + +Immediately following the name string of the menu, various optional +keyword-value pairs are permitted: currently, :filter, :active, :included, +and :config. (See below.) If an element of a menu (or menubar) is a string, then that string will be presented as unselectable text. @@ -406,6 +459,29 @@ If an element of a menu is a string consisting solely of hyphens, then that item will be presented as a solid horizontal line. +If an element of a menu is a string beginning with "--:", it will be +presented as a line whose appearance is controlled by the rest of the +text in the string. The allowed line specs are system-dependent, and +currently work only under X Windows (with Lucid and Motif menubars); +otherwise, a solid horizontal line is presented, as if the string were +all hyphens. + +The possibilities are: + + "--:singleLine" + "--:doubleLine" + "--:singleDashedLine" + "--:doubleDashedLine" + "--:noLine" + "--:shadowEtchedIn" + "--:shadowEtchedOut" + "--:shadowEtchedInDash" + "--:shadowEtchedOutDash" + "--:shadowDoubleEtchedIn" (Lucid menubars only) + "--:shadowDoubleEtchedOut" (Lucid menubars only) + "--:shadowDoubleEtchedInDash" (Lucid menubars only) + "--:shadowDoubleEtchedOutDash" (Lucid menubars only) + If an element of a menu is a list, it is treated as a submenu. The name of that submenu (the first element in the list) will be used as the name of the item representing this menu on the parent. @@ -415,33 +491,39 @@ which are flushright. Otherwise, the element must be a vector, which describes a menu item. -A menu item can have any of the following forms: +A menu item is of the following form: + + [ "name" callback : : ... ] + +The following forms are also accepted for compatibility, but deprecated: [ "name" callback ] [ "name" callback ] - [ "name" callback : : ... ] The name is the string to display on the menu; it is filtered through the resource database, so it is possible for resources to override what string -is actually displayed. +is actually displayed. Menu accelerator indicators (the sequence `%_') are +also processed; see above. If the name is not a string, it will be +evaluated with `eval', and the result should be a string. If the `callback' of a menu item is a symbol, then it must name a command. It will be invoked with `call-interactively'. If it is a list, then it is evaluated with `eval'. -The possible keywords are this: +In the deprecated forms, is equivalent to using the :active +keyword, and is equivalent to using the :suffix keyword. - :active
Same as in the first two forms: the - expression is evaluated just before the menu is +The possible keywords are: + + :active The expression is evaluated just before the menu is displayed, and the menu will be selectable only if the result is non-nil. - :suffix Same as in the second form: the expression - is evaluated just before the menu is displayed and - resulting string is appended to the displayed name, - providing a convenient way of adding the name of a - command's ``argument'' to the menu, like - ``Kill Buffer NAME''. + :suffix The expression is evaluated just before the menu is + displayed and the resulting string is appended to + the displayed name, providing a convenient way of + adding the name of a command's ``argument'' to the + menu, like ``Kill Buffer NAME''. :keys "string" Normally, the keyboard equivalents of commands in menus are displayed when the `callback' is a symbol. @@ -478,47 +560,42 @@ See the variable `menubar-configuration'. :filter A menu filter can only be used in a menu item list. - (i.e.: not in a menu item itself). It is used to - sensitize or incrementally create a submenu only when - it is selected by the user and not every time the - menubar is activated. The filter function is passed - the list of menu items in the submenu and must return a - list of menu items to be used for the menu. It is - called only when the menu is about to be displayed, so - other menus may already be displayed. Vile and - terrible things will happen if a menu filter function - changes the current buffer, window, or frame. It - also should not raise, lower, or iconify any frames. - Basically, the filter function should have no - side-effects. + (i.e. not in a menu item itself). It is used to + incrementally create a submenu only when it is selected + by the user and not every time the menubar is activated. + The filter function is passed the list of menu items in + the submenu and must return a list of menu items to be + used for the menu. It must not destructively modify + the list of menu items passed to it. It is called only + when the menu is about to be displayed, so other menus + may already be displayed. Vile and terrible things will + happen if a menu filter function changes the current + buffer, window, or frame. It also should not raise, + lower, or iconify any frames. Basically, the filter + function should have no side-effects. :key-sequence keys Used in FSF Emacs as an hint to an equivalent keybinding. - Ignored by XEnacs for easymenu.el compatibility. - - :label (unimplemented!) Like :suffix, but replaces label - completely. - (might be added in 21.2). + Ignored by XEmacs for easymenu.el compatibility. For example: - ("File" + ("%_File" :filter file-menu-filter ; file-menu-filter is a function that takes ; one argument (a list of menu items) and ; returns a list of menu items - [ "Save As..." write-file t ] - [ "Revert Buffer" revert-buffer (buffer-modified-p) ] - [ "Read Only" toggle-read-only :style toggle + [ "Save %_As..." write-file t ] + [ "%_Revert Buffer" revert-buffer (buffer-modified-p) ] + [ "R%_ead Only" toggle-read-only :style toggle :selected buffer-read-only ] ) -See x-menubar.el for many more examples. +See menubar-items.el for many more examples. After the menubar is clicked upon, but before any menus are popped up, the functions on the `activate-menubar-hook' are invoked to make top-level changes to the menus and menubar. Note, however, that the use of menu filters (using the :filter keyword) is usually a more efficient way to -dynamically alter or sensitize menus. -*/, menubar_variable_changed); +dynamically alter or sensitize menus. */, menubar_variable_changed); Vcurrent_menubar = Qnil; @@ -564,6 +641,80 @@ default pointer is used. */ ); + DEFVAR_LISP ("menu-accelerator-prefix", &Vmenu_accelerator_prefix /* +Prefix key(s) that must be typed before menu accelerators will be activated. +Set this to a value acceptable by define-key. + +NOTE: This currently only has any effect under X Windows. +*/ ); + Vmenu_accelerator_prefix = Qnil; + + DEFVAR_LISP ("menu-accelerator-modifiers", &Vmenu_accelerator_modifiers /* +Modifier keys which must be pressed to get to the top level menu accelerators. +This is a list of modifier key symbols. All modifier keys must be held down +while a valid menu accelerator key is pressed in order for the top level +menu to become active. + +NOTE: This currently only has any effect under X Windows. + +See also menu-accelerator-enabled and menu-accelerator-prefix. +*/ ); + Vmenu_accelerator_modifiers = list1 (Qmeta); + + DEFVAR_LISP ("menu-accelerator-enabled", &Vmenu_accelerator_enabled /* +Whether menu accelerator keys can cause the menubar to become active. +If 'menu-force or 'menu-fallback, then menu accelerator keys can +be used to activate the top level menu. Once the menubar becomes active, the +accelerator keys can be used regardless of the value of this variable. + +menu-force is used to indicate that the menu accelerator key takes +precedence over bindings in the current keymap(s). menu-fallback means +that bindings in the current keymap take precedence over menu accelerator keys. +Thus a top level menu with an accelerator of "T" would be activated on a +keypress of Meta-t if menu-accelerator-enabled is menu-force. +However, if menu-accelerator-enabled is menu-fallback, then +Meta-t will not activate the menubar and will instead run the function +transpose-words, to which it is normally bound. + +See also menu-accelerator-modifiers and menu-accelerator-prefix. +*/ ); + Vmenu_accelerator_enabled = Qnil; + + DEFVAR_LISP ("menu-accelerator-map", &Vmenu_accelerator_map /* +Keymap for use when the menubar is active. +The actions menu-quit, menu-up, menu-down, menu-left, menu-right, +menu-select and menu-escape can be mapped to keys in this map. +NOTE: This currently only has any effect under X Windows. + +menu-quit Immediately deactivate the menubar and any open submenus without + selecting an item. +menu-up Move the menu cursor up one row in the current menu. If the + move extends past the top of the menu, wrap around to the bottom. +menu-down Move the menu cursor down one row in the current menu. If the + move extends past the bottom of the menu, wrap around to the top. + If executed while the cursor is in the top level menu, move down + into the selected menu. +menu-left Move the cursor from a submenu into the parent menu. If executed + while the cursor is in the top level menu, move the cursor to the + left. If the move extends past the left edge of the menu, wrap + around to the right edge. +menu-right Move the cursor into a submenu. If the cursor is located in the + top level menu or is not currently on a submenu heading, then move + the cursor to the next top level menu entry. If the move extends + past the right edge of the menu, wrap around to the left edge. +menu-select Activate the item under the cursor. If the cursor is located on + a submenu heading, then move the cursor into the submenu. +menu-escape Pop up to the next level of menus. Moves from a submenu into its + parent menu. From the top level menu, this deactivates the + menubar. + +This keymap can also contain normal key-command bindings, in which case the +menubar is deactivated and the corresponding command is executed. + +The action bindings used by the menu accelerator code are designed to mimic +the actions of menu traversal keys in a commonly used PC operating system. +*/ ); + Fprovide (intern ("menubar")); } @@ -588,4 +739,6 @@ complex_vars_of_menubar (void) { Vmenubar_pointer_glyph = Fmake_glyph_internal (Qpointer); + + Vmenu_accelerator_map = Fmake_keymap (Qnil); } diff -r 9f011ab08d48 -r 2f8bb876ab1d src/menubar.h --- a/src/menubar.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/menubar.h Mon Aug 13 11:16:07 2007 +0200 @@ -20,7 +20,7 @@ /* Synched up with: Not in FSF. */ -/* #### Not properly abstracted for device-independence. */ +/* #### Still needs some device-abstraction work. */ #ifndef INCLUDED_menubar_h_ #define INCLUDED_menubar_h_ @@ -35,6 +35,37 @@ EXFUN (Fmenu_find_real_submenu, 2); +extern Lisp_Object Vmenu_accelerator_prefix; +extern Lisp_Object Vmenu_accelerator_modifiers; +extern Lisp_Object Vmenu_accelerator_enabled; +extern Lisp_Object Vmenu_accelerator_map; + +extern Lisp_Object Qmenu_force; +extern Lisp_Object Qmenu_fallback; + +extern Lisp_Object Qmenu_quit; +extern Lisp_Object Qmenu_up; +extern Lisp_Object Qmenu_down; +extern Lisp_Object Qmenu_left; +extern Lisp_Object Qmenu_right; +extern Lisp_Object Qmenu_select; +extern Lisp_Object Qmenu_escape; + + +/* #### kluuuuuuuuuuuuuuuuuuuuuuuuuuuudge! + The author of the accelerator code didn't know what the hell he was doing. + Someone needs to abstract this properly. */ +#if defined(HAVE_X_WINDOWS) && defined(LWLIB_MENUBARS_LUCID) +extern int x_kludge_lw_menu_active (void); +struct command_builder; +Lisp_Object command_builder_find_menu_accelerator (struct command_builder + *builder); +Lisp_Object command_builder_operate_menu_accelerator (struct command_builder + *builder); + +extern int in_menu_callback; +#endif + #endif /* HAVE_MENUBARS */ #endif /* INCLUDED_menubar_h_ */ diff -r 9f011ab08d48 -r 2f8bb876ab1d src/minibuf.c --- a/src/minibuf.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/minibuf.c Mon Aug 13 11:16:07 2007 +0200 @@ -682,7 +682,7 @@ else { write_string_to_stdio_stream (stderr, 0, (const Bufbyte *) "\n", 0, 1, - Qterminal); + Qterminal, 0); return Qnil; } } @@ -751,7 +751,7 @@ if (STRINGP (reloc)) nonreloc = XSTRING_DATA (reloc); write_string_to_stdio_stream (stderr, 0, nonreloc, offset, length, - Qterminal); + Qterminal, 0); } } diff -r 9f011ab08d48 -r 2f8bb876ab1d src/miscplay.c --- a/src/miscplay.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/miscplay.c Mon Aug 13 11:16:07 2007 +0200 @@ -32,7 +32,6 @@ #define UNUSED(x) ((void)(x)) #else #define UNUSED(x) -#define __inline__ #endif /* Maintain global variable for keeping parser state information; this struct @@ -114,7 +113,7 @@ this might require re-partioning of the data segments if headers cross the boundaries between two read operations. This is done in a two-step way: first we request a certain amount of bytes... */ -static __inline__ int waverequire(void **data,size_t *sz,size_t rq) +static inline int waverequire(void **data,size_t *sz,size_t rq) { int rc = 1; @@ -135,7 +134,7 @@ } /* ...and next we remove this many bytes from the buffer */ -static __inline__ void waveremove(size_t rq) +static inline void waveremove(size_t rq) { if (parsestate.wave.left <= rq) parsestate.wave.left = 0; @@ -431,7 +430,7 @@ /* Convert a number in the range -32768..32767 to an 8 bit ulaw encoded number --- I hope, I got this conversion right :-) */ -static __inline__ signed char int2ulaw(int i) +static inline signed char int2ulaw(int i) { /* Lookup table for fast calculation of number of bits that need shifting*/ static short int t_bits[128] = { diff -r 9f011ab08d48 -r 2f8bb876ab1d src/mule-canna.c --- a/src/mule-canna.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/mule-canna.c Mon Aug 13 11:16:07 2007 +0200 @@ -718,7 +718,8 @@ } DEFUN ("canna-henkan-begin", Fcanna_henkan_begin, 1, 1, 0, /* -¤«¤Ê´Á»úÊÑ´¹¤·¤¿·ë²Ì¤òÊÖ´Ô¤¹¤ë¡£Ê¸ÀáÀڤ꤬¤·¤Æ¤¢¤ë¡£ +Return the result of kana-to-kanji conversion. +Clause separator is set. */ (yomi)) { @@ -773,7 +774,7 @@ } DEFUN ("canna-henkan-next", Fcanna_henkan_next, 1, 1, 0, /* -¸õÊä°ìÍ÷¤òµá¤á¤ë¡£ +Return the list of candidates. */ (bunsetsu)) { @@ -798,7 +799,7 @@ } else { - endp = XCDR (endp) = Fcons (make_string (p, slen), Qnil); + endp = XCDR (res) = Fcons (make_string (p, slen), Qnil); } p += slen + 1; } @@ -806,7 +807,7 @@ } DEFUN ("canna-bunsetu-henkou", Fcanna_bunsetu_henkou, 2, 2, 0, /* -ʸÀá¤ÎŤµ¤ò»ØÄꤹ¤ë¡£ +Specify the length of a clause. */ (bunsetsu, bunlen)) { @@ -826,7 +827,7 @@ } DEFUN ("canna-henkan-kakutei", Fcanna_henkan_kakutei, 2, 2, 0, /* -¸õÊäÁªÂò¡£ +Select a candidate. */ (bun, kouho)) { @@ -845,7 +846,7 @@ } DEFUN ("canna-henkan-end", Fcanna_henkan_end, 0, 0, 0, /* -ÊÑ´¹½ªÎ»¡£ +End conversion. */ ()) { @@ -858,7 +859,7 @@ } DEFUN ("canna-henkan-quit", Fcanna_henkan_quit, 0, 0, 0, /* -ÊÑ´¹½ªÎ»¡£ +Quit conversion. */ ()) { @@ -1777,9 +1778,9 @@ /* EUC multibyte string to MULE internal string */ static void -c2mu (char *cp, int l, char *mp) +c2mu (unsigned char *cp, int l, unsigned char *mp) { - char ch, *ep = cp+l; + unsigned char ch, *ep = cp+l; while ((cp < ep) && (ch = *cp)) { diff -r 9f011ab08d48 -r 2f8bb876ab1d src/mule-charset.h --- a/src/mule-charset.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/mule-charset.h Mon Aug 13 11:16:07 2007 +0200 @@ -401,8 +401,8 @@ /* Is this a prefix for a private leading byte? */ -INLINE int LEADING_BYTE_PREFIX_P (unsigned char lb); -INLINE int +INLINE_HEADER int LEADING_BYTE_PREFIX_P (unsigned char lb); +INLINE_HEADER int LEADING_BYTE_PREFIX_P (unsigned char lb) { return (lb == PRE_LEADING_BYTE_PRIVATE_1 || @@ -565,8 +565,8 @@ /* int not Bufbyte even though that is the actual type of a leading byte. This way, out-ot-range values will get caught rather than automatically truncated. */ -INLINE Lisp_Object CHARSET_BY_LEADING_BYTE (int lb); -INLINE Lisp_Object +INLINE_HEADER Lisp_Object CHARSET_BY_LEADING_BYTE (int lb); +INLINE_HEADER Lisp_Object CHARSET_BY_LEADING_BYTE (int lb) { assert (lb >= 0x80 && lb <= 0xFF); @@ -592,8 +592,8 @@ extern const Bytecount rep_bytes_by_first_byte[0xA0]; /* Number of bytes in the string representation of a character. */ -INLINE int REP_BYTES_BY_FIRST_BYTE (int fb); -INLINE int +INLINE_HEADER int REP_BYTES_BY_FIRST_BYTE (int fb); +INLINE_HEADER int REP_BYTES_BY_FIRST_BYTE (int fb) { #ifdef ERROR_CHECK_TYPECHECK @@ -675,8 +675,8 @@ FIELD2_TO_PRIVATE_LEADING_BYTE are the same. */ -INLINE Bufbyte CHAR_LEADING_BYTE (Emchar c); -INLINE Bufbyte +INLINE_HEADER Bufbyte CHAR_LEADING_BYTE (Emchar c); +INLINE_HEADER Bufbyte CHAR_LEADING_BYTE (Emchar c) { if (CHAR_ASCII_P (c)) @@ -710,8 +710,8 @@ FIELD2_TO_PRIVATE_LEADING_BYTE are the same. */ -INLINE Emchar MAKE_CHAR (Lisp_Object charset, int c1, int c2); -INLINE Emchar +INLINE_HEADER Emchar MAKE_CHAR (Lisp_Object charset, int c1, int c2); +INLINE_HEADER Emchar MAKE_CHAR (Lisp_Object charset, int c1, int c2) { if (EQ (charset, Vcharset_ascii)) @@ -748,8 +748,8 @@ : ((c1) = CHAR_FIELD2 (c), \ (c2) = CHAR_FIELD3 (c)) -INLINE void breakup_char_1 (Emchar c, Lisp_Object *charset, int *c1, int *c2); -INLINE void +INLINE_HEADER void breakup_char_1 (Emchar c, Lisp_Object *charset, int *c1, int *c2); +INLINE_HEADER void breakup_char_1 (Emchar c, Lisp_Object *charset, int *c1, int *c2) { *charset = CHAR_CHARSET (c); diff -r 9f011ab08d48 -r 2f8bb876ab1d src/nt.c --- a/src/nt.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/nt.c Mon Aug 13 11:16:07 2007 +0200 @@ -48,20 +48,7 @@ #include #include -#ifndef __MINGW32__ #include -#else -typedef void (CALLBACK TIMECALLBACK)(UINT uTimerID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2); - -typedef TIMECALLBACK FAR *LPTIMECALLBACK; -DWORD WINAPI timeGetTime(void); -MMRESULT WINAPI timeSetEvent(UINT uDelay, UINT uResolution, - LPTIMECALLBACK fptc, DWORD dwUser, UINT fuEvent); -MMRESULT WINAPI timeKillEvent(UINT uTimerID); -MMRESULT WINAPI timeGetDevCaps(TIMECAPS* ptc, UINT cbtc); -MMRESULT WINAPI timeBeginPeriod(UINT uPeriod); -MMRESULT WINAPI timeEndPeriod(UINT uPeriod); -#endif #include "nt.h" #include @@ -132,25 +119,25 @@ }; uid_t -getuid () +getuid (void) { return nt_fake_unix_uid; } uid_t -geteuid () +geteuid (void) { return nt_fake_unix_uid; } gid_t -getgid () +getgid (void) { return the_passwd.pw_gid; } gid_t -getegid () +getegid (void) { return getgid (); } @@ -183,7 +170,7 @@ } void -init_user_info () +init_user_info (void) { /* This code is pretty much of ad hoc nature. There is no unix-like UIDs under Windows NT. There is no concept of root user, because @@ -593,7 +580,7 @@ } void -init_environment () +init_environment (void) { /* Check for environment variables and use registry if they don't exist */ { @@ -615,7 +602,7 @@ "EMACSLOCKDIR", "INFOPATH" }; -#ifdef HEAP_IN_DATA +#if defined (HEAP_IN_DATA) && !defined(PDUMP) cache_system_info (); #endif for (i = 0; i < countof (env_vars); i++) @@ -1250,6 +1237,11 @@ } #else +#if defined(__MINGW32__) && CYGWIN_VERSION_DLL_MAJOR <= 21 +#define LowPart u.LowPart +#define HighPart u.HighPart +#endif + static LARGE_INTEGER utc_base_li; time_t @@ -1319,6 +1311,10 @@ return ret; } #endif +#if defined(__MINGW32__) && CYGWIN_VERSION_DLL_MAJOR <= 21 +#undef LowPart +#undef HighPart +#endif #if 0 /* in case we ever have need of this */ @@ -1400,6 +1396,12 @@ Oh, and do not encapsulater stat for non-MS compilers, too */ /* #### popineau@ese-metz.fr says they still might be broken. Oh well... Let's add that `1 ||' condition.... --kkm */ +/* #### aichner@ecf.teradyne.com reported that with the library + provided stat/fstat, (file-exist "d:\\tmp\\") =>> nil, + (file-exist "d:\\tmp") =>> t, when d:\tmp exists. Whenever + we opt to use non-encapsulated stat(), this should serve as + a compatibility test. --kkm */ + #if 1 || defined(_MSC_VER) && _MSC_VER < 1100 /* Since stat is encapsulated on Windows NT, we need to encapsulate @@ -1667,7 +1669,7 @@ } void -init_ntproc () +init_ntproc (void) { /* Initial preparation for subprocess support: replace our standard handles with non-inheritable versions. */ diff -r 9f011ab08d48 -r 2f8bb876ab1d src/ntproc.c --- a/src/ntproc.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/ntproc.c Mon Aug 13 11:16:07 2007 +0200 @@ -55,6 +55,9 @@ #include "syswait.h" #include "buffer.h" #include "process.h" + +#include "console-msw.h" + /*#include "w32term.h"*/ /* From 19.34.6: sync in ? --marcpa */ /* #### I'm not going to play with shit. */ @@ -120,13 +123,6 @@ DWORD WINAPI reader_thread (void *arg); -/* Determine if running on Windows 9x and not NT */ -static int -windows9x_p (void) -{ - return GetVersion () & 0x80000000; -} - /* Find an unused process slot. */ child_process * new_child (void) @@ -751,7 +747,7 @@ /* Override escape char by binding win32-quote-process-args to desired character, or use t for auto-selection. */ if (INTP (Vwin32_quote_process_args)) - escape_char = XINT (Vwin32_quote_process_args); + escape_char = (char) XINT (Vwin32_quote_process_args); else escape_char = is_cygnus_app ? '"' : '\\'; } @@ -947,7 +943,7 @@ GetClassName (hwnd, window_class, sizeof (window_class)); if (strcmp (window_class, - windows9x_p() + msw_windows9x_p() ? "tty" : "ConsoleWindowClass") == 0) { @@ -1040,7 +1036,7 @@ if (NILP (Vwin32_start_process_share_console) && cp && cp->hwnd) { #if 1 - if (windows9x_p()) + if (msw_windows9x_p()) { /* Another possibility is to try terminating the VDM out-right by @@ -1442,7 +1438,7 @@ void -syms_of_ntproc () +syms_of_ntproc (void) { DEFSUBR (Fwin32_short_file_name); DEFSUBR (Fwin32_long_file_name); diff -r 9f011ab08d48 -r 2f8bb876ab1d src/opaque.c --- a/src/opaque.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/opaque.c Mon Aug 13 11:16:07 2007 +0200 @@ -124,7 +124,7 @@ const Lisp_Opaque_Ptr *p = XOPAQUE_PTR (obj); char buf[200]; - sprintf (buf, "#", + sprintf (buf, "#", (long)(p->ptr), (unsigned long) p); write_c_string (buf, printcharfun); } @@ -141,7 +141,7 @@ return (unsigned long) XOPAQUE_PTR (obj)->ptr; } -DEFINE_LRECORD_IMPLEMENTATION ("opaque_ptr", opaque_ptr, +DEFINE_LRECORD_IMPLEMENTATION ("opaque-ptr", opaque_ptr, 0, print_opaque_ptr, 0, equal_opaque_ptr, hash_opaque_ptr, 0, Lisp_Opaque_Ptr); diff -r 9f011ab08d48 -r 2f8bb876ab1d src/postgresql.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/postgresql.c Mon Aug 13 11:16:07 2007 +0200 @@ -0,0 +1,2133 @@ +/* + postgresql.c -- Emacs Lisp binding to libpq.so + Copyright (C) 2000 Electrotechnical Laboratory, JAPAN. + Licensed to the Free Software Foundation. + + Author: SL Baur + Maintainer: SL Baur + +Please send patches to this file to me first before submitting them to +xemacs-patches. + + +KNOWN PROBLEMS (Last update 15-March-2000) ++ None. + +Implementation notes: +0. Supported PostgreSQL versions + This code was developed against libpq-6.5.3 and libpq-7.0-beta1. Earlier + versions may work. V7 support is more complete than V6.5 support. +1. Mule + Non-ASCII databases have been tested on both 6.5 and 7.0. +2. Asynchronous Operation + Starting with libpq-7.0, an asynchronous interface is offered. This + binding supports the asynchronous calls to a limited extent. Since the + XEmacs 21.2 core does not support a sensible interface to add managed but + unreadable (by XEmacs) file descriptors to the main select code, polling + is required to drive the asynchronous calls. XtAppAddInput would work + fine, but we want to be able to use the database when running strictly in + tty mode. +3. Completeness + Various calls have been deliberately not exported to Lisp. The + unexported calls are either left-over backwards compatibility code that + aren't needed, calls that cannot be implemented sensibly, or calls that + cannot be implemented safely. A list of all global functions in libpq + but not exported to Lisp is below. +4. Policy + This interface tries very hard to not set any policy towards how database + code in Emacs Lisp will be written. +5. Documentation + For full lisp programming documentation, see the XEmacs Lisp Reference + Manual. For PostgreSQL documentation, see the PostgreSQL distribution. + +TODO (in rough order of priority): +1. Asynchronous notifies need to be implemented to the extent they can be. +2. The large object interface needs work with Emacs buffers in addition + to files. Need two functions buffer->large_object, and large_object-> + buffer. +*/ + +/* + Unimplemented functions: [TODO] + PQsetNoticeProcessor + + Implemented, but undocumented functions: [TODO] + PQgetline (copy in/out) + PQputline (copy in/out) + PQgetlineAsync (copy in/out Asynch.) + PQputnbytes (copy in/out Asynch.) + PQendcopy (copy in/out) + PQsetenvStart (Asynch. Queries) + PQsetenvPoll (Asynch. Queries) + PQsetenvHandle (Asynch. Queries) + + Unsupported functions: + PQsetdbLogin -- This function is deprecated, has a subset of the + functionality of PQconnectdb, and is better done in Lisp. + PQsetdb -- Same as for PQsetdbLogin + PQsocket -- Abstraction error, file descriptors should not be leaked + into Lisp code + PQprint -- print to a file descriptor, deprecated, better done in Lisp + PQdisplayTuples -- deprecated + PQprintTuples -- really, really deprecated + PQmblen -- Returns the length in bytes of multibyte character encoded + string. + PQtrace -- controls debug print tracing to a tty. + PQuntrace -- Ditto. I don't see any way to do this sensibly. + PQoidStatus -- deprecated and nearly identical to PQoidValue + PQfn -- "Fast path" interface + lo_open (large object) [*] + lo_close (large object) [*] + lo_read (large object) [*] + lo_write (large object) [*] + lo_lseek (large object) [*] + lo_creat (large object) [*] + lo_tell (large object) [*] + lo_unlink (large object) [*] +*/ + +#include + +/* This must be portable with XEmacs 21.1 so long as it is the official + released version of XEmacs and provides the basis of InfoDock. The + interface to lcrecord handling has changed with 21.2, so unfortunately + we will need a few snippets of backwards compatibility code. +*/ +#if (EMACS_MAJOR_VERSION == 21) && (EMACS_MINOR_VERSION < 2) +#define RUNNING_XEMACS_21_1 1 +#endif + +/* #define POSTGRES_LO_IMPORT_IS_VOID 1 */ + +#include "lisp.h" +#include "sysdep.h" +#include "buffer.h" + +#include +/* Undefine the following when asynchronous setenvs are fixed in libpq. */ +/* #define LIBPQ_7_0_IS_FIXED */ +#include "postgresql.h" + +#ifdef RUNNING_XEMACS_21_1 /* handle interface changes */ +#define I_HATE_CONST CONST +#define PG_OS_CODING FORMAT_FILENAME +#define TO_EXTERNAL_FORMAT(a,from,b,to,c) GET_C_STRING_EXT_DATA_ALLOCA(from,FORMAT_FILENAME,to) +#else +#define I_HATE_CONST const +#ifdef MULE +#define PG_OS_CODING Fget_coding_system(Vpg_coding_system) +#else +#define PG_OS_CODING Qnative +#endif +Lisp_Object Vpg_coding_system; +#endif + +#define CHECK_LIVE_CONNECTION(P) { \ + if (!P || (PQstatus (P) != CONNECTION_OK)) { \ + char *e = "bad value"; \ + if (P) e = PQerrorMessage (P); \ + error ("dead connection [%s]", e); \ + } } +#define PUKE_IF_NULL(p) { \ + if (!p) error ("bad value"); \ + } + +static Lisp_Object VXPGHOST; +static Lisp_Object VXPGUSER; +static Lisp_Object VXPGOPTIONS; +static Lisp_Object VXPGPORT; +static Lisp_Object VXPGTTY; /* This needs to be blanked! */ +static Lisp_Object VXPGDATABASE; +static Lisp_Object VXPGREALM; +#ifdef MULE +static Lisp_Object VXPGCLIENTENCODING; +#endif /* MULE */ + +/* Other variables: + PGAUTHTYPE -- not used after PostgreSQL 6.5 + PGGEQO + PGCOSTINDEX + PGCOSTHEAP + PGTZ + PGDATESTYLE +*/ +#ifndef HAVE_POSTGRESQLV7 +static Lisp_Object VXPGAUTHTYPE; +#endif +static Lisp_Object VXPGGEQO, VXPGCOSTINDEX, VXPGCOSTHEAP, VXPGTZ, VXPGDATESTYLE; + +static Lisp_Object Qpostgresql; +static Lisp_Object Qpg_connection_ok, Qpg_connection_bad; +static Lisp_Object Qpg_connection_started, Qpg_connection_made; +static Lisp_Object Qpg_connection_awaiting_response, Qpg_connection_auth_ok; +static Lisp_Object Qpg_connection_setenv; + +static Lisp_Object Qpqdb, Qpquser, Qpqpass, Qpqhost, Qpqport, Qpqtty; +static Lisp_Object Qpqoptions, Qpqstatus, Qpqerrormessage, Qpqbackendpid; + +static Lisp_Object Qpgres_empty_query, Qpgres_command_ok, Qpgres_tuples_ok; +static Lisp_Object Qpgres_copy_out, Qpgres_copy_in, Qpgres_bad_response; +static Lisp_Object Qpgres_nonfatal_error, Qpgres_fatal_error; + +static Lisp_Object Qpgres_polling_failed, Qpgres_polling_reading; +static Lisp_Object Qpgres_polling_writing, Qpgres_polling_ok; +static Lisp_Object Qpgres_polling_active; +/****/ + +/* PGconn is an opaque object and we need to be able to store them in + Lisp code because libpq supports multiple connections. +*/ +Lisp_Object Qpgconnp; + +static Lisp_Object +make_pgconn (Lisp_PGconn *pgconn) +{ + Lisp_Object lisp_pgconn; + XSETPGCONN (lisp_pgconn, pgconn); + return lisp_pgconn; +} + +static Lisp_Object +#ifdef RUNNING_XEMACS_21_1 +mark_pgconn (Lisp_Object obj, void (*markobj) (Lisp_Object)) +#else +mark_pgconn (Lisp_Object obj) +#endif +{ + return Qnil; +} + +static void +print_pgconn (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +{ + char buf[256]; + PGconn *P; + ConnStatusType cst; + char *host="", *db="", *user="", *port=""; + + P = (XPGCONN (obj))->pgconn; + + if (!P) /* this may happen since we allow PQfinish() to be called */ + strcpy (buf, "#"); /* evil! */ + else if ((cst = PQstatus (P)) == CONNECTION_OK) + { + if (!(host = PQhost (P))) + host = ""; + port = PQport (P); + db = PQdb (P); + if (!(user = PQuser (P))) + user = ""; + sprintf (buf, "#", /* evil! */ + !strlen (host) ? "localhost" : host, + port, + user, + db); + } + else if (cst == CONNECTION_BAD) + strcpy (buf, "#"); /* evil! */ + else + strcpy (buf, "#"); /* evil! */ + + if (print_readably) + error ("printing unreadable object %s", buf); + else + write_c_string (buf, printcharfun); +} + +static Lisp_PGconn * +allocate_pgconn (void) +{ +#ifdef RUNNING_XEMACS_21_1 + Lisp_PGconn *pgconn = alloc_lcrecord_type (Lisp_PGconn, + lrecord_pgconn); +#else + Lisp_PGconn *pgconn = alloc_lcrecord_type (Lisp_PGconn, + &lrecord_pgconn); +#endif + pgconn->pgconn = (PGconn *)NULL; + return pgconn; +} + +static void +finalize_pgconn (void *header, int for_disksave) +{ + Lisp_PGconn *pgconn = (Lisp_PGconn *)header; + + if (for_disksave) + signal_simple_error ("Can't dump an emacs containing PGconn objects", + make_pgconn (pgconn)); + + if (pgconn->pgconn) + { + PQfinish (pgconn->pgconn); + pgconn->pgconn = (PGconn *)NULL; + } +} + +#ifdef RUNNING_XEMACS_21_1 +DEFINE_LRECORD_IMPLEMENTATION ("pgconn", pgconn, + mark_pgconn, print_pgconn, finalize_pgconn, + NULL, NULL, + Lisp_PGconn); +#else +DEFINE_LRECORD_IMPLEMENTATION ("pgconn", pgconn, + mark_pgconn, print_pgconn, finalize_pgconn, + NULL, NULL, + 0, + Lisp_PGconn); +#endif +/****/ + +/* PGresult is an opaque object and we need to be able to store them in + Lisp code. +*/ +Lisp_Object Qpgresultp; + +static Lisp_Object +make_pgresult (Lisp_PGresult *pgresult) +{ + Lisp_Object lisp_pgresult; + XSETPGRESULT (lisp_pgresult, pgresult); + return lisp_pgresult; +} + +static Lisp_Object +#ifdef RUNNING_XEMACS_21_1 +mark_pgresult (Lisp_Object obj, void (*markobj) (Lisp_Object)) +#else +mark_pgresult (Lisp_Object obj) +#endif +{ + return Qnil; +} + +#define RESULT_TUPLES_FMT "#" +#define RESULT_CMD_TUPLES_FMT "#" +#define RESULT_DEFAULT_FMT "#" +static void +print_pgresult (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +{ + char buf[1024]; + PGresult *res; + + res = (XPGRESULT (obj))->pgresult; + + if (res) + { + switch (PQresultStatus (res)) + { + case PGRES_TUPLES_OK: + /* Add number of tuples of result to output */ + sprintf (buf, RESULT_TUPLES_FMT, /* evil! */ + PQresStatus (PQresultStatus (res)), + PQntuples (res), + PQcmdStatus (res)); + break; + case PGRES_COMMAND_OK: + /* Add number of tuples affected by output-less command */ + if (!strlen (PQcmdTuples (res))) goto notuples; + sprintf (buf, RESULT_CMD_TUPLES_FMT, /* evil! */ + PQresStatus (PQresultStatus (res)), + PQcmdTuples (res), + PQcmdStatus (res)); + break; + default: +notuples: + /* No counts to print */ + sprintf (buf, RESULT_DEFAULT_FMT, /* evil! */ + PQresStatus (PQresultStatus (res)), + PQcmdStatus (res)); + break; + } + } + else + strcpy (buf, "#"); /* evil! */ + + if (print_readably) + error ("printing unreadable object %s", buf); + else + write_c_string (buf, printcharfun); +} + +#undef RESULT_TUPLES_FMT +#undef RESULT_CMD_TUPLES_FMT +#undef RESULT_DEFAULT_FMT + +static Lisp_PGresult * +allocate_pgresult (void) +{ +#ifdef RUNNING_XEMACS_21_1 + Lisp_PGresult *pgresult = alloc_lcrecord_type (Lisp_PGresult, + lrecord_pgresult); +#else + Lisp_PGresult *pgresult = alloc_lcrecord_type (Lisp_PGresult, + &lrecord_pgresult); +#endif + pgresult->pgresult = (PGresult *)NULL; + return pgresult; +} + +static void +finalize_pgresult (void *header, int for_disksave) +{ + Lisp_PGresult *pgresult = (Lisp_PGresult *)header; + + if (for_disksave) + signal_simple_error ("Can't dump an emacs containing PGresult objects", + make_pgresult (pgresult)); + + if (pgresult->pgresult) + { + PQclear (pgresult->pgresult); + pgresult->pgresult = (PGresult *)NULL; + } +} + +#ifdef RUNNING_XEMACS_21_1 +DEFINE_LRECORD_IMPLEMENTATION ("pgresult", pgresult, + mark_pgresult, print_pgresult, finalize_pgresult, + NULL, NULL, + Lisp_PGresult); +#else +DEFINE_LRECORD_IMPLEMENTATION ("pgresult", pgresult, + mark_pgresult, print_pgresult, finalize_pgresult, + NULL, NULL, + 0, + Lisp_PGresult); +#endif + +/****/ +#ifdef HAVE_POSTGRESQLV7 +/* PGsetenvHandle is an opaque object and we need to be able to store them in + Lisp code so we can make asynchronous environmental calls. + + Asynchronous setenv calls were introduced in libpq-7.0. +*/ +#ifdef LIBPQ_7_0_IS_FIXED + +Lisp_Object Qpgsetenvp; + +static Lisp_Object +make_pgsetenv (Lisp_PGsetenvHandle *pgsetenv) +{ + Lisp_Object lisp_pgsetenv; + XSETPGSETENV (lisp_pgsetenv, pgsetenv); + return lisp_pgsetenv; +} + +static Lisp_Object +#ifdef RUNNING_XEMACS_21_1 +mark_pgsetenv (Lisp_Object obj, void (*markobj) (Lisp_Object)) +#else +mark_pgsetenv (Lisp_Object obj) +#endif +{ + return Qnil; +} + +static void +print_pgsetenv (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +{ + char *fmt = "#"; + char buf[1024]; + PGsetenvHandle *h; + + h = (XPGSETENV (obj))->pgsetenv; + + sprintf (buf, fmt, h ? "live" : "DEAD"); + + /* There are no accessor functions to retrieve any fields, so we must */ + /* treat this as being completely opaque. */ + if (print_readably) + error ("printing unreadable object %s", buf); + else + write_c_string (buf, printcharfun); +} + +static Lisp_PGsetenvHandle * +allocate_pgresult (void) +{ +#ifdef RUNNING_XEMACS_21_1 + Lisp_PGsetenvHandle *pgsetenv = + alloc_lcrecord_type (Lisp_PGsetenvHandle, lrecord_pgsetenv); +#else + Lisp_PGsetenvHandle *pgsetenv = + alloc_lcrecord_type (Lisp_PGsetenvHandle, &lrecord_pgsetenv); +#endif + pgsetenv->pgsetenv = (PGsetenvState *)NULL; + return pgsetenv; +} + +static void +finalize_pgsetenv (void *header, int for_disksave) +{ + Lisp_PGsetenvHandle *pgsetenv = (Lisp_PGsetenvHandle *)header; + + if (for_disksave) + signal_simple_error ("Can't dump an emacs containing PGsetenvHandle objects", + make_pgsetenv (pgsetenv)); + + /* #### PGsetenvHandle's are allocated with malloc(), however in + libpq-7.0 the treatment of them is little short of disastrous. + We don't dare attempt to free it, because there are many code + paths which lead to the handle being freed internally. The + connection routines leak setenv handles and so will we until + libpq gets cleaned up. + Actually, in 7.0b1 asynchronous setenv cannot work outside libpq, so + these functions are disabled in this API. + */ + if (pgsetenv->pgsetenv) + { + free (pgsetenv->pgsetenv); + pgsetenv->pgsetenv = (PGsetenvHandle *)NULL; + } +} + +#ifdef RUNNING_XEMACS_21_1 +DEFINE_LRECORD_IMPLEMENTATION ("pgresult", pgresult, + mark_pgresult, print_pgresult, finalize_pgresult, + NULL, NULL, + Lisp_PGresult); +#else +DEFINE_LRECORD_IMPLEMENTATION ("pgresult", pgresult, + mark_pgresult, print_pgresult, finalize_pgresult, + NULL, NULL, + 0, + Lisp_PGresult); +#endif /* RUNNING_XEMACS_21_1 */ + +#endif /* LIBPQ_7_0_IS_FIXED */ +#endif /* HAVE_POSTGRESQLV7 */ + +/***********************/ + +/* notices */ +static void +xemacs_notice_processor (void *arg, I_HATE_CONST char *msg) +{ + warn_when_safe (Qpostgresql, Qnotice, "%s", msg); +} + +/* There are four ways (as of PostgreSQL v7) to connect to a database. + Two of them, PQsetdb and PQsetdbLogin, are deprecated. Both of those + routines take a number of positional parameters and are better done in Lisp. + Note that PQconnectStart does not exist prior to v7. +*/ + +DEFUN ("pq-conn-defaults", Fpq_conn_defaults, 0, 0, 0, /* +Return a connection default structure. +*/ + ()) +{ + /* This function can GC */ + PQconninfoOption *pcio; + Lisp_Object temp, temp1; + int i; + + pcio = PQconndefaults(); + if (!pcio) return Qnil; /* can never happen in libpq-7.0 */ + temp = list1 (Fcons (build_ext_string (pcio[0].keyword, PG_OS_CODING), + Fcons (build_ext_string (pcio[0].envvar, PG_OS_CODING), + Fcons (build_ext_string (pcio[0].compiled, PG_OS_CODING), + Fcons (build_ext_string (pcio[0].val, PG_OS_CODING), + Fcons (build_ext_string (pcio[0].label, PG_OS_CODING), + Fcons (build_ext_string (pcio[0].dispchar, PG_OS_CODING), + Fcons (make_int (pcio[0].dispsize), Qnil)))))))); + + for (i = 1; pcio[i].keyword; i++) + { + temp1 = list1 (Fcons (build_ext_string (pcio[i].keyword, PG_OS_CODING), + Fcons (build_ext_string (pcio[i].envvar, PG_OS_CODING), + Fcons (build_ext_string (pcio[i].compiled, PG_OS_CODING), + Fcons (build_ext_string (pcio[i].val, PG_OS_CODING), + Fcons (build_ext_string (pcio[i].label, PG_OS_CODING), + Fcons (build_ext_string (pcio[i].dispchar, PG_OS_CODING), + Fcons (make_int (pcio[i].dispsize), Qnil)))))))); + { + Lisp_Object args[2]; + args[0] = temp; + args[1] = temp1; + /* Fappend GCPROs its arguments */ + temp = Fappend (2, args); + } + } + + return temp; +} + +/* PQconnectdb Makes a new connection to a backend. +PGconn *PQconnectdb(const char *conninfo) +*/ + +DEFUN ("pq-connectdb", Fpq_connectdb, 1, 1, 0, /* +Make a new connection to a PostgreSQL backend. +*/ + (conninfo)) +{ + PGconn *P; + Lisp_PGconn *lisp_pgconn; + char *error_message = "Out of Memory?"; + char *c_conninfo; + + CHECK_STRING (conninfo); + + TO_EXTERNAL_FORMAT(LISP_STRING, conninfo, + C_STRING_ALLOCA, c_conninfo, Qnative); + P = PQconnectdb (c_conninfo); + if (P && (PQstatus (P) == CONNECTION_OK)) + { + (void)PQsetNoticeProcessor (P, xemacs_notice_processor, NULL); + lisp_pgconn = allocate_pgconn(); + lisp_pgconn->pgconn = P; + return make_pgconn (lisp_pgconn); + } + else + { + /* Connection failed. Destroy the connection and signal an error. */ + char buf[BLCKSZ]; + strcpy (buf, error_message); + if (P) + { + /* storage for the error message gets erased when call PQfinish */ + /* so we must temporarily stash it somewhere */ + strncpy (buf, PQerrorMessage (P), sizeof (buf)); + buf[sizeof (buf) - 1] = '\0'; + PQfinish (P); + } + error ("libpq: %s", buf); + } +} + +/* PQconnectStart Makes a new asynchronous connection to a backend. +PGconn *PQconnectStart(const char *conninfo) +*/ + +#ifdef HAVE_POSTGRESQLV7 +DEFUN ("pq-connect-start", Fpq_connect_start, 1, 1, 0, /* +Make a new asynchronous connection to a PostgreSQL backend. +*/ + (conninfo)) +{ + PGconn *P; + Lisp_PGconn *lisp_pgconn; + char *error_message = "Out of Memory?"; + char *c_conninfo; + + CHECK_STRING (conninfo); + TO_EXTERNAL_FORMAT (LISP_STRING, conninfo, + C_STRING_ALLOCA, c_conninfo, Qnative); + P = PQconnectStart (c_conninfo); + + if (P && (PQstatus (P) != CONNECTION_BAD)) + { + (void)PQsetNoticeProcessor (P, xemacs_notice_processor, NULL); + lisp_pgconn = allocate_pgconn(); + lisp_pgconn->pgconn = P; + + return make_pgconn (lisp_pgconn); + } + else + { + /* capture the error message before destroying the object */ + char buf[BLCKSZ]; + strcpy (buf, error_message); + if (P) + { + strncpy (buf, PQerrorMessage (P), sizeof (buf)); + buf[sizeof (buf) - 1] = '\0'; + PQfinish (P); + } + error ("libpq: %s", buf); + } +} + +DEFUN ("pq-connect-poll", Fpq_connect_poll, 1, 1, 0, /* +Poll an asynchronous connection for completion +*/ + (conn)) +{ + PGconn *P; + PostgresPollingStatusType PS; + + CHECK_PGCONN (conn); + + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); + + PS = PQconnectPoll (P); + switch (PS) + { + case PGRES_POLLING_FAILED: + /* Something Bad has happened */ + { + char *e = PQerrorMessage (P); + error ("libpq: %s", e); + } + case PGRES_POLLING_OK: + return Qpgres_polling_ok; + case PGRES_POLLING_READING: + return Qpgres_polling_reading; + case PGRES_POLLING_WRITING: + return Qpgres_polling_writing; + case PGRES_POLLING_ACTIVE: + return Qpgres_polling_active; + default: + /* they've added a new field we don't know about */ + error ("Help! Unknown status code %08x from backend!", PS); + } +} + +#ifdef MULE +DEFUN ("pq-client-encoding", Fpq_client_encoding, 1, 1, 0, /* +Return client coding system. +*/ + (conn)) +{ + PGconn *P; + + CHECK_PGCONN (conn); + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); + + return make_int (PQclientEncoding (P)); +} + +DEFUN ("pq-set-client-encoding", Fpq_set_client_encoding, 2, 2, 0, /* +Set client coding system. +*/ + (conn, encoding)) +{ + PGconn *P; + int rc; + char *c_encoding; + + CHECK_PGCONN (conn); + CHECK_STRING (encoding); + + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); + + TO_EXTERNAL_FORMAT (LISP_STRING, encoding, + C_STRING_ALLOCA, c_encoding, Qnative); + + if ((rc = PQsetClientEncoding (P, c_encoding)) < 0) + error ("bad encoding"); + else + return make_int (rc); +} + +#endif +#endif /* HAVE_POSTGRESQLV7 */ + +/* PQfinish Close the connection to the backend. Also frees memory + used by the PGconn object. +void PQfinish(PGconn *conn) +*/ +DEFUN ("pq-finish", Fpq_finish, 1, 1, 0, /* +Close the connection to the backend. +*/ + (conn)) +{ + PGconn *P; + + CHECK_PGCONN (conn); + P = (XPGCONN (conn))->pgconn; + PUKE_IF_NULL (P); + + PQfinish (P); + /* #### PQfinish deallocates the PGconn structure, so we now have a + dangling pointer. */ + /* Genocided all @'s ... */ + (XPGCONN (conn))->pgconn = (PGconn *)NULL; /* You feel DEAD inside */ + return Qnil; +} + +DEFUN ("pq-clear", Fpq_clear, 1, 1, 0, /* +Forcibly erase a PGresult object. +*/ + (res)) +{ + PGresult *R; + + CHECK_PGRESULT (res); + R = (XPGRESULT (res))->pgresult; + PUKE_IF_NULL (R); + + PQclear (R); + /* Genocided all @'s ... */ + (XPGRESULT (res))->pgresult = (PGresult *)NULL; /* You feel DEAD inside */ + + return Qnil; +} + +DEFUN ("pq-is-busy", Fpq_is_busy, 1, 1, 0, /* +Return t if PQgetResult would block waiting for input. +*/ + (conn)) +{ + PGconn *P; + + CHECK_PGCONN (conn); + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); + + return PQisBusy (P) ? Qt : Qnil; +} + +DEFUN ("pq-consume-input", Fpq_consume_input, 1, 1, 0, /* +Consume any available input from the backend. +Returns nil if something bad happened. +*/ + (conn)) +{ + PGconn *P; + + CHECK_PGCONN (conn); + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); + + return PQconsumeInput (P) ? Qt : Qnil; +} + +/* PQreset Reset the communication port with the backend. +void PQreset(PGconn *conn) +*/ +DEFUN ("pq-reset", Fpq_reset, 1, 1, 0, /* +Reset the connection to the backend. +This function will close the connection to the backend and attempt to +reestablish a new connection to the same postmaster, using all the same +parameters previously used. This may be useful for error recovery if a +working connection is lost. +*/ + (conn)) +{ + PGconn *P; + + CHECK_PGCONN (conn); + P = (XPGCONN (conn))->pgconn; + PUKE_IF_NULL (P);/* we can resurrect a BAD connection, but not a dead one. */ + + PQreset (P); + + return Qnil; +} + +#ifdef HAVE_POSTGRESQLV7 +DEFUN ("pq-reset-start", Fpq_reset_start, 1, 1, 0, /* +Reset connection to the backend asynchronously. +*/ + (conn)) +{ + PGconn *P; + + CHECK_PGCONN (conn); + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); + + if (PQresetStart (P)) return Qt; + { + char *e = PQerrorMessage (P); + error ("libpq: %s", e); + } +} + +DEFUN ("pq-reset-poll", Fpq_reset_poll, 1, 1, 0, /* +Poll an asynchronous reset for completion +*/ + (conn)) +{ + PGconn *P; + PostgresPollingStatusType PS; + + CHECK_PGCONN (conn); + + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); + + PS = PQresetPoll (P); + switch (PS) + { + case PGRES_POLLING_FAILED: + /* Something Bad has happened */ + { + char *e = PQerrorMessage (P); + error ("libpq: %s", e); + } + case PGRES_POLLING_OK: + return Qpgres_polling_ok; + case PGRES_POLLING_READING: + return Qpgres_polling_reading; + case PGRES_POLLING_WRITING: + return Qpgres_polling_writing; + case PGRES_POLLING_ACTIVE: + return Qpgres_polling_active; + default: + /* they've added a new field we don't know about */ + error ("Help! Unknown status code %08x from backend!", PS); + } +} +#endif + +DEFUN ("pq-request-cancel", Fpq_request_cancel, 1, 1, 0, /* +Attempt to request cancellation of the current operation. + +The return value is t if the cancel request was successfully +dispatched, nil if not (in which case conn->errorMessage is set). +Note: successful dispatch is no guarantee that there will be any effect at +the backend. The application must read the operation result as usual. +*/ + (conn)) +{ + PGconn *P; + + CHECK_PGCONN (conn); + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); + + return PQrequestCancel (P) ? Qt : Qnil; +} + +/* accessor function for the PGconn object */ +DEFUN ("pq-pgconn", Fpq_pgconn, 2, 2, 0, /* +Accessor function for the PGconn object. +Currently recognized symbols for the field: +pq::db Database name +pq::user Database user name +pq::pass Database user's password +pq::host Hostname of PostgreSQL backend connected to +pq::port TCP port number of connection +pq::tty Debugging TTY (not used in Emacs) +pq::options Additional backend options +pq::status Connection status (either OK or BAD) +pq::error-message Last error message from the backend +pq::backend-pid Process ID of backend process +*/ + (conn, field)) +{ + PGconn *P; + + CHECK_PGCONN (conn); + P = (XPGCONN (conn))->pgconn; + PUKE_IF_NULL (P); /* BAD connections still have state to query */ + + if (EQ(field, Qpqdb)) + /* PQdb Returns the database name of the connection. + char *PQdb(PGconn *conn) + */ + return build_ext_string (PQdb(P), PG_OS_CODING); + else if (EQ (field, Qpquser)) + /* PQuser Returns the user name of the connection. + char *PQuser(PGconn *conn) + */ + return build_ext_string (PQuser(P), PG_OS_CODING); + else if (EQ (field, Qpqpass)) + /* PQpass Returns the password of the connection. + char *PQpass(PGconn *conn) + */ + return build_ext_string (PQpass(P), PG_OS_CODING); + else if (EQ (field, Qpqhost)) + /* PQhost Returns the server host name of the connection. + char *PQhost(PGconn *conn) + */ + return build_ext_string (PQhost(P), PG_OS_CODING); + else if (EQ (field, Qpqport)) + { + char *p; + /* PQport Returns the port of the connection. + char *PQport(PGconn *conn) + */ + if ((p = PQport(P))) + return make_int(atoi(p)); + else + return make_int(-1); + } + else if (EQ (field, Qpqtty)) + /* PQtty Returns the debug tty of the connection. + char *PQtty(PGconn *conn) + */ + return build_ext_string (PQtty(P), PG_OS_CODING); + else if (EQ (field, Qpqoptions)) + /* PQoptions Returns the backend options used in the connection. + char *PQoptions(PGconn *conn) + */ + return build_ext_string (PQoptions(P), PG_OS_CODING); + else if (EQ (field, Qpqstatus)) + { + ExecStatusType est; + /* PQstatus Returns the status of the connection. The status can be + CONNECTION_OK or CONNECTION_BAD. + ConnStatusType PQstatus(PGconn *conn) + */ + switch ((est = PQstatus (P))) + { + case CONNECTION_OK: return Qpg_connection_ok; + case CONNECTION_BAD: return Qpg_connection_bad; +#ifdef HAVE_POSTGRESQLV7 + case CONNECTION_STARTED: return Qpg_connection_started; + case CONNECTION_MADE: return Qpg_connection_made; + case CONNECTION_AWAITING_RESPONSE: return Qpg_connection_awaiting_response; + case CONNECTION_AUTH_OK: return Qpg_connection_auth_ok; + case CONNECTION_SETENV: return Qpg_connection_setenv; +#endif /* HAVE_POSTGRESQLV7 */ + default: + /* they've added a new field we don't know about */ + error ("Help! Unknown exec status code %08x from backend!", est); + } + } + else if (EQ (field, Qpqerrormessage)) + /* PQerrorMessage Returns the error message most recently generated + by an operation on the connection. + char *PQerrorMessage(PGconn* conn); + */ + return build_ext_string (PQerrorMessage(P), PG_OS_CODING); + else if (EQ (field, Qpqbackendpid)) + /* PQbackendPID Returns the process ID of the backend server handling + this connection. + int PQbackendPID(PGconn *conn); + */ + return make_int (PQbackendPID(P)); + else + error ("bad PGconn accessor"); +} + +/* Query functions */ +DEFUN ("pq-exec", Fpq_exec, 2, 2, 0, /* +Submit a query to Postgres and wait for the result. +*/ + (conn, query)) +{ + PGconn *P; + Lisp_PGresult *lisp_pgresult; + PGresult *R; + char *c_query; + + CHECK_PGCONN (conn); + CHECK_STRING (query); + + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); + + TO_EXTERNAL_FORMAT (LISP_STRING, query, + C_STRING_ALLOCA, c_query, Qnative); + + R = PQexec (P, c_query); + { + char *tag, buf[BLCKSZ]; + + if (!R) error ("query: out of memory"); + else + switch (PQresultStatus (R)) + { + case PGRES_BAD_RESPONSE: + tag = "bad response [%s]"; + goto err; + case PGRES_NONFATAL_ERROR: + tag = "non-fatal error [%s]"; + goto err; + case PGRES_FATAL_ERROR: + tag = "fatal error [%s]"; +err: + strncpy (buf, PQresultErrorMessage (R), sizeof (buf)); + buf [sizeof (buf) - 1] = '\0'; + PQclear (R); + error (tag, buf); + /*NOTREACHED*/ + default: + break; + } + } + + lisp_pgresult = allocate_pgresult (); + lisp_pgresult->pgresult = R; + + return make_pgresult (lisp_pgresult); +} + +DEFUN ("pq-send-query", Fpq_send_query, 2, 2, 0, /* +Submit a query to Postgres and don't wait for the result. +Returns: t if successfully submitted + nil if error (conn->errorMessage is set) +*/ + (conn, query)) +{ + PGconn *P; + char *c_query; + + CHECK_PGCONN (conn); + CHECK_STRING (query); + + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); + + TO_EXTERNAL_FORMAT (LISP_STRING, query, + C_STRING_ALLOCA, c_query, Qnative); + + if (PQsendQuery (P, c_query)) return Qt; + else error ("async query: %s", PQerrorMessage (P)); +} + +DEFUN ("pq-get-result", Fpq_get_result, 1, 1, 0, /* +Retrieve an asynchronous result from a query. +NIL is returned when no more query work remains. +*/ + (conn)) +{ + PGconn *P; + Lisp_PGresult *lisp_pgresult; + PGresult *R; + + CHECK_PGCONN (conn); + + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); + + R = PQgetResult (P); + if (!R) return Qnil; /* not an error, there's no more data to get */ + + { + char *tag, buf[BLCKSZ]; + + switch (PQresultStatus (R)) + { + case PGRES_BAD_RESPONSE: + tag = "bad response [%s]"; + goto err; + case PGRES_NONFATAL_ERROR: + tag = "non-fatal error [%s]"; + goto err; + case PGRES_FATAL_ERROR: + tag = "fatal error [%s]"; +err: + strncpy (buf, PQresultErrorMessage (R), sizeof (buf)); + buf[sizeof (buf) - 1] = '\0'; + PQclear (R); + error (tag, buf); + /*NOTREACHED*/ + default: + break; + } + } + + lisp_pgresult = allocate_pgresult(); + lisp_pgresult->pgresult = R; + + return make_pgresult (lisp_pgresult); +} + +DEFUN ("pq-result-status", Fpq_result_status, 1, 1, 0, /* +Return result status of the query. +*/ + (result)) +{ + PGresult *R; + ExecStatusType est; + + CHECK_PGRESULT (result); + R = (XPGRESULT (result))->pgresult; + PUKE_IF_NULL (R); + + switch ((est = PQresultStatus (R))) { + case PGRES_EMPTY_QUERY: return Qpgres_empty_query; + case PGRES_COMMAND_OK: return Qpgres_command_ok; + case PGRES_TUPLES_OK: return Qpgres_tuples_ok; + case PGRES_COPY_OUT: return Qpgres_copy_out; + case PGRES_COPY_IN: return Qpgres_copy_in; + case PGRES_BAD_RESPONSE: return Qpgres_bad_response; + case PGRES_NONFATAL_ERROR: return Qpgres_nonfatal_error; + case PGRES_FATAL_ERROR: return Qpgres_fatal_error; + default: + /* they've added a new field we don't know about */ + error ("Help! Unknown exec status code %08x from backend!", est); + } +} + +DEFUN ("pq-res-status", Fpq_res_status, 1, 1, 0, /* +Return stringified result status of the query. +*/ + (result)) +{ + PGresult *R; + + CHECK_PGRESULT (result); + R = (XPGRESULT (result))->pgresult; + PUKE_IF_NULL (R); + + return build_ext_string (PQresStatus (PQresultStatus (R)), PG_OS_CODING); +} + +/* Sundry PGresult accessor functions */ +DEFUN ("pq-result-error-message", Fpq_result_error_message, 1, 1, 0, /* +Return last message associated with the query. +*/ + (result)) +{ + PGresult *R; + + CHECK_PGRESULT (result); + R = (XPGRESULT (result))->pgresult; + PUKE_IF_NULL (R); + + return build_ext_string (PQresultErrorMessage (R), PG_OS_CODING); +} + +DEFUN ("pq-ntuples", Fpq_ntuples, 1, 1, 0, /* +Return the number of tuples (instances) in the query result. +*/ + (result)) +{ + PGresult *R; + + CHECK_PGRESULT (result); + R = (XPGRESULT (result))->pgresult; + PUKE_IF_NULL (R); + + return make_int (PQntuples (R)); +} + +DEFUN ("pq-nfields", Fpq_nfields, 1, 1, 0, /* +Return the number of fields (attributes) in each tuple of the query result. +*/ + (result)) +{ + PGresult *R; + + CHECK_PGRESULT (result); + R = (XPGRESULT (result))->pgresult; + PUKE_IF_NULL (R); + + return make_int (PQnfields (R)); +} + +DEFUN ("pq-binary-tuples", Fpq_binary_tuples, 1, 1, 0, /* +Return t if the query result contains binary data, nil otherwise. +*/ + (result)) +{ + PGresult *R; + + CHECK_PGRESULT (result); + R = (XPGRESULT (result))->pgresult; + PUKE_IF_NULL (R); + + return (PQbinaryTuples (R)) ? Qt : Qnil; +} + +DEFUN ("pq-fname", Fpq_fname, 2, 2, 0, /* +Return the field (attribute) name associated with the given field index. +Field indices start at 0. +*/ + (result, field_index)) +{ + PGresult *R; + + CHECK_PGRESULT (result); + CHECK_INT (field_index); + R = (XPGRESULT (result))->pgresult; + PUKE_IF_NULL (R); + + return build_ext_string (PQfname (R, XINT (field_index)), PG_OS_CODING); +} + +DEFUN ("pq-fnumber", Fpq_fnumber, 2, 2, 0, /* +Return the number of fields (attributes) in each tuple of the query result. +*/ + (result, field_name)) +{ + PGresult *R; + char *c_field_name; + + CHECK_PGRESULT (result); + CHECK_STRING (field_name); + R = (XPGRESULT (result))->pgresult; + PUKE_IF_NULL (R); + + TO_EXTERNAL_FORMAT (LISP_STRING, field_name, + C_STRING_ALLOCA, c_field_name, Qnative); + + return make_int (PQfnumber (R, c_field_name)); +} + +DEFUN ("pq-ftype", Fpq_ftype, 2, 2, 0, /* +Return the field type associated with the given field index. +The integer returned is the internal coding of the type. Field indices +start at 0. +*/ + (result, field_num)) +{ + PGresult *R; + + CHECK_PGRESULT (result); + CHECK_INT (field_num); + R = (XPGRESULT (result))->pgresult; + PUKE_IF_NULL (R); + + return make_int (PQftype (R, XINT (field_num))); +} + +DEFUN ("pq-fsize", Fpq_fsize, 2, 2, 0, /* +Return the field size in bytes associated with the given field index. +Field indices start at 0. +*/ + (result, field_index)) +{ + PGresult *R; + + CHECK_PGRESULT (result); + CHECK_INT (field_index); + R = (XPGRESULT (result))->pgresult; + PUKE_IF_NULL (R); + + return make_int (PQftype (R, XINT (field_index))); +} + +DEFUN ("pq-fmod", Fpq_fmod, 2, 2, 0, /* +Return the type modifier associated with a field. +Field indices start at 0. +*/ + (result, field_index)) +{ + PGresult *R; + + CHECK_PGRESULT (result); + CHECK_INT (field_index); + R = (XPGRESULT (result))->pgresult; + PUKE_IF_NULL (R); + + return make_int (PQfmod (R, XINT (field_index))); +} + +DEFUN ("pq-get-value", Fpq_get_value, 3, 3, 0, /* +Return a single field (attribute) value of one tuple of a PGresult. +Tuple and field indices start at 0. +*/ + (result, tup_num, field_num)) +{ + PGresult *R; + + CHECK_PGRESULT (result); + CHECK_INT (tup_num); + CHECK_INT (field_num); + R = (XPGRESULT (result))->pgresult; + PUKE_IF_NULL (R); + + return build_ext_string (PQgetvalue (R, XINT (tup_num), XINT (field_num)), + PG_OS_CODING); +} + +DEFUN ("pq-get-length", Fpq_get_length, 3, 3, 0, /* +Returns the length of a field value in bytes. +If result is binary, i.e. a result of a binary portal, then the +length returned does NOT include the size field of the varlena. (The +data returned by PQgetvalue doesn't either.) +*/ + (result, tup_num, field_num)) +{ + PGresult *R; + + CHECK_PGRESULT (result); + CHECK_INT (tup_num); + CHECK_INT (field_num); + R = (XPGRESULT (result))->pgresult; + PUKE_IF_NULL (R); + + return make_int (PQgetlength (R, XINT (tup_num), XINT (field_num))); +} + +DEFUN ("pq-get-is-null", Fpq_get_is_null, 3, 3, 0, /* +Returns the null status of a field value. +*/ + (result, tup_num, field_num)) +{ + PGresult *R; + + CHECK_PGRESULT (result); + CHECK_INT (tup_num); + CHECK_INT (field_num); + R = (XPGRESULT (result))->pgresult; + PUKE_IF_NULL (R); + + return PQgetisnull (R, XINT (tup_num), XINT (field_num)) ? Qt : Qnil; +} + +DEFUN ("pq-cmd-status", Fpq_cmd_status, 1, 1, 0, /* +Returns the command status string from the SQL command that generated the result. +*/ + (result)) +{ + PGresult *R; + + CHECK_PGRESULT (result); + R = (XPGRESULT (result))->pgresult; + PUKE_IF_NULL (R); + + return build_ext_string (PQcmdStatus (R), PG_OS_CODING); +} + +DEFUN ("pq-cmd-tuples", Fpq_cmd_tuples, 1, 1, 0, /* +Returns the number of rows affected by the SQL command +*/ + (result)) +{ + PGresult *R; + + CHECK_PGRESULT (result); + R = (XPGRESULT (result))->pgresult; + PUKE_IF_NULL (R); + + return build_ext_string (PQcmdTuples (R), PG_OS_CODING); +} + +DEFUN ("pq-oid-value", Fpq_oid_value, 1, 1, 0, /* +Returns the object id of the tuple inserted. +*/ + (result)) +{ + PGresult *R; + + CHECK_PGRESULT (result); + R = (XPGRESULT (result))->pgresult; + PUKE_IF_NULL (R); + +#ifdef HAVE_POSTGRESQLV7 + return make_int (PQoidValue (R)); +#else + /* Use the old interface */ + return make_int (atoi (PQoidStatus (R))); +#endif +} + +#ifdef HAVE_POSTGRESQLV7 +DEFUN ("pq-set-nonblocking", Fpq_set_nonblocking, 2, 2, 0, /* +Sets the PGconn's database connection non-blocking if the arg is TRUE +or makes it non-blocking if the arg is FALSE, this will not protect +you from PQexec(), you'll only be safe when using the non-blocking API. + +Needs to be called only on a connected database connection. +*/ + (conn, arg)) +{ + PGconn *P; + + CHECK_PGCONN (conn); + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); + + return make_int (PQsetnonblocking (P, !NILP (arg))); +} + +DEFUN ("pq-is-nonblocking", Fpq_is_nonblocking, 1, 1, 0, /* +Return the blocking status of the database connection +*/ + (conn)) +{ + PGconn *P; + + CHECK_PGCONN (conn); + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); + + return PQisnonblocking (P) ? Qt : Qnil; +} + +DEFUN ("pq-flush", Fpq_flush, 1, 1, 0, /* +Force the write buffer to be written (or at least try) +*/ + (conn)) +{ + PGconn *P; + + CHECK_PGCONN (conn); + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); + + return make_int (PQflush (P)); +} +#endif + +DEFUN ("pq-notifies", Fpq_notifies, 1, 1, 0, /* +Return the latest async notification that has not yet been handled. +If there has been a notification, then a list of two elements will be returned. +The first element contains the relation name being notified, the second +element contains the backend process ID number. nil is returned if there +aren't any notifications to process. +*/ + (conn)) +{ + /* This function cannot GC */ + PGconn *P; + PGnotify *PGN; + + CHECK_PGCONN (conn); + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); + + PGN = PQnotifies (P); + if (!PGN) + return Qnil; + else + { + Lisp_Object temp; + + temp = list2 (build_ext_string (PGN->relname, PG_OS_CODING), make_int (PGN->be_pid)); + free ((void *)PGN); + return temp; + } +} + +#if defined (HAVE_POSTGRESQLV7) && defined(MULE) +DEFUN ("pq-env-2-encoding", Fpq_env_2_encoding, 0, 0, 0, /* +Get encoding id from environment variable PGCLIENTENCODING. +*/ + ()) +{ + return make_int (PQenv2encoding ()); +} +#endif /* MULE */ + +DEFUN ("pq-lo-import", Fpq_lo_import, 2, 2, 0, /* +*/ + (conn, filename)) +{ + PGconn *P; + char *c_filename; + + CHECK_PGCONN (conn); + CHECK_STRING (filename); + + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); + + TO_EXTERNAL_FORMAT (LISP_STRING, filename, + C_STRING_ALLOCA, c_filename, + Qfile_name); + + return make_int ((int)lo_import (P, c_filename)); +} + +DEFUN ("pq-lo-export", Fpq_lo_export, 3, 3, 0, /* +*/ + (conn, oid, filename)) +{ + PGconn *P; + char *c_filename; + + CHECK_PGCONN (conn); + CHECK_INT (oid); + CHECK_STRING (filename); + + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); + + TO_EXTERNAL_FORMAT (LISP_STRING, filename, + C_STRING_ALLOCA, c_filename, Qfile_name); + + return make_int ((int)lo_export (P, XINT (oid), c_filename)); +} + +DEFUN ("pq-make-empty-pgresult", Fpq_make_empty_pgresult, 2, 2, 0, /* +Make an empty PGresult object with the given status. +*/ + (conn, status)) +{ + PGconn *P; + Lisp_PGresult *lpgr; + PGresult *R; + ExecStatusType est; + + CHECK_PGCONN (conn); + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); /* needed here? */ + + if (EQ (status, Qpgres_empty_query)) est = PGRES_EMPTY_QUERY; + else if (EQ (status, Qpgres_command_ok)) est = PGRES_COMMAND_OK; + else if (EQ (status, Qpgres_tuples_ok)) est = PGRES_TUPLES_OK; + else if (EQ (status, Qpgres_copy_out)) est = PGRES_COPY_OUT; + else if (EQ (status, Qpgres_copy_in)) est = PGRES_COPY_IN; + else if (EQ (status, Qpgres_bad_response)) est = PGRES_BAD_RESPONSE; + else if (EQ (status, Qpgres_nonfatal_error)) est = PGRES_NONFATAL_ERROR; + else if (EQ (status, Qpgres_fatal_error)) est = PGRES_FATAL_ERROR; + else signal_simple_error ("bad status symbol", status); + + R = PQmakeEmptyPGresult (P, est); + if (!R) error ("out of memory?"); + + lpgr = allocate_pgresult (); + lpgr->pgresult = R; + + return make_pgresult (lpgr); +} + +DEFUN ("pq-get-line", Fpq_get_line, 1, 1, 0, /* +Retrieve a line from server in copy in operation. +The return value is a dotted pair where the cons cell is an integer code: + -1: Copying is complete + 0: A record is complete + 1: A record is incomplete, it will be continued in the next `pq-get-line' + operation. +and the cdr cell is returned string data. + +The copy operation is complete when the value `\.' (backslash dot) is +returned. +*/ + (conn)) +{ + char buffer[BLCKSZ]; /* size of a Postgres disk block */ + PGconn *P; + int ret; + + CHECK_PGCONN (conn); + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); + + ret = PQgetline (P, buffer, sizeof (buffer)); + + return Fcons (make_int (ret), build_ext_string (buffer, PG_OS_CODING)); +} + +DEFUN ("pq-put-line", Fpq_put_line, 2, 2, 0, /* +Send a line to the server in copy out operation. + +Returns t if the operation succeeded, nil otherwise. +*/ + (conn, string)) +{ + PGconn *P; + char *c_string; + + CHECK_PGCONN (conn); + CHECK_STRING (string); + + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); + TO_EXTERNAL_FORMAT (LISP_STRING, string, + C_STRING_ALLOCA, c_string, Qnative); + + return !PQputline (P, c_string) ? Qt : Qnil; +} + +DEFUN ("pq-get-line-async", Fpq_get_line_async, 1, 1, 0, /* +Get a line from the server in copy in operation asynchronously. + +This routine is for applications that want to do "COPY to stdout" +asynchronously, that is without blocking. Having issued the COPY command +and gotten a PGRES_COPY_OUT response, the app should call PQconsumeInput +and this routine until the end-of-data signal is detected. Unlike +PQgetline, this routine takes responsibility for detecting end-of-data. + +On each call, PQgetlineAsync will return data if a complete newline- +terminated data line is available in libpq's input buffer, or if the +incoming data line is too long to fit in the buffer offered by the caller. +Otherwise, no data is returned until the rest of the line arrives. + +If -1 is returned, the end-of-data signal has been recognized (and removed +from libpq's input buffer). The caller *must* next call PQendcopy and +then return to normal processing. + +RETURNS: + -1 if the end-of-copy-data marker has been recognized + 0 if no data is available + >0 the number of bytes returned. +The data returned will not extend beyond a newline character. If possible +a whole line will be returned at one time. But if the buffer offered by +the caller is too small to hold a line sent by the backend, then a partial +data line will be returned. This can be detected by testing whether the +last returned byte is '\n' or not. +The returned string is *not* null-terminated. +*/ + (conn)) +{ + PGconn *P; + char buffer[BLCKSZ]; + int ret; + + CHECK_PGCONN (conn); + + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); + + ret = PQgetlineAsync (P, buffer, sizeof (buffer)); + + if (ret == -1) return Qt; /* done! */ + else if (!ret) return Qnil; /* no data yet */ + else return Fcons (make_int (ret), + make_ext_string (buffer, ret, PG_OS_CODING)); +} + +DEFUN ("pq-put-nbytes", Fpq_put_nbytes, 2, 2, 0, /* +Asynchronous copy out. +*/ + (conn, data)) +{ + /* NULs are not allowed. I don't think this matters at this time. */ + PGconn *P; + char *c_data; + + CHECK_PGCONN (conn); + CHECK_STRING (data); + + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); + TO_EXTERNAL_FORMAT (LISP_STRING, data, + C_STRING_ALLOCA, c_data, Qnative); + + return !PQputnbytes (P, c_data, strlen (c_data)) ? Qt : Qnil; +} + +DEFUN ("pq-end-copy", Fpq_end_copy, 1, 1, 0, /* +End a copying operation. +*/ + (conn)) +{ + PGconn *P; + + CHECK_PGCONN (conn); + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); + + return PQendcopy (P) ? Qt : Qnil; +} + +/* The setenv suite of functions. The author of the libpq manual doesn't + know a whole lot about them, and neither do I. +*/ +#if !defined (HAVE_POSTGRESQLV7) || defined (LIBPQ_7_0_IS_FIXED) +DEFUN ("pq-setenv", Fpq_setenv, 1, 1, 0, /* +Set environmental parameters on the backend synchronously. +Returns t if the operation was successful, nil otherwise. +*/ + (conn)) +{ + PGconn *P; + + CHECK_PGCONN (conn); + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); + + return PQsetenv (P) ? Qt : Qnil; +} +#endif + +#ifdef LIBPQ_7_0_IS_FIXED + +DEFUN ("pq-setenv-start", Fpq_setenv_start, 1, 1, 0, /* +Set environmental parameters on the backend asynchronously. +A PGsetenvHandle is returned on success, nil otherwise. +*/ + (conn)) +{ + PGconn *P; + PGsetenvHandle *handle; + Lisp_setenvHandle *lseh; + + CHECK_PGCONN (conn); + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); + + handle = PQsetenvStart (P); + if (!handle) error ("out of memory?"); + + lseh = allocate_pgsetenv (); + lseh->setenv = handle; + + return make_pgsetenv (lseh); +} + +DEFUN ("pq-setenv-poll", Fpq_setenv_poll, 1, 1, 0, /* +Poll an asynchronous setenv operation for completion. +*/ + (conn)) +{ + PGconn *P; + PostgresPollingStatusType pst; + + CHECK_PGCONN (conn); + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); + + pst = PQsetenvPoll (P); + switch (pst) + { + case PGRES_POLLING_FAILED: + /* Something Bad has happened */ + { + char *e = PQerrorMessage (P); + error ("libpq: %s", e); + } + case PGRES_POLLING_OK: + return Qpgres_polling_ok; + case PGRES_POLLING_READING: + return Qpgres_polling_reading; + case PGRES_POLLING_WRITING: + return Qpgres_polling_writing; + case PGRES_POLLING_ACTIVE: + return Qpgres_polling_active; + default: + /* they've added a new field we don't know about */ + error ("Help! Unknown status code %08x from backend!", PS); + } +} + +DEFUN ("pq-setenv-abort", Fpq_setenv_abort, 1, 1, 0, /* +Attempt to abort an in-progress asynchronous setenv operation. +*/ + (handle)) +{ + PGsetenvHandle *h; + + CHECK_PGSETENV (handle); + h = (XPGSETENV (handle))->pgsetenv; + PUKE_IF_NULL (h); + + PQsetenvAbort (h); + /* PQsetenvAbort usually free(3)'s the handle, don't take any chances. */ + (XSETENV (handle))->pgsetenv = (PGsetenvHandle *)NULL; + + return Qt; +} +#endif /* LIBPQ_7_0_IS_FIXED */ + +void +syms_of_postgresql(void) +{ +#ifndef RUNNING_XEMACS_21_1 + INIT_LRECORD_IMPLEMENTATION (pgconn); + INIT_LRECORD_IMPLEMENTATION (pgresult); +#ifdef LIBPQ_7_0_IS_FIXED + INIT_LRECORD_IMPLEMENTATION (pgsetenv); +#endif +#endif + defsymbol (&Qpostgresql, "postgresql"); + + /* opaque exported types */ + defsymbol (&Qpgconnp, "pgconnp"); + defsymbol (&Qpgresultp, "pgresultp"); + + /* connection status types */ + defsymbol (&Qpg_connection_ok, "pg::connection-ok"); + defsymbol (&Qpg_connection_bad, "pg::connection-bad"); + defsymbol (&Qpg_connection_started, "pg::connection-started"); + defsymbol (&Qpg_connection_made, "pg::connection-made"); + defsymbol (&Qpg_connection_awaiting_response, "pg::connection-awaiting-response"); + defsymbol (&Qpg_connection_auth_ok, "pg::connection-auth-ok"); + defsymbol (&Qpg_connection_setenv, "pg::connection-setenv"); + + /* Fields of PGconn */ + defsymbol (&Qpqdb, "pq::db"); + defsymbol (&Qpquser, "pq::user"); + defsymbol (&Qpqpass, "pq::pass"); + defsymbol (&Qpqhost, "pq::host"); + defsymbol (&Qpqport, "pq::port"); + defsymbol (&Qpqtty, "pq::tty"); + defsymbol (&Qpqoptions, "pq::options"); + defsymbol (&Qpqstatus, "pq::status"); + defsymbol (&Qpqerrormessage, "pq::error-message"); + defsymbol (&Qpqbackendpid, "pq::backend-pid"); + + /* Query status results */ + defsymbol (&Qpgres_empty_query, "pgres::empty-query"); + defsymbol (&Qpgres_command_ok, "pgres::command-ok"); + defsymbol (&Qpgres_tuples_ok, "pgres::tuples-ok"); + defsymbol (&Qpgres_copy_out, "pgres::copy-out"); + defsymbol (&Qpgres_copy_in, "pgres::copy-in"); + defsymbol (&Qpgres_bad_response, "pgres::bad-response"); + defsymbol (&Qpgres_nonfatal_error, "pgres::nonfatal-error"); + defsymbol (&Qpgres_fatal_error, "pgres::fatal-error"); + + /* Poll status results */ + defsymbol (&Qpgres_polling_failed, "pgres::polling-failed"); + defsymbol (&Qpgres_polling_reading, "pgres::polling-reading"); + defsymbol (&Qpgres_polling_writing, "pgres::polling-writing"); + defsymbol (&Qpgres_polling_ok, "pgres::polling-ok"); + defsymbol (&Qpgres_polling_active, "pgres::polling-active"); + +#ifdef HAVE_POSTGRESQLV7 + DEFSUBR (Fpq_connect_start); + DEFSUBR (Fpq_connect_poll); +#ifdef MULE + DEFSUBR (Fpq_client_encoding); + DEFSUBR (Fpq_set_client_encoding); +#endif /* MULE */ +#endif /* HAVE_POSTGRESQLV7 */ + DEFSUBR (Fpq_conn_defaults); + DEFSUBR (Fpq_connectdb); + DEFSUBR (Fpq_finish); + DEFSUBR (Fpq_clear); + DEFSUBR (Fpq_is_busy); + DEFSUBR (Fpq_consume_input); + + DEFSUBR (Fpq_reset); +#ifdef HAVE_POSTGRESQLV7 + DEFSUBR (Fpq_reset_start); + DEFSUBR (Fpq_reset_poll); +#endif + DEFSUBR (Fpq_request_cancel); + DEFSUBR (Fpq_pgconn); + + DEFSUBR (Fpq_exec); + DEFSUBR (Fpq_send_query); + DEFSUBR (Fpq_get_result); + DEFSUBR (Fpq_result_status); + DEFSUBR (Fpq_res_status); + DEFSUBR (Fpq_result_error_message); + DEFSUBR (Fpq_ntuples); + DEFSUBR (Fpq_nfields); + DEFSUBR (Fpq_binary_tuples); + DEFSUBR (Fpq_fname); + DEFSUBR (Fpq_fnumber); + DEFSUBR (Fpq_ftype); + DEFSUBR (Fpq_fsize); + DEFSUBR (Fpq_fmod); + /***/ + DEFSUBR (Fpq_get_value); + DEFSUBR (Fpq_get_length); + DEFSUBR (Fpq_get_is_null); + DEFSUBR (Fpq_cmd_status); + DEFSUBR (Fpq_cmd_tuples); + DEFSUBR (Fpq_oid_value); + +#ifdef HAVE_POSTGRESQLV7 + DEFSUBR (Fpq_set_nonblocking); + DEFSUBR (Fpq_is_nonblocking); + DEFSUBR (Fpq_flush); +#endif + DEFSUBR (Fpq_notifies); + +#if defined (HAVE_POSTGRESQLV7) && defined(MULE) + DEFSUBR (Fpq_env_2_encoding); +#endif + + DEFSUBR (Fpq_lo_import); + DEFSUBR (Fpq_lo_export); + + DEFSUBR (Fpq_make_empty_pgresult); + + /* copy in/out functions */ + DEFSUBR (Fpq_get_line); + DEFSUBR (Fpq_put_line); + DEFSUBR (Fpq_get_line_async); + DEFSUBR (Fpq_put_nbytes); + DEFSUBR (Fpq_end_copy); + + /* The value of the setenv functions is questioned in the libpq manual. */ +#if !defined (HAVE_POSTGRESQLV7) || defined (LIBPQ_7_0_IS_FIXED) + DEFSUBR (Fpq_setenv); +#endif +#ifdef LIBPQ_7_0_IS_FIXED + DEFSUBR (Fpq_setenv_start); + DEFSUBR (Fpq_setenv_poll); + DEFSUBR (Fpq_setenv_abort); +#endif /* LIBPQ_7_0_IS_FIXED */ +} + +void +vars_of_postgresql(void) +{ + char *p; + + Fprovide (Qpostgresql); +#ifdef HAVE_POSTGRESQLV7 + Fprovide (intern ("postgresqlv7")); +#endif +#ifndef RUNNING_XEMACS_21_1 + Vpg_coding_system = Qnative; + DEFVAR_LISP ("pg-coding-system", &Vpg_coding_system /* +Default Postgres client coding system. +*/ ); +#endif + + if ((p = getenv ("PGHOST"))) + { + VXPGHOST = build_ext_string (p, PG_OS_CODING); + } + else + { + VXPGHOST = Qnil; + } + DEFVAR_LISP ("pg:host", &VXPGHOST /* +Default PostgreSQL server name. +If not set, the server running on the local host is used. The +initial value is set from the PGHOST environment variable. +*/ ); + + if ((p = getenv ("PGUSER"))) + { + VXPGUSER = build_ext_string (p, PG_OS_CODING); + } + else + { + VXPGUSER = Qnil; + } + DEFVAR_LISP ("pg:user", &VXPGUSER /* +Default PostgreSQL user name. +This value is used when connecting to a database for authentication. +The initial value is set from the PGUSER environment variable. +*/ ); + + if ((p = getenv ("PGOPTIONS"))) + { + VXPGOPTIONS = build_ext_string (p, PG_OS_CODING); + } + else + { + VXPGOPTIONS = Qnil; + } + DEFVAR_LISP ("pg:options", &VXPGOPTIONS /* +Default PostgreSQL user name. +This value is used when connecting to a database for authentication. +The initial value is set from the PGUSER environment variable. +*/ ); + + if ((p = getenv ("PGPORT"))) + { + VXPGPORT = make_int (atoi (p)); + } + else + { + VXPGPORT = Qnil; + } + DEFVAR_LISP ("pg:port", &VXPGPORT /* +Default port to connect to PostgreSQL backend. +This value is used when connecting to a database. +The initial value is set from the PGPORT environment variable. +*/ ); + + if ((p = getenv ("PGTTY"))) + { + VXPGTTY = build_ext_string (p, PG_OS_CODING); + } + else + { + VXPGTTY = Qnil; + } + DEFVAR_LISP ("pg:tty", &VXPGTTY /* +Default debugging TTY. +There is no useful setting of this variable in the XEmacs Lisp API. +The initial value is set from the PGTTY environment variable. +*/ ); + + if ((p = getenv ("PGDATABASE"))) + { + VXPGDATABASE = build_ext_string (p, PG_OS_CODING); + } + else + { + VXPGDATABASE = Qnil; + } + DEFVAR_LISP ("pg:database", &VXPGDATABASE /* +Default database to connect to. +The initial value is set from the PGDATABASE environment variable. +*/ ); + + if ((p = getenv ("PGREALM"))) + { + VXPGREALM = build_ext_string (p, PG_OS_CODING); + } + else + { + VXPGREALM = Qnil; + } + DEFVAR_LISP ("pg:realm", &VXPGREALM /* +Default kerberos realm to use for authentication. +The initial value is set from the PGREALM environment variable. +*/ ); + +#ifdef MULE + /* It's not clear whether this is any use. My intent is to + autodetect the coding system from the database. */ + if ((p = getenv ("PGCLIENTENCODING"))) + { + VXPGCLIENTENCODING = build_ext_string (p, PG_OS_CODING); + } + else + { + VXPGCLIENTENCODING = Qnil; + } + DEFVAR_LISP ("pg:client-encoding", &VXPGCLIENTENCODING /* +Default client encoding to use. +The initial value is set from the PGCLIENTENCODING environment variable. +*/ ); +#endif + +#if !defined(HAVE_POSTGRESQLV7) + if ((p = getenv ("PGAUTHTYPE"))) + { + VXPGAUTHTYPE = build_ext_string (p, PG_OS_CODING); + } + else + { + VXPGAUTHTYPE = Qnil; + } + DEFVAR_LISP ("pg:authtype", &VXPGAUTHTYPE /* +Default authentication to use. +The initial value is set from the PGAUTHTYPE environment variable. + +WARNING: This variable has gone away in versions of PostgreSQL newer +than 6.5. +*/ ); +#endif + + if ((p = getenv ("PGGEQO"))) + { + VXPGGEQO = build_ext_string (p, PG_OS_CODING); + } + else + { + VXPGGEQO = Qnil; + } + DEFVAR_LISP ("pg:geqo", &VXPGGEQO /* +Genetic Query Optimizer options. +The initial value is set from the PGGEQO environment variable. +*/ ); + + if ((p = getenv ("PGCOSTINDEX"))) + { + VXPGCOSTINDEX = build_ext_string (p, PG_OS_CODING); + } + else + { + VXPGCOSTINDEX = Qnil; + } + DEFVAR_LISP ("pg:cost-index", &VXPGCOSTINDEX /* +Default cost index options. +The initial value is set from the PGCOSTINDEX environment variable. +*/ ); + + if ((p = getenv ("PGCOSTHEAP"))) + { + VXPGCOSTHEAP = build_ext_string (p, PG_OS_CODING); + } + else + { + VXPGCOSTHEAP = Qnil; + } + DEFVAR_LISP ("pg:cost-heap", &VXPGCOSTHEAP /* +Default cost heap options. +The initial value is set from the PGCOSTHEAP environment variable. +*/ ); + + if ((p = getenv ("PGTZ"))) + { + VXPGTZ = build_ext_string (p, PG_OS_CODING); + } + else + { + VXPGTZ = Qnil; + } + DEFVAR_LISP ("pg:tz", &VXPGTZ /* +Default timezone to use. +The initial value is set from the PGTZ environment variable. +*/ ); + + if ((p = getenv ("PGDATESTYLE"))) + { + VXPGDATESTYLE = build_ext_string (p, PG_OS_CODING); + } + else + { + VXPGDATESTYLE = Qnil; + } + DEFVAR_LISP ("pg:date-style", &VXPGDATESTYLE /* +Default date style to use. +The initial value is set from the PGDATESTYLE environment variable. +*/ ); +} diff -r 9f011ab08d48 -r 2f8bb876ab1d src/postgresql.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/postgresql.h Mon Aug 13 11:16:07 2007 +0200 @@ -0,0 +1,87 @@ +/* + postgresql.h -- Emacs Lisp binding to libpq.so + Copyright (C) 2000 Electrotechnical Laboratory, JAPAN. + Licensed to the Free Software Foundation. + + Author: SL Baur + Maintainer: SL Baur + +Please send patches to this file to me first before submitting them to +xemacs-patches. +*/ + +#ifndef XEMACS_POSTGRESQL_H__ +#define XEMACS_POSTGRESQL_H__ 1 + +#define BLCKSZ 8192 /* size of a default Postres disk block */ +/* + This file contains the GCC bug workaround code for the private + LRECORD types. +*/ + +/* PGconn is an opaque object and we need to be able to store them in + Lisp code because libpq supports multiple connections. +*/ +struct Lisp_PGconn +{ + struct lcrecord_header header; + PGconn *pgconn; +}; +typedef struct Lisp_PGconn Lisp_PGconn; + +DECLARE_LRECORD (pgconn, Lisp_PGconn); + +#define XPGCONN(x) XRECORD (x, pgconn, Lisp_PGconn) +#define XSETPGCONN(x, p) XSETRECORD (x, p, pgconn) +#define PGCONNP(x) RECORDP (x, pgconn) +#define CHECK_PGCONN(x) CHECK_RECORD (x, pgconn) +#define CONCHECK_PGCONN(x) CONCHECK_RECORD (x, pgconn) + +/****/ + +/* PGresult is an opaque object and we need to be able to store them in + Lisp code. +*/ +struct Lisp_PGresult +{ + struct lcrecord_header header; + PGresult *pgresult; +}; +typedef struct Lisp_PGresult Lisp_PGresult; + +DECLARE_LRECORD (pgresult, Lisp_PGresult); + +#define XPGRESULT(x) XRECORD (x, pgresult, Lisp_PGresult) +#define XSETPGRESULT(x, p) XSETRECORD (x, p, pgresult) +#define PGRESULTP(x) RECORDP (x, pgresult) +#define CHECK_PGRESULT(x) CHECK_RECORD (x, pgresult) +#define CONCHECK_PGRESULT(x) CONCHECK_RECORD (x, pgresult) + +/****/ +#ifdef HAVE_POSTGRESQLV7 + +#ifdef LIBPQ_7_0_IS_FIXED /* this is broken in released 7.0b1 */ + +/* PGsetenvHandle is an opaque object and we need to be able to store + them in Lisp code in order to make asynchronous environment calls. +*/ +struct Lisp_PGsetenvHandle +{ + struct lcrecord_header header; + PGsetenvHandle *pgsetenv; +}; +typedef struct Lisp_PGsetenvHandle Lisp_PGsetenvHandle; + +DECLARE_LRECORD (pgsetenv, Lisp_PGsetenvHandle); + +#define XPGSETENV(x) XRECORD (x, pgsetenv, Lisp_PGsetenvHandle) +#define XSETPGSETENV(x, p) XSETRECORD (x, p, pgsetenv) +#define PGSETENVP(x) RECORDP (x, pgsetenv) +#define CHECK_PGSETENV(x) CHECK_RECORD (x, pgsetenv) +#define CONCHECK_PGSETENV(x) CONCHECK_RECORD (x, pgsetenv) + +#endif /* LIBPQ_7_0_IS_FIXED */ + +#endif /* HAVE_POSTGRESQLV7 */ + +#endif /* XEMACS_POSTGRESQL_H__ */ diff -r 9f011ab08d48 -r 2f8bb876ab1d src/print.c --- a/src/print.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/print.c Mon Aug 13 11:16:07 2007 +0200 @@ -1,6 +1,6 @@ /* Lisp object printing and output streams. Copyright (C) 1985, 1986, 1988, 1992-1995 Free Software Foundation, Inc. - Copyright (C) 1995, 1996 Ben Wing. + Copyright (C) 1995, 1996, 2000 Ben Wing. This file is part of XEmacs. @@ -38,6 +38,9 @@ #include "insdel.h" #include "lstream.h" #include "sysfile.h" +#ifdef WINDOWSNT +#include "console-msw.h" +#endif #include #include @@ -103,40 +106,40 @@ int stdout_needs_newline; -/* Write a string (in internal format) to stdio stream STREAM. */ - -void -write_string_to_stdio_stream (FILE *stream, struct console *con, - const Bufbyte *str, - Bytecount offset, Bytecount len, - Lisp_Object coding_system) +static void +std_handle_out_external (FILE *stream, Lisp_Object lstream, + const Extbyte *extptr, Extcount extlen, + /* is this really stdout/stderr? + (controls termscript writing) */ + int output_is_std_handle, + int must_flush) { - Extcount extlen; - const Extbyte *extptr; - - TO_EXTERNAL_FORMAT (DATA, (str + offset, len), - ALLOCA, (extptr, extlen), - coding_system); if (stream) { - fwrite (extptr, 1, extlen, stream); +#ifdef WINDOWSNT + /* we typically have no useful stdout/stderr under windows if we're + being invoked graphically. */ + if (!noninteractive) + msw_output_console_string (extptr, extlen); + else +#endif + { + fwrite (extptr, 1, extlen, stream); #ifdef WINDOWSNT - /* Q122442 says that pipes are "treated as files, not as - devices", and that this is a feature. Before I found that - article, I thought it was a bug. Thanks MS, I feel much - better now. - kkm */ - if (stream == stdout || stream == stderr) - fflush (stream); + /* Q122442 says that pipes are "treated as files, not as + devices", and that this is a feature. Before I found that + article, I thought it was a bug. Thanks MS, I feel much + better now. - kkm */ + must_flush = 1; #endif + if (must_flush) + fflush (stream); + } } else - { - assert (CONSOLE_TTY_P (con)); - Lstream_write (XLSTREAM (CONSOLE_TTY_DATA (con)->outstream), - extptr, extlen); - } - if (stream == stdout || stream == stderr || - (!stream && CONSOLE_TTY_DATA (con)->is_stdio)) + Lstream_write (XLSTREAM (lstream), extptr, extlen); + + if (output_is_std_handle) { if (termscript) { @@ -147,6 +150,113 @@ } } +/* #### The following function should be replaced a call to the + emacs_doprnt_*() functions. This is the only way to ensure that + I18N3 works properly (many implementations of the *printf() + functions, including the ones included in glibc, do not implement + the %###$ argument-positioning syntax). + + Note, however, that to do this, we'd have to + + 1) pre-allocate all the lstreams and do whatever else was necessary + to make sure that no allocation occurs, since these functions may be + called from fatal_error_signal(). + + 2) (to be really correct) make a new lstream that outputs using + msw_output_console_string(). */ + +static int +std_handle_out_va (FILE *stream, const char *fmt, va_list args) +{ + Bufbyte kludge[8192]; + Extbyte *extptr; + Extcount extlen; + int retval; + + retval = vsprintf ((char *) kludge, fmt, args); + TO_EXTERNAL_FORMAT (DATA, (kludge, strlen ((char *) kludge)), + ALLOCA, (extptr, extlen), + Qnative); + std_handle_out_external (stream, Qnil, extptr, extlen, 1, 1); + return retval; +} + +/* Output portably to stderr or its equivalent; call GETTEXT on the + format string. Automatically flush when done. */ + +int +stderr_out (const char *fmt, ...) +{ + int retval; + va_list args; + va_start (args, fmt); + retval = std_handle_out_va (stderr, GETTEXT (fmt), args); + va_end (args); + return retval; +} + +/* Output portably to stdout or its equivalent; call GETTEXT on the + format string. Automatically flush when done. */ + +int +stdout_out (const char *fmt, ...) +{ + int retval; + va_list args; + va_start (args, fmt); + retval = std_handle_out_va (stdout, GETTEXT (fmt), args); + va_end (args); + return retval; +} + +DOESNT_RETURN +fatal (const char *fmt, ...) +{ + va_list args; + va_start (args, fmt); + + stderr_out ("\nXEmacs: "); + std_handle_out_va (stderr, GETTEXT (fmt), args); + stderr_out ("\n"); + + va_end (args); + exit (1); +} + +/* Write a string (in internal format) to stdio stream STREAM. */ + +void +write_string_to_stdio_stream (FILE *stream, struct console *con, + const Bufbyte *str, + Bytecount offset, Bytecount len, + Lisp_Object coding_system, + int must_flush) +{ + Extcount extlen; + const Extbyte *extptr; + + /* #### yuck! sometimes this function is called with string data, + and the following call may gc. */ + { + Bufbyte *puta = (Bufbyte *) alloca (len); + memcpy (puta, str + offset, len); + TO_EXTERNAL_FORMAT (DATA, (puta, len), + ALLOCA, (extptr, extlen), + coding_system); + } + + if (stream) + std_handle_out_external (stream, Qnil, extptr, extlen, + stream == stdout || stream == stderr, must_flush); + else + { + assert (CONSOLE_TTY_P (con)); + std_handle_out_external (0, CONSOLE_TTY_DATA (con)->outstream, + extptr, extlen, + CONSOLE_TTY_DATA (con)->is_stdio, must_flush); + } +} + /* Write a string to the output location specified in FUNCTION. Arguments NONRELOC, RELOC, OFFSET, and LEN are as in buffer_insert_string_1() in insdel.c. */ @@ -238,7 +348,7 @@ else if (EQ (function, Qt) || EQ (function, Qnil)) { write_string_to_stdio_stream (stdout, 0, newnonreloc, offset, len, - Qterminal); + Qterminal, print_unbuffered); } else { @@ -1427,6 +1537,10 @@ to stderr. You can use this function to write directly to the terminal. This function can be used as the STREAM argument of Fprint() or the like. +Under MS Windows, this writes output to the console window (which is +created, if necessary), unless XEmacs is being run noninteractively +(i.e. using the `-batch' argument). + If you have opened a termscript file (using `open-termscript'), then the output also will be logged to this file. */ @@ -1461,7 +1575,7 @@ write_string_to_stdio_stream (file, con, XSTRING_DATA (char_or_string), 0, XSTRING_LENGTH (char_or_string), - Qterminal); + Qterminal, 1); else { Bufbyte str[MAX_EMCHAR_LEN]; @@ -1469,7 +1583,7 @@ CHECK_CHAR_COERCE_INT (char_or_string); len = set_charptr_emchar (str, XCHAR (char_or_string)); - write_string_to_stdio_stream (file, con, str, 0, len, Qterminal); + write_string_to_stdio_stream (file, con, str, 0, len, Qterminal, 1); } return char_or_string; @@ -1542,7 +1656,6 @@ { debug_print_no_newline (debug_print_obj); stderr_out ("\n"); - fflush (stderr); } /* Debugging kludge -- unbuffered */ @@ -1575,7 +1688,6 @@ Fbacktrace (Qexternal_debugging_output, Qt); stderr_out ("\n"); - fflush (stderr); Vinhibit_quit = old_inhibit_quit; Vprint_level = old_print_level; @@ -1593,13 +1705,11 @@ int first = 1; struct backtrace *bt = backtrace_list; stderr_out (" ["); - fflush (stderr); while (length > 0 && bt) { if (!first) { stderr_out (", "); - fflush (stderr); } if (COMPILED_FUNCTIONP (*bt->function)) { @@ -1612,15 +1722,12 @@ if (!NILP (ann)) { stderr_out (""); - fflush (stderr); } else { stderr_out (""); - fflush (stderr); } } else @@ -1630,7 +1737,6 @@ bt = bt->next; } stderr_out ("]\n"); - fflush (stderr); } #endif /* debugging kludge */ diff -r 9f011ab08d48 -r 2f8bb876ab1d src/process-nt.c --- a/src/process-nt.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/process-nt.c Mon Aug 13 11:16:07 2007 +0200 @@ -2,7 +2,7 @@ Copyright (C) 1985, 1986, 1987, 1988, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 1995, 1996 Ben Wing. + Copyright (C) 1995, 1996, 2000 Ben Wing. This file is part of XEmacs. @@ -26,15 +26,15 @@ #include #include "lisp.h" +#include "console-msw.h" #include "hash.h" #include "lstream.h" #include "process.h" #include "procimpl.h" #include "sysdep.h" -#ifndef __MINGW32__ #include -#else +#ifdef __MINGW32__ #include #endif #include @@ -52,9 +52,22 @@ struct nt_process_data { HANDLE h_process; + DWORD dwProcessId; + HWND hwnd; /* console window */ int need_enable_child_signals; }; +/* Control whether create_child causes the process to inherit Emacs' + console window, or be given a new one of its own. The default is + nil, to allow multiple DOS programs to run on Win95. Having separate + consoles also allows Emacs to cleanly terminate process groups. */ +Lisp_Object Vmswindows_start_process_share_console; + +/* Control whether create_child cause the process to inherit Emacs' + error mode setting. The default is t, to minimize the possibility of + subprocesses blocking when accessing unmounted drives. */ +Lisp_Object Vmswindows_start_process_inherit_error_mode; + #define NT_DATA(p) ((struct nt_process_data*)((p)->process_data)) /*-----------------------------------------------------------------------*/ @@ -68,6 +81,21 @@ { return (NT_DATA (p)->h_process); } + +static struct Lisp_Process * +find_process_from_pid (DWORD pid) +{ + Lisp_Object tail, proc; + + for (tail = Vprocess_list; CONSP (tail); tail = XCDR (tail)) + { + proc = XCAR (tail); + if (NT_DATA (XPROCESS (proc))->dwProcessId == pid) + return XPROCESS (proc); + } + return 0; +} + /*-----------------------------------------------------------------------*/ /* Running remote threads. See Microsoft Systems Journal 1994 Number 5 */ @@ -224,6 +252,8 @@ /* Sending signals */ /*-----------------------------------------------------------------------*/ +/* ---------------------------- the NT way ------------------------------- */ + /* * We handle the following signals: * @@ -287,19 +317,34 @@ * Return nonzero if successful. */ -/* This code assigns a return value of GetProcAddress to function pointers - of many different types. Instead of heavy obscure casts, we just disable - warnings about assignments to different function pointer types. */ -#pragma warning (disable : 4113) - static int -send_signal (HANDLE h_process, int signo) +send_signal_the_nt_way (struct nt_process_data *cp, int pid, int signo) { + HANDLE h_process; HMODULE h_kernel = GetModuleHandle ("kernel32"); + int close_process = 0; DWORD retval; assert (h_kernel != NULL); + if (cp) + { + pid = cp->dwProcessId; + h_process = cp->h_process; + } + else + { + close_process = 1; + /* Try to open the process with required privileges */ + h_process = OpenProcess (PROCESS_CREATE_THREAD + | PROCESS_QUERY_INFORMATION + | PROCESS_VM_OPERATION + | PROCESS_VM_WRITE, + FALSE, pid); + if (!h_process) + return 0; + } + switch (signo) { case SIGKILL: @@ -308,7 +353,9 @@ case SIGHUP: { sigkill_data d; - d.adr_ExitProcess = GetProcAddress (h_kernel, "ExitProcess"); + + d.adr_ExitProcess = + (void (WINAPI *) (UINT)) GetProcAddress (h_kernel, "ExitProcess"); assert (d.adr_ExitProcess); retval = run_in_other_process (h_process, (LPTHREAD_START_ROUTINE)sigkill_proc, @@ -319,6 +366,7 @@ { sigint_data d; d.adr_GenerateConsoleCtrlEvent = + (BOOL (WINAPI *) (DWORD, DWORD)) GetProcAddress (h_kernel, "GenerateConsoleCtrlEvent"); assert (d.adr_GenerateConsoleCtrlEvent); d.event = CTRL_C_EVENT; @@ -331,6 +379,8 @@ assert (0); } + if (close_process) + CloseHandle (h_process); return (int)retval > 0 ? 1 : 0; } @@ -345,6 +395,7 @@ assert (h_kernel != NULL); d.adr_SetConsoleCtrlHandler = + (BOOL (WINAPI *) (LPVOID, BOOL)) GetProcAddress (h_kernel, "SetConsoleCtrlHandler"); assert (d.adr_SetConsoleCtrlHandler); run_in_other_process (h_process, (LPTHREAD_START_ROUTINE)sig_enable_proc, @@ -353,6 +404,214 @@ #pragma warning (default : 4113) +/* ---------------------------- the 95 way ------------------------------- */ + +static BOOL CALLBACK +find_child_console (HWND hwnd, struct nt_process_data *cp) +{ + DWORD thread_id; + DWORD process_id; + + thread_id = GetWindowThreadProcessId (hwnd, &process_id); + if (process_id == cp->dwProcessId) + { + char window_class[32]; + + GetClassName (hwnd, window_class, sizeof (window_class)); + if (strcmp (window_class, + msw_windows9x_p () + ? "tty" + : "ConsoleWindowClass") == 0) + { + cp->hwnd = hwnd; + return FALSE; + } + } + /* keep looking */ + return TRUE; +} + +static int +send_signal_the_95_way (struct nt_process_data *cp, int pid, int signo) +{ + HANDLE h_process; + int close_process = 0; + int rc = 1; + + if (cp) + { + pid = cp->dwProcessId; + h_process = cp->h_process; + + /* Try to locate console window for process. */ + EnumWindows (find_child_console, (LPARAM) cp); + } + else + { + close_process = 1; + /* Try to open the process with required privileges */ + h_process = OpenProcess (PROCESS_TERMINATE, FALSE, pid); + if (!h_process) + return 0; + } + + if (signo == SIGINT) + { + if (NILP (Vmswindows_start_process_share_console) && cp && cp->hwnd) + { + BYTE control_scan_code = (BYTE) MapVirtualKey (VK_CONTROL, 0); + BYTE vk_break_code = VK_CANCEL; + BYTE break_scan_code = (BYTE) MapVirtualKey (vk_break_code, 0); + HWND foreground_window; + + if (break_scan_code == 0) + { + /* Fake Ctrl-C if we can't manage Ctrl-Break. */ + vk_break_code = 'C'; + break_scan_code = (BYTE) MapVirtualKey (vk_break_code, 0); + } + + foreground_window = GetForegroundWindow (); + if (foreground_window) + { + /* NT 5.0, and apparently also Windows 98, will not allow + a Window to be set to foreground directly without the + user's involvement. The workaround is to attach + ourselves to the thread that owns the foreground + window, since that is the only thread that can set the + foreground window. */ + DWORD foreground_thread, child_thread; + foreground_thread = + GetWindowThreadProcessId (foreground_window, NULL); + if (foreground_thread == GetCurrentThreadId () + || !AttachThreadInput (GetCurrentThreadId (), + foreground_thread, TRUE)) + foreground_thread = 0; + + child_thread = GetWindowThreadProcessId (cp->hwnd, NULL); + if (child_thread == GetCurrentThreadId () + || !AttachThreadInput (GetCurrentThreadId (), + child_thread, TRUE)) + child_thread = 0; + + /* Set the foreground window to the child. */ + if (SetForegroundWindow (cp->hwnd)) + { + /* Generate keystrokes as if user had typed Ctrl-Break or + Ctrl-C. */ + keybd_event (VK_CONTROL, control_scan_code, 0, 0); + keybd_event (vk_break_code, break_scan_code, + (vk_break_code == 'C' ? 0 : KEYEVENTF_EXTENDEDKEY), 0); + keybd_event (vk_break_code, break_scan_code, + (vk_break_code == 'C' ? 0 : KEYEVENTF_EXTENDEDKEY) + | KEYEVENTF_KEYUP, 0); + keybd_event (VK_CONTROL, control_scan_code, + KEYEVENTF_KEYUP, 0); + + /* Sleep for a bit to give time for Emacs frame to respond + to focus change events (if Emacs was active app). */ + Sleep (100); + + SetForegroundWindow (foreground_window); + } + /* Detach from the foreground and child threads now that + the foreground switching is over. */ + if (foreground_thread) + AttachThreadInput (GetCurrentThreadId (), + foreground_thread, FALSE); + if (child_thread) + AttachThreadInput (GetCurrentThreadId (), + child_thread, FALSE); + } + } + /* Ctrl-Break is NT equivalent of SIGINT. */ + else if (!GenerateConsoleCtrlEvent (CTRL_BREAK_EVENT, pid)) + { +#if 0 /* FSF Emacs */ + DebPrint (("sys_kill.GenerateConsoleCtrlEvent return %d " + "for pid %lu\n", GetLastError (), pid)); + errno = EINVAL; +#endif + rc = 0; + } + } + else + { + if (NILP (Vmswindows_start_process_share_console) && cp && cp->hwnd) + { +#if 1 + if (msw_windows9x_p ()) + { +/* + Another possibility is to try terminating the VDM out-right by + calling the Shell VxD (id 0x17) V86 interface, function #4 + "SHELL_Destroy_VM", ie. + + mov edx,4 + mov ebx,vm_handle + call shellapi + + First need to determine the current VM handle, and then arrange for + the shellapi call to be made from the system vm (by using + Switch_VM_and_callback). + + Could try to invoke DestroyVM through CallVxD. + +*/ +#if 0 + /* On Win95, posting WM_QUIT causes the 16-bit subsystem + to hang when cmdproxy is used in conjunction with + command.com for an interactive shell. Posting + WM_CLOSE pops up a dialog that, when Yes is selected, + does the same thing. TerminateProcess is also less + than ideal in that subprocesses tend to stick around + until the machine is shutdown, but at least it + doesn't freeze the 16-bit subsystem. */ + PostMessage (cp->hwnd, WM_QUIT, 0xff, 0); +#endif + if (!TerminateProcess (h_process, 0xff)) + { +#if 0 /* FSF Emacs */ + DebPrint (("sys_kill.TerminateProcess returned %d " + "for pid %lu\n", GetLastError (), pid)); + errno = EINVAL; +#endif + rc = 0; + } + } + else +#endif + PostMessage (cp->hwnd, WM_CLOSE, 0, 0); + } + /* Kill the process. On W32 this doesn't kill child processes + so it doesn't work very well for shells which is why it's not + used in every case. */ + else if (!TerminateProcess (h_process, 0xff)) + { +#if 0 /* FSF Emacs */ + DebPrint (("sys_kill.TerminateProcess returned %d " + "for pid %lu\n", GetLastError (), pid)); + errno = EINVAL; +#endif + rc = 0; + } + } + + if (close_process) + CloseHandle (h_process); + + return rc; +} + +/* -------------------------- all-OS functions ---------------------------- */ + +static int +send_signal (struct nt_process_data *cp, int pid, int signo) +{ + return send_signal_the_nt_way (cp, pid, signo) + || send_signal_the_95_way (cp, pid, signo); +} + /* * Signal error if SIGNO is not supported */ @@ -383,8 +642,8 @@ nt_finalize_process_data (Lisp_Process *p, int for_disksave) { assert (!for_disksave); - if (NT_DATA(p)->h_process) - CloseHandle (NT_DATA(p)->h_process); + if (NT_DATA (p)->h_process) + CloseHandle (NT_DATA (p)->h_process); } /* @@ -416,6 +675,13 @@ signal_simple_error_2 ("Error starting", image_file, lisp_strerror (errno)); } +static void +ensure_console_window_exists () +{ + if (msw_windows9x_p ()) + msw_hide_console (); +} + static int nt_create_process (Lisp_Process *p, Lisp_Object *argv, int nargv, @@ -595,6 +861,7 @@ STARTUPINFO si; PROCESS_INFORMATION pi; DWORD err; + DWORD flags; xzero (si); si.dwFlags = STARTF_USESHOWWINDOW; @@ -607,9 +874,19 @@ si.dwFlags |= STARTF_USESTDHANDLES; } - err = (CreateProcess (NULL, command_line, NULL, NULL, TRUE, - CREATE_NEW_CONSOLE | CREATE_NEW_PROCESS_GROUP - | CREATE_SUSPENDED, + flags = CREATE_SUSPENDED; + if (msw_windows9x_p ()) + flags |= (!NILP (Vmswindows_start_process_share_console) + ? CREATE_NEW_PROCESS_GROUP + : CREATE_NEW_CONSOLE); + else + flags |= CREATE_NEW_CONSOLE | CREATE_NEW_PROCESS_GROUP; + if (NILP (Vmswindows_start_process_inherit_error_mode)) + flags |= CREATE_DEFAULT_ERROR_MODE; + + ensure_console_window_exists (); + + err = (CreateProcess (NULL, command_line, NULL, NULL, TRUE, flags, proc_env, (char *) XSTRING_DATA (cur_dir), &si, &pi) ? 0 : GetLastError ()); @@ -636,6 +913,7 @@ if (do_io) { NT_DATA(p)->h_process = pi.hProcess; + NT_DATA(p)->dwProcessId = pi.dwProcessId; init_process_io_handles (p, (void*)hmyslurp, (void*)hmyshove, 0); } else @@ -789,18 +1067,18 @@ /* Enable child signals if necessary. This may lose the first but it's better than nothing. */ - if (NT_DATA(p)->need_enable_child_signals > 0) + if (NT_DATA (p)->need_enable_child_signals > 0) { - enable_child_signals(NT_DATA(p)->h_process); - NT_DATA(p)->need_enable_child_signals = 0; + enable_child_signals (NT_DATA(p)->h_process); + NT_DATA (p)->need_enable_child_signals = 0; } /* Signal error if SIGNO cannot be sent */ validate_signal_number (signo); /* Send signal */ - if (!send_signal (NT_DATA(p)->h_process, signo)) - error ("Cannot send signal to process"); + if (!send_signal (NT_DATA (p), 0, signo)) + signal_simple_error ("Cannot send signal to process", proc); } /* @@ -812,26 +1090,13 @@ static int nt_kill_process_by_pid (int pid, int signo) { - HANDLE h_process; - int send_result; - + struct Lisp_Process *p; + /* Signal error if SIGNO cannot be sent */ validate_signal_number (signo); - /* Try to open the process with required privileges */ - h_process = OpenProcess (PROCESS_CREATE_THREAD - | PROCESS_QUERY_INFORMATION - | PROCESS_VM_OPERATION - | PROCESS_VM_WRITE, - FALSE, pid); - if (h_process == NULL) - return -1; - - send_result = send_signal (h_process, signo); - - CloseHandle (h_process); - - return send_result ? 0 : -1; + p = find_process_from_pid (pid); + return send_signal (p ? NT_DATA (p) : 0, pid, signo) ? 0 : -1; } /*-----------------------------------------------------------------------*/ @@ -942,9 +1207,11 @@ deactivate and close it via delete-process */ static void -nt_open_network_stream (Lisp_Object name, Lisp_Object host, Lisp_Object service, +nt_open_network_stream (Lisp_Object name, Lisp_Object host, + Lisp_Object service, Lisp_Object protocol, void** vinfd, void** voutfd) { + /* !!#### not Mule-ized */ struct sockaddr_in address; SOCKET s; int port; @@ -953,8 +1220,7 @@ CHECK_STRING (host); if (!EQ (protocol, Qtcp)) - error ("Unsupported protocol \"%s\"", - string_data (symbol_name (XSYMBOL (protocol)))); + signal_simple_error ("Unsupported protocol", protocol); if (INTP (service)) port = htons ((unsigned short) XINT (service)); @@ -964,7 +1230,7 @@ CHECK_STRING (service); svc_info = getservbyname ((char *) XSTRING_DATA (service), "tcp"); if (svc_info == 0) - error ("Unknown service \"%s\"", XSTRING_DATA (service)); + signal_simple_error ("Unknown service", service); port = svc_info->s_port; } @@ -1026,18 +1292,20 @@ connect_failed: closesocket (s); - if (INTP (service)) { - warn_when_safe(Qstream, Qwarning, - "failure to open network stream to host \"%s\" for service \"%d\"", - XSTRING_DATA (host), - (unsigned short) XINT (service)); - } - else { - warn_when_safe(Qstream, Qwarning, - "failure to open network stream to host \"%s\" for service \"%s\"", - XSTRING_DATA (host), - XSTRING_DATA (service)); - } + if (INTP (service)) + { + warn_when_safe (Qstream, Qwarning, + "failure to open network stream to host \"%s\" for service \"%d\"", + XSTRING_DATA (host), + (unsigned short) XINT (service)); + } + else + { + warn_when_safe (Qstream, Qwarning, + "failure to open network stream to host \"%s\" for service \"%s\"", + XSTRING_DATA (host), + XSTRING_DATA (service)); + } report_file_error ("connection failed", list2 (host, name)); } @@ -1077,4 +1345,22 @@ void vars_of_process_nt (void) { + DEFVAR_LISP ("mswindows-start-process-share-console", + &Vmswindows_start_process_share_console /* +When nil, new child processes are given a new console. +When non-nil, they share the Emacs console; this has the limitation of +allowing only only DOS subprocess to run at a time (whether started directly +or indirectly by Emacs), and preventing Emacs from cleanly terminating the +subprocess group, but may allow Emacs to interrupt a subprocess that doesn't +otherwise respond to interrupts from Emacs. +*/ ); + Vmswindows_start_process_share_console = Qnil; + + DEFVAR_LISP ("mswindows-start-process-inherit-error-mode", + &Vmswindows_start_process_inherit_error_mode /* + "When nil, new child processes revert to the default error mode. +When non-nil, they inherit their error mode setting from Emacs, which stops +them blocking when trying to access unmounted drives etc. +*/ ); + Vmswindows_start_process_inherit_error_mode = Qt; } diff -r 9f011ab08d48 -r 2f8bb876ab1d src/process-unix.c --- a/src/process-unix.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/process-unix.c Mon Aug 13 11:16:07 2007 +0200 @@ -1765,7 +1765,7 @@ #ifdef HAVE_MULTICAST -/* Didier Verna Nov. 28 1997. +/* Didier Verna Nov. 28 1997. This function is similar to open-network-stream-internal, but provides a mean to open an UDP multicast connection instead of a TCP one. Like in the diff -r 9f011ab08d48 -r 2f8bb876ab1d src/process.h --- a/src/process.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/process.h Mon Aug 13 11:16:07 2007 +0200 @@ -37,7 +37,8 @@ #else /* not NO_SUBPROCESSES */ -/* Only process.c needs to know about the guts of this */ +/* struct Lisp_Process is defined in procimpl.h; only process-*.c need + to know about the guts of it. */ DECLARE_LRECORD (process, Lisp_Process); #define XPROCESS(x) XRECORD (x, process, Lisp_Process) diff -r 9f011ab08d48 -r 2f8bb876ab1d src/redisplay-msw.c --- a/src/redisplay-msw.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/redisplay-msw.c Mon Aug 13 11:16:07 2007 +0200 @@ -202,16 +202,17 @@ /* * Given F, retrieve device context. F can be a display frame, or - * a print job. + * a print job. For a print job, page is also started when printer's + * device context is first time requested. */ -INLINE HDC -get_frame_dc (struct frame *f) +static HDC +get_frame_dc (struct frame *f, int start_page_p) { if (FRAME_MSWINDOWS_P (f)) return FRAME_MSWINDOWS_DC (f); else { - if (!FRAME_MSPRINTER_PAGE_STARTED (f)) + if (start_page_p && !FRAME_MSPRINTER_PAGE_STARTED (f)) msprinter_start_page (f); return DEVICE_MSPRINTER_HDC (XDEVICE (FRAME_DEVICE (f))); } @@ -221,13 +222,14 @@ * Given F, retrieve compatible device context. F can be a display * frame, or a print job. */ -INLINE HDC +static HDC get_frame_compdc (struct frame *f) { - if (FRAME_MSWINDOWS_P (f)) - return FRAME_MSWINDOWS_CDC (f); + struct device *d = XDEVICE (FRAME_DEVICE (f)); + if (DEVICE_MSWINDOWS_P (d)) + return DEVICE_MSWINDOWS_HCDC (d); else - return FRAME_MSPRINTER_CDC (f); + return DEVICE_MSPRINTER_HCDC (d); } /***************************************************************************** @@ -285,7 +287,7 @@ struct rune *rb, int start_pixpos) { struct frame *f = XFRAME (w->frame); - HDC hdc = get_frame_dc (f); + HDC hdc = get_frame_dc (f, 1); RECT rect = { rb->xpos, DISPLAY_LINE_YPOS (dl), rb->xpos+rb->width, DISPLAY_LINE_YEND (dl) }; @@ -338,7 +340,7 @@ struct face_cachel *cachel=0; Lisp_Object font = Qnil; int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d)); - HDC hdc = get_frame_dc (f); + HDC hdc = get_frame_dc (f, 1); unsigned int local_face_index=0; char *p_char = NULL; int n_char = 0; @@ -458,7 +460,7 @@ struct frame *f = XFRAME (w->frame); /* struct device *d = XDEVICE (f->device);*/ Lisp_Object window; - HDC hdc = get_frame_dc (f); + HDC hdc = get_frame_dc (f, 1); int clip_end; Lisp_Object bg_pmap; int len = Dynarr_length (buf); @@ -571,7 +573,7 @@ struct display_box* db, struct display_glyph_area* dga) { - HDC hdc = get_frame_dc (f); + HDC hdc = get_frame_dc (f, 1); HDC hcompdc = get_frame_compdc (f); HGDIOBJ old=NULL; COLORREF bgcolor = GetBkColor (hdc); @@ -680,7 +682,7 @@ int cursor_height, int bg_pixmap) { struct frame *f = XFRAME (w->frame); - HDC hdc = get_frame_dc (f); + HDC hdc = get_frame_dc (f, 1); Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance); Lisp_Object window; @@ -731,7 +733,7 @@ if (IntersectRect (&rect_paint, &rect_dead, prc)) { struct frame *f = XFRAME (WINDOW_FRAME (w)); - FillRect (get_frame_dc (f), &rect_paint, + FillRect (get_frame_dc (f, 1), &rect_paint, (HBRUSH) (COLOR_BTNFACE+1)); } } @@ -910,7 +912,7 @@ { RECT rect = { x, y, x + width, y + height }; Lisp_Object color = WINDOW_FACE_CACHEL_BACKGROUND (w, findex); - HDC hdc = get_frame_dc (f); + HDC hdc = get_frame_dc (f, 1); mswindows_update_dc (hdc, Qnil, color, Qnil); DrawEdge (hdc, &rect, edge, border); @@ -969,7 +971,7 @@ mswindows_flash (struct device *d) { struct frame *f = device_selected_frame (d); - HDC hdc = get_frame_dc (f); + HDC hdc = get_frame_dc (f, 1); RECT rc; GetClientRect (FRAME_MSWINDOWS_HANDLE (f), &rc); @@ -1121,6 +1123,7 @@ Lisp_Object instance; struct display_box dbox; struct display_glyph_area dga; + redisplay_calculate_display_boxes (dl, rb->xpos, rb->object.dglyph.xoffset, start_pixpos, rb->width, &dbox, &dga); @@ -1131,69 +1134,72 @@ findex = rb->findex; if (IMAGE_INSTANCEP (instance)) - switch (XIMAGE_INSTANCE_TYPE (instance)) - { - case IMAGE_TEXT: + { + switch (XIMAGE_INSTANCE_TYPE (instance)) { - /* #### This is way losing. See the comment in - add_glyph_rune(). */ - Lisp_Object string = - XIMAGE_INSTANCE_TEXT_STRING (instance); - convert_bufbyte_string_into_emchar_dynarr - (XSTRING_DATA (string), XSTRING_LENGTH (string), buf); - + case IMAGE_TEXT: + { + /* #### This is way losing. See the comment in + add_glyph_rune(). */ + Lisp_Object string = + XIMAGE_INSTANCE_TEXT_STRING (instance); + convert_bufbyte_string_into_emchar_dynarr + (XSTRING_DATA (string), XSTRING_LENGTH (string), buf); + + if (rb->cursor_type == CURSOR_ON) + mswindows_output_cursor (w, dl, xpos, cursor_width, + findex, Dynarr_at (buf, 0), 0); + else /* #### redisplay-x passes -1 as the width: why ? */ + mswindows_output_string (w, dl, buf, xpos, + rb->object.dglyph.xoffset, + start_pixpos, rb->width, findex, + 0, 0, 0, 0); + Dynarr_reset (buf); + } + break; + + case IMAGE_MONO_PIXMAP: + case IMAGE_COLOR_PIXMAP: + redisplay_output_pixmap (w, instance, &dbox, &dga, findex, + cursor_start, cursor_width, + cursor_height, 0); if (rb->cursor_type == CURSOR_ON) mswindows_output_cursor (w, dl, xpos, cursor_width, - findex, Dynarr_at (buf, 0), 0); - else /* #### redisplay-x passes -1 as the width: why ? */ - mswindows_output_string (w, dl, buf, xpos, - rb->object.dglyph.xoffset, - start_pixpos, rb->width, findex, - 0, 0, 0, 0); - Dynarr_reset (buf); + findex, 0, 1); + break; + + case IMAGE_POINTER: + abort (); + + case IMAGE_SUBWINDOW: + case IMAGE_WIDGET: + redisplay_output_subwindow (w, instance, &dbox, &dga, findex, + cursor_start, cursor_width, + cursor_height); + if (rb->cursor_type == CURSOR_ON) + mswindows_output_cursor (w, dl, xpos, cursor_width, + findex, 0, 1); + break; + + case IMAGE_LAYOUT: + redisplay_output_layout (w, instance, &dbox, &dga, findex, + cursor_start, cursor_width, + cursor_height); + if (rb->cursor_type == CURSOR_ON) + mswindows_output_cursor (w, dl, xpos, cursor_width, + findex, 0, 1); + break; + + case IMAGE_NOTHING: + /* nothing is as nothing does */ + break; + + default: + abort (); } - break; - - case IMAGE_MONO_PIXMAP: - case IMAGE_COLOR_PIXMAP: - redisplay_output_pixmap (w, instance, &dbox, &dga, findex, - cursor_start, cursor_width, - cursor_height, 0); - if (rb->cursor_type == CURSOR_ON) - mswindows_output_cursor (w, dl, xpos, cursor_width, - findex, 0, 1); - break; - - case IMAGE_POINTER: - abort (); - - case IMAGE_SUBWINDOW: - case IMAGE_WIDGET: - redisplay_output_subwindow (w, instance, &dbox, &dga, findex, - cursor_start, cursor_width, - cursor_height); - if (rb->cursor_type == CURSOR_ON) - mswindows_output_cursor (w, dl, xpos, cursor_width, - findex, 0, 1); - break; - - case IMAGE_LAYOUT: - redisplay_output_layout (w, instance, &dbox, &dga, findex, - cursor_start, cursor_width, - cursor_height); - if (rb->cursor_type == CURSOR_ON) - mswindows_output_cursor (w, dl, xpos, cursor_width, - findex, 0, 1); - break; - - case IMAGE_NOTHING: - /* nothing is as nothing does */ - break; - - default: - abort (); - } - + IMAGE_INSTANCE_OPTIMIZE_OUTPUT + (XIMAGE_INSTANCE (instance)) = 0; + } xpos += rb->width; elt++; } @@ -1226,15 +1232,15 @@ mswindows_output_vertical_divider (struct window *w, int clear_unused) { struct frame *f = XFRAME (w->frame); - HDC hdc = get_frame_dc (f); + HDC hdc = get_frame_dc (f, 1); RECT rect; int spacing = XINT (w->vertical_divider_spacing); int shadow = XINT (w->vertical_divider_shadow_thickness); int abs_shadow = abs (shadow); int line_width = XINT (w->vertical_divider_line_width); int div_left = WINDOW_RIGHT (w) - window_divider_width (w); - int y1 = WINDOW_TOP (w) + FRAME_TOP_GUTTER_BOUNDS (f); - int y2 = WINDOW_BOTTOM (w) + FRAME_BOTTOM_GUTTER_BOUNDS (f); + int y1 = WINDOW_TOP (w); + int y2 = WINDOW_BOTTOM (w); /* Clear left and right spacing areas */ if (spacing) @@ -1287,7 +1293,7 @@ mswindows_text_width (struct frame *f, struct face_cachel *cachel, const Emchar *str, Charcount len) { - HDC hdc = get_frame_dc (f); + HDC hdc = get_frame_dc (f, 0); int width_so_far = 0; unsigned char *text_storage = (unsigned char *) alloca (2 * len); textual_run *runs = alloca_array (textual_run, len); @@ -1317,7 +1323,7 @@ Lisp_Object background_pixmap) { RECT rect = { x, y, x+width, y+height }; - HDC hdc = get_frame_dc (f); + HDC hdc = get_frame_dc (f, 1); if (!NILP (background_pixmap)) { diff -r 9f011ab08d48 -r 2f8bb876ab1d src/redisplay-output.c --- a/src/redisplay-output.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/redisplay-output.c Mon Aug 13 11:16:07 2007 +0200 @@ -101,7 +101,7 @@ For the given LINE in window W, make the current display line equal the desired display line. ****************************************************************************/ -static void +void sync_display_line_structs (struct window *w, int line, int do_blocks, display_line_dynarr *cdla, display_line_dynarr *ddla) @@ -211,10 +211,7 @@ #### It would really be worth it to arrange for this function to be (almost) a single call to memcmp. */ - if ((crb->findex != drb->findex) || - (WINDOW_FACE_CACHEL_DIRTY (w, drb->findex))) - return 0; - else if (crb->xpos != drb->xpos) + if (crb->xpos != drb->xpos) return 0; else if (crb->width != drb->width) return 0; @@ -236,17 +233,67 @@ return 0; /* Only check dirtiness if we know something has changed. */ else if (crb->type == RUNE_DGLYPH && - XFRAME (w->frame)->glyphs_changed) + ((XFRAME (w->frame)->glyphs_changed && + XGLYPH_DIRTYP (crb->object.dglyph.glyph)) || + crb->findex != drb->findex)) { - glyph_index gindex = get_glyph_cachel_index (w, drb->object.dglyph.glyph); - /* Although doing the cachel lookup for every comparison is - very expensive.we have to do it to make sure the cache is - up-to-date. */ - if (GLYPH_CACHEL_DIRTYP (w, gindex)) + /* We need some way of telling redisplay_output_layout () that the + only reason we are outputting it is because something has + changed internally. That way we can optimize whether we need + to clear the layout first and also only output the components + that have changed. The image_instance dirty flag and + display_hash are no good to us because these will invariably + have been set anyway if the layout has changed. So it looks + like we need yet another change flag that we can set here and + then clear in redisplay_output_layout (). */ + Lisp_Object window, image; + Lisp_Image_Instance* ii; + XSETWINDOW (window, w); + image = glyph_image_instance (crb->object.dglyph.glyph, + window, ERROR_ME_NOT, 1); + ii = XIMAGE_INSTANCE (image); + + if (TEXT_IMAGE_INSTANCEP (image) && + (crb->findex != drb->findex || + WINDOW_FACE_CACHEL_DIRTY (w, drb->findex))) return 0; + + /* It is quite common of the two glyphs to be EQ since in many + cases they will actually be the same object. This does not + mean, however, that nothing has changed. We therefore need to + check the current hash of the glyph against the last recorded + display hash. See update_subwindow (). */ + if (IMAGE_INSTANCE_DISPLAY_HASH (ii) == 0 || + IMAGE_INSTANCE_DISPLAY_HASH (ii) != + internal_hash (image, IMAGE_INSTANCE_HASH_DEPTH) || + crb->findex != drb->findex || + WINDOW_FACE_CACHEL_DIRTY (w, drb->findex)) + { + /* We now now we are going to re-output the glyph, but since + this is for some internal reason not related to geometry + changes, send a hint to the output routines that they can + take some short cuts. This is most useful for + layouts. This flag should get reset by the output + routines. + + #### It is possible for us to get here when the + face_cachel is dirty. I do not know what the implications + of this are.*/ + IMAGE_INSTANCE_OPTIMIZE_OUTPUT (ii) = 1; + return 0; + } else return 1; } + /* We now do this last so that glyph checks can do their own thing + for face changes. Face changes quite often happen when we are + trying to output something in the gutter, this would normally + lead to a lot of flashing. The indices can quite often be + different and yet the faces are the same, we do not want to + re-output in this instance. */ + else if (crb->findex != drb->findex || + WINDOW_FACE_CACHEL_DIRTY (w, drb->findex)) + return 0; else return 1; } @@ -1067,6 +1114,8 @@ { struct frame *f = XFRAME (w->frame); struct device *d = XDEVICE (f->device); + /* Temporarily disabled until generalization is done. */ +#if 0 struct display_block *db = Dynarr_atp (dl->display_blocks, block); rune_dynarr *rba = db->runes; struct rune *rb; @@ -1084,6 +1133,7 @@ rb = Dynarr_atp (rba, end - 1); width = rb->xpos + rb->width - xpos; +#endif /* now actually output the block. */ DEVMETH (d, output_display_block, (w, dl, block, start, end, start_pixpos, @@ -1243,17 +1293,6 @@ struct frame *f = XFRAME (w->frame); struct device *d = XDEVICE (f->device); int layout_height, layout_width; - /* We bogusly don't take f->extents_changed and f->glyphs_changed - into account. This is because if we do we always redisplay the - entire layout. So far I have seen no ill effects so we'll see. */ - int frame_really_changed = (f->buffers_changed || - f->clip_changed || - f->faces_changed || - f->frame_changed || - f->modeline_changed || - f->subwindows_changed || - f->windows_changed || - f->windows_structure_changed); XSETWINDOW (window, w); @@ -1269,7 +1308,7 @@ /* Highly dodgy optimization. We want to only output the whole layout if we really have to. */ - if (frame_really_changed + if (!IMAGE_INSTANCE_OPTIMIZE_OUTPUT (p) || IMAGE_INSTANCE_LAYOUT_CHANGED (p) || IMAGE_INSTANCE_WIDGET_FACE_CHANGED (p) || IMAGE_INSTANCE_SIZE_CHANGED (p) @@ -1342,6 +1381,7 @@ if (IMAGE_INSTANCEP (child)) { Lisp_Image_Instance* childii = XIMAGE_INSTANCE (child); + /* The enclosing layout offsets are +ve at this point */ struct display_glyph_area cdga; cdga.xoffset = IMAGE_INSTANCE_XOFFSET (childii) - dga->xoffset; @@ -1349,6 +1389,9 @@ cdga.width = glyph_width (child, window); cdga.height = glyph_height (child, window); + IMAGE_INSTANCE_OPTIMIZE_OUTPUT (childii) = + IMAGE_INSTANCE_OPTIMIZE_OUTPUT (p); + /* Although normalization is done by the output routines we have to do it here so that they don't try and clear all of db. This is true below also. */ @@ -1375,7 +1418,8 @@ generalisation.*/ if (redisplay_normalize_glyph_area (&cdb, &cdga) && - (frame_really_changed || IMAGE_INSTANCE_DIRTYP (childii))) + (!IMAGE_INSTANCE_OPTIMIZE_OUTPUT (childii) || + IMAGE_INSTANCE_DIRTYP (childii))) { struct display_line dl; /* this is fake */ Lisp_Object string = @@ -1409,14 +1453,16 @@ case IMAGE_MONO_PIXMAP: case IMAGE_COLOR_PIXMAP: - if (frame_really_changed || IMAGE_INSTANCE_DIRTYP (childii)) + if (!IMAGE_INSTANCE_OPTIMIZE_OUTPUT (childii) + || IMAGE_INSTANCE_DIRTYP (childii)) redisplay_output_pixmap (w, child, &cdb, &cdga, findex, 0, 0, 0, 0); break; case IMAGE_WIDGET: case IMAGE_SUBWINDOW: - if (frame_really_changed || IMAGE_INSTANCE_DIRTYP (childii)) + if (!IMAGE_INSTANCE_OPTIMIZE_OUTPUT (childii) || + IMAGE_INSTANCE_DIRTYP (childii)) redisplay_output_subwindow (w, child, &cdb, &cdga, findex, 0, 0, 0); break; @@ -1435,6 +1481,7 @@ abort (); } } + IMAGE_INSTANCE_OPTIMIZE_OUTPUT (childii) = 0; } } diff -r 9f011ab08d48 -r 2f8bb876ab1d src/redisplay-tty.c --- a/src/redisplay-tty.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/redisplay-tty.c Mon Aug 13 11:16:07 2007 +0200 @@ -333,79 +333,83 @@ window, ERROR_ME_NOT, 1); if (IMAGE_INSTANCEP (instance)) - switch (XIMAGE_INSTANCE_TYPE (instance)) - { - case IMAGE_TEXT: + { + switch (XIMAGE_INSTANCE_TYPE (instance)) { - Bufbyte *temptemp; - Lisp_Object string = - XIMAGE_INSTANCE_TEXT_STRING (instance); - Bytecount len = XSTRING_LENGTH (string); - - /* In the unlikely instance that a garbage-collect - occurs during encoding, we at least need to - copy the string. - */ - temptemp = (Bufbyte *) alloca (len); - memcpy (temptemp, XSTRING_DATA (string), len); + case IMAGE_TEXT: { - int i; - - /* Now truncate the first rb->object.dglyph.xoffset - columns. */ - for (i = 0; i < rb->object.dglyph.xoffset;) - { + Bufbyte *temptemp; + Lisp_Object string = + XIMAGE_INSTANCE_TEXT_STRING (instance); + Bytecount len = XSTRING_LENGTH (string); + + /* In the unlikely instance that a garbage-collect + occurs during encoding, we at least need to + copy the string. + */ + temptemp = (Bufbyte *) alloca (len); + memcpy (temptemp, XSTRING_DATA (string), len); + { + int i; + + /* Now truncate the first rb->object.dglyph.xoffset + columns. */ + for (i = 0; i < rb->object.dglyph.xoffset;) + { #ifdef MULE - Emchar ch = charptr_emchar (temptemp); - i += XCHARSET_COLUMNS (CHAR_CHARSET (ch)); + Emchar ch = charptr_emchar (temptemp); + i += XCHARSET_COLUMNS (CHAR_CHARSET (ch)); #else - i++; /* telescope this */ + i++; /* telescope this */ #endif - INC_CHARPTR (temptemp); - } - - /* If we truncated one column too many, then - add a space at the beginning. */ - if (i > rb->object.dglyph.xoffset) + INC_CHARPTR (temptemp); + } + + /* If we truncated one column too many, then + add a space at the beginning. */ + if (i > rb->object.dglyph.xoffset) + { + assert (i > 0); + *--temptemp = ' '; + i--; + } + len -= i; + } + + tty_output_bufbyte_string (w, dl, temptemp, len, + xpos, findex, 0); + + if (xpos >= cursor_start + && (cursor_start < + xpos + (bufbyte_string_displayed_columns + (temptemp, len)))) { - assert (i > 0); - *--temptemp = ' '; - i--; + cmgoto (f, dl->ypos - 1, cursor_start); } - len -= i; } - - tty_output_bufbyte_string (w, dl, temptemp, len, - xpos, findex, 0); - - if (xpos >= cursor_start - && (cursor_start < - xpos + (bufbyte_string_displayed_columns - (temptemp, len)))) - { - cmgoto (f, dl->ypos - 1, cursor_start); - } + break; + + case IMAGE_MONO_PIXMAP: + case IMAGE_COLOR_PIXMAP: + case IMAGE_SUBWINDOW: + case IMAGE_WIDGET: + case IMAGE_LAYOUT: + /* just do nothing here */ + break; + + case IMAGE_POINTER: + abort (); + + case IMAGE_NOTHING: + /* nothing is as nothing does */ + break; + + default: + abort (); } - break; - - case IMAGE_MONO_PIXMAP: - case IMAGE_COLOR_PIXMAP: - case IMAGE_SUBWINDOW: - case IMAGE_WIDGET: - case IMAGE_LAYOUT: - /* just do nothing here */ - break; - - case IMAGE_POINTER: - abort (); - - case IMAGE_NOTHING: - /* nothing is as nothing does */ - break; - - default: - abort (); - } + IMAGE_INSTANCE_OPTIMIZE_OUTPUT + (XIMAGE_INSTANCE (instance)) = 0; + } xpos += rb->width; elt++; @@ -566,7 +570,7 @@ clear_to_end (f); #else /* #### Not implemented. */ - fprintf (stderr, "Not yet.\n"); + stderr_out ("Not yet.\n"); #endif } tty_turn_off_frame_face (f, Vdefault_face); diff -r 9f011ab08d48 -r 2f8bb876ab1d src/redisplay-x.c --- a/src/redisplay-x.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/redisplay-x.c Mon Aug 13 11:16:07 2007 +0200 @@ -449,55 +449,59 @@ findex = rb->findex; if (IMAGE_INSTANCEP (instance)) - switch (XIMAGE_INSTANCE_TYPE (instance)) - { - case IMAGE_TEXT: + { + switch (XIMAGE_INSTANCE_TYPE (instance)) { - /* #### This is way losing. See the comment in - add_glyph_rune(). */ - Lisp_Object string = - XIMAGE_INSTANCE_TEXT_STRING (instance); - convert_bufbyte_string_into_emchar_dynarr - (XSTRING_DATA (string), XSTRING_LENGTH (string), buf); - - x_output_string (w, dl, buf, xpos, - rb->object.dglyph.xoffset, - start_pixpos, -1, findex, - (rb->cursor_type == CURSOR_ON), - cursor_start, cursor_width, - cursor_height); - Dynarr_reset (buf); + case IMAGE_TEXT: + { + /* #### This is way losing. See the comment in + add_glyph_rune(). */ + Lisp_Object string = + XIMAGE_INSTANCE_TEXT_STRING (instance); + convert_bufbyte_string_into_emchar_dynarr + (XSTRING_DATA (string), XSTRING_LENGTH (string), buf); + + x_output_string (w, dl, buf, xpos, + rb->object.dglyph.xoffset, + start_pixpos, -1, findex, + (rb->cursor_type == CURSOR_ON), + cursor_start, cursor_width, + cursor_height); + Dynarr_reset (buf); + } + break; + + case IMAGE_MONO_PIXMAP: + case IMAGE_COLOR_PIXMAP: + redisplay_output_pixmap (w, instance, &dbox, &dga, findex, + cursor_start, cursor_width, + cursor_height, 0); + break; + + case IMAGE_WIDGET: + case IMAGE_SUBWINDOW: + redisplay_output_subwindow (w, instance, &dbox, &dga, findex, + cursor_start, cursor_width, + cursor_height); + break; + + case IMAGE_LAYOUT: + redisplay_output_layout (w, instance, &dbox, &dga, findex, + cursor_start, cursor_width, + cursor_height); + break; + + case IMAGE_NOTHING: + /* nothing is as nothing does */ + break; + + case IMAGE_POINTER: + default: + abort (); } - break; - - case IMAGE_MONO_PIXMAP: - case IMAGE_COLOR_PIXMAP: - redisplay_output_pixmap (w, instance, &dbox, &dga, findex, - cursor_start, cursor_width, - cursor_height, 0); - break; - - case IMAGE_WIDGET: - case IMAGE_SUBWINDOW: - redisplay_output_subwindow (w, instance, &dbox, &dga, findex, - cursor_start, cursor_width, - cursor_height); - break; - - case IMAGE_LAYOUT: - redisplay_output_layout (w, instance, &dbox, &dga, findex, - cursor_start, cursor_width, - cursor_height); - break; - - case IMAGE_NOTHING: - /* nothing is as nothing does */ - break; - - case IMAGE_POINTER: - default: - abort (); - } + IMAGE_INSTANCE_OPTIMIZE_OUTPUT + (XIMAGE_INSTANCE (instance)) = 0; + } xpos += rb->width; elt++; @@ -682,7 +686,7 @@ { /* #### I fixed once case where this was getting it. It was a bad macro expansion (compiler bug). */ - fprintf (stderr, "Help! x_get_gc got a bogus fg value! fg = "); + stderr_out ("Help! x_get_gc got a bogus fg value! fg = "); debug_print (fg); fg = Qnil; } @@ -1320,8 +1324,8 @@ spacing = XINT (w->vertical_divider_spacing); line_width = XINT (w->vertical_divider_line_width); x = WINDOW_RIGHT (w) - width; - y1 = WINDOW_TOP (w) + FRAME_TOP_GUTTER_BOUNDS (f); - y2 = WINDOW_BOTTOM (w) + FRAME_BOTTOM_GUTTER_BOUNDS (f); + y1 = WINDOW_TOP (w); + y2 = WINDOW_BOTTOM (w); memset (&gcv, ~0, sizeof (XGCValues)); @@ -1983,6 +1987,7 @@ struct frame *f = device_selected_frame (d); struct window *w = XWINDOW (FRAME_ROOT_WINDOW (f)); Widget shell = FRAME_X_SHELL_WIDGET (f); + int flash_height; XSETFRAME (frame, f); @@ -1999,8 +2004,22 @@ gcv.graphics_exposures = False; gc = gc_cache_lookup (DEVICE_X_GC_CACHE (XDEVICE (f->device)), &gcv, (GCForeground | GCFunction | GCGraphicsExposures)); - XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top, - w->pixel_width, w->pixel_height); + default_face_height_and_width (frame, &flash_height, 0); + + /* If window is tall, flash top and bottom line. */ + if (EQ (Vvisible_bell, Qtop_bottom) && w->pixel_height > 3 * flash_height) + { + XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top, + w->pixel_width, flash_height); + XFillRectangle (dpy, win, gc, w->pixel_left, + w->pixel_top + w->pixel_height - flash_height, + w->pixel_width, flash_height); + } + else + /* If it is short, flash it all. */ + XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top, + w->pixel_width, w->pixel_height); + XSync (dpy, False); #ifdef HAVE_SELECT @@ -2020,8 +2039,20 @@ #endif /* HAVE_POLL */ #endif /* HAVE_SELECT */ - XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top, - w->pixel_width, w->pixel_height); + /* If window is tall, flash top and bottom line. */ + if (EQ (Vvisible_bell, Qtop_bottom) && w->pixel_height > 3 * flash_height) + { + XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top, + w->pixel_width, flash_height); + XFillRectangle (dpy, win, gc, w->pixel_left, + w->pixel_top + w->pixel_height - flash_height, + w->pixel_width, flash_height); + } + else + /* If it is short, flash it all. */ + XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top, + w->pixel_width, w->pixel_height); + XSync (dpy, False); return 1; diff -r 9f011ab08d48 -r 2f8bb876ab1d src/redisplay.c --- a/src/redisplay.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/redisplay.c Mon Aug 13 11:16:07 2007 +0200 @@ -364,8 +364,7 @@ int glyphs_changed; int glyphs_changed_set; -/* non-zero if any displayed subwindow is in need of updating - somewhere. */ +/* non-zero if any subwindow has been deleted. */ int subwindows_changed; int subwindows_changed_set; @@ -419,9 +418,9 @@ Lisp_Object Vbar_cursor; Lisp_Object Qbar_cursor; -int visible_bell; /* If true and the terminal will support it - then the frame will flash instead of - beeping when an error occurs */ +Lisp_Object Vvisible_bell; /* If true and the terminal will support it + then the frame will flash instead of + beeping when an error occurs */ /* Nonzero means no need to redraw the entire frame on resuming a suspended Emacs. This is useful on terminals with multiple pages, @@ -471,6 +470,8 @@ int column_number_start_at_one; +Lisp_Object Qtop_bottom; + #define WINDOW_SCROLLED(w) \ (w->hscroll > 0 || w->left_xoffset) @@ -1528,10 +1529,12 @@ glyph sizes might have changed too */ invalidate_glyph_geometry_maybe (gb->glyph, w); - /* This makes sure the glyph is in the cachels. - - #### We need to change this so that we hold onto the glyph_index - here, not the glyph itself. */ + /* This makes sure the glyph is in the cachels. + + #### We do this to make sure the glyph is in the glyph cachels, + so that the dirty flag can be reset after redisplay has + finished. We should do this some other way, maybe by iterating + over the window cache of subwindows. */ get_glyph_cachel_index (w, gb->glyph); /* A nil extent indicates a special glyph (ex. truncator). */ @@ -3632,10 +3635,6 @@ /* The modeline is at the bottom of the gutters. */ dl->ypos = WINDOW_BOTTOM (w); - /* adjust for the bottom gutter */ - if (window_is_lowest (w)) - dl->ypos -= FRAME_BOTTOM_GUTTER_BOUNDS (f); - rb.findex = MODELINE_INDEX; rb.xpos = dl->bounds.left_out; rb.width = dl->bounds.right_out - dl->bounds.left_out; @@ -3689,9 +3688,6 @@ set this until we've generated the modeline in order to account for any embedded faces. */ dl->ypos = WINDOW_BOTTOM (w) - dl->descent - ypos_adj; - /* adjust for the bottom gutter */ - if (window_is_lowest (w)) - dl->ypos -= FRAME_BOTTOM_GUTTER_BOUNDS (f); } static Charcount @@ -5157,6 +5153,9 @@ else prop = 0; + /* Make sure this is set always */ + /* Note the conversion at end */ + w->window_end_pos[type] = start_pos; while (ypos < yend) { struct display_line dl; @@ -5260,10 +5259,14 @@ Dynarr_free (prop); /* #### More not quite right, but close enough. */ - /* #### Ben sez: apparently window_end_pos[] is measured + /* Ben sez: apparently window_end_pos[] is measured as the number of characters between the window end and the end of the buffer? This seems rather weirdo. What's - the justification for this? */ + the justification for this? + + JV sez: Because BUF_Z (b) would be a good initial value, however + that can change. This representation allows initalizing with 0. + */ w->window_end_pos[type] = BUF_Z (b) - w->window_end_pos[type]; if (need_modeline) @@ -6290,7 +6293,7 @@ /* Ensure that all windows on the given frame are correctly displayed. */ -static int +int redisplay_frame (struct frame *f, int preemption_check) { struct device *d = XDEVICE (f->device); @@ -6332,30 +6335,26 @@ being handled. */ update_frame_menubars (f); #endif /* HAVE_MENUBARS */ - /* widgets are similar to menus in that they can call lisp to - determine activation etc. Therefore update them before we get - into redisplay. This is primarily for connected widgets such as - radio buttons. */ - update_frame_subwindows (f); #ifdef HAVE_TOOLBARS /* Update the toolbars. */ update_frame_toolbars (f); #endif /* HAVE_TOOLBARS */ + /* Gutter update proper has to be done inside display when no frame + size changes can occur, thus we separately update the gutter + geometry here if it needs it. */ + update_frame_gutter_geometry (f); /* If we clear the frame we have to force its contents to be redrawn. */ if (f->clear) f->frame_changed = 1; - /* invalidate the subwindow cache. We use subwindows_changed here to + /* Invalidate the subwindow cache. We use subwindows_changed here to cause subwindows to get instantiated. This is because subwindows_state_changed is less strict - dealing with things like the clicked state of button. We have to do this before redisplaying the gutters as subwindows get unmapped in the process.*/ - if (!Dynarr_length (f->subwindow_cachels) - || f->subwindows_changed - || f->faces_changed - || f->frame_changed) + if (f->frame_changed || f->subwindows_changed) { reset_subwindow_cachels (f); /* we have to do this so the gutter gets regenerated. */ @@ -6364,16 +6363,6 @@ else mark_subwindow_cachels_as_not_updated (f); - /* We can now update the gutters, safe in the knowledge that our - efforts won't get undone. */ - - /* #### This can call lisp, it may be that if the subwindow cachels - have been reset there are no remaining references to the - displayed glyphs and so they get garbage collected. We should - consider putting this call inside the critical redisplay - section. */ - update_frame_gutters (f); - hold_frame_size_changes (); /* ----------------- BEGIN CRITICAL REDISPLAY SECTION ---------------- */ @@ -6400,6 +6389,16 @@ #### If a frame-size change does occur we should probably actually be preempting redisplay. */ + /* We can now update the gutters, safe in the knowledge that our + efforts won't get undone. */ + + /* This can call lisp, but redisplay is protected by binding + inhibit_quit. More importantly the code involving display lines + *assumes* that GC will not happen and so does not GCPRO + anything. Since we use this code the whole time with the gutters + we cannot allow GC to happen when manipulating the gutters. */ + update_frame_gutters (f); + /* Erase the frame before outputting its contents. */ if (f->clear) { @@ -7553,11 +7552,18 @@ displayed. The end of the last line is also know as the window end position. + WARNING: It is possible that rediplay failed to layout any lines for the + windows. Under normal circumstances this is rare. However it seems that it + does occur in the following situation: A mouse event has come in and we + need to compute its location in a window. That code (in + pixel_to_glyph_translation) already can handle 0 as an error return value. + #### With a little work this could probably be reworked as just a call to start_with_line_at_pixpos. */ static Bufpos -start_end_of_last_line (struct window *w, Bufpos startp, int end) +start_end_of_last_line (struct window *w, Bufpos startp, int end, + int may_error) { struct buffer *b = XBUFFER (w->buffer); line_start_cache_dynarr *cache = w->line_start_cache; @@ -7577,7 +7583,7 @@ start_elt = point_in_line_start_cache (w, cur_start, 0); if (start_elt == -1) - abort (); /* this had better never happen */ + return may_error ? 0 : startp; while (1) { @@ -7641,7 +7647,7 @@ Bufpos start_of_last_line (struct window *w, Bufpos startp) { - return start_end_of_last_line (w, startp, 0); + return start_end_of_last_line (w, startp, 0 , 0); } /* For the given window W, if display starts at STARTP, what will be @@ -7651,9 +7657,16 @@ Bufpos end_of_last_line (struct window *w, Bufpos startp) { - return start_end_of_last_line (w, startp, 1); + return start_end_of_last_line (w, startp, 1, 0); } +static Bufpos +end_of_last_line_may_error (struct window *w, Bufpos startp) +{ + return start_end_of_last_line (w, startp, 1, 1); +} + + /* For window W, what does the starting position have to be so that the line containing POINT will cover pixel position PIXPOS. */ @@ -8807,7 +8820,7 @@ if (!MARKERP ((*w)->start[CURRENT_DISP])) *closest = 0; else - *closest = end_of_last_line (*w, + *closest = end_of_last_line_may_error (*w, marker_position ((*w)->start[CURRENT_DISP])); *col = 0; UPDATE_CACHE_RETURN; @@ -8895,6 +8908,9 @@ f->clear = 1; redisplay_frame (f, 1); + /* See the comment in Fredisplay_frame. */ + RESET_CHANGED_SET_FLAGS; + return unbind_to (count, Qnil); } @@ -8922,6 +8938,15 @@ redisplay_frame (f, 1); + /* If we don't reset the global redisplay flafs here, subsequent + changes to the display will not get registered by redisplay + because it thinks it already has registered changes. If you + really knew what you were doing you could confuse redisplay by + calling Fredisplay_frame while updating another frame. We assume + that if you know what you are doing you will not be that + stupid. */ + RESET_CHANGED_SET_FLAGS; + return unbind_to (count, Qnil); } @@ -8951,6 +8976,9 @@ } redisplay_device (d, 0); + /* See the comment in Fredisplay_frame. */ + RESET_CHANGED_SET_FLAGS; + return unbind_to (count, Qnil); } @@ -8978,6 +9006,9 @@ redisplay_device (d, 0); + /* See the comment in Fredisplay_frame. */ + RESET_CHANGED_SET_FLAGS; + return unbind_to (count, Qnil); } @@ -9240,6 +9271,7 @@ defsymbol (&Qbar_cursor, "bar-cursor"); defsymbol (&Qredisplay_end_trigger_functions, "redisplay-end-trigger-functions"); + defsymbol (&Qtop_bottom, "top-bottom"); DEFSUBR (Fredisplay_echo_area); DEFSUBR (Fredraw_frame); @@ -9328,10 +9360,19 @@ redisplay_variable_changed); truncate_partial_width_windows = 1; - DEFVAR_BOOL ("visible-bell", &visible_bell /* -*Non-nil means try to flash the frame to represent a bell. + DEFVAR_LISP ("visible-bell", &Vvisible_bell /* +*Non-nil substitutes a visual signal for the audible bell. + +Default behavior is to flash the whole screen. On some platforms, +special effects are available using the following values: + +'display Flash the whole screen (ie, the default behavior). +'top-bottom Flash only the top and bottom lines of the selected frame. + +When effects are unavailable on a platform, the visual bell is the +default, whole screen. (Currently only X supports any special effects.) */ ); - visible_bell = 0; + Vvisible_bell = Qnil; DEFVAR_BOOL ("no-redraw-on-reenter", &no_redraw_on_reenter /* *Non-nil means no need to redraw entire frame after suspending. diff -r 9f011ab08d48 -r 2f8bb876ab1d src/redisplay.h --- a/src/redisplay.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/redisplay.h Mon Aug 13 11:16:07 2007 +0200 @@ -415,24 +415,24 @@ If any of these flags are set, redisplay will look more carefully to see if anything has really changed. */ -/* non-nil if the contents of a buffer have changed since the last time - redisplay completed */ +/* Nonzero if the contents of a buffer have changed since the last time + redisplay completed. */ extern int buffers_changed; extern int buffers_changed_set; /* Nonzero if head_clip or tail_clip of a buffer has changed - since last redisplay that finished */ + since last redisplay that finished. */ extern int clip_changed; extern int clip_changed_set; -/* non-nil if any extent has changed since the last time redisplay completed */ +/* Nonzero if any extent has changed since the last time redisplay completed. */ extern int extents_changed; extern int extents_changed_set; -/* non-nil if any face has changed since the last time redisplay completed */ +/* Nonzero if any face has changed since the last time redisplay completed. */ extern int faces_changed; -/* Nonzero means one or more frames have been marked as garbaged */ +/* Nonzero means one or more frames have been marked as garbaged. */ extern int frame_changed; /* True if any of the builtin display glyphs (continuation, @@ -459,34 +459,34 @@ extern int menubar_changed; extern int menubar_changed_set; -/* true iff we should redraw the modelines on the next redisplay */ +/* True iff we should redraw the modelines on the next redisplay. */ extern int modeline_changed; extern int modeline_changed_set; -/* non-nil if point has changed in some buffer since the last time - redisplay completed */ +/* Nonzero if point has changed in some buffer since the last time + redisplay completed. */ extern int point_changed; extern int point_changed_set; -/* non-nil if some frame has changed its size */ +/* Nonzero if some frame has changed its size. */ extern int size_changed; -/* non-nil if some device has signaled that it wants to change size */ +/* Nonzero if some device has signaled that it wants to change size. */ extern int asynch_device_change_pending; -/* non-nil if any toolbar has changed */ +/* Nonzero if any toolbar has changed. */ extern int toolbar_changed; extern int toolbar_changed_set; -/* non-nil if any gutter has changed */ +/* Nonzero if any gutter has changed. */ extern int gutter_changed; extern int gutter_changed_set; -/* non-nil if any window has changed since the last time redisplay completed */ +/* Nonzero if any window has changed since the last time redisplay completed */ extern int windows_changed; -/* non-nil if any frame's window structure has changed since the last - time redisplay completed */ +/* Nonzero if any frame's window structure has changed since the last + time redisplay completed. */ extern int windows_structure_changed; /* These macros can be relatively expensive. Since they are often @@ -550,7 +550,6 @@ buffers_changed = 0; \ clip_changed = 0; \ extents_changed = 0; \ - faces_changed = 0; \ frame_changed = 0; \ icon_changed = 0; \ menubar_changed = 0; \ @@ -560,7 +559,7 @@ gutter_changed = 0; \ glyphs_changed = 0; \ subwindows_changed = 0; \ - subwindows_state_changed = 0; \ + subwindows_state_changed = 0; \ windows_changed = 0; \ windows_structure_changed = 0; \ } while (0) @@ -578,7 +577,7 @@ (p)->toolbar_changed || \ (p)->gutter_changed || \ (p)->glyphs_changed || \ - (p)->size_changed || \ + (p)->size_changed || \ (p)->subwindows_changed || \ (p)->subwindows_state_changed || \ (p)->windows_changed || \ @@ -640,8 +639,8 @@ where one page is used for Emacs and another for all else. */ extern int no_redraw_on_reenter; -/* Nonzero means flash the frame instead of ringing the bell. */ -extern int visible_bell; +/* Non-nil means flash the frame instead of ringing the bell. */ +extern Lisp_Object Vvisible_bell; /* Thickness of shadow border around 3D modelines. */ extern Lisp_Object Vmodeline_shadow_thickness; @@ -670,6 +669,8 @@ extern Lisp_Object Qbar_cursor, Qcursor_in_echo_area, Vwindow_system; +extern Lisp_Object Qtop_bottom; + /*************************************************************************/ /* redisplay exported functions */ @@ -684,6 +685,7 @@ Bufbyte *nonreloc, Lisp_Object reloc, Bytecount offset, Bytecount len); +int redisplay_frame (struct frame *f, int preemption_check); void redisplay (void); struct display_block *get_display_block_from_line (struct display_line *dl, enum display_type type); @@ -784,5 +786,8 @@ void output_display_line (struct window *w, display_line_dynarr *cdla, display_line_dynarr *ddla, int line, int force_start, int force_end); +void sync_display_line_structs (struct window *w, int line, int do_blocks, + display_line_dynarr *cdla, + display_line_dynarr *ddla); #endif /* INCLUDED_redisplay_h_ */ diff -r 9f011ab08d48 -r 2f8bb876ab1d src/regex.c --- a/src/regex.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/regex.c Mon Aug 13 11:16:07 2007 +0200 @@ -2388,7 +2388,7 @@ if (c == ':' || c == ']' || p == pend || c1 == CHAR_CLASS_MAX_LENGTH) break; - str[c1++] = c; + str[c1++] = (char) c; } str[c1] = '\0'; diff -r 9f011ab08d48 -r 2f8bb876ab1d src/s/cygwin32.h --- a/src/s/cygwin32.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/s/cygwin32.h Mon Aug 13 11:16:07 2007 +0200 @@ -42,26 +42,26 @@ /* cheesy way to determine cygwin version */ #ifndef NOT_C_CODE -#include -#ifdef HAVE_CYGWIN_VERSION_H -#include -#else -#ifdef SIGIO -#define CYGWIN_VERSION_DLL_MAJOR 19 -#define CYGWIN_VERSION_DLL_MINOR 0 -#define CYGWIN_B19 -#else -#define CYGWIN_VERSION_DLL_MAJOR 18 -#define CYGWIN_VERSION_DLL_MINOR 0 -#define BROKEN_CYGWIN -#endif -#endif +# include +# ifdef HAVE_CYGWIN_VERSION_H +# include +# else +# ifdef SIGIO +# define CYGWIN_VERSION_DLL_MAJOR 19 +# define CYGWIN_VERSION_DLL_MINOR 0 +# define CYGWIN_B19 +# else +# define CYGWIN_VERSION_DLL_MAJOR 18 +# define CYGWIN_VERSION_DLL_MINOR 0 +# define BROKEN_CYGWIN +# endif +# endif extern void cygwin32_win32_to_posix_path_list(const char*, char*); extern int cygwin32_win32_to_posix_path_list_buf_size(const char*); extern void cygwin32_posix_to_win32_path_list(const char*, char*); extern int cygwin32_posix_to_win32_path_list_buf_size(const char*); -#if CYGWIN_VERSION_DLL_MAJOR < 20 +# if CYGWIN_VERSION_DLL_MAJOR < 20 struct timeval; struct timezone; struct itimerval; @@ -85,28 +85,27 @@ extern int srandom( unsigned seed); extern long random(); -#define SND_ASYNC 1 -#define SND_NODEFAULT 2 -#define SND_MEMORY 4 -#define SND_FILENAME 0x2000L -#define VK_APPS 0x5D -#define SIF_TRACKPOS 0x0010 -#define ICC_BAR_CLASSES 4 -#define FW_BLACK FW_HEAVY -#define FW_ULTRABOLD FW_EXTRABOLD -#define FW_DEMIBOLD FW_SEMIBOLD -#define FW_ULTRALIGHT FW_EXTRALIGHT -#define APPCMD_FILTERINITS 0x20L -#define CBF_FAIL_SELFCONNECTIONS 0x1000 -#define CBF_SKIP_ALLNOTIFICATIONS 0x3C0000 -#define CBF_FAIL_ADVISES 0x4000 -#define CBF_FAIL_POKES 0x10000 -#define CBF_FAIL_REQUESTS 0x20000 -#define SZDDESYS_TOPIC "System" -#define JOHAB_CHARSET 130 -#define MAC_CHARSET 77 - -#endif +# define SND_ASYNC 1 +# define SND_NODEFAULT 2 +# define SND_MEMORY 4 +# define SND_FILENAME 0x2000L +# define VK_APPS 0x5D +# define SIF_TRACKPOS 0x0010 +# define ICC_BAR_CLASSES 4 +# define FW_BLACK FW_HEAVY +# define FW_ULTRABOLD FW_EXTRABOLD +# define FW_DEMIBOLD FW_SEMIBOLD +# define FW_ULTRALIGHT FW_EXTRALIGHT +# define APPCMD_FILTERINITS 0x20L +# define CBF_FAIL_SELFCONNECTIONS 0x1000 +# define CBF_SKIP_ALLNOTIFICATIONS 0x3C0000 +# define CBF_FAIL_ADVISES 0x4000 +# define CBF_FAIL_POKES 0x10000 +# define CBF_FAIL_REQUESTS 0x20000 +# define SZDDESYS_TOPIC "System" +# define JOHAB_CHARSET 130 +# define MAC_CHARSET 77 +# endif #endif #ifndef SPI_GETWHEELSCROLLLINES @@ -160,6 +159,7 @@ #define TEXT_END -1 #define DATA_END -1 #define HEAP_IN_DATA +#define NO_LIM_DATA #define UNEXEC "unexcw.o" #ifdef CYGWIN_VERSION_DLL_MAJOR diff -r 9f011ab08d48 -r 2f8bb876ab1d src/s/mingw32.h --- a/src/s/mingw32.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/s/mingw32.h Mon Aug 13 11:16:07 2007 +0200 @@ -28,8 +28,6 @@ #define DOS_NT /* MSDOS or WINDOWSNT */ #endif -#define PBS_SMOOTH 0x01 - #ifdef HAVE_MS_WINDOWS #define HAVE_NTGUI #define HAVE_FACES @@ -51,7 +49,6 @@ #define TIME_ONESHOT 0 #define TIME_PERIODIC 1 #define LOCALE_USE_CP_ACP 0x40000000 -#define SHGFI_EXETYPE 0x2000 #define NSIG 23 #ifndef SPI_GETWHEELSCROLLLINES @@ -63,9 +60,34 @@ #ifndef WHEEL_DELTA #define WHEEL_DELTA 120 #endif + +/* this is necessary to get the TCS_* definitions in */ +#define _WIN32_IE 0x0400 + #ifndef WM_MOUSEWHEEL #define WM_MOUSEWHEEL 0x20A #endif +#ifndef TCS_BOTTOM +#define TCS_BOTTOM 0x0002 +#endif +#ifndef TCS_VERTICAL +#define TCS_VERTICAL 0x0080 +#endif +#ifndef PHYSICALWIDTH +#define PHYSICALWIDTH 110 +#endif +#ifndef PHYSICALHEIGHT +#define PHYSICALHEIGHT 111 +#endif +#ifndef PHYSICALOFFSETX +#define PHYSICALOFFSETX 112 +#endif +#ifndef PHYSICALOFFSETY +#define PHYSICALOFFSETY 113 +#endif +#ifndef PBS_SMOOTH +#define PBS_SMOOTH 0x01 +#endif /* translate NT world unexec stuff to our a.out definitions */ @@ -169,12 +191,6 @@ #include #endif -typedef unsigned int MMRESULT; -typedef struct timecaps_tag { - unsigned int wPeriodMin; - unsigned int wPeriodMax; -} TIMECAPS; - /* IO calls that are emulated or shadowed */ #define pipe sys_pipe int sys_pipe (int * phandles); @@ -199,11 +215,6 @@ #define popen _popen #define pclose _pclose -typedef int uid_t; -typedef int gid_t; -typedef int pid_t; -typedef int ssize_t; - /* Encapsulation of system calls */ #ifndef DONT_ENCAPSULATE #define getpid sys_getpid @@ -230,13 +241,23 @@ uid_t geteuid (void); gid_t getgid (void); gid_t getegid (void); + +#if CYGWIN_VERSION_DLL_MAJOR <= 21 +#define _ftime ftime #define _timeb timeb +#endif /* Stuff that gets set wrongly or otherwise */ #define HAVE_SETITIMER #define HAVE_GETTIMEOFDAY #define HAVE_SELECT /*#define HAVE_STRUCT_UTIMBUF*/ +#ifndef HAVE_H_ERRNO +#define HAVE_H_ERRNO +#endif +#ifndef HAVE_TZNAME +#define HAVE_TZNAME +#endif #undef GETTIMEOFDAY_ONE_ARGUMENT #undef HAVE_SYS_WAIT_H diff -r 9f011ab08d48 -r 2f8bb876ab1d src/s/windowsnt.h --- a/src/s/windowsnt.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/s/windowsnt.h Mon Aug 13 11:16:07 2007 +0200 @@ -58,7 +58,7 @@ #define SIZEOF_SHORT 2 #define SIZEOF_INT 4 #define SIZEOF_LONG 4 -#define SIZEOF_LONG_LONG 8 +#define SIZEOF_LONG_LONG 0 #define SIZEOF_VOID_P 4 /* NOMULTIPLEJOBS should be defined if your system's shell diff -r 9f011ab08d48 -r 2f8bb876ab1d src/scrollbar.c --- a/src/scrollbar.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/scrollbar.c Mon Aug 13 11:16:07 2007 +0200 @@ -460,14 +460,10 @@ if (!NILP (w->scrollbar_on_left_p)) { x_offset = WINDOW_LEFT (w); - if (window_is_leftmost (w)) - x_offset += FRAME_LEFT_GUTTER_BOUNDS (f); } else { x_offset = WINDOW_RIGHT (w) - scrollbar_width; - if (window_is_rightmost (w)) - x_offset -= FRAME_RIGHT_GUTTER_BOUNDS (f); if (window_needs_vertical_divider (w)) x_offset -= window_divider_width (w); } @@ -481,8 +477,6 @@ if (!NILP (w->scrollbar_on_top_p)) { y_offset += WINDOW_TOP (w); - if (window_is_highest (w)) - y_offset += FRAME_TOP_GUTTER_BOUNDS (f); } else { diff -r 9f011ab08d48 -r 2f8bb876ab1d src/select-msw.c --- a/src/select-msw.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/select-msw.c Mon Aug 13 11:16:07 2007 +0200 @@ -34,175 +34,178 @@ #include "console-msw.h" -DEFUN ("mswindows-set-clipboard", Fmswindows_set_clipboard, 1, 1, 0, /* -Copy STRING to the mswindows clipboard. -*/ - (string)) -{ - int rawsize, size, i; - unsigned char *src, *dst, *next; - HGLOBAL h = NULL; - struct frame *f = NULL; - - CHECK_STRING (string); - - /* Calculate size with LFs converted to CRLFs because - * CF_TEXT format uses CRLF delimited ASCIIZ */ - src = XSTRING_DATA (string); - size = rawsize = XSTRING_LENGTH (string) + 1; - for (i=0; icaching->offset_into_struct_window); + /* #### What's the point of this check, other than to optimize image + instance instantiation? Unless you specify a caching instantiate + method the instantiation that specifier_instance will do will + always create a new copy. Thus EQ will always fail. Unfortunately + calling equal is no good either as this doesn't take into account + things attached to the specifier - for instance strings on + extents. --andyp */ if (!EQ (newval, *location)) { Lisp_Object oldval = *location; diff -r 9f011ab08d48 -r 2f8bb876ab1d src/specifier.h --- a/src/specifier.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/specifier.h Mon Aug 13 11:16:07 2007 +0200 @@ -267,9 +267,9 @@ #ifdef ERROR_CHECK_TYPECHECK #define DECLARE_SPECIFIER_TYPE(type) \ extern struct specifier_methods * type##_specifier_methods; \ -INLINE struct type##_specifier * \ +INLINE_HEADER struct type##_specifier * \ error_check_##type##_specifier_data (Lisp_Specifier *sp); \ -INLINE struct type##_specifier * \ +INLINE_HEADER struct type##_specifier * \ error_check_##type##_specifier_data (Lisp_Specifier *sp) \ { \ if (SPECIFIERP (sp->magic_parent)) \ @@ -282,9 +282,9 @@ assert (SPECIFIER_TYPE_P (sp, type)); \ return (struct type##_specifier *) sp->data; \ } \ -INLINE Lisp_Specifier * \ +INLINE_HEADER Lisp_Specifier * \ error_check_##type##_specifier_type (Lisp_Object obj); \ -INLINE Lisp_Specifier * \ +INLINE_HEADER Lisp_Specifier * \ error_check_##type##_specifier_type (Lisp_Object obj) \ { \ Lisp_Specifier *sp = XSPECIFIER (obj); \ @@ -293,11 +293,11 @@ } \ DECLARE_NOTHING #else -#define DECLARE_SPECIFIER_TYPE(type) \ +#define DECLARE_SPECIFIER_TYPE(type) \ extern struct specifier_methods * type##_specifier_methods #endif /* ERROR_CHECK_TYPECHECK */ -#define DEFINE_SPECIFIER_TYPE(type) \ +#define DEFINE_SPECIFIER_TYPE(type) \ struct specifier_methods * type##_specifier_methods #define INITIALIZE_SPECIFIER_TYPE(type, obj_name, pred_sym) do { \ @@ -305,12 +305,12 @@ type##_specifier_methods->name = obj_name; \ type##_specifier_methods->extra_description = \ specifier_empty_extra_description; \ - defsymbol_nodump (&type##_specifier_methods->predicate_symbol, pred_sym); \ - add_entry_to_specifier_type_list (Q##type, type##_specifier_methods); \ - dumpstruct (&type##_specifier_methods, &specifier_methods_description); \ + defsymbol_nodump (&type##_specifier_methods->predicate_symbol, pred_sym); \ + add_entry_to_specifier_type_list (Q##type, type##_specifier_methods); \ + dumpstruct (&type##_specifier_methods, &specifier_methods_description); \ } while (0) -#define REINITIALIZE_SPECIFIER_TYPE(type) do { \ +#define REINITIALIZE_SPECIFIER_TYPE(type) do { \ staticpro_nodump (&type##_specifier_methods->predicate_symbol); \ } while (0) @@ -366,7 +366,7 @@ # define XSETSPECIFIER_TYPE(x, p, type) XSETSPECIFIER (x, p) #endif /* ERROR_CHECK_TYPE_CHECK */ -#define SPECIFIER_TYPEP(x, type) \ +#define SPECIFIER_TYPEP(x, type) \ (SPECIFIERP (x) && SPECIFIER_TYPE_P (XSPECIFIER (x), type)) #define CHECK_SPECIFIER_TYPE(x, type) do { \ CHECK_SPECIFIER (x); \ diff -r 9f011ab08d48 -r 2f8bb876ab1d src/symsinit.h --- a/src/symsinit.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/symsinit.h Mon Aug 13 11:16:07 2007 +0200 @@ -152,6 +152,7 @@ void syms_of_window (void); void syms_of_select_x (void); void syms_of_eldap (void); +void syms_of_postgresql (void); void syms_of_gpmevent (void); /* Initialize the console types (dump-time but for reinit_). */ @@ -290,6 +291,7 @@ void reinit_vars_of_extents (void); void vars_of_faces (void); void vars_of_fileio (void); +void reinit_vars_of_fileio (void); void vars_of_filelock (void); void vars_of_floatfns (void); void vars_of_font_lock (void); @@ -376,6 +378,7 @@ void vars_of_select_x (void); void reinit_vars_of_select_x (void); void vars_of_eldap (void); +void vars_of_postgresql (void); void vars_of_gpmevent (void); /* Initialize specifier variables (dump-time only). */ @@ -428,7 +431,7 @@ void init_buffer (void); void init_callproc (void); -void init_console_stream (void); +void init_console_stream (int reinit); void init_device_tty (void); void init_dosfns (void); void init_editfns (void); diff -r 9f011ab08d48 -r 2f8bb876ab1d src/syntax.c --- a/src/syntax.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/syntax.c Mon Aug 13 11:16:07 2007 +0200 @@ -295,14 +295,13 @@ Lisp_Object syntax_match (Lisp_Object table, Emchar ch) { - Lisp_Object code = CHAR_TABLE_VALUE_UNSAFE (XCHAR_TABLE (table), ch); + Lisp_Object code = XCHAR_TABLE_VALUE_UNSAFE (table, ch); Lisp_Object code2 = code; if (CONSP (code)) code2 = XCAR (code); if (SYNTAX_FROM_CODE (XINT (code2)) == Sinherit) - code = CHAR_TABLE_VALUE_UNSAFE (XCHAR_TABLE (Vstandard_syntax_table), - ch); + code = XCHAR_TABLE_VALUE_UNSAFE (Vstandard_syntax_table, ch); return CONSP (code) ? XCDR (code) : Qnil; } diff -r 9f011ab08d48 -r 2f8bb876ab1d src/syntax.h --- a/src/syntax.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/syntax.h Mon Aug 13 11:16:07 2007 +0200 @@ -72,8 +72,8 @@ #define SYNTAX_CODE_UNSAFE(table, c) \ XINT (CHAR_TABLE_VALUE_UNSAFE (table, c)) -INLINE int SYNTAX_CODE (Lisp_Char_Table *table, Emchar c); -INLINE int +INLINE_HEADER int SYNTAX_CODE (Lisp_Char_Table *table, Emchar c); +INLINE_HEADER int SYNTAX_CODE (Lisp_Char_Table *table, Emchar c) { return SYNTAX_CODE_UNSAFE (table, c); @@ -85,8 +85,8 @@ #define SYNTAX_FROM_CODE(code) ((enum syntaxcode) ((code) & 0177)) #define SYNTAX(table, c) SYNTAX_FROM_CODE (SYNTAX_CODE (table, c)) -INLINE int WORD_SYNTAX_P (Lisp_Char_Table *table, Emchar c); -INLINE int +INLINE_HEADER int WORD_SYNTAX_P (Lisp_Char_Table *table, Emchar c); +INLINE_HEADER int WORD_SYNTAX_P (Lisp_Char_Table *table, Emchar c) { return SYNTAX (table, c) == Sword; diff -r 9f011ab08d48 -r 2f8bb876ab1d src/sysdep.c --- a/src/sysdep.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/sysdep.c Mon Aug 13 11:16:07 2007 +0200 @@ -93,6 +93,11 @@ #include "ntheap.h" #endif +#ifdef HAVE_MMAP +#include +#include +#endif + /* ------------------------------- */ /* TTY definitions */ /* ------------------------------- */ @@ -612,20 +617,20 @@ } #ifdef WINDOWSNT + pid_t sys_getpid (void) { return abs (getpid ()); } + #endif /* WINDOWSNT */ /* Fork a subshell. */ static void sys_subshell (void) { -#ifdef WINDOWSNT - HANDLE pid; -#else +#ifndef WINDOWSNT int pid; #endif struct save_signal saved_handlers[5]; @@ -660,21 +665,17 @@ str = (unsigned char *) alloca (XSTRING_LENGTH (dir) + 2); len = XSTRING_LENGTH (dir); memcpy (str, XSTRING_DATA (dir), len); - /* #### Unix specific */ - if (str[len - 1] != '/') str[len++] = '/'; + if (!IS_ANY_SEP (str[len - 1])) + str[len++] = DIRECTORY_SEP; str[len] = 0; xyzzy: -#ifdef WINDOWSNT - pid = NULL; -#else /* not WINDOWSNT */ - +#ifndef WINDOWSNT pid = fork (); if (pid == -1) error ("Can't spawn subshell"); if (pid == 0) - #endif /* not WINDOWSNT */ { char *sh = 0; @@ -688,7 +689,18 @@ if (str) sys_chdir (str); -#if !defined (NO_SUBPROCESSES) && !defined (WINDOWSNT) +#ifdef WINDOWSNT + + /* Waits for process completion */ + if (_spawnlp (_P_WAIT, sh, sh, NULL) != 0) + error ("Can't spawn subshell"); + else + return; /* we're done, no need to wait for termination */ + } + +#else + +#if !defined (NO_SUBPROCESSES) close_process_descs (); /* Close Emacs's pipes/ptys */ #endif @@ -697,23 +709,18 @@ nice (-emacs_priority); /* Give the new shell the default priority */ #endif -#ifdef WINDOWSNT - /* Waits for process completion */ - pid = (HANDLE) _spawnlp (_P_WAIT, sh, sh, NULL); - if (pid == NULL) - write (1, "Can't execute subshell", 22); - -#else /* not WINDOWSNT */ execlp (sh, sh, 0); write (1, "Can't execute subshell", 22); _exit (1); -#endif /* not WINDOWSNT */ } save_signal_handlers (saved_handlers); synch_process_alive = 1; wait_for_termination (pid); restore_signal_handlers (saved_handlers); + +#endif /* not WINDOWSNT */ + } #endif /* !defined (SIGTSTP) && !defined (USG_JOBCTRL) */ @@ -2191,7 +2198,7 @@ * */ -#ifdef ORDINARY_LINK +#if defined(ORDINARY_LINK) && !defined(__MINGW32__) extern char **environ; #endif @@ -2208,7 +2215,7 @@ * is known to live at or near the start of the system crt0.c, and * we don't sweat the handful of bytes that might lose. */ -#ifdef HEAP_IN_DATA +#if defined (HEAP_IN_DATA) && !defined(PDUMP) extern char* static_heap_base; if (!initialized) return static_heap_base; diff -r 9f011ab08d48 -r 2f8bb876ab1d src/sysdep.h --- a/src/sysdep.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/sysdep.h Mon Aug 13 11:16:07 2007 +0200 @@ -29,6 +29,10 @@ extern char **environ; #endif +#ifdef PDUMP +int pdump_read_file (char **pdump_start_pos, size_t *pdump_length); +#endif + int eight_bit_tty (struct device *d); void stuff_char (struct console *con, int c); diff -r 9f011ab08d48 -r 2f8bb876ab1d src/sysfile.h --- a/src/sysfile.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/sysfile.h Mon Aug 13 11:16:07 2007 +0200 @@ -24,6 +24,7 @@ #define INCLUDED_sysfile_h_ #include +#include #ifndef WINDOWSNT #include /* does not always imply this */ @@ -206,10 +207,21 @@ #define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) #endif +/* Client .c files should simply use `PATH_MAX'. */ +#ifndef PATH_MAX +# if defined (_POSIX_PATH_MAX) +# define PATH_MAX _POSIX_PATH_MAX +# elif defined (MAXPATHLEN) +# define PATH_MAX MAXPATHLEN +# else +# define PATH_MAX 1024 +# endif +#endif + +/* MAXPATHLEN is deprecated, but, as of this writing, still used. */ #ifndef MAXPATHLEN -/* in 4.1, param.h fails to define this. */ -#define MAXPATHLEN 1024 -#endif /* not MAXPATHLEN */ +# define MAXPATHLEN 1024 +#endif #ifndef X_OK # define X_OK 01 diff -r 9f011ab08d48 -r 2f8bb876ab1d src/window.c --- a/src/window.c Mon Aug 13 11:15:00 2007 +0200 +++ b/src/window.c Mon Aug 13 11:16:07 2007 +0200 @@ -290,6 +290,11 @@ INIT_DISP_VARIABLE (window_end_pos, 0); p->redisplay_end_trigger = Qnil; + p->gutter_extent_modiff[0] = 0; + p->gutter_extent_modiff[1] = 0; + p->gutter_extent_modiff[2] = 0; + p->gutter_extent_modiff[3] = 0; + #define WINDOW_SLOT(slot, compare) p->slot = Qnil #include "winslots.h" @@ -1010,31 +1015,35 @@ relative to the frame, not the window. ****************************************************************************/ +static int +window_top_window_gutter_height (struct window *w) +{ + if (!NILP (w->hchild) || !NILP (w->vchild)) + return 0; + +#ifdef HAVE_SCROLLBARS + if (!NILP (w->scrollbar_on_top_p)) + return window_scrollbar_height (w); + else +#endif + return 0; +} + int window_top_gutter_height (struct window *w) { - int gutter = WINDOW_REAL_TOP_GUTTER_BOUNDS (w); + return window_top_window_gutter_height (w); +} + +static int +window_bottom_window_gutter_height (struct window *w) +{ + int gutter; if (!NILP (w->hchild) || !NILP (w->vchild)) return 0; -#ifdef HAVE_SCROLLBARS - if (!NILP (w->scrollbar_on_top_p)) - return window_scrollbar_height (w) + gutter; - else -#endif - return gutter; -} - -int -window_bottom_gutter_height (struct window *w) -{ - int gutter = WINDOW_REAL_BOTTOM_GUTTER_BOUNDS (w); - - if (!NILP (w->hchild) || !NILP (w->vchild)) - return 0; - - gutter += window_modeline_height (w); + gutter = window_modeline_height (w); #ifdef HAVE_SCROLLBARS if (NILP (w->scrollbar_on_top_p)) @@ -1045,25 +1054,35 @@ } int -window_left_gutter_width (struct window *w, int modeline) -{ - int gutter = WINDOW_REAL_LEFT_GUTTER_BOUNDS (w); - +window_bottom_gutter_height (struct window *w) +{ + return window_bottom_window_gutter_height (w); +} + +static int +window_left_window_gutter_width (struct window *w, int modeline) +{ if (!NILP (w->hchild) || !NILP (w->vchild)) return 0; #ifdef HAVE_SCROLLBARS if (!modeline && !NILP (w->scrollbar_on_left_p)) - gutter += window_scrollbar_width (w); + return window_scrollbar_width (w); #endif - return gutter; + return 0; } int -window_right_gutter_width (struct window *w, int modeline) -{ - int gutter = WINDOW_REAL_RIGHT_GUTTER_BOUNDS (w); +window_left_gutter_width (struct window *w, int modeline) +{ + return window_left_window_gutter_width (w, modeline); +} + +static int +window_right_window_gutter_width (struct window *w, int modeline) +{ + int gutter = 0; if (!NILP (w->hchild) || !NILP (w->vchild)) return 0; @@ -1079,6 +1098,18 @@ return gutter; } +int +window_right_gutter_width (struct window *w, int modeline) +{ + return window_right_window_gutter_width (w, modeline); +} + +static int +window_pixel_height (struct window* w) +{ + return WINDOW_HEIGHT (w); +} + DEFUN ("windowp", Fwindowp, 1, 1, 0, /* Return t if OBJ is a window. @@ -1294,6 +1325,22 @@ Use `window-height' to get consistent results in geometry calculations. Use `window-displayed-height' to get the actual number of lines currently displayed in a window. + +The names are somewhat confusing; here's a table to help out: + + width height +------------------------------------------------------------------------- +w/o gutters + (rows/columns) window-width window-text-area-height + (pixels) window-text-area-pixel-width window-text-area-pixel-height + +with gutters + (rows/columns) window-full-width window-height + (pixels) window-pixel-width window-pixel-height + +actually displayed + (rows/columns) ---- window-displayed-height + (pixels) ---- window-displayed-text-pixel-height */ (window)) { @@ -1320,7 +1367,20 @@ */ (window)) { - return make_int (decode_window (window)->pixel_height); + return make_int (window_pixel_height (decode_window (window))); +} + +DEFUN ("window-text-area-height", Fwindow_text_area_height, 0, 1, 0, /* +Return the number of default lines in the text area of WINDOW. +This actually works by dividing the window's text area pixel height (i.e. +excluding the modeline and horizontal scrollbar, if any) by the height of the +default font; therefore, the number of displayed lines will probably +be different. +See also `window-height' and `window-displayed-height'. +*/ + (window)) +{ + return make_int (window_char_height (decode_window (window), 0)); } DEFUN ("window-text-area-pixel-height", @@ -1401,13 +1461,25 @@ DEFUN ("window-width", Fwindow_width, 0, 1, 0, /* Return the number of display columns in WINDOW. -This is the width that is usable columns available for text in WINDOW. +This is the width that is usable columns available for text in WINDOW, +and does not include vertical scrollbars, dividers, or the like. See also +`window-full-width' and `window-height'. */ (window)) { return make_int (window_char_width (decode_window (window), 0)); } +DEFUN ("window-full-width", Fwindow_full_width, 0, 1, 0, /* +Return the total number of columns in WINDOW. +This is like `window-width' but includes vertical scrollbars, dividers, +etc. +*/ + (window)) +{ + return make_int (window_char_width (decode_window (window), 1)); +} + DEFUN ("window-pixel-width", Fwindow_pixel_width, 0, 1, 0, /* Return the width of WINDOW in pixels. Defaults to current window. */ @@ -1526,15 +1598,14 @@ DEFUN ("window-pixel-edges", Fwindow_pixel_edges, 0, 1, 0, /* Return a list of the pixel edge coordinates of WINDOW. \(LEFT TOP RIGHT BOTTOM), all relative to 0, 0 at top left corner of frame. -The frame toolbars and menubars are considered to be outside of this area. +The frame toolbars, menubars and gutters are considered to be outside of this area. */ (window)) { struct window *w = decode_window (window); - struct frame *f = XFRAME (w->frame); - - int left = w->pixel_left - FRAME_LEFT_BORDER_END (f); - int top = w->pixel_top - FRAME_TOP_BORDER_END (f); + + int left = w->pixel_left; + int top = w->pixel_top; return list4 (make_int (left), make_int (top), @@ -3277,8 +3348,9 @@ /* we have already caught dead-window errors */ if (!NILP (w->hchild) || !NILP (w->vchild)) error ("Trying to select non-leaf window"); - + w->use_time = make_int (++window_select_count); + if (EQ (window, old_selected_window)) return window; @@ -3402,6 +3474,10 @@ p->line_start_cache = Dynarr_new (line_start_cache); p->face_cachels = Dynarr_new (face_cachel); p->glyph_cachels = Dynarr_new (glyph_cachel); + p->subwindow_instance_cache = + make_lisp_hash_table (10, + HASH_TABLE_KEY_WEAK, + HASH_TABLE_EQ); /* Put new into window structure in place of window */ replace_window (window, new); @@ -3617,12 +3693,6 @@ } static int -window_pixel_height (Lisp_Object window) -{ - return WINDOW_HEIGHT (XWINDOW (window)); -} - -static int window_pixel_height_to_char_height (struct window *w, int pixel_height, int include_gutters_p) { @@ -3635,8 +3705,8 @@ avail_height = (pixel_height - (include_gutters_p ? 0 : - window_top_gutter_height (w) + - window_bottom_gutter_height (w))); + window_top_window_gutter_height (w) + + window_bottom_window_gutter_height (w))); default_face_height_and_width (window, &defheight, &defwidth); @@ -3667,8 +3737,8 @@ avail_height = char_height * defheight; pixel_height = (avail_height + (include_gutters_p ? 0 : - window_top_gutter_height (w) + - window_bottom_gutter_height (w))); + window_top_window_gutter_height (w) + + window_bottom_window_gutter_height (w))); /* It's the calling function's responsibility to check these values and make sure they're not out of range. @@ -3681,11 +3751,12 @@ /* Return number of default lines of text can fit in the window W. If INCLUDE_GUTTERS_P is 1, include "gutter" space (modeline plus horizontal scrollbar) in the space that is used for the calculation. + This doesn't include space used by the frame gutters. */ int window_char_height (struct window *w, int include_gutters_p) { - return window_pixel_height_to_char_height (w, WINDOW_HEIGHT (w), + return window_pixel_height_to_char_height (w, window_pixel_height (w), include_gutters_p); } @@ -3765,6 +3836,8 @@ return WINDOW_WIDTH (XWINDOW (window)); } +/* Calculate the pixel of a window, optionally including margin space + but no vertical gutters. */ static int window_pixel_width_to_char_width (struct window *w, int pixel_width, int include_margins_p) @@ -3809,8 +3882,8 @@ avail_width = char_width * defwidth; pixel_width = (avail_width + - window_left_gutter_width (w, 0) + - window_right_gutter_width (w, 0) + + window_left_window_gutter_width (w, 0) + + window_right_window_gutter_width (w, 0) + (include_margins_p ? 0 : window_left_margin_width (w)) + (include_margins_p ? 0 : window_right_margin_width (w))); @@ -3849,6 +3922,12 @@ (widthflag ? window_min_width : MINI_WINDOW_P (XWINDOW (window)) \ ? 1 : window_min_height) +static int +window_pixheight (Lisp_Object w) +{ + return window_pixel_height (XWINDOW (w)); +} + /* Unlike set_window_pixheight, this function also changes the heights of the siblings so as to keep everything consistent. */ @@ -3864,7 +3943,7 @@ int *sizep; int (*sizefun) (Lisp_Object) = (widthflag ? window_pixel_width - : window_pixel_height); + : window_pixheight); void (*setsizefun) (Lisp_Object, int, int) = (widthflag ? set_window_pixwidth : set_window_pixheight); @@ -5102,7 +5181,7 @@ frame "sizes" maybe equal but the windows still should be resized. This is tickled alot by the new "character size stays constant" policy in 21.0. It leads to very wierd - glitches (and possibly craches when asserts are tickled). + glitches (and possibly crashes when asserts are tickled). Just changing the units doens't help because changing the toolbar configuration can also change the pixel positions. @@ -5175,6 +5254,10 @@ w->glyph_cachels = Dynarr_new (glyph_cachel); if (!w->line_start_cache) w->line_start_cache = Dynarr_new (line_start_cache); + w->gutter_extent_modiff[0] = 0; + w->gutter_extent_modiff[1] = 0; + w->gutter_extent_modiff[2] = 0; + w->gutter_extent_modiff[3] = 0; w->dead = 0; if (p->parent_index >= 0) @@ -5374,6 +5457,7 @@ the restored current_window. */ if (f == selected_frame ()) { +#if 0 /* When using `pop-window-configuration', often the minibuffer ends up as the selected window even though it's not active ... I really don't know the cause of this, but it should never @@ -5382,15 +5466,25 @@ #### Find out why this is really going wrong. */ if (!minibuf_level && MINI_WINDOW_P (XWINDOW (config->current_window))) - Fselect_window (Fnext_window (config->current_window, - Qnil, Qnil, Qnil), - Qnil); + window_to_select = Fnext_window (config->current_window, + Qnil, Qnil, Qnil); else - Fselect_window (config->current_window, Qnil); + window_to_select = config->current_window; +#endif + /* Do this last so that buffer stacking is calculated + correctly. */ + Fselect_window (config->current_window, Qnil); + if (!NILP (new_current_buffer)) - Fset_buffer (new_current_buffer); + { + Fset_buffer (new_current_buffer); + Frecord_buffer (new_current_buffer); + } else - Fset_buffer (XWINDOW (Fselected_window (Qnil))->buffer); + { + Fset_buffer (XWINDOW (config->current_window)->buffer); + Frecord_buffer (XWINDOW (config->current_window)->buffer); + } } else set_frame_selected_window (f, config->current_window); @@ -5599,7 +5693,14 @@ /* config->frame_width = FRAME_WIDTH (f); config->frame_height = FRAME_HEIGHT (f); */ - config->current_window = FRAME_SELECTED_WINDOW (f); + /* When using `push-window-configuration', often the minibuffer ends + up as the selected window because functions run as the result of + user interaction e.g. hyper-apropros. It seems to me the sensible + thing to do is not record the minibuffer here. */ + if (FRAME_MINIBUF_ONLY_P (f) || minibuf_level) + config->current_window = FRAME_SELECTED_WINDOW (f); + else + config->current_window = FRAME_LAST_NONMINIBUF_WINDOW (f); XSETBUFFER (config->current_buffer, current_buffer); config->minibuffer_scroll_window = Vminibuffer_scroll_window; config->root_window = FRAME_ROOT_WINDOW (f); @@ -5739,15 +5840,15 @@ child = Fwindow_first_hchild (window); for (i = level; i > 0; i--) - putc ('\t', stderr); - - fputs ("#buffer; if (!NILP (buffer) && BUFFERP (buffer)) - fprintf (stderr, " on %s", XSTRING_DATA (XBUFFER (buffer)->name)); + stderr_out (" on %s", XSTRING_DATA (XBUFFER (buffer)->name)); } - fprintf (stderr, " 0x%x>", XWINDOW (window)->header.uid); + stderr_out (" 0x%x>", XWINDOW (window)->header.uid); while (!NILP (child)) { @@ -5815,8 +5916,10 @@ DEFSUBR (Fwindow_height); DEFSUBR (Fwindow_displayed_height); DEFSUBR (Fwindow_width); + DEFSUBR (Fwindow_full_width); DEFSUBR (Fwindow_pixel_height); DEFSUBR (Fwindow_pixel_width); + DEFSUBR (Fwindow_text_area_height); DEFSUBR (Fwindow_text_area_pixel_height); DEFSUBR (Fwindow_displayed_text_pixel_height); DEFSUBR (Fwindow_text_area_pixel_width); diff -r 9f011ab08d48 -r 2f8bb876ab1d src/window.h --- a/src/window.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/window.h Mon Aug 13 11:16:07 2007 +0200 @@ -184,6 +184,9 @@ must run the redisplay-end-trigger-functions. */ Lisp_Object redisplay_end_trigger; + /* Set by the extent code when extents in the gutter are changed. */ + int gutter_extent_modiff[4]; + /* Set by redisplay to the last position seen. This is used to implement the redisplay-end-trigger-functions. */ Bufpos last_redisplay_pos; diff -r 9f011ab08d48 -r 2f8bb876ab1d src/winslots.h --- a/src/winslots.h Mon Aug 13 11:15:00 2007 +0200 +++ b/src/winslots.h Mon Aug 13 11:16:07 2007 +0200 @@ -102,6 +102,10 @@ This is not a size hog because the value here is not copied, and will be shared with the specs in the specifier. */ WINDOW_SLOT_ARRAY (gutter, 4, EQUAL_WRAPPED); + /* Real (pre-calculated) gutter specification for each of the four positions. + This is not a specifier, it is calculated by the specifier change + functions. */ + WINDOW_SLOT_ARRAY (real_gutter, 4, EQUAL_WRAPPED); /* Gutter size for each of the four positions. */ WINDOW_SLOT_ARRAY (gutter_size, 4, EQUAL_WRAPPED); /* Real (pre-calculated) gutter size for each of the four positions. diff -r 9f011ab08d48 -r 2f8bb876ab1d tests/ChangeLog --- a/tests/ChangeLog Mon Aug 13 11:15:00 2007 +0200 +++ b/tests/ChangeLog Mon Aug 13 11:16:07 2007 +0200 @@ -1,3 +1,16 @@ +2000-03-20 Martin Buchholz + + * XEmacs 21.2.32 is released. + +2000-03-10 Martin Buchholz + + * automated/mule-tests.el: Check that (make-temp-name) returns + unique values. + +2000-03-06 Yoshiki Hayashi + + * gutter-test.el: Fix name of specifier. + 2000-02-23 Martin Buchholz * XEmacs 21.2.31 is released. diff -r 9f011ab08d48 -r 2f8bb876ab1d tests/automated/c-tests.el --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/automated/c-tests.el Mon Aug 13 11:16:07 2007 +0200 @@ -0,0 +1,43 @@ +;; Copyright (C) 2000 Martin Buchholz + +;; Author: Martin Buchholz +;; Maintainer: Martin Buchholz +;; Created: 1998 +;; Keywords: tests + +;; This file is part of XEmacs. + +;; XEmacs is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; XEmacs is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with XEmacs; see the file COPYING. If not, write to the Free +;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +;; 02111-1307, USA. + +;;; Synched up with: Not in FSF. + +;;; Commentary: + +;;; Call tests in src/tests.c, which cannot be written using lisp only. +;;; See test-harness.el for instructions on how to run these tests. + +(eval-when-compile + (condition-case nil + (require 'test-harness) + (file-error + (push "." load-path) + (when (and (boundp 'load-file-name) (stringp load-file-name)) + (push (file-name-directory load-file-name) load-path)) + (require 'test-harness)))) + +(when (boundp 'test-function-list) ; Only if configure --debug + (loop for fun in test-function-list do + (Assert (eq 'PASS (funcall fun))))) diff -r 9f011ab08d48 -r 2f8bb876ab1d tests/automated/mule-tests.el --- a/tests/automated/mule-tests.el Mon Aug 13 11:15:00 2007 +0200 +++ b/tests/automated/mule-tests.el Mon Aug 13 11:16:07 2007 +0200 @@ -299,6 +299,7 @@ (file-name-coding-system 'iso-8859-2)) ;; This is how you suppress output from `message', called by `write-region' (flet ((append-message (&rest args) ())) + (Assert (not (equal name1 name2))) (Assert (not (file-exists-p name1))) (write-region (point-min) (point-max) name1) (Assert (file-exists-p name1)) diff -r 9f011ab08d48 -r 2f8bb876ab1d tests/glyph-test.el --- a/tests/glyph-test.el Mon Aug 13 11:15:00 2007 +0200 +++ b/tests/glyph-test.el Mon Aug 13 11:16:07 2007 +0200 @@ -18,26 +18,26 @@ (make-extent (point) (point)) (setq radio-button1 (make-glyph - [button :descriptor ["ok " (setq ok-select t) + [button :descriptor ["ok1" (setq ok-select t) :style radio :selected ok-select]]))) ;; button in a group (set-extent-begin-glyph (make-extent (point) (point)) (setq radio-button2 (make-glyph - [button :descriptor ["ok" (setq ok-select nil) :style radio +` [button :descriptor ["ok2" (setq ok-select nil) :style radio :selected (not ok-select)]]))) ;; toggle button (set-extent-begin-glyph (make-extent (point) (point)) (setq tbutton - (make-glyph [button :descriptor ["ok" (setq ok-select nil) + (make-glyph [button :descriptor ["ok3" (setq ok-select nil) :style toggle :selected (not ok-select)]]))) (set-extent-begin-glyph (make-extent (point) (point)) (setq toggle-button - (make-glyph [button :descriptor ["ok" :style toggle + (make-glyph [button :descriptor ["ok4" :style toggle :callback (setq ok-select (not ok-select)) :selected ok-select]]))) @@ -69,9 +69,9 @@ [tab-control :descriptor "My Tab" :face highlight :orientation right - :properties (:items (["One" foo] - ["Two" fee] - ["Three" foo]))]))) + :properties (:items (["One" foo :selected t] + ["Two" fee :selected nil] + ["Three" foo :selected nil]))]))) ;; progress gauge (set-extent-begin-glyph diff -r 9f011ab08d48 -r 2f8bb876ab1d tests/gutter-test.el --- a/tests/gutter-test.el Mon Aug 13 11:15:00 2007 +0200 +++ b/tests/gutter-test.el Mon Aug 13 11:16:07 2007 +0200 @@ -1,17 +1,23 @@ -(setq str "Hello There\nHello Again") +(setq str "Hello\nAgain") +(setq str-ext (make-extent 0 5 str)) (set-extent-begin-glyph - (make-extent 0 0 str) + str-ext (make-glyph [xpm :file "../etc/xemacs-icon.xpm"])) +(set-extent-property str-ext 'mouse-face 'highlight) +(setq str2 "Hello\n") +(setq str2-ext (make-extent 0 1 str2)) (set-extent-begin-glyph - (make-extent 3 3 str) + str2-ext (make-glyph [button :width 5 :height 1 :face modeline-mousable + :callback (set-specifier bottom-gutter-visible-p '(str2)) :descriptor "ok" :selected t])) -(set-specifier default-gutter-height 'autodetect) -(set-specifier default-gutter-width 40) -(set-specifier default-gutter-border-width 2) -(set-specifier default-gutter str) -(set-default-gutter-position 'bottom) +(set-specifier bottom-gutter-height 'autodetect) +(set-specifier bottom-gutter-border-width 2) +(set-gutter-element bottom-gutter 'str str) +(set-gutter-element bottom-gutter 'str2 str2) +(set-gutter-element-visible-p bottom-gutter-visible-p 'str t) +(set-gutter-element-visible-p bottom-gutter-visible-p 'str2 t) diff -r 9f011ab08d48 -r 2f8bb876ab1d version.sh --- a/version.sh Mon Aug 13 11:15:00 2007 +0200 +++ b/version.sh Mon Aug 13 11:16:07 2007 +0200 @@ -2,8 +2,8 @@ emacs_is_beta=t emacs_major_version=21 emacs_minor_version=2 -emacs_beta_version=31 -xemacs_codename="Iris" +emacs_beta_version=32 +xemacs_codename="Kastor & Polydeukes" infodock_major_version=4 infodock_minor_version=0 infodock_build_version=8