#!/bin/sh #### Patch script - GNU Emacs - version 19.19 to 19.20 #### This file contains patches to turn version 19.19 of GNU Emacs into #### 19.20. To apply them, cd to the top of the Emacs source tree, and #### then type 'sh '. #### After you apply the patches, you should run Emacs (an earlier 19 will do) #### and type M-x byte-recompile-directory RET lisp RET #### to recompile the changed Emacs Lisp files. #### Then you can build the new Emacs version. #### Also compile some new files: #### iso-acc.el mouse-sel.el pascal.el pp.el #### regi.el supercite.el thingatpt.el #### Use M-x byte-compile-file RET RET to compile #### file . You need to do it once for each of these new files. #### #### Compile regi.el and thingatpt.el first, then load the compiled files #### compiling mouse-sel.el and supercite.el. #### Use M-x load-file RET RET to load. #### We don't include patches for Info files since you can #### regenerate them from the Texinfo files that we do include. #### To update the changed info files, do #### (cd man; makeinfo emacs.texi; makeinfo cl.texi; makeinfo gnus.texi) ### Patchmaker's checklist: ### - update version numbers in comments and version.el tweak ### - diff -u ls -R listings, and decide on rm's and mv's. ### - apply rm's and mv's, and then do a diff -cprP --exclude=\*.elc ### to generate the body. ### - insert the body just before the line saying `end-of-emacs-patch-kit'. if [ -d lisp ] ; then true else if [ -d emacs-19.19/lisp ] ; then cd emacs-19.19 else (echo "$0: In order to apply this patch, the current directory" echo "must be the top of the Emacs distribution tree.") >&2 exit 1 fi fi ### We can't patch version.el, because it contains some random dump ### number. So we'll be a little more relaxed about this edit. sed < lisp/version.el > $$ \ -e 's/defconst emacs-version "[^"]*"/defconst emacs-version "19.20.0"/' mv lisp/version.el lisp/version.el~ mv $$ lisp/version.el ### Put moves and renames here. rm src/Makefile.in rm lisp/sc-elec.el lisp/sc-elec.elc lisp/sc.elc mv build-install.in build-ins.in mv src/ymakefile src/Makefile.in.in mv man/sc.texinfo man/sc.texi mv man/forms.texinfo man/forms.texi mv man/cl.texinfo man/cl.texi mv man/vip.texinfo man/vip.texi patch -p1 << \end-of-emacs-patch-kit diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/ChangeLog emacs-19.20/ChangeLog *** emacs-19.19/ChangeLog Sat Aug 14 19:04:02 1993 --- emacs-19.20/ChangeLog Thu Nov 11 19:35:49 1993 *************** *** 1,2 **** --- 1,127 ---- + Thu Nov 11 09:52:37 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * Version 19.20 released. + + * build-ins.in: Renamed from build-install.in. + + Wed Nov 10 16:02:03 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * make-dist: Don't try to link *.texinfo--there are none now. + When running make in lib-src, specify YACC var value. + + Sun Oct 3 15:55:17 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * configure.in (extrasub): Add vpath patterns for %.[yls]. + + * configure.in: Don't do seddery on config.status after AC_OUTPUT. + Instead just include the commands to make src/Makefile as the + second arg to AC_OUTPUT. + + * configure.in: Use : instead of dnl for comment inside + $makefile_command. + + * configure.in: No longer use vpath_sed. Instead, when we notice + srcdir already configured, set extrasub to hack vpath in the + makefiles. + + * configure.in: In cmds to make src/Makefile, chmod Makefile.new + before moving it. + * Makefile.in (VPATH): Define to @srcdir@. + + Tue Sep 28 03:25:46 1993 Brian Fox (bfox@cubit) + + * configure.in: Don't copy ${srcdir}/src/Makefile.in; that file + doesn't exist. Just copy src/Makefile.in instead. Touch + all of the Makefiles after editing config.status. + + * INSTALL: Update documentation to match new configuration + mechanism. + + Mon Sep 27 08:51:38 1993 Brian Fox (bfox@ai.mit.edu) + + * configure.in: Allow any of the path or directory Makefile + variables to be set with flags to configure. Create all Makefiles + at configure time. Edit special commands into config.status after + src/Makefile.in is built from src/Makefile. + + * Makefile.in (src/Makefile, lib-src/Makefile, oldXMenu/Makefile): + If these files are out of date, simply have config.status + rebuild them; don't rebuild them explicitly. + + Sat Sep 25 12:00:38 1993 Brian Fox (bfox@ai.mit.edu) + + * build-install.in: Change src/xemacs to src/emacs. We no longer + create src/xemacs, so the file wouldn't be found. + + * make-dist: Remove `src/ymakefile', add `src/Makefile.in.in'. + + Fri Sep 24 03:07:35 1993 Brian Fox (bfox@albert.gnu.ai.mit.edu) + + * configure.in: Avoid forcing the search of /usr/include before + fixed include files by resetting C_SWITCH_X_SITE if it is + "-I/usr/include". + + Mon Sep 20 09:47:59 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * Makefile.in (@rip_paths@locallisppath): + Delete ${datadir}/emacs/site-lisp. + + Sun Sep 15 19:54:04 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * configure.in: + Use AC_QUOTE_SQUOTE twice to properly quote vpath_sed value. + Remove ${extra_output} from AC_OUTPUT call. + + Fri Sep 17 13:22:22 1993 Brian Fox (bfox@inferno) + + * make-dist: Quote backquotes found in strings to be echoed. + + * configure.in: Use "sh -c pwd" when we want to avoid having the + shell fix up the value of $PWD. + + Mon Sep 13 21:06:16 1993 Brian Fox (bfox@inferno) + + * Makefile.in (do-install): Don't abort if ln or chmod at the end + of the installation fail. Suggested by Karl Berry. + + Mon Aug 30 07:41:04 1993 Brian Fox (bfox@inferno) + + * Makefile.in (*clean): Use "$(MAKE) $(MAKEFLAGS)" wherever "make" + was used. Set MAKEFLAGS from MFLAGS. + + Thu Sep 16 16:08:11 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * configure.in: Test for res_init in libc. + + Mon Sep 13 11:56:01 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * configure.in: In the file ${tempcname}, use configure___ + instead of @configure@. + + Sun Sep 12 10:51:49 1993 Roland McGrath (roland@sugar-bombs.gnu.ai.mit.edu) + + * make-dist: Dist vpath.sed + + * Makefile.in (lib-src/Makefile, src/Makefile, oldXMenu/Makefile): + Depend on vpath.sed. + Replace sed comand for VPATH with @vpath_sed@. + + * configure.in: Substitute variable `vpath_sed'. + If not in $srcdir and $srcdir is configured, + issue warning that GNU make is required, + and set vpath_sed to use vpath.sed script. + + Fri Sep 10 01:18:13 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * configure.in: Remove check for $srcdir being configured. This + pretty much works now. + Grok {m68*-hp,i[34]86-*}-netbsd* and set opsys=netbsd. + Check for XFree86 (/usr/X386/include) independent of whether + -lXbsd exists. + + * Makefile.in (info, dvi, clean, mostlyclean, distclean, + realclean, unlock, relock): Use `$(MAKE)' in place of plain + `make'. + Sat Aug 14 01:31:37 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/GETTING.GNU.SOFTWARE emacs-19.20/GETTING.GNU.SOFTWARE *** emacs-19.19/GETTING.GNU.SOFTWARE Sun Aug 15 01:17:44 1993 --- emacs-19.20/GETTING.GNU.SOFTWARE Sun Sep 12 04:44:50 1993 *************** *** 89,103 **** `/pub/gnu/GNUinfo/DESCRIPTIONS'. - ** Where is the documentation? - - If documentation exists, it is inside each program's source code - distribution. Instructions on installing a program are often in files - name "README" and "INSTALL". Manuals and on-line documentations are - written in GNU's texinfo format and are found in files ending with - ".texi" or ".texinfo". Reference cards are usually written in TeX, - and TeX files end in ".tex". Unix style man pages only exist, when - volunteers supply them (the GNU Project finds the texinfo format to - be superior). Man page files usually end in a single digit. - * No Warranties --- 89,92 ---- diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/INSTALL emacs-19.20/INSTALL *** emacs-19.19/INSTALL Sun Aug 15 01:17:45 1993 --- emacs-19.20/INSTALL Thu Nov 11 19:35:08 1993 *************** *** 22,27 **** least 400k and can reach 8Mb or more. If the swapping space is insufficient, you will get an error in the command `temacs -batch -l ! loadup dump', found in `./src/ymakefile', or possibly when running the ! final dumped Emacs. Building Emacs requires about 30 Mb of disk space (including the Emacs --- 22,27 ---- least 400k and can reach 8Mb or more. If the swapping space is insufficient, you will get an error in the command `temacs -batch -l ! loadup dump', found in `./src/Makefile.in.in', or possibly when ! running the final dumped Emacs. Building Emacs requires about 30 Mb of disk space (including the Emacs *************** *** 388,416 **** redefine parameters used in `./lib-src/movemail.c'. ! 3) If you're going to use the make utility to build Emacs, copy ! `./Makefile.in' to `./Makefile', and then edit that to specify 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. ! ! 4) Typing `make src/Makefile lib-src/Makefile' builds the ! makefiles for the subdirectories, editing in the values for the path ! variables you established in step 3. ! -- or -- 4) If you're going to use the build-install script to build Emacs, ! copy `./build-install.in' to `./build-install', and edit the similar definitions found at the top of the script. - The `configure' script is built from `configure.in' by the `autoconf' program. However, since Emacs has configuration requirements that ! autoconf can't meet, `configure.in' uses an unholy 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. --- 388,412 ---- redefine parameters used in `./lib-src/movemail.c'. ! 3) If you're going to use the make utility to build Emacs, you will ! still need to run `configure' first, giving theappropriate 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/emacslock 4) If you're going to use the build-install script to build Emacs, ! copy `./build-ins.in' to `./build-install', and edit the definitions found at the top of the script. The `configure' script is built from `configure.in' by the `autoconf' program. However, since Emacs has configuration requirements that ! autoconf can't meet, `configure.in' uses an 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. *************** *** 433,438 **** This creates a file `./src/emacs' which is the runnable Emacs, ! assigning it a new version number by incrementing the version stored ! in `./lisp/version.el'. It also creates a file in `./etc' whose name is `DOC' followed by the --- 429,434 ---- This creates a file `./src/emacs' which is the runnable Emacs, ! assigning it a new build version number by incrementing the build ! version stored in `./lisp/version.el'. It also creates a file in `./etc' whose name is `DOC' followed by the diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/Makefile.in emacs-19.20/Makefile.in *** emacs-19.19/Makefile.in Thu Aug 12 23:47:56 1993 --- emacs-19.20/Makefile.in Sun Oct 3 15:54:56 1993 *************** *** 74,82 **** # Where to install Emacs and other binaries that people will want to # run directly (like etags). ! bindir=${exec_prefix}/bin # Where to install architecture-independent data files. ${lispdir} # and ${etcdir} are subdirectories of this. ! datadir=${prefix}/lib # Where to install and expect the files that Emacs modifies as it --- 74,82 ---- # Where to install Emacs and other binaries that people will want to # run directly (like etags). ! bindir=@bindir@ # Where to install architecture-independent data files. ${lispdir} # and ${etcdir} are subdirectories of this. ! datadir=@datadir@ # Where to install and expect the files that Emacs modifies as it *************** *** 84,88 **** # only such data is the locking directory; ${lockdir} is a # subdirectory of this. ! statedir=${prefix}/lib # Where to install and expect executable files to be run by Emacs --- 84,88 ---- # only such data is the locking directory; ${lockdir} is a # subdirectory of this. ! statedir=@statedir@ # Where to install and expect executable files to be run by Emacs *************** *** 92,96 **** # Where to install Emacs's man pages, and what extension they should have. ! mandir=${prefix}/man/man1 manext=.1 --- 92,96 ---- # Where to install Emacs's man pages, and what extension they should have. ! mandir=@mandir@ manext=.1 *************** *** 99,103 **** # since there are now many packages documented with the texinfo # system, it is inappropriate to imply that it is part of Emacs. ! infodir=${prefix}/info # Where to find the source code. The source code for Emacs's C kernel is --- 99,103 ---- # since there are now many packages documented with the texinfo # system, it is inappropriate to imply that it is part of Emacs. ! infodir=@infodir@ # Where to find the source code. The source code for Emacs's C kernel is *************** *** 107,110 **** --- 107,113 ---- srcdir=@srcdir@ + # Tell make where to find source files; this is needed for the makefiles. + VPATH=@srcdir@ + # ==================== Emacs-specific directories ==================== *************** *** 112,126 **** # based on the values of the standard Make variables above. ! @inst_paths@# Where to install the lisp files distributed with ! @inst_paths@# Emacs. This includes the Emacs version, so that the ! @inst_paths@# lisp files for different versions of Emacs will install ! @inst_paths@# themselves in separate directories. ! @inst_paths@lispdir=${datadir}/emacs/${version}/lisp ! ! @inst_paths@# Directories Emacs should search for lisp files specific ! @inst_paths@# to this site (i.e. customizations), before consulting ! @inst_paths@# ${lispdir}. This should be a colon-separated list of ! @inst_paths@# directories. ! @inst_paths@locallisppath=${datadir}/emacs/site-lisp # Where Emacs will search to find its lisp files. Before --- 115,129 ---- # based on the values of the standard Make variables above. ! # Where to install the lisp files distributed with ! # Emacs. This includes the Emacs version, so that the ! # lisp files for different versions of Emacs will install ! # themselves in separate directories. ! lispdir=@lispdir@ ! ! # Directories Emacs should search for lisp files specific ! # to this site (i.e. customizations), before consulting ! # ${lispdir}. This should be a colon-separated list of ! # directories. ! locallisppath=@locallisppath@ # Where Emacs will search to find its lisp files. Before *************** *** 128,132 **** # better be served by changing locallisppath. This # should be a colon-separated list of directories. ! lisppath=${locallisppath}:${lispdir} # Where Emacs will search for its lisp files while --- 131,135 ---- # better be served by changing locallisppath. This # should be a colon-separated list of directories. ! lisppath=@lisppath@ # Where Emacs will search for its lisp files while *************** *** 140,178 **** buildlisppath=${srcdir}/lisp ! @inst_paths@# Where to install the other architecture-independent ! @inst_paths@# data files distributed with Emacs (like the tutorial, ! @inst_paths@# the cookie recipes and the Zippy database). This path ! @inst_paths@# usually contains the Emacs version number, so the data ! @inst_paths@# files for multiple versions of Emacs may be installed ! @inst_paths@# at once. ! @inst_paths@etcdir=${datadir}/emacs/${version}/etc ! ! @inst_paths@# Where to create and expect the locking directory, where ! @inst_paths@# the Emacs locking code keeps track of which files are ! @inst_paths@# currently being edited. ! @inst_paths@lockdir=${statedir}/emacs/lock ! ! @inst_paths@# Where to put executables to be run by Emacs rather than ! @inst_paths@# the user. This path usually includes the Emacs version ! @inst_paths@# and configuration name, so that multiple configurations ! @inst_paths@# for multiple versions of Emacs may be installed at ! @inst_paths@# once. ! @inst_paths@archlibdir=${libdir}/emacs/${version}/${configuration} ! ! # ====================== Developer's configuration ======================= ! ! # The following assignments make sense if you're running Emacs on a single ! # machine, one version at a time, and you want changes to the lisp and etc ! # directories in the source tree to show up immediately in your working ! # environment. It saves a great deal of disk space by not duplicating the ! # lisp and etc directories. ! ! @rip_paths@lispdir=${srcdir}/lisp ! @rip_paths@externallispdir=${srcdir}/externallisp ! @rip_paths@locallisppath=${srcdir}/site-lisp:${datadir}/emacs/site-lisp ! @rip_paths@etcdir=${srcdir}/etc ! @rip_paths@lockdir=${srcdir}/lock ! @rip_paths@archlibdir=${srcdir}/lib-src ! @rip_paths@infodir=${srcdir}/info # ==================== Utility Programs for the Build ==================== --- 143,165 ---- buildlisppath=${srcdir}/lisp ! # Where to install the other architecture-independent ! # data files distributed with Emacs (like the tutorial, ! # the cookie recipes and the Zippy database). This path ! # usually contains the Emacs version number, so the data ! # files for multiple versions of Emacs may be installed ! # at once. ! etcdir=@etcdir@ ! ! # Where to create and expect the locking directory, where ! # the Emacs locking code keeps track of which files are ! # currently being edited. ! lockdir=@lockdir@ ! ! # Where to put executables to be run by Emacs rather than ! # the user. This path usually includes the Emacs version ! # and configuration name, so that multiple configurations ! # for multiple versions of Emacs may be installed at ! # once. ! archlibdir=@archlibdir@ # ==================== Utility Programs for the Build ==================== *************** *** 185,191 **** # ============================= Targets ============================== - # Flags passed down to subdirectory makefiles. - MFLAGS = - # Subdirectories to make recursively. `lisp' is not included # because the compiled lisp files are part of the distribution --- 172,175 ---- *************** *** 233,311 **** ${SUBDIR}: ${SUBDIR_MAKEFILES} FRC ! cd $@; $(MAKE) all ${MFLAGS} \ ! CC='${CC}' CFLAGS='${CFLAGS}' MAKE='${MAKE}' \ ! prefix='${prefix}' srcdir='${srcdir}/$@' libdir='${libdir}' ! ! ## We build the makefiles for the subdirectories here so that we can ! ## edit the values for the path variables into them. This means that ! ## when the user has built them from this makefile once, they will use ! ## the right default values for the path variables. ! lib-src/Makefile: ${srcdir}/lib-src/Makefile.in Makefile ! rm -f lib-src/Makefile.tmp ! @echo "Producing \`lib-src/Makefile' from \`${srcdir}/lib-src/Makefile.in'." ! @(echo "# This file is generated from \`${srcdir}/lib-src/Makefile.in'." ; \ ! echo "# If you are thinking about editing it, you should seriously consider" ; \ ! echo "# running \`make lib-src/Makefile' at the top of the" ; \ ! echo "# Emacs build tree instead, or editing" ; \ ! echo "# \`${srcdir}/lib-src/Makefile.in' itself." ; \ ! sed < ${srcdir}/lib-src/Makefile.in \ ! -e 's|^\(version *=\).*$$|\1'"${version}"'|' \ ! -e 's|^\(configname *=\).*$$|\1'"${configuration}"'|' \ ! -e 's|^\(prefix *=\).*$$|\1'"${prefix}"'|' \ ! -e 's|^\(exec_prefix *=\).*$$|\1'"${exec_prefix}"'|' \ ! -e 's|^\(libdir *=\).*$$|\1'"${libdir}"'|' \ ! -e 's|^\(srcdir *=\).*$$|\1'"${srcdir}"'/lib-src|' \ ! -e 's|^\(VPATH *=\).*$$|\1'"${srcdir}"'/lib-src|' \ ! -e 's|^\(archlibdir *=\).*$$|\1'"${archlibdir}"'|' \ ! -e 's|^\(ALLOCA *=\).*$$|\1'"${ALLOCA}"'|' \ ! -e 's|^\(YACC *=\).*$$|\1'"${YACC}"'|' \ ! -e 's|^CC *=.*$$|CC='"${CC}"'|' \ ! -e 's|^CFLAGS *=.*$$|CFLAGS='"${CFLAGS}"'|' \ ! -e 's|^C_SWITCH_SYSTEM *=.*$$|C_SWITCH_SYSTEM='"${C_SWITCH_SYSTEM}"'|' \ ! -e 's|^LOADLIBES *=.*$$|LOADLIBES='"${libsrc_libs}"'|' \ ! -e '/^# DIST: /d') > lib-src/Makefile.tmp ! @${srcdir}/move-if-change lib-src/Makefile.tmp lib-src/Makefile ! chmod -w lib-src/Makefile ! ! src/Makefile: ${srcdir}/src/Makefile.in Makefile ! rm -f src/Makefile.tmp ! @echo "Producing \`src/Makefile' from \`${srcdir}/src/Makefile.in'." ! @(echo "# This file is generated from \`${srcdir}/src/Makefile.in'." ; \ ! echo "# If you are thinking about editing it, you should seriously consider" ; \ ! echo "# running \`make src/Makefile' at the top of the" ; \ ! echo "# Emacs build tree instead, or editing" ; \ ! echo "# \`${srcdir}/src/Makefile.in' itself." ; \ ! sed < ${srcdir}/src/Makefile.in \ ! -e 's|^\(srcdir *=\).*$$|\1${srcdir}/src|' \ ! -e 's|^\(VPATH *=\).*$$|\1${srcdir}/src|' \ ! -e 's|^CC *=.*$$|CC=${CC}|' \ ! -e 's|^CPP *=.*$$|CPP=${CPP}|' \ ! -e 's|^LN_S *=.*$$|LN_S=${LN_S}|' \ ! -e 's|^CFLAGS *=.*$$|CFLAGS=${CFLAGS}|' \ ! -e 's|^\(C_SWITCH_SYSTEM *=\).*$$|\1'"${C_SWITCH_SYSTEM}"'|' \ ! -e 's|^\(LD_SWITCH_X_SITE *=\).*$$|\1${LD_SWITCH_X_SITE}|' \ ! -e '/^# DIST: /d') > src/Makefile.tmp ! @${srcdir}/move-if-change src/Makefile.tmp src/Makefile ! chmod -w src/Makefile ! ! oldXMenu/Makefile: ${srcdir}/oldXMenu/Makefile.in Makefile ! rm -f oldXMenu/Makefile.tmp ! @echo "Producing \`oldXMenu/Makefile' from \`${srcdir}/oldXMenu/Makefile.in'." ! @(echo "# This file is generated from \`${srcdir}/oldXMenu/Makefile.in'." ; \ ! echo "# If you are thinking about editing it, you should seriously consider" ; \ ! echo "# running \`make oldXMenu/Makefile' at the top of the" ; \ ! echo "# Emacs build tree instead, or editing" ; \ ! echo "# \`${srcdir}/oldXMenu/Makefile.in' itself." ; \ ! sed < ${srcdir}/oldXMenu/Makefile.in \ ! -e 's|^\(srcdir *=\).*$$|\1'"${srcdir}"'/oldXMenu|' \ ! -e 's|^\(VPATH *=\).*$$|\1'"${srcdir}"'/oldXMenu|' \ ! -e 's|^\(C_SWITCH_X_SITE *=\).*$$|\1'"${C_SWITCH_X_SITE}"'|' \ ! -e 's|^CC *=.*$$|CC='"${CC}"'|' \ ! -e 's|^DEFS *=.*$$|DEFS='"${DEFS}"'|' \ ! -e '/^# DIST: /d') > oldXMenu/Makefile.tmp ! @${srcdir}/move-if-change oldXMenu/Makefile.tmp oldXMenu/Makefile ! chmod -w oldXMenu/Makefile ! Makefile: ./config.status --- 217,233 ---- ${SUBDIR}: ${SUBDIR_MAKEFILES} FRC ! cd $@; $(MAKE) all $(MFLAGS) \ ! CC='${CC}' CFLAGS='${CFLAGS}' MAKE='${MAKE}' ! ! Makefile: Makefile.in config.status ! ./config.status ! ! src/Makefile: src/Makefile.in.in config.status ! ./config.status ! ! lib-src/Makefile: lib-src/Makefile.in config.status ! ./config.status ! oldXMenu/Makefile: oldXMenu/Makefile.in config.status ./config.status *************** *** 330,334 **** do-install: mkdir (cd lib-src; \ ! $(MAKE) install ${MFLAGS} prefix=${prefix} \ exec_prefix=${exec_prefix} bindir=${bindir} libdir=${libdir} \ archlibdir=${archlibdir}) --- 252,256 ---- do-install: mkdir (cd lib-src; \ ! $(MAKE) install $(MFLAGS) prefix=${prefix} \ exec_prefix=${exec_prefix} bindir=${bindir} libdir=${libdir} \ archlibdir=${archlibdir}) *************** *** 373,379 **** done ${INSTALL_PROGRAM} src/emacs ${bindir}/emacs-${version} ! chmod 1755 ${bindir}/emacs-${version} rm -f ${bindir}/emacs ! ln ${bindir}/emacs-${version} ${bindir}/emacs ### Build all the directories we're going to install Emacs in. Since --- 295,301 ---- done ${INSTALL_PROGRAM} src/emacs ${bindir}/emacs-${version} ! -chmod 1755 ${bindir}/emacs-${version} rm -f ${bindir}/emacs ! -ln ${bindir}/emacs-${version} ${bindir}/emacs ### Build all the directories we're going to install Emacs in. Since *************** *** 394,398 **** uninstall: (cd lib-src; \ ! $(MAKE) ${MFLAGS} uninstall \ prefix=${prefix} exec_prefix=${exec_prefix} \ bindir=${bindir} libdir=${libdir} archlibdir=${archlibdir}) --- 316,320 ---- uninstall: (cd lib-src; \ ! $(MAKE) $(MFLAGS) uninstall \ prefix=${prefix} exec_prefix=${exec_prefix} \ bindir=${bindir} libdir=${libdir} archlibdir=${archlibdir}) *************** *** 426,433 **** ### is rarely necessary and takes a lot of time. mostlyclean: FRC.mostlyclean ! (cd src; make ${MFLAGS} mostlyclean) ! (cd oldXMenu; make ${MFLAGS} mostlyclean) ! (cd lib-src; make ${MFLAGS} mostlyclean) ! (cd man; make ${MFLAGS} mostlyclean) ### `clean' --- 348,355 ---- ### is rarely necessary and takes a lot of time. mostlyclean: FRC.mostlyclean ! (cd src; $(MAKE) $(MFLAGS) mostlyclean) ! (cd oldXMenu; $(MAKE) $(MFLAGS) mostlyclean) ! (cd lib-src; $(MAKE) $(MFLAGS) mostlyclean) ! -(cd man; $(MAKE) $(MFLAGS) mostlyclean) ### `clean' *************** *** 440,447 **** ### Delete `.dvi' files here if they are not part of the distribution. clean: FRC.clean ! (cd src; make ${MFLAGS} clean) ! (cd oldXMenu; make ${MFLAGS} clean) ! (cd lib-src; make ${MFLAGS} clean) ! (cd man; make ${MFLAGS} clean) ### `distclean' --- 362,369 ---- ### Delete `.dvi' files here if they are not part of the distribution. clean: FRC.clean ! (cd src; $(MAKE) $(MFLAGS) clean) ! (cd oldXMenu; $(MAKE) $(MFLAGS) clean) ! (cd lib-src; $(MAKE) $(MFLAGS) clean) ! -(cd man; $(MAKE) $(MFLAGS) clean) ### `distclean' *************** *** 456,463 **** (cd lock ; rm -f *) distclean: FRC.distclean ! (cd src; make ${MFLAGS} distclean) ! (cd oldXMenu; make ${MFLAGS} distclean) ! (cd lib-src; make ${MFLAGS} distclean) ! (cd man; make ${MFLAGS} distclean) ${top_distclean} --- 378,385 ---- (cd lock ; rm -f *) distclean: FRC.distclean ! (cd src; $(MAKE) $(MFLAGS) distclean) ! (cd oldXMenu; $(MAKE) $(MFLAGS) distclean) ! (cd lib-src; $(MAKE) $(MFLAGS) distclean) ! (cd man; $(MAKE) $(MFLAGS) distclean) ${top_distclean} *************** *** 475,482 **** ### begin to build the program. realclean: FRC.realclean ! (cd src; make ${MFLAGS} realclean) ! (cd oldXMenu; make ${MFLAGS} realclean) ! (cd lib-src; make ${MFLAGS} realclean) ! (cd man; make ${MFLAGS} realclean) ${top_distclean} --- 397,404 ---- ### begin to build the program. realclean: FRC.realclean ! (cd src; $(MAKE) $(MFLAGS) realclean) ! (cd oldXMenu; $(MAKE) $(MFLAGS) realclean) ! (cd lib-src; $(MAKE) $(MFLAGS) realclean) ! -(cd man; $(MAKE) $(MFLAGS) realclean) ${top_distclean} *************** *** 486,490 **** ### it deletes backup and autosave files too. extraclean: ! for i in ${SUBDIR}; do (cd $$i; $(MAKE) ${MFLAGS} extraclean); done -(cd lock; rm *) -rm config.status config-tmp-* --- 408,412 ---- ### it deletes backup and autosave files too. extraclean: ! for i in ${SUBDIR}; do (cd $$i; $(MAKE) $(MFLAGS) extraclean); done -(cd lock; rm *) -rm config.status config-tmp-* *************** *** 507,528 **** chmod u+w $(SOURCES) cpp/* -(cd elisp; chmod u+w Makefile README *.texi) ! (cd etc; make unlock) ! (cd lib-src; make unlock) ! (cd lisp; make unlock) (cd lisp/term; chmod u+w README *.el) (cd man; chmod u+w *texi* ChangeLog split-man) (cd oldXMenu; chmod u+w *.[ch] Makefile README) ! (cd src; make unlock) relock: chmod u-w $(SOURCES) cpp/* -(cd elisp; chmod u-w Makefile README *.texi) ! (cd etc; make relock) ! (cd lib-src; make relock) ! (cd lisp; make relock) (cd lisp/term; chmod u+w README *.el) (cd man; chmod u+w *texi* ChangeLog split-man) (cd oldXMenu; chmod u+w *.[ch] Makefile README) ! (cd src; make relock) TAGS tags: lib-src --- 429,450 ---- chmod u+w $(SOURCES) cpp/* -(cd elisp; chmod u+w Makefile README *.texi) ! (cd etc; $(MAKE) $(MFLAGS) unlock) ! (cd lib-src; $(MAKE) $(MFLAGS) unlock) ! (cd lisp; $(MAKE) $(MFLAGS) unlock) (cd lisp/term; chmod u+w README *.el) (cd man; chmod u+w *texi* ChangeLog split-man) (cd oldXMenu; chmod u+w *.[ch] Makefile README) ! (cd src; $(MAKE) $(MFLAGS) unlock) relock: chmod u-w $(SOURCES) cpp/* -(cd elisp; chmod u-w Makefile README *.texi) ! (cd etc; $(MAKE) $(MFLAGS) relock) ! (cd lib-src; $(MAKE) $(MFLAGS) relock) ! (cd lisp; $(MAKE) $(MFLAGS) relock) (cd lisp/term; chmod u+w README *.el) (cd man; chmod u+w *texi* ChangeLog split-man) (cd oldXMenu; chmod u+w *.[ch] Makefile README) ! (cd src; $(MAKE) $(MFLAGS) relock) TAGS tags: lib-src *************** *** 537,541 **** info: ! (cd ${srcdir}/man; make ${MFLAGS} info) dvi: ! (cd ${srcdir}/man; make ${MFLAGS} dvi) --- 459,463 ---- info: ! (cd ${srcdir}/man; $(MAKE) $(MFLAGS) info) dvi: ! (cd ${srcdir}/man; $(MAKE) $(MFLAGS) dvi) diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/PROBLEMS emacs-19.20/PROBLEMS *** emacs-19.19/PROBLEMS Sun Aug 15 01:17:48 1993 --- emacs-19.20/PROBLEMS Fri Sep 24 14:32:29 1993 *************** *** 2,5 **** --- 2,20 ---- in compiling, installing and running GNU Emacs. + * You "lose characters" after typing Compose Character key. + + This is because the Compose Character key is defined as the keysym + Multi_key, and Emacs (seeing that) does the proper X11 + character-composition processing. If you don't want your Compose key + to do that, you can redefine it with xmodmap. + + For example, here's one way to turn it into a Meta key: + + xmodmap -e "keysym Multi_key = Meta_L" + + If all users at your site of a particular keyboard prefer Meta to + Compose, you can make the remapping happen automatically by adding the + xmodmap command to the xdm setup script for that display. + * Watch out for .emacs files and EMACSLOADPATH environment vars diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/README emacs-19.20/README *** emacs-19.19/README Sun Aug 15 01:09:19 1993 --- emacs-19.20/README Thu Nov 11 19:34:47 1993 *************** *** 1,3 **** ! This directory tree holds version 19.19 of GNU Emacs, the extensible, customizable, self-documenting real-time display editor. --- 1,3 ---- ! This directory tree holds version 19.0 of GNU Emacs, the extensible, customizable, self-documenting real-time display editor. *************** *** 47,52 **** possible. ! The files `Makefile.in' and `build-install.in' are templates used by ! `configure' to create `Makefile' and `build-install'. The file `make-dist' is a shell script to build a distribution tar --- 47,52 ---- possible. ! The file `Makefile.in' is a template used by `configure' to create ! `Makefile'. The file `make-dist' is a shell script to build a distribution tar diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/build-ins.in emacs-19.20/build-ins.in *** emacs-19.19/build-ins.in Sun Aug 15 01:17:50 1993 --- emacs-19.20/build-ins.in Tue Sep 28 05:41:49 1993 *************** *** 132,136 **** cp ${libdir}/[ce]tags ${bindir} ! mv src/xemacs ${BINDIR}/emacs rm src/temacs chmod 777 ${bindir}/[ce]tags ${bindir}/emacs --- 132,136 ---- cp ${libdir}/[ce]tags ${bindir} ! mv src/emacs ${BINDIR}/emacs rm src/temacs chmod 777 ${bindir}/[ce]tags ${bindir}/emacs diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/config.guess emacs-19.20/config.guess *** emacs-19.19/config.guess Sun Aug 15 01:09:18 1993 --- emacs-19.20/config.guess Thu Nov 11 18:36:16 1993 *************** *** 19,25 **** # # This script attempts to guess a canonical system name similar to ! # config.sub. If it succeeds, it prints the system name on stdout, and ! # exits with 0. Otherwise, it prints an error message on stderr, and ! # exits with 1. # # The plan is that this can be called by configure scripts if you --- 19,24 ---- # # This script attempts to guess a canonical system name similar to ! # config.sub. If it succeeds, it prints the system name on stdout, and ! # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you *************** *** 39,44 **** --- 38,51 ---- case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in alpha:OSF1:1.*:*) + # 1.2 uses "1.2" for uname -r. echo alpha-dec-osf${UNAME_RELEASE} exit 0 ;; + alpha:OSF1:V1.*:*) + # 1.3 uses "V1.3" for uname -r. + echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^V//'` + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; sun4*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` *************** *** 71,74 **** --- 78,88 ---- echo m88k-motorola-sysv3 exit 0 ;; + AViiON:dgux:*:*) + echo m88k-dg-dgux${UNAME_RELEASE} + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; *:IRIX:*:*) echo mips-sgi-irix${UNAME_RELEASE} *************** *** 95,98 **** --- 109,118 ---- echo m68k-hp-hpux exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; 9000/7??:HP-UX:*:* | 9000/8?7:HP-UX:*:* ) echo hppa1.1-hp-hpux *************** *** 101,104 **** --- 121,151 ---- echo hppa1.0-hp-hpux exit 0 ;; + 3050*:HI-UX:*:*) + sed 's/^ //' << EOF >dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } + EOF + ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 + rm -f dummy.c dummy + echo unknown-hitachi-hiuxwe2 + exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?7:4.3bsd:*:* ) echo hppa1.1-hp-bsd *************** *** 122,125 **** --- 169,178 ---- echo cray2-cray-unicos exit 0 ;; + hp3[0-9][05]:NetBSD:*:*) + echo m68k-hp-netbsd${UNAME_RELEASE} + exit 0 ;; + i[34]86:NetBSD:*:*) + echo ${UNAME_MACHINE}-unknown-netbsd${UNAME_RELEASE} + exit 0 ;; i[34]86:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux *************** *** 147,153 **** M680[234]0:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; ! 33??:*:4.0:*) uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; esac --- 200,215 ---- M680[234]0:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; ! 3[34]??:*:4.0:*) uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; + m680[234]0:LynxOS:2.2*:*) + echo m68k-lynx-lynxos${UNAME_RELEASE} + exit 0 ;; + i[34]86:LynxOS:2.2*:*) + echo i386-lynx-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.2*:*) + echo sparc-lynx-lynxos${UNAME_RELEASE} + exit 0 ;; esac *************** *** 165,168 **** --- 227,234 ---- #endif + #if defined (__arm) && defined (__acorn) && defined (__unix) + printf("arm-acorn-riscix"); exit (0); + #endif + #if defined(hp300) && !defined(hpux) printf("m68k-hp-bsd\n"); exit(0); *************** *** 212,214 **** exit 1 - --- 278,279 ---- diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/config.sub emacs-19.20/config.sub *** emacs-19.19/config.sub Sun Aug 15 01:09:17 1993 --- emacs-19.20/config.sub Thu Nov 11 18:36:15 1993 *************** *** 66,70 **** -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next* | -hp | -isi* | -apollo | -altos* | \ ! -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi | \ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp ) --- 66,70 ---- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next* | -hp | -isi* | -apollo | -altos* | \ ! -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp ) *************** *** 72,75 **** --- 72,78 ---- basic_machine=$1 ;; + -hiux*) + os==-hiuxwe2 + ;; -sco4) os=-sco3.2v4 *************** *** 105,113 **** # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in ! # Recognize the basic CPU types with without company name. # Some are omitted here because they have special meanings below. tahoe | i[34]86 | i860 | m68k | m68000 | m88k | ns32k | arm | pyramid \ | tron | a29k | 580 | i960 | h8300 | hppa1.0 | hppa1.1 \ ! | alpha | we32k | ns16k | clipper | sparclite | i370 | sh) basic_machine=$basic_machine-unknown ;; --- 108,117 ---- # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in ! # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. tahoe | i[34]86 | i860 | m68k | m68000 | m88k | ns32k | arm | pyramid \ | tron | a29k | 580 | i960 | h8300 | hppa1.0 | hppa1.1 \ ! | alpha | we32k | ns16k | clipper | sparclite | i370 | sh \ ! | powerpc) basic_machine=$basic_machine-unknown ;; *************** *** 117,121 **** exit 1 ;; ! # Recognize the basic CPU types with with company name. vax-* | tahoe-* | i[34]86-* | i860-* | m68k-* | m68000-* | m88k-* \ | sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \ --- 121,125 ---- exit 1 ;; ! # Recognize the basic CPU types with company name. vax-* | tahoe-* | i[34]86-* | i860-* | m68k-* | m68000-* | m88k-* \ | sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \ *************** *** 124,128 **** | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \ | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \ ! | sh-*) ;; # Recognize the various machine names and aliases which stand --- 128,132 ---- | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \ | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \ ! | sh-* | powerpc-*) ;; # Recognize the various machine names and aliases which stand *************** *** 160,163 **** --- 164,171 ---- basic_machine=spur-unknown ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; alliant | fx80) basic_machine=fx80-alliant *************** *** 313,316 **** --- 321,332 ---- basic_machine=hppa1.0-hp ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; isi68 | isi) basic_machine=m68k-isi *************** *** 519,523 **** | -nindy* | -vxworks* | -ebmon* | -hms* | -mvs* | -clix* \ | -riscos* | -linux* | -uniplus* | -iris* | -rtu* | -xenix* \ ! | -386bsd* | -lynxos*) ;; -sunos5*) --- 535,539 ---- | -nindy* | -vxworks* | -ebmon* | -hms* | -mvs* | -clix* \ | -riscos* | -linux* | -uniplus* | -iris* | -rtu* | -xenix* \ ! | -hiux* | -386bsd* | -netbsd* | -riscix* | -lynxos*) ;; -sunos5*) *************** *** 588,591 **** --- 604,610 ---- case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; *-dec | vax-*) os=-ultrix4.2 *************** *** 612,615 **** --- 631,637 ---- os=-hpux ;; + *-hitachi) + os=-hiux + ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv *************** *** 672,675 **** --- 694,700 ---- *-unknown) case $os in + -riscix*) + vendor=acorn + ;; -sunos*) vendor=sun *************** *** 683,686 **** --- 708,714 ---- -hpux*) vendor=hp + ;; + -hiux*) + vendor=hitachi ;; -unos*) diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/configure emacs-19.20/configure *** emacs-19.19/configure Sun Aug 15 01:17:58 1993 --- emacs-19.20/configure Wed Nov 10 21:19:15 1993 *************** *** 26,30 **** ### the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - ### Since Emacs has configuration requirements that autoconf can't ### meet, this file is an unholy marriage of custom-baked --- 26,29 ---- *************** *** 41,45 **** ### config.status is removed. - ### Remove any more than one leading "." element from the path name. ### If we don't remove them, then another "./" will be prepended to --- 40,43 ---- *************** *** 57,60 **** --- 55,83 ---- + ### Establish some default values. + run_in_place= + single_tree= + prefix='/usr/local' + exec_prefix='${prefix}' + bindir='${exec_prefix}/bin' + datadir='${prefix}/lib' + statedir='${prefix}/lib' + libdir='${exec_prefix}/lib' + mandir='${prefix}/man/man1' + infodir='${prefix}/info' + lispdir='${datadir}/emacs/${version}/lisp' + locallisppath='${datadir}/emacs/site-lisp' + lisppath='${locallisppath}:${lispdir}' + etcdir='${datadir}/emacs/${version}/etc' + lockdir='${statedir}/emacs/lock' + archlibdir='${libdir}/emacs/${version}/${configuration}' + + # We cannot use this variable in the case statement below, because many + # /bin/sh's have broken semantics for "case". Unfortunately, you must + # actually edit the clause itself. + # path_options="prefix | exec_prefix | bindir | libdir | etcdir | datadir" + # path_options="$path_options | archlibdir | statedir | mandir | infodir" + # path_options="$path_options | lispdir | lockdir | lisppath | locallisppath" + #### Usage messages. *************** *** 71,76 **** --run-in-place Use libraries and data files directly out of the source tree. ! --srcdir=DIR Look for source in DIR. ! --prefix=DIR Install files below dir. If successful, ${progname} leaves its status in config.status. If --- 94,111 ---- --run-in-place Use libraries and data files directly out of the source tree. ! --single-tree=DIR Has the effect of creating a directory tree at DIR ! which looks like: ! .../DIR/bin/CONFIGNAME (emacs, etags, etc.) ! .../DIR/bin/CONFIGNAME/etc (movemail, etc.) ! .../DIR/common/lisp (emacs' lisp files) ! .../DIR/common/site-lisp (local lisp files) ! .../DIR/common/lib (DOC, TUTORIAL, etc.) ! .../DIR/common/lock (lockfiles) ! --srcdir=DIR Look for the Emacs source files in DIR. ! --prefix=DIR Install files below DIR. Defaults to \`${prefix}'. ! ! You may also specify any of the \`path' variables found in Makefile.in, ! including --bindir, --libdir, --etcdir, --infodir, and so on. This allows ! you to override a single default location when configuring. If successful, ${progname} leaves its status in config.status. If *************** *** 83,108 **** arguments="$@" ! ### These values are used to comment and uncomment different values ! ### for the path variables in the Makefile, to choose the installed ! ### configuration or the run-in-place configuration. ! rip_paths='#disabled# ' ! inst_paths='' ! ! ### Establish some default values. ! prefix='/usr/local' ! exec_prefix='${prefix}' ### Don't use shift -- that destroys the argument list, which autoconf needs ### to produce config.status. It turns out that "set - ${arguments}" doesn't ### work portably. ! index=0 ! while [ $index -lt $# ]; do ! index=`expr $index + 1` ! arg=`eval echo '$'$index` case "${arg}" in ## Anything starting with a hyphen we assume is an option. -* ) - ## Separate the switch name from the value it's being given. case "${arg}" in --- 118,141 ---- arguments="$@" ! ### Shell Magic: Quote the quoted arguments in ARGUMENTS. At a later date, ! ### in order to get the arguments back in $@, we have to do an ! ### `eval set x "$quoted_arguments"; shift'. ! quoted_arguments= ! for i in "$@"; do ! quoted_arguments="$quoted_arguments '$i'" ! done ### Don't use shift -- that destroys the argument list, which autoconf needs ### to produce config.status. It turns out that "set - ${arguments}" doesn't ### work portably. ! ### However, it also turns out that many shells cannot expand ${10} at all. ! ### So using an index variable doesn't work either. It is possible to use ! ### some shell magic to make 'set x "$arguments"; shift' work portably. ! while [ $# != 0 ]; do ! arg="$1"; shift case "${arg}" in ## Anything starting with a hyphen we assume is an option. -* ) ## Separate the switch name from the value it's being given. case "${arg}" in *************** *** 166,170 **** if [ "${valomitted}" = "yes" ]; then ## Get the next argument from the argument list, if there is one. ! if [ $index = $# ]; then (echo "${progname}: You must give a value for the \`--${optname}' option, as in \`--${optname}=FOO'." --- 199,203 ---- if [ "${valomitted}" = "yes" ]; then ## Get the next argument from the argument list, if there is one. ! if [ $# = 0 ]; then (echo "${progname}: You must give a value for the \`--${optname}' option, as in \`--${optname}=FOO'." *************** *** 172,177 **** exit 1 fi ! index=`expr $index + 1` ! val=`eval echo '$'$index` fi srcdir="${val}" --- 205,209 ---- exit 1 fi ! val="$1"; shift fi srcdir="${val}" *************** *** 186,197 **** if [ "${valomitted}" = "yes" ]; then ## Get the next argument from the argument list, if there is one. ! if [ $index = $# ]; then (echo "${progname}: You must give a value for the \`--${optname}' option, as in ! \`--${optname}=FOO'." echo "${short_usage}") >&2 exit 1 fi ! index=`expr $index + 1` ! val=`eval echo '$'$index` fi x_includes="${val}" --- 218,228 ---- if [ "${valomitted}" = "yes" ]; then ## Get the next argument from the argument list, if there is one. ! if [ $# = 0 ]; then (echo "${progname}: You must give a value for the \`--${optname}' option, as in ! \`--${optname}=/usr/local/X11/include'." echo "${short_usage}") >&2 exit 1 fi ! val="$1"; shift fi x_includes="${val}" *************** *** 201,212 **** if [ "${valomitted}" = "yes" ]; then ## Get the next argument from the argument list, if there is one. ! if [ $index = $# ]; then (echo "${progname}: You must give a value for the \`--${optname}' option, as in ! \`--${optname}=FOO'." echo "${short_usage}") >&2 exit 1 fi ! index=`expr $index + 1` ! val=`eval echo '$'$index` fi x_libraries="${val}" --- 232,242 ---- if [ "${valomitted}" = "yes" ]; then ## Get the next argument from the argument list, if there is one. ! if [ $# = 0 ]; then (echo "${progname}: You must give a value for the \`--${optname}' option, as in ! \`--${optname}=/usr/local/X11/lib'." echo "${short_usage}") >&2 exit 1 fi ! val="$1"; shift fi x_libraries="${val}" *************** *** 215,255 **** ## Should this use the "development configuration"? "run_in_place" ) ! rip_paths='' ! inst_paths='#disabled# ' ;; ! ## Has the user specified an installation prefix? ! "prefix" ) ! ## If the value was omitted, get it from the next argument. ! if [ "${valomitted}" = "yes" ]; then ! ## Get the next argument from the argument list, if there is one. ! if [ $index = $# ]; then ! (echo "${progname}: You must give a value for the \`--${optname}' option, as in ! \`--${optname}=FOO'." ! echo "${short_usage}") >&2 ! exit 1 ! fi ! index=`expr $index + 1` ! val=`eval echo '$'$index` ! fi ! prefix="${val}" ! ;; ! ## Has the user specified an installation prefix? ! "exec_prefix" ) ! ## If the value was omitted, get it from the next argument. ! if [ "${valomitted}" = "yes" ]; then ! ## Get the next argument from the argument list, if there is one. ! if [ $index = $# ]; then ! (echo "${progname}: You must give a value for the \`--${optname}' option, as in ! \`--${optname}=FOO'." ! echo "${short_usage}") >&2 ! exit 1 ! fi ! index=`expr $index + 1` ! val=`eval echo '$'$index` ! fi ! exec_prefix="${val}" ! ;; ## Verbose flag, tested by autoconf macros. --- 245,277 ---- ## Should this use the "development configuration"? "run_in_place" ) ! single_tree= ! run_in_place=1 ;; ! ## Should this use the "single tree" configuration? ! "single_tree" ) ! run_in_place= ! single_tree=1 ! ;; ! ## Has the user specified one of the path options? ! prefix | exec_prefix | bindir | libdir | etcdir | datadir | \ ! archlibdir | statedir | mandir | infodir | lispdir | lockdir | \ ! lisppath | locallisppath ) ! ## If the value was omitted, get it from the next argument. ! if [ "${valomitted}" = "yes" ]; then ! if [ $# = 0 ]; then ! (echo \ ! "$progname: You must give a value for the \`--${optname}' option,"; ! echo \ ! "as in \`--${optname}=`eval echo '$'$optname`.'" ! echo "$short_usage") >&2 ! exit 1 ! fi ! val="$1"; shift ! fi ! eval "${opt}=\"${val}\"" ! eval "${opt}_specified=1" ! ;; ## Verbose flag, tested by autoconf macros. *************** *** 282,285 **** --- 304,310 ---- done + ### Get the arguments back. See the diatribe on Shell Magic above. + eval set x "$quoted_arguments"; shift + if [ "${configuration}" = "" ]; then echo '- You did not tell me what kind of host system you want to configure. *************** *** 346,350 **** ## We may be able to use the $PWD environment variable to make this ## absolute. But sometimes PWD is inaccurate. ! if [ "${PWD}" != "" ] && [ "`(cd ${PWD} ; pwd)`" = "`pwd`" ] ; then srcdir="$PWD" else --- 371,375 ---- ## We may be able to use the $PWD environment variable to make this ## absolute. But sometimes PWD is inaccurate. ! if [ "${PWD}" != "" ] && [ "`(cd ${PWD} ; sh -c pwd)`" = "`pwd`" ] ; then srcdir="$PWD" else *************** *** 355,366 **** esac ! #### Make sure that the source directory doesn't already have a ! #### configured system in it. if [ `pwd` != `(cd ${srcdir} && pwd)` ] \ && [ -f "${srcdir}/src/config.h" ] ; then ! (echo "${progname}: the directory tree \`${srcdir}' is being used" echo " as a build directory right now; it has been configured in its own" ! echo " right. You can't use srcdir in this situation.") >&2 ! exit 1 fi --- 380,399 ---- esac ! #### Check if the source directory already has a configured system in it. if [ `pwd` != `(cd ${srcdir} && pwd)` ] \ && [ -f "${srcdir}/src/config.h" ] ; then ! (echo "${progname}: WARNING: The directory tree \`${srcdir}' is being used" echo " as a build directory right now; it has been configured in its own" ! echo " right. To configure in another directory as well, you MUST" ! echo " use GNU make. If you do not have GNU make, then you must" ! echo " now do \`make distclean' in ${srcdir}," ! echo " and then run ${progname} again.") >&2 ! extrasub='/^VPATH[ ]*=/c\ ! vpath %.c $(srcdir)\ ! vpath %.h $(srcdir)\ ! vpath %.y $(srcdir)\ ! vpath %.l $(srcdir)\ ! vpath %.s $(srcdir)\ ! vpath %.in $(srcdir)' fi *************** *** 556,559 **** --- 589,595 ---- machine=hp9000s300 opsys=bsd4-3 ;; + m68*-hp-netbsd* ) + machine=hp9000s300 opsys=netbsd + ;; ## HP/UX 7, 8 and 9 are supported on these machines. m68*-hp-hpux* ) *************** *** 893,896 **** --- 929,933 ---- *-bsd386* ) opsys=bsd386 ;; *-386bsd* ) opsys=386bsd ;; + *-netbsd* ) opsys=netbsd ;; ## Otherwise, we'll fall through to the generic opsys code at the bottom. esac *************** *** 1123,1127 **** ! for hdr in sys/timeb.h sys/time.h do trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'` --- 1160,1164 ---- ! for hdr in sys/timeb.h sys/time.h unistd.h do trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'` *************** *** 1433,1437 **** - #### Choose a window system. echo "Checking window system." --- 1470,1473 ---- *************** *** 1522,1525 **** --- 1558,1566 ---- [ -n "${x_includes}" ] && C_SWITCH_X_SITE="-I${x_includes}" + # Avoid forcing the search of /usr/include before fixed include files. + if [ "$C_SWITCH_X_SITE" = "-I/usr/include" ]; then + C_SWITCH_X_SITE=" " + fi + case "${window_system}" in x11 ) *************** *** 1571,1576 **** #define C_SWITCH_SYSTEM #endif ! @configure@ libsrc_libs=LIBS_MACHINE LIBS_SYSTEM ! @configure@ c_switch_system=C_SWITCH_SYSTEM #ifndef LIB_X11_LIB --- 1612,1617 ---- #define C_SWITCH_SYSTEM #endif ! configure___ libsrc_libs=LIBS_MACHINE LIBS_SYSTEM ! configure___ c_switch_system=C_SWITCH_SYSTEM #ifndef LIB_X11_LIB *************** *** 1585,1600 **** #define LIBX11_SYSTEM #endif ! @configure@ LIBX=LIB_X11_LIB LIBX11_MACHINE LIBX11_SYSTEM #ifdef UNEXEC ! @configure@ unexec=UNEXEC #else ! @configure@ unexec=unexec.o #endif #ifdef SYSTEM_MALLOC ! @configure@ system_malloc=yes #else ! @configure@ system_malloc=no #endif --- 1626,1641 ---- #define LIBX11_SYSTEM #endif ! configure___ LIBX=LIB_X11_LIB LIBX11_MACHINE LIBX11_SYSTEM #ifdef UNEXEC ! configure___ unexec=UNEXEC #else ! configure___ unexec=unexec.o #endif #ifdef SYSTEM_MALLOC ! configure___ system_malloc=yes #else ! configure___ system_malloc=no #endif *************** *** 1608,1614 **** #ifdef __GNUC__ ! @configure@ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH #else ! @configure@ CFLAGS=C_DEBUG_SWITCH #endif ' > ${tempcname} --- 1649,1655 ---- #ifdef __GNUC__ ! configure___ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH #else ! configure___ CFLAGS=C_DEBUG_SWITCH #endif ' > ${tempcname} *************** *** 1617,1622 **** CPP=`eval "echo $CPP"` eval `${CPP} -Isrc ${tempcname} \ ! | grep '@configure@' \ ! | sed -e 's/^@configure@ \([^=]*=\)\(.*\)$/\1"\2"/'` rm ${tempcname} --- 1658,1663 ---- CPP=`eval "echo $CPP"` eval `${CPP} -Isrc ${tempcname} \ ! | grep 'configure___' \ ! | sed -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/'` rm ${tempcname} *************** *** 1692,1699 **** if test -n "${have_lib}"; then :; LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd" - if test -d /usr/X386/include; then - HAVE_XFREE386=yes - test -z "${C_SWITCH_X_SITE}" && C_SWITCH_X_SITE="-I/usr/X386/include" - fi else :; --- 1733,1736 ---- *************** *** 1701,1704 **** --- 1738,1747 ---- + echo checking for XFree86 + if test -d /usr/X386/include; then + HAVE_XFREE386=yes + test -z "${C_SWITCH_X_SITE}" && C_SWITCH_X_SITE="-I/usr/X386/include" + fi + if test "${HAVE_X11}" = "yes"; then DEFS="$C_SWITCH_X_SITE $DEFS" *************** *** 2011,2015 **** fi ! for func in gettimeofday gethostname dup2 rename closedir mkdir rmdir random bcopy logb frexp ftime do trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'` --- 2054,2058 ---- fi ! for func in gettimeofday gethostname dup2 rename closedir mkdir rmdir random bcopy logb frexp ftime res_init do trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'` *************** *** 2155,2158 **** --- 2198,2211 ---- + + + + + + + + + + { test -n "$verbose" && \ *************** *** 2303,2306 **** --- 2356,2406 ---- fi + # ====================== Developer's configuration ======================= + + # The following assignments make sense if you're running Emacs on a single + # machine, one version at a time, and you want changes to the lisp and etc + # directories in the source tree to show up immediately in your working + # environment. It saves a great deal of disk space by not duplicating the + # lisp and etc directories. + + if [ "$run_in_place" = "1" ]; then + lispdir='${srcdir}/lisp' + locallisppath='${srcdir}/site-lisp:${datadir}/emacs/site-lisp' + etcdir='${srcdir}/etc' + lockdir='${srcdir}/lock' + archlibdir='${srcdir}/lib-src' + infodir='${srcdir}/info' + elif [ "$single_tree" = "1" ]; then + if [ "$exec_prefix_specified" = "" ]; then + exec_prefix='${prefix}' + fi + if [ "$bindir_specified" = "" ]; then + bindir='${exec_prefix}/bin/${configuration}' + fi + if [ "$datadir_specified" = "" ]; then + datadir='${prefix}/common' + fi + if [ "$statedir_specified" = "" ]; then + statedir='${prefix}/common' + fi + if [ "$libdir_specified" = "" ]; then + libdir='${bindir}' + fi + if [ "$lispdir_specified" = "" ]; then + lispdir='${prefix}/common/lisp' + fi + if [ "$locallisppath_specified" = "" ]; then + locallisppath='${prefix}/common/site-lisp' + fi + if [ "$lockdir_specified" = "" ]; then + lockdir='${prefix}/common/lock' + fi + if [ "$archlibdir_specified" = "" ]; then + archlibdir='${libdir}/etc' + fi + if [ "$etcdir_specified" = "" ]; then + etcdir='${prefix}/common/data' + fi + fi #### Report on what we decided to do. *************** *** 2364,2368 **** done ! trap 'rm -fr Makefile src/config.h conftest*; exit 1' 1 3 15 CC='$CC' LN_S='$LN_S' --- 2464,2468 ---- done ! trap 'rm -fr Makefile lib-src/Makefile oldXMenu/Makefile src/Makefile.in src/config.h conftest*; exit 1' 1 3 15 CC='$CC' LN_S='$LN_S' *************** *** 2376,2388 **** version='$version' srcdir='$srcdir' c_switch_system='$c_switch_system' libsrc_libs='$libsrc_libs' - rip_paths='$rip_paths' - inst_paths='$inst_paths' LD_SWITCH_X_SITE='$LD_SWITCH_X_SITE' C_SWITCH_X_SITE='$C_SWITCH_X_SITE' CFLAGS='$CFLAGS' - prefix='$prefix' - exec_prefix='$exec_prefix' LIBS='$LIBS' prefix='$prefix' --- 2476,2498 ---- version='$version' srcdir='$srcdir' + prefix='$prefix' + exec_prefix='$exec_prefix' + bindir='$bindir' + datadir='$datadir' + statedir='$statedir' + libdir='$libdir' + mandir='$mandir' + infodir='$infodir' + lispdir='$lispdir' + locallisppath='$locallisppath' + lisppath='$lisppath' + etcdir='$etcdir' + lockdir='$lockdir' + archlibdir='$archlibdir' c_switch_system='$c_switch_system' libsrc_libs='$libsrc_libs' LD_SWITCH_X_SITE='$LD_SWITCH_X_SITE' C_SWITCH_X_SITE='$C_SWITCH_X_SITE' CFLAGS='$CFLAGS' LIBS='$LIBS' prefix='$prefix' *************** *** 2395,2399 **** # Allow make-time overrides of the generated file list. ! test -n "$gen_files" || gen_files="Makefile" for file in .. $gen_files; do if [ "x$file" != "x.." ]; then --- 2505,2509 ---- # Allow make-time overrides of the generated file list. ! test -n "$gen_files" || gen_files="Makefile lib-src/Makefile oldXMenu/Makefile src/Makefile.in" for file in .. $gen_files; do if [ "x$file" != "x.." ]; then *************** *** 2421,2433 **** s%@version@%$version%g s%@srcdir@%$srcdir%g s%@c_switch_system@%$c_switch_system%g s%@libsrc_libs@%$libsrc_libs%g - s%@rip_paths@%$rip_paths%g - s%@inst_paths@%$inst_paths%g s%@LD_SWITCH_X_SITE@%$LD_SWITCH_X_SITE%g s%@C_SWITCH_X_SITE@%$C_SWITCH_X_SITE%g s%@CFLAGS@%$CFLAGS%g - s%@prefix@%$prefix%g - s%@exec_prefix@%$exec_prefix%g s%@LIBS@%$LIBS%g s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file --- 2531,2553 ---- s%@version@%$version%g s%@srcdir@%$srcdir%g + s%@prefix@%$prefix%g + s%@exec_prefix@%$exec_prefix%g + s%@bindir@%$bindir%g + s%@datadir@%$datadir%g + s%@statedir@%$statedir%g + s%@libdir@%$libdir%g + s%@mandir@%$mandir%g + s%@infodir@%$infodir%g + s%@lispdir@%$lispdir%g + s%@locallisppath@%$locallisppath%g + s%@lisppath@%$lisppath%g + s%@etcdir@%$etcdir%g + s%@lockdir@%$lockdir%g + s%@archlibdir@%$archlibdir%g s%@c_switch_system@%$c_switch_system%g s%@libsrc_libs@%$libsrc_libs%g s%@LD_SWITCH_X_SITE@%$LD_SWITCH_X_SITE%g s%@C_SWITCH_X_SITE@%$C_SWITCH_X_SITE%g s%@CFLAGS@%$CFLAGS%g s%@LIBS@%$LIBS%g s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file *************** *** 2528,2530 **** --- 2648,2691 ---- chmod +x config.status test -n "$no_create" || ./config.status + + # Build src/Makefile from ${srcdir}/src/Makefile.in. This must be done + # after src/config.h is built, since we rely on that file. Only do the + # build if "config.status" is present, since it's non-presence indicates + # an error occured. + status=$? + if [ ! -f ./config.status ]; then + exit $status + fi + topsrcdir=${srcdir} + makefile_command='echo "creating src/Makefile"; + topsrcdir='"${topsrcdir}"'; + ( cd ./src; + cp Makefile.in junk.c; + eval `echo ${CPP} -I. -I${topsrcdir}/src ${CPPFLAGS} junk.c \>junk.cpp`; + < junk.cpp '\ + ' sed -e '\''s/^#.*//'\'' '\ + ' -e '\''s/^[ \f\t][ \f\t]*$//'\'' '\ + ' -e '\''s/^ / /'\'' '\ + ' | sed -n -e '\''/^..*$/p'\'' '\ + ' > Makefile.new; + chmod 444 Makefile.new; + mv -f Makefile.new Makefile; + rm -f junk.c junk.cpp; + )' + eval `echo $makefile_command` + # AC-OUTPUT has created `config.status' already. We need to add the above + # commands to re-create `src/Makefile', and we need to insert them before + # the final "exit 0" which appears at the end of `config.status'. + config.new + echo $makefile_command >>config.new + echo exit 0 >>config.new + mv -f config.new config.status + chmod +x config.status + # Don't let the fact that we just rewrote config.status make Makefile think + # that it is now newer. We have just rewritten all of the Makefiles as well. + MFS="Makefile src/Makefile src/Makefile.in lib-src/Makefile oldXMenu/Makefile" + for file in $MFS; do + chmod a+w $file; touch $file; chmod 444 $file + done + exit 0 diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/configure.in emacs-19.20/configure.in *** emacs-19.19/configure.in Sat Aug 14 01:32:06 1993 --- emacs-19.20/configure.in Wed Nov 10 15:20:30 1993 *************** *** 34,38 **** ### the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - ### Since Emacs has configuration requirements that autoconf can't ### meet, this file is an unholy marriage of custom-baked --- 34,37 ---- *************** *** 49,53 **** ### config.status is removed. - ### Remove any more than one leading "." element from the path name. ### If we don't remove them, then another "./" will be prepended to --- 48,51 ---- *************** *** 65,68 **** --- 63,91 ---- + ### Establish some default values. + run_in_place= + single_tree= + prefix='/usr/local' + exec_prefix='${prefix}' + bindir='${exec_prefix}/bin' + datadir='${prefix}/lib' + statedir='${prefix}/lib' + libdir='${exec_prefix}/lib' + mandir='${prefix}/man/man1' + infodir='${prefix}/info' + lispdir='${datadir}/emacs/${version}/lisp' + locallisppath='${datadir}/emacs/site-lisp' + lisppath='${locallisppath}:${lispdir}' + etcdir='${datadir}/emacs/${version}/etc' + lockdir='${statedir}/emacs/lock' + archlibdir='${libdir}/emacs/${version}/${configuration}' + + # We cannot use this variable in the case statement below, because many + # /bin/sh's have broken semantics for "case". Unfortunately, you must + # actually edit the clause itself. + # path_options="prefix | exec_prefix | bindir | libdir | etcdir | datadir" + # path_options="$path_options | archlibdir | statedir | mandir | infodir" + # path_options="$path_options | lispdir | lockdir | lisppath | locallisppath" + #### Usage messages. *************** *** 79,84 **** --run-in-place Use libraries and data files directly out of the source tree. ! --srcdir=DIR Look for source in DIR. ! --prefix=DIR Install files below dir. If successful, ${progname} leaves its status in config.status. If --- 102,119 ---- --run-in-place Use libraries and data files directly out of the source tree. ! --single-tree=DIR Has the effect of creating a directory tree at DIR ! which looks like: ! .../DIR/bin/CONFIGNAME (emacs, etags, etc.) ! .../DIR/bin/CONFIGNAME/etc (movemail, etc.) ! .../DIR/common/lisp (emacs' lisp files) ! .../DIR/common/site-lisp (local lisp files) ! .../DIR/common/lib (DOC, TUTORIAL, etc.) ! .../DIR/common/lock (lockfiles) ! --srcdir=DIR Look for the Emacs source files in DIR. ! --prefix=DIR Install files below DIR. Defaults to \`${prefix}'. ! ! You may also specify any of the \`path' variables found in Makefile.in, ! including --bindir, --libdir, --etcdir, --infodir, and so on. This allows ! you to override a single default location when configuring. If successful, ${progname} leaves its status in config.status. If *************** *** 91,116 **** arguments="$@" ! ### These values are used to comment and uncomment different values ! ### for the path variables in the Makefile, to choose the installed ! ### configuration or the run-in-place configuration. ! rip_paths='#disabled# ' ! inst_paths='' ! ! ### Establish some default values. ! prefix='/usr/local' ! exec_prefix='${prefix}' ### Don't use shift -- that destroys the argument list, which autoconf needs ### to produce config.status. It turns out that "set - ${arguments}" doesn't ### work portably. ! index=0 ! while [ $index -lt $# ]; do ! index=`expr $index + 1` ! arg=`eval echo '$'$index` case "${arg}" in ## Anything starting with a hyphen we assume is an option. -* ) - ## Separate the switch name from the value it's being given. case "${arg}" in --- 126,149 ---- arguments="$@" ! ### Shell Magic: Quote the quoted arguments in ARGUMENTS. At a later date, ! ### in order to get the arguments back in $@, we have to do an ! ### `eval set x "$quoted_arguments"; shift'. ! quoted_arguments= ! for i in "$@"; do ! quoted_arguments="$quoted_arguments '$i'" ! done ### Don't use shift -- that destroys the argument list, which autoconf needs ### to produce config.status. It turns out that "set - ${arguments}" doesn't ### work portably. ! ### However, it also turns out that many shells cannot expand ${10} at all. ! ### So using an index variable doesn't work either. It is possible to use ! ### some shell magic to make 'set x "$arguments"; shift' work portably. ! while [ $# != 0 ]; do ! arg="$1"; shift case "${arg}" in ## Anything starting with a hyphen we assume is an option. -* ) ## Separate the switch name from the value it's being given. case "${arg}" in *************** *** 174,178 **** if [ "${valomitted}" = "yes" ]; then ## Get the next argument from the argument list, if there is one. ! if [ $index = $# ]; then (echo "${progname}: You must give a value for the \`--${optname}' option, as in \`--${optname}=FOO'." --- 207,211 ---- if [ "${valomitted}" = "yes" ]; then ## Get the next argument from the argument list, if there is one. ! if [ $# = 0 ]; then (echo "${progname}: You must give a value for the \`--${optname}' option, as in \`--${optname}=FOO'." *************** *** 180,185 **** exit 1 fi ! index=`expr $index + 1` ! val=`eval echo '$'$index` fi srcdir="${val}" --- 213,217 ---- exit 1 fi ! val="$1"; shift fi srcdir="${val}" *************** *** 194,205 **** if [ "${valomitted}" = "yes" ]; then ## Get the next argument from the argument list, if there is one. ! if [ $index = $# ]; then (echo "${progname}: You must give a value for the \`--${optname}' option, as in ! \`--${optname}=FOO'." echo "${short_usage}") >&2 exit 1 fi ! index=`expr $index + 1` ! val=`eval echo '$'$index` fi x_includes="${val}" --- 226,236 ---- if [ "${valomitted}" = "yes" ]; then ## Get the next argument from the argument list, if there is one. ! if [ $# = 0 ]; then (echo "${progname}: You must give a value for the \`--${optname}' option, as in ! \`--${optname}=/usr/local/X11/include'." echo "${short_usage}") >&2 exit 1 fi ! val="$1"; shift fi x_includes="${val}" *************** *** 209,220 **** if [ "${valomitted}" = "yes" ]; then ## Get the next argument from the argument list, if there is one. ! if [ $index = $# ]; then (echo "${progname}: You must give a value for the \`--${optname}' option, as in ! \`--${optname}=FOO'." echo "${short_usage}") >&2 exit 1 fi ! index=`expr $index + 1` ! val=`eval echo '$'$index` fi x_libraries="${val}" --- 240,250 ---- if [ "${valomitted}" = "yes" ]; then ## Get the next argument from the argument list, if there is one. ! if [ $# = 0 ]; then (echo "${progname}: You must give a value for the \`--${optname}' option, as in ! \`--${optname}=/usr/local/X11/lib'." echo "${short_usage}") >&2 exit 1 fi ! val="$1"; shift fi x_libraries="${val}" *************** *** 223,263 **** ## Should this use the "development configuration"? "run_in_place" ) ! rip_paths='' ! inst_paths='#disabled# ' ;; ! ## Has the user specified an installation prefix? ! "prefix" ) ! ## If the value was omitted, get it from the next argument. ! if [ "${valomitted}" = "yes" ]; then ! ## Get the next argument from the argument list, if there is one. ! if [ $index = $# ]; then ! (echo "${progname}: You must give a value for the \`--${optname}' option, as in ! \`--${optname}=FOO'." ! echo "${short_usage}") >&2 ! exit 1 ! fi ! index=`expr $index + 1` ! val=`eval echo '$'$index` ! fi ! prefix="${val}" ! ;; ! ## Has the user specified an installation prefix? ! "exec_prefix" ) ! ## If the value was omitted, get it from the next argument. ! if [ "${valomitted}" = "yes" ]; then ! ## Get the next argument from the argument list, if there is one. ! if [ $index = $# ]; then ! (echo "${progname}: You must give a value for the \`--${optname}' option, as in ! \`--${optname}=FOO'." ! echo "${short_usage}") >&2 ! exit 1 ! fi ! index=`expr $index + 1` ! val=`eval echo '$'$index` ! fi ! exec_prefix="${val}" ! ;; ## Verbose flag, tested by autoconf macros. --- 253,285 ---- ## Should this use the "development configuration"? "run_in_place" ) ! single_tree= ! run_in_place=1 ;; ! ## Should this use the "single tree" configuration? ! "single_tree" ) ! run_in_place= ! single_tree=1 ! ;; ! ## Has the user specified one of the path options? ! prefix | exec_prefix | bindir | libdir | etcdir | datadir | \ ! archlibdir | statedir | mandir | infodir | lispdir | lockdir | \ ! lisppath | locallisppath ) ! ## If the value was omitted, get it from the next argument. ! if [ "${valomitted}" = "yes" ]; then ! if [ $# = 0 ]; then ! (echo \ ! "$progname: You must give a value for the \`--${optname}' option,"; ! echo \ ! "as in \`--${optname}=`eval echo '$'$optname`.'" ! echo "$short_usage") >&2 ! exit 1 ! fi ! val="$1"; shift ! fi ! eval "${opt}=\"${val}\"" ! eval "${opt}_specified=1" ! ;; ## Verbose flag, tested by autoconf macros. *************** *** 290,293 **** --- 312,318 ---- done + ### Get the arguments back. See the diatribe on Shell Magic above. + eval set x "$quoted_arguments"; shift + if [ "${configuration}" = "" ]; then echo '- You did not tell me what kind of host system you want to configure. *************** *** 354,358 **** ## We may be able to use the $PWD environment variable to make this ## absolute. But sometimes PWD is inaccurate. ! if [ "${PWD}" != "" ] && [ "`(cd ${PWD} ; pwd)`" = "`pwd`" ] ; then srcdir="$PWD" else --- 379,383 ---- ## We may be able to use the $PWD environment variable to make this ## absolute. But sometimes PWD is inaccurate. ! if [ "${PWD}" != "" ] && [ "`(cd ${PWD} ; sh -c pwd)`" = "`pwd`" ] ; then srcdir="$PWD" else *************** *** 363,374 **** esac ! #### Make sure that the source directory doesn't already have a ! #### configured system in it. if [ `pwd` != `(cd ${srcdir} && pwd)` ] \ && [ -f "${srcdir}/src/config.h" ] ; then ! (echo "${progname}: the directory tree \`${srcdir}' is being used" echo " as a build directory right now; it has been configured in its own" ! echo " right. You can't use srcdir in this situation.") >&2 ! exit 1 fi --- 388,407 ---- esac ! #### Check if the source directory already has a configured system in it. if [ `pwd` != `(cd ${srcdir} && pwd)` ] \ && [ -f "${srcdir}/src/config.h" ] ; then ! (echo "${progname}: WARNING: The directory tree \`${srcdir}' is being used" echo " as a build directory right now; it has been configured in its own" ! echo " right. To configure in another directory as well, you MUST" ! echo " use GNU make. If you do not have GNU make, then you must" ! echo " now do \`make distclean' in ${srcdir}," ! echo " and then run ${progname} again.") >&2 ! extrasub='/^VPATH[ ]*=/c\ ! vpath %.c $(srcdir)\ ! vpath %.h $(srcdir)\ ! vpath %.y $(srcdir)\ ! vpath %.l $(srcdir)\ ! vpath %.s $(srcdir)\ ! vpath %.in $(srcdir)' fi *************** *** 564,567 **** --- 597,603 ---- machine=hp9000s300 opsys=bsd4-3 ;; + m68*-hp-netbsd* ) + machine=hp9000s300 opsys=netbsd + ;; ## HP/UX 7, 8 and 9 are supported on these machines. m68*-hp-hpux* ) *************** *** 901,904 **** --- 937,941 ---- *-bsd386* ) opsys=bsd386 ;; *-386bsd* ) opsys=386bsd ;; + *-netbsd* ) opsys=netbsd ;; ## Otherwise, we'll fall through to the generic opsys code at the bottom. esac *************** *** 969,973 **** dnl checks for header files ! AC_HAVE_HEADERS(sys/timeb.h sys/time.h) AC_STDC_HEADERS AC_TIME_WITH_SYS_TIME --- 1006,1010 ---- dnl checks for header files ! AC_HAVE_HEADERS(sys/timeb.h sys/time.h unistd.h) AC_STDC_HEADERS AC_TIME_WITH_SYS_TIME *************** *** 989,993 **** [ - #### Choose a window system. echo "Checking window system." --- 1026,1029 ---- *************** *** 1055,1058 **** --- 1091,1099 ---- [ -n "${x_includes}" ] && C_SWITCH_X_SITE="-I${x_includes}" + # Avoid forcing the search of /usr/include before fixed include files. + if [ "$C_SWITCH_X_SITE" = "-I/usr/include" ]; then + C_SWITCH_X_SITE=" " + fi + case "${window_system}" in x11 ) *************** *** 1104,1109 **** #define C_SWITCH_SYSTEM #endif ! @configure@ libsrc_libs=LIBS_MACHINE LIBS_SYSTEM ! @configure@ c_switch_system=C_SWITCH_SYSTEM #ifndef LIB_X11_LIB --- 1145,1150 ---- #define C_SWITCH_SYSTEM #endif ! configure___ libsrc_libs=LIBS_MACHINE LIBS_SYSTEM ! configure___ c_switch_system=C_SWITCH_SYSTEM #ifndef LIB_X11_LIB *************** *** 1118,1133 **** #define LIBX11_SYSTEM #endif ! @configure@ LIBX=LIB_X11_LIB LIBX11_MACHINE LIBX11_SYSTEM #ifdef UNEXEC ! @configure@ unexec=UNEXEC #else ! @configure@ unexec=unexec.o #endif #ifdef SYSTEM_MALLOC ! @configure@ system_malloc=yes #else ! @configure@ system_malloc=no #endif --- 1159,1174 ---- #define LIBX11_SYSTEM #endif ! configure___ LIBX=LIB_X11_LIB LIBX11_MACHINE LIBX11_SYSTEM #ifdef UNEXEC ! configure___ unexec=UNEXEC #else ! configure___ unexec=unexec.o #endif #ifdef SYSTEM_MALLOC ! configure___ system_malloc=yes #else ! configure___ system_malloc=no #endif *************** *** 1141,1147 **** #ifdef __GNUC__ ! @configure@ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH #else ! @configure@ CFLAGS=C_DEBUG_SWITCH #endif ' > ${tempcname} --- 1182,1188 ---- #ifdef __GNUC__ ! configure___ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH #else ! configure___ CFLAGS=C_DEBUG_SWITCH #endif ' > ${tempcname} *************** *** 1150,1155 **** CPP=`eval "echo $CPP"` eval `${CPP} -Isrc ${tempcname} \ ! | grep '@configure@' \ ! | sed -e 's/^@configure@ \([^=]*=\)\(.*\)$/\1"\2"/'` rm ${tempcname} --- 1191,1196 ---- CPP=`eval "echo $CPP"` eval `${CPP} -Isrc ${tempcname} \ ! | grep 'configure___' \ ! | sed -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/'` rm ${tempcname} *************** *** 1183,1191 **** AC_HAVE_LIBRARY(-ldnet) ! AC_HAVE_LIBRARY(-lXbsd, LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd" ! if test -d /usr/X386/include; then ! HAVE_XFREE386=yes ! test -z "${C_SWITCH_X_SITE}" && C_SWITCH_X_SITE="-I/usr/X386/include" ! fi) if test "${HAVE_X11}" = "yes"; then --- 1224,1234 ---- AC_HAVE_LIBRARY(-ldnet) ! AC_HAVE_LIBRARY(-lXbsd, LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd") ! ! echo checking for XFree86 ! if test -d /usr/X386/include; then ! HAVE_XFREE386=yes ! test -z "${C_SWITCH_X_SITE}" && C_SWITCH_X_SITE="-I/usr/X386/include" ! fi if test "${HAVE_X11}" = "yes"; then *************** *** 1199,1203 **** # logb and frexp are found in -lm on most systems. AC_HAVE_LIBRARY(-lm) ! AC_HAVE_FUNCS(gettimeofday gethostname dup2 rename closedir mkdir rmdir random bcopy logb frexp ftime) ok_so_far=true --- 1242,1246 ---- # logb and frexp are found in -lm on most systems. AC_HAVE_LIBRARY(-lm) ! AC_HAVE_FUNCS(gettimeofday gethostname dup2 rename closedir mkdir rmdir random bcopy logb frexp ftime res_init) ok_so_far=true *************** *** 1235,1247 **** AC_SUBST(version) AC_SUBST(srcdir) AC_SUBST(c_switch_system) AC_SUBST(libsrc_libs) - AC_SUBST(rip_paths) - AC_SUBST(inst_paths) AC_SUBST(LD_SWITCH_X_SITE) AC_SUBST(C_SWITCH_X_SITE) AC_SUBST(CFLAGS) - AC_SUBST(prefix) - AC_SUBST(exec_prefix) AC_DEFINE_UNQUOTED(config_machfile, "\"${machfile}\"") --- 1278,1300 ---- AC_SUBST(version) AC_SUBST(srcdir) + AC_SUBST(prefix) + AC_SUBST(exec_prefix) + AC_SUBST(bindir) + AC_SUBST(datadir) + AC_SUBST(statedir) + AC_SUBST(libdir) + AC_SUBST(mandir) + AC_SUBST(infodir) + AC_SUBST(lispdir) + AC_SUBST(locallisppath) + AC_SUBST(lisppath) + AC_SUBST(etcdir) + AC_SUBST(lockdir) + AC_SUBST(archlibdir) AC_SUBST(c_switch_system) AC_SUBST(libsrc_libs) AC_SUBST(LD_SWITCH_X_SITE) AC_SUBST(C_SWITCH_X_SITE) AC_SUBST(CFLAGS) AC_DEFINE_UNQUOTED(config_machfile, "\"${machfile}\"") *************** *** 1274,1277 **** --- 1327,1377 ---- fi + # ====================== Developer's configuration ======================= + + # The following assignments make sense if you're running Emacs on a single + # machine, one version at a time, and you want changes to the lisp and etc + # directories in the source tree to show up immediately in your working + # environment. It saves a great deal of disk space by not duplicating the + # lisp and etc directories. + + if [ "$run_in_place" = "1" ]; then + lispdir='${srcdir}/lisp' + locallisppath='${srcdir}/site-lisp:${datadir}/emacs/site-lisp' + etcdir='${srcdir}/etc' + lockdir='${srcdir}/lock' + archlibdir='${srcdir}/lib-src' + infodir='${srcdir}/info' + elif [ "$single_tree" = "1" ]; then + if [ "$exec_prefix_specified" = "" ]; then + exec_prefix='${prefix}' + fi + if [ "$bindir_specified" = "" ]; then + bindir='${exec_prefix}/bin/${configuration}' + fi + if [ "$datadir_specified" = "" ]; then + datadir='${prefix}/common' + fi + if [ "$statedir_specified" = "" ]; then + statedir='${prefix}/common' + fi + if [ "$libdir_specified" = "" ]; then + libdir='${bindir}' + fi + if [ "$lispdir_specified" = "" ]; then + lispdir='${prefix}/common/lisp' + fi + if [ "$locallisppath_specified" = "" ]; then + locallisppath='${prefix}/common/site-lisp' + fi + if [ "$lockdir_specified" = "" ]; then + lockdir='${prefix}/common/lock' + fi + if [ "$archlibdir_specified" = "" ]; then + archlibdir='${libdir}/etc' + fi + if [ "$etcdir_specified" = "" ]; then + etcdir='${prefix}/common/data' + fi + fi #### Report on what we decided to do. *************** *** 1298,1300 **** exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'` ] ! AC_OUTPUT(Makefile) --- 1398,1441 ---- exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'` ] ! AC_OUTPUT(Makefile lib-src/Makefile oldXMenu/Makefile src/Makefile.in) [ ! # Build src/Makefile from ${srcdir}/src/Makefile.in. This must be done ! # after src/config.h is built, since we rely on that file. Only do the ! # build if "config.status" is present, since it's non-presence indicates ! # an error occured. ! status=$? ! if [ ! -f ./config.status ]; then ! exit $status ! fi ! topsrcdir=${srcdir} ! makefile_command='echo "creating src/Makefile"; ! topsrcdir='"${topsrcdir}"'; ! ( cd ./src; ! cp Makefile.in junk.c; ! eval `echo ${CPP} -I. -I${topsrcdir}/src ${CPPFLAGS} junk.c \>junk.cpp`; ! < junk.cpp '\ ! ' sed -e '\''s/^#.*//'\'' '\ ! ' -e '\''s/^[ \f\t][ \f\t]*$//'\'' '\ ! ' -e '\''s/^ / /'\'' '\ ! ' | sed -n -e '\''/^..*$/p'\'' '\ ! ' > Makefile.new; ! chmod 444 Makefile.new; ! mv -f Makefile.new Makefile; ! rm -f junk.c junk.cpp; ! )' ! eval `echo $makefile_command` ! # AC-OUTPUT has created `config.status' already. We need to add the above ! # commands to re-create `src/Makefile', and we need to insert them before ! # the final "exit 0" which appears at the end of `config.status'. ! config.new ! echo $makefile_command >>config.new ! echo exit 0 >>config.new ! mv -f config.new config.status ! chmod +x config.status ! # Don't let the fact that we just rewrote config.status make Makefile think ! # that it is now newer. We have just rewritten all of the Makefiles as well. ! MFS="Makefile src/Makefile src/Makefile.in lib-src/Makefile oldXMenu/Makefile" ! for file in $MFS; do ! chmod a+w $file; touch $file; chmod 444 $file ! done ! exit 0 ! ] diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/etc/ChangeLog emacs-19.20/etc/ChangeLog *** emacs-19.19/etc/ChangeLog Sat Aug 14 19:04:19 1993 --- emacs-19.20/etc/ChangeLog Thu Nov 11 12:55:47 1993 *************** *** 1,2 **** --- 1,6 ---- + Thu Nov 11 12:55:39 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * Version 19.20 released. + Sat Aug 14 00:23:11 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/etc/FTP emacs-19.20/etc/FTP *** emacs-19.19/etc/FTP Sun Aug 15 01:39:17 1993 --- emacs-19.20/etc/FTP Thu Sep 30 21:43:43 1993 *************** *** 144,148 **** archive.cis.ohio-state.edu, and ftp.uu.net:/archive/systems/gnu). And these foreign sites: ftp.cs.ubc.ca:/mirror2/gnu (Canada, daily full ! mirror, ran by ftp-admin@cs.ubc.ca), archie.oz.au:/gnu (Australia (archie.oz or archie.oz.au for ACSnet)), ftp.technion.ac.il:/pub/unsupported/gnu (Israel, daily full mirror, --- 144,148 ---- archive.cis.ohio-state.edu, and ftp.uu.net:/archive/systems/gnu). And these foreign sites: ftp.cs.ubc.ca:/mirror2/gnu (Canada, daily full ! mirror, ran by ftp-admin@cs.ubc.ca), archie.au:/gnu (Australia (archie.oz or archie.oz.au for ACSnet)), ftp.technion.ac.il:/pub/unsupported/gnu (Israel, daily full mirror, *************** *** 155,161 **** ran by gnu-adm), ftp.denet.dk (Denmark), ugle.unit.no (Norway 129.241.1.97), ftp.eunet.ch or nic.switch.ch:/mirror/gnu ! (Switzerland), irisa.irisa.fr:/pub/gnu or grasp1.univ-lyon1.fr:pub/gnu ! (France), archive.eu.net (Europe, 192.16.202.1), ! cair.kaist.ac.kr:/pub/gnu (Korea 143.248.11.170), utsun.s.u-tokyo.ac.jp:/ftpsync/prep or ftp.cs.titech.ac.jp (Japan, nemacs, the japanese port of GNU Emacs, is under ~ftp/JAPAN). Please --- 155,161 ---- ran by gnu-adm), ftp.denet.dk (Denmark), ugle.unit.no (Norway 129.241.1.97), ftp.eunet.ch or nic.switch.ch:/mirror/gnu ! (Switzerland), irisa.irisa.fr:/pub/gnu or ftp.univ-lyon1.fr:pub/gnu ! (ran by ftpmaint@ftp.univ-lyon1.fr) (France), archive.eu.net (Europe, ! 192.16.202.1), cair.kaist.ac.kr:/pub/gnu (Korea 143.248.11.170), utsun.s.u-tokyo.ac.jp:/ftpsync/prep or ftp.cs.titech.ac.jp (Japan, nemacs, the japanese port of GNU Emacs, is under ~ftp/JAPAN). Please diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/etc/MACHINES emacs-19.20/etc/MACHINES *** emacs-19.19/etc/MACHINES Sun Aug 15 00:21:59 1993 --- emacs-19.20/etc/MACHINES Sun Sep 26 21:23:27 1993 *************** *** 530,533 **** --- 530,536 ---- ANSI C compiler version 3.10. + Compiling Emacs using the system's compiler with -O + does not work in Irix 4.0.5; don't use -O (or use GCC). + Most irix3.3 systems do not have an ANSI C compiler, but a few do. If you are using the ANSI C compiler, you may need to add *************** *** 539,543 **** subprocesses of Emacs. Irix versions 4.0 and later with GNU Emacs versions 18.59 and later fix this bug. - Macintosh --- 542,545 ---- diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/etc/MAILINGLISTS emacs-19.20/etc/MAILINGLISTS *** emacs-19.19/etc/MAILINGLISTS Sun Aug 15 01:39:47 1993 --- emacs-19.20/etc/MAILINGLISTS Tue Oct 5 15:53:04 1993 *************** *** 1,3 **** ! GNU Project Electronic Mailing Lists. Last Updated 9 Jun 93 Please report improvements to: gnu@prep.ai.mit.edu --- 1,3 ---- ! GNU Project Electronic Mailing Lists. Last Updated 22 Sep 93 Please report improvements to: gnu@prep.ai.mit.edu *************** *** 171,184 **** help-* list. ! Please DON'T post your bug reports on the gnu.* newsgroups! Mail them ! to bug-*@prep instead! At first sight, it seems to make no difference: ! anything sent to one will be propagated to the other; but if you post on ! the newsgroup, the information about how to reach you is lost in the ! message that goes on the mailing list. It can be very important to know ! how to reach you if there is anything in the bug report that we don't ! understand. Bug reports also reach the GNU maintainers quickest when ! they are sent to the bug-* mailing list submittal address. ! And please DON'T post your GNU bug reports to comp.* or other non gnu.* newsgroups, they never make it to the GNU maintainers at all. Please mail them to bug-*@prep instead! --- 171,191 ---- help-* list. ! Please DON'T post your bug reports on the gnu.*.bug newsgroups! Mail ! them to bug-*@prep instead! At first sight, it seems to make no ! difference: anything sent to one will be propagated to the other; but: ! - if you post on the newsgroup, the information about how to ! reach you is lost in the message that goes on the mailing list. It ! can be very important to know how to reach you, if there is anything ! in the bug report that we don't understand; ! - bug reports reach the GNU maintainers quickest when they are ! sent to the bug-* mailing list submittal address; ! - mail is much more reliable then netnews; and ! - if the internet mailers can't get your bug report delivered, ! they almost always send you an error message, so you can find another ! way to get the bug report in. When netnews fails to get your message ! delivered to the maintainers, you'll never know about it and the ! maintainers will never see the bug report. ! And please DON'T post your GNU bug reports to comp.* or other gnu.* newsgroups, they never make it to the GNU maintainers at all. Please mail them to bug-*@prep instead! *************** *** 403,407 **** The most convenient form of test case is a piece of cpp output that can ! be passed directly to cc1. Preferably written in C, not C++. Subscribers to bug-gcc get all info-gcc messages. --- 410,415 ---- The most convenient form of test case is a piece of cpp output that can ! be passed directly to cc1. Preferably written in C, not C++ or ! Objective C. Subscribers to bug-gcc get all info-gcc messages. *************** *** 418,422 **** If gcc crashes, or if you build gcc following the standard procedure on ! a system which gcc is supposed to work on (see config.gcc) and it does not work at all, or if an command line option does not behave as it is documented to behave, this is a bug. Don't send bug reports to help-gcc --- 426,430 ---- If gcc crashes, or if you build gcc following the standard procedure on ! a system which gcc is supposed to work on (see config.sub) and it does not work at all, or if an command line option does not behave as it is documented to behave, this is a bug. Don't send bug reports to help-gcc diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/etc/NEWS emacs-19.20/etc/NEWS *** emacs-19.19/etc/NEWS Sat Aug 14 05:15:21 1993 --- emacs-19.20/etc/NEWS Wed Nov 10 15:23:37 1993 *************** *** 1,3 **** ! GNU Emacs NEWS -- history of user-visible changes. 7 Jul 1993 Copyright (C) 1993 Free Software Foundation, Inc. See the end for copying conditions. --- 1,3 ---- ! GNU Emacs NEWS -- history of user-visible changes. 9 Oct 1993 Copyright (C) 1993 Free Software Foundation, Inc. See the end for copying conditions. *************** *** 7,10 **** --- 7,408 ---- see the file LNEWS. + User editing changes in version 19.20. + (See following page for Lisp programming changes.) + + Note that some of these changes were made subsequent to the Emacs 19.20 + editions of the Emacs manual and Emacs Lisp manual; therefore, if you + have those editions, do read this page. + + * Dragging with mouse button 1 now puts the selected region + in the kill ring so you can paste it into other X applications. + + * Double and triple clicks with button 1 now behave as in xterm, + selecting the word or line surrounding where you click. If you drag + after the last click, you can select a range of words or lines. + + * You can use button 3 to extend a mouse-selected region, as in xterm. + This works for regions selected either by dragging Mouse-1 or by + multiple-clicking Mouse-1. Clicking Mouse-3 moves the end of the + region that is (initially) nearer to where you click. + + If the selection was first made by multiple-clicking Mouse-1, and thus + consists of entire words or lines, Mouse-3 preserves that state. + + As before, clicking Mouse-3 again in the same place kills the region + thus selected. + + * The secondary selection commands, M-Mouse-1 and M-Mouse-3, have been + likewise modified. + + * You can now search for strings and regexps using the Edit menu bar menu. + + * You can now access bookmarks using the Bookmark submenu in the File + menu in the menu bar. + + * ISO Accents mode, a buffer-local minor mode, provides a convenient + way to type certain non-ASCII characters. It makes the characters `, + ', ", ^, ~ and / serve as modifiers for the following letter. ` and ' + add accents, " adds an umlaut or diaresis, ^ adds a circumflex, ~ + adds a tilde, and / adds a slash to the following letter. + + If the following character is not a letter, or cannot be modified as + requested, then both characters stand for themselves. If you + duplicate the modifier accent character, that enters the corresponding + ISO non-spacing accent character (thus, '' enters the ISO acute-accent + character). To enter a modifier character itself, type it followed by + a space. + + This feature can be used whenever a key sequence is expected: for + ordinary insertion, for searching, and for certain command arguments. + + A few special combinations: + + ~c => c with cedilla + ~d => d with stroke + ~< => left guillemet + ~> => right guillemet + + * iso-transl.el is a new library that replaces iso-insert.el. + It defines C-x 8 as an insertion prefix for the ISO characters + between 128 and 255, much like iso-insert, except that iso-transl + works even in searches and help commands--wherever a key sequence + is expected. + + To define case-conversion for these characters for ISO 8859/1, + load the library iso-syntax. (This is not new.) + + * M-TAB in Text mode now runs the command ispell-complete-word + which performs completion using the spelling dictionary. + + The spelling correction submenu now includes this command + and another command which completes a word fragment (that is, + it doesn't assume that the text to be completed starts at the + beginning of a word. + + * In incremental search, you can use M-y to yank the most recent kill + into the search string. + + * The new function ispell-message checks the spelling of a message + you are about to send or post. It ignores text cited from other + messages. + + To automatically check all your outgoing messages, include the + following line in your .emacs file: + (setq news-inews-hook (setq mail-send-hook 'ispell-message)) + + * There is now a separate minibuffer history list for the names of + extended commands. This history list is used by M-x when reading + the command name. The motivation for this is to prevent command + names from appearing in the history used for other minibuffer + arguments. + + Note that the history list for entire commands that use the minibuffer + is a separate feature. That history list records a command with all + its arguments, and you must use C-x ESC ESC to access it. + + * You can use the new command C-x v ~ VERSION RET to examine a + specified version of a file that is maintained with version control. + + * In Indented Text mode, only blank lines now separate paragraphs. + Indented lines continue the paragraph that is in progress. This makes + the user option variable adaptive-fill-mode have its intended effect. + + * Local variable specifications in files for variables whose names end + in `-hook' and `-function' are now controlled by the variable + `enable-local-eval', just like the `eval' variable. + + * C-x r j (jump-to-register) when restoring a frame configuration now + makes all unwanted frames (existing frames not mentioned in the + configuration) invisible. + + If you want to delete these unwanted frames, use a prefix argument for + C-x r j. + + * You can customize the calendar to display weeks beginning on + Monday: set the variable `calendar-week-start-day' to 1. + + * Rmail changes. + + If you save messages to a file in Unix format while viewing a message + with its whole header, this now copies to the file the entire header + of each message copied. + + * Comint mode changes. + + C-c C-e shows as much output as possible in the window. + C-c RET copies an old input (the one at point) + and places the copy after the latest prompt. + C-c C-p and C-c C-n move through the buffer, stopping at places + where the subshell prompted for input. + C-c C-h lists the input history in a `*Help*' buffer. + + There are new menu bar items for completion/input/output/signal commands. + + Input behaviour is configurable. Variables control whether some windows + showing the buffer scroll to the bottom before insertion. These are + `comint-scroll-to-bottom-on-input' and `before-change-function'. By default, + insertion causes the selected window to scroll to the bottom before insertion + occurs. + + Subprocess output now keeps point at the end of the buffer in each + window individually if point was already at the end of the buffer in + that window. + + If `comint-scroll-show-maximum-output' is non-nil (which is the + default), then scrolling due to arrival of output tries to place the + last line of text at the bottom line of the window, so as to show as + much useful text as possible. (This mimics the scrolling behavior of + many terminals.) + + By setting `comint-scroll-to-bottom-on-output', you can opt for having + point jump to the end of the buffer whenever output arrives--no matter + where in the buffer point was before. If the value is `this', point + jumps in the selected window. If the value is `all', point jumps in + each window that shows the comint buffer. If the value is `other', + point jumps in all nonselected windows that show the current buffer. + The default value is nil, which means point does not jump to the end. + + Input history insertion is configurable. A variable controls whether only the + first instance of successive identical inputs is stored in the input history. + This is `comint-input-ignoredups'. + + Completion (bound to TAB) is now more general. Depending on context, + completion now operates on the input history, on command names, or (as + before) on filenames. + + Filename completion is configurable. Variables control whether + file/directory suffix characters are added (`comint-completion-addsuffix'), + whether shortest completion is acceptable when no further unambiguous + completion is possible (`comint-completion-recexact'), and the timing of + completion candidate listing (`comint-completion-autolist'). + + Comint mode now provides history expansion. Insert input using `!' + and `^', in the same syntax that typical shells use; then type TAB. + This searches the comint input history for a matching element, + performs substitution if necessary, and places the result in the + comint buffer in place of the original input. + + History references in the input may be expanded before insertion into + the input ring, or on input to the interpreter (and therefore + visibly). The variable `comint-input-autoexpand' specifies which. + + You can make the SPC key perform history expansion by binding + SPC to the command `comint-magic-space'. + + The command `comint-dynamic-complete-variable' does variable name + completion using the environment variables as set within Emacs. The + variables controlling filename completion apply to variable name + completion too. This command is normally available through the menu + bar. + + * Shell mode + + Paragraph motion and marking commands (default bindings M-{, M-}, M-h) operate + on output groups (i.e., shell prompt plus associated shell output). + + TAB now completes commands, as well as file names and expand history. + Commands are searched for along the path that Emacs has on startup. + + C-c C-f now moves forward a command (`shell-forward-command') and + C-c C-b now moves backward a command (`shell-backward-command'). + + Command completion is configurable. The variables controlling + filename completion in comint mode apply, together with a variable + controlling whether to restrict possible completions to only files + that are executable (`shell-command-execonly'). + + The input history is initialised from the file name given in the + variable `shell-input-ring-file-name'--normally `.history' in your + home directory. + + Directory tracking is more robust. It can cope with command sequences + and forked commands, and can detect the failure of directory changing + commands in most circumstances. It's still not infallible, of course. + + You can now configure the behaviour of `pushd'. Variables control + whether `pushd' behaves like `cd' if no argument is given + (`shell-pushd-tohome'), pop rather than rotate with a numeric argument + (`shell-pushd-dextract'), and only add directories to the directory + stack if they are not already on it (`shell-pushd-dunique'). The + configuration you choose should match the underlying shell, of course. + + Emacs Lisp programming changes in Emacs 19.20. + + * A new function `remove-hook' is now used to remove a hook that you might + have added with `add-hook'. + + * There is now a Lisp pretty-printer in the library `pp'. + + * The partial Common Lisp support has been entirely reimplemented. + + * When you insert text using `insert', `insert-before-markers' or + `insert-buffer-substring', text properties are no longer inherited + from the surrounding text. + + When you want to inherit text properties, use the new functions + `insert-and-inherit' or `insert-before-markers-and-inherit'. + + The self-inserting character command does do inheritance. + + * Frame creation hooks. + + The function make-frame now runs the normal hooks + before-make-frame-hook and after-make-frame-hook. + + * You can now use function-key-map to make a key an alias for other + key sequences that can vary depending on circumstances. To do this, + give the key a definition in function-key-map which is a function + rather than a specific expansion key sequence. + + If the function reads input itself, it can have the effect of altering + the event that follows. For example, here's how to define C-c h to + turn the character that follows into a hyper character: + + (define-key function-key-map "\C-ch" 'hyperify) + + (defun hyperify (prompt) + (let ((e (if prompt (message "%s%s" prompt (single-key-description + (read-event))) + (vector (if (numberp e) + (logior (lsh 1 20) e) + (if (memq 'hyper (event-modifiers e)) + e + (add-event-modifier "H-" e)))))) + + (defun add-event-modifier (string e) + (let ((symbol (if (symbolp e) e (car e)))) + (setq symbol (intern (concat string (symbol-name symbol)))) + (if (symbolp e) + symbol + (cons symbol (cdr e))))) + + The character translation function gets one argument, which is the + prompt that was specified in read-key-sequence--or nil if the key + sequence is being read by the editor command loop. In most cases + you can just ignore the prompt value. + + * Changes for reading and writing text properties. + + New low-level Lisp features make it possible to write Lisp programs to + save text properties in files, and read text properties from files. + You can program any file format you like. + + The variable `write-region-annotation-functions' should contain a list + of functions to be run by `write-region' to encode text properties in + some fashion as annotations to the text that is written. + + Each function in the list is called with two arguments: the start and + end of the region to be written. These functions should not alter the + contents of the buffer. Instead, they should return lists indicating + annotations to write in the file in addition to the text in the + buffer. + + Each function should return a list of elements of the form (POSITION + . STRING), where POSITION is an integer specifying the relative + position in the text to be written, and STRING is the annotation to + add there. + + Each list returned by one of these functions must be already sorted in + increasing order by POSITION. If there is more than one function, + `write-region' merges the lists destructively into one sorted list. + + When `write-region' actually writes the text from the buffer to the + file, it intermixes the specified annotations at the corresponding + positions. All this takes place without modifying the buffer. + + The variable `after-insert-file-functions' should contain a list of + functions to be run each time a file's contents have been inserted into + a buffer. Each function receives one argument, the length of the + inserted text; point indicates the start of that text. The function + should make whatever changes it wants to make, then return the updated + length of the inserted text, as it stands after those changes. The + value returned by one function is used as the argument to the next. + These functions should always return with point at the beginning of + the inserted text. + + The intended use of `after-insert-file-functions' is for converting + some sort of textual annotations into actual text properties. But many + other uses may be possible. + + We now invite users to begin implementing Lisp programs to store and + retrieve text properties in files, using these new primitive features, + and thus to experiment with various data formats and find good ones. + + We suggest not trying to handle arbitrary Lisp objects as property + names or property values--because a program that general is probably + difficult to write, and slow. Instead, choose a set of possible data + types that are reasonably flexible, and not too hard to encode. + + * Comint completion. + + Currently comint-dynamic-complete-command (and associated variable + comint-after-partial-pathname-command) are set by default to complete a + filename. Other comint-mode users should have their own functions to achieve + this. For example, gud-mode could complete debugger commands. A completion + function is provided solely for this reason (comint-dynamic-simple-complete). + + Other comint-mode users should bind comint-dynamic-complete (shell-mode does + already). + + * Comint history reference expansion + + Currently comint-input-autoexpand is 'history, which means only expand + history on insertion to comint-input-ring. For non-shell modes, this is + a strange default, since non-shells will not understand history references. + Perhaps it would be better for the variable to be 'input, which means expand + on RET. + + The value 'history might possibly be wrong even for shells, since the + expansion will be done both by comint and the underlying shell (except sh, of + course). It would be better for expansion to be done by one or the other, + not both since they may (ahem) disagree. Since it is silly to put a literal + history reference into comint-input-ring, perhaps it would be better for the + variable to be 'input too. + + The reason the variable is not 'input by default is that I was attempting to + adhere to The Principle of Least Astonishment. I didn't want to shock users + by having their input change in front of their eyes. + + * Argument delimiters and Comint mode. + + Currently comint-delimiter-argument-list is '(), which means no strings are + to be treated as delimiters and arguments. In shell-mode, this variable is + set to shell-delimiter-argument-list, '("|" "&" "<" ">" "(" ")" ";"). Other + comint-mode users should set this variable too. For example, a lisp-type + mode might want to set this to '("." "(" ")") or some such. + + * Comint output hook. + + There is now a hook, comint-output-filter-hook, that is run-hooks'ed by the + output filter, comint-output-filter. This is useful for scrolling (see + below), but also things like processing output for specific text, output + hilighting, etc. + + So that such output processing may be done efficiently, there is a new + variable, comint-last-output-start, that records the position of the start of + the lastest output inserted into the buffer (effectively the previous value + of process-mark). Output processing functions should process the text + between comint-last-output-start (or perhaps the beginning of the line that + the position lies on) and process-mark. + + * Comint scrolling. + + There is now automatic scrolling of process windows. + + Currently comint-scroll-show-maximum-output is t, which means when scrolling + output put process-mark at the bottom of the window. There is a good case + for it to be t, since the user is likely to want to see as much output as + possible. But, then again, there is a comint-show-maximum-output command. + + * Comint history retrieval. + + The input following point is not deleted when moving around the input history + (with M-p etc.). Emacs maintainers may not like this. However, I feel this + is a useful feature. The simple remedy is to put end-of-line in before + delete-region in comint-previous-matching-input. + + The input history retrieval commands still wrap-around the input ring, unlike + Emacs command history. + Changes in version 19.19. *************** *** 1429,1436 **** because either `RCS' or `SCCS' appears in the mode line. ! ** A new Calendar mode has been added, based on the work of Nachum ! Dershowitz and Edward M. Reingold. The mode can display the Gregorian ! calendar and a variety of other calendars at any date, and interacts ! with a diary facility similar to the UNIX `calendar' utility. ** There is a new major mode for editing binary files: Hexl mode. --- 1827,1834 ---- because either `RCS' or `SCCS' appears in the mode line. ! ** A new Calendar mode has been added, the work of Edward M. Reingold. ! The mode can display the Gregorian calendar and a variety of other ! calendars at any date, and interacts with a diary facility similar to ! the UNIX `calendar' utility. ** There is a new major mode for editing binary files: Hexl mode. *************** *** 1588,1592 **** Here are three ways to enter two-column mode: ! C-x 6 2 makes the current buffer into the left-hand buffer. It the right-hand window it puts a buffer whose name is based on the current buffer's name. --- 1986,1990 ---- Here are three ways to enter two-column mode: ! C-x 6 2 makes the current buffer into the left-hand buffer. In the right-hand window it puts a buffer whose name is based on the current buffer's name. *************** *** 1613,1617 **** recenters both buffers together. ! If you want to make a lines which will span both columns, put it in the left-hand buffer, with an empty line in the corresponding place in the right-hand buffer. --- 2011,2015 ---- recenters both buffers together. ! If you want to make a line which will span both columns, put it in the left-hand buffer, with an empty line in the corresponding place in the right-hand buffer. *************** *** 1731,1735 **** character by means of this command, to distinguish various classes of files. If OLD is ` ', then the command operates on all unmarked ! files; if NEW is ` ', then the command unmarks the files in acts on. ** Operating on Multiple Files --- 2129,2133 ---- character by means of this command, to distinguish various classes of files. If OLD is ` ', then the command operates on all unmarked ! files; if NEW is ` ', then the command unmarks the files it acts on. ** Operating on Multiple Files diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/etc/ORDERS emacs-19.20/etc/ORDERS *** emacs-19.19/etc/ORDERS Sun Aug 15 01:40:03 1993 --- emacs-19.20/etc/ORDERS Tue Aug 24 14:56:20 1993 *************** *** 131,135 **** The tape includes source code for: - * acm (multiplayer aerial combat simulation for the X window system) * autoconf (produces shell scripts to automatically configure software builds) * Bash (GNU's Bourne Again SHell) --- 131,134 ---- *************** *** 144,150 **** * GNU find & finger * GNU fontutils (create and support fonts for use with Ghostscript or TeX) * ms (MandelSpawn, a parallel Mandelbrot program for the X window system) ! * GNU Chess (a chess playing program with an interface to X) ! * GNU Shogi (plays Shogi, a japanese game similar to chess, with a X interface) * Nethack (a rogue-like game) * GNU GO (the GNU implementation of the game of GO) --- 143,150 ---- * GNU find & finger * GNU fontutils (create and support fonts for use with Ghostscript or TeX) + * acm (multiplayer aerial combat simulation for the X window system) * ms (MandelSpawn, a parallel Mandelbrot program for the X window system) ! * GNU Chess (a chess playing program with interfaces to both X & ttys) ! * GNU Shogi (plays a japanese game like chess; has both tty & X interfaces) * Nethack (a rogue-like game) * GNU GO (the GNU implementation of the game of GO) diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/etc/SERVICE emacs-19.20/etc/SERVICE *** emacs-19.19/etc/SERVICE Mon Aug 9 17:44:46 1993 --- emacs-19.20/etc/SERVICE Thu Sep 23 11:19:53 1993 *************** *** 928,955 **** Entered: 12 Feb 92  - Watchmaker Computing - P.O.Box 163, Kendall Square - Cambridge, MA 02142 - email: support@watch.com - - Emacs: We'll do GNUEmacs support, porting, bug fixing, and customizing. - We also have specific expertise in: - packages: GCC, G++, X11, Xt, InterViews, PERL, TeX, Epoch - languages: C, C++, Lisp, most others; we learn quickly! - Extensive experience coding for portability under UNIX. - Typical rates $35-$150/hour; will telecommute (Internet or phone) - - Entered: 1/16/91 -  Joe Wells ! c/o: Boston University Computer Science Department 111 Cummington Street, Room 138 Boston, Massachusetts 02215 ! Work: (617)353-3381; Home: (617)352-7508 Finger "jbw@cs.bu.edu" for up-to-date contact information. Experience: ! I have B.A. and M.A. degrees in Computer Science and am ! all-but-dissertation for a Ph.D. in C.S. My primary programming languages are Emacs Lisp, Perl, and Bourne shell. I have written numerous Emacs Lisp packages. I started the USENET "List of --- 928,941 ---- Entered: 12 Feb 92  Joe Wells ! care of: Boston University Computer Science Department 111 Cummington Street, Room 138 Boston, Massachusetts 02215 ! Work: (617) 353-3381; Home: (617) 352-7508 (until mid-May 1994) Finger "jbw@cs.bu.edu" for up-to-date contact information. Experience: ! I have B.A. and M.A. degrees in Computer Science and have completed ! all but the dissertation for a Ph.D. in C.S. My primary programming languages are Emacs Lisp, Perl, and Bourne shell. I have written numerous Emacs Lisp packages. I started the USENET "List of *************** *** 959,977 **** Programs supported: ! GNU Emacs: installation, training, customization, bug fixing, ! troubleshooting, extension, development, or answering any ! kind of question. ! Any other GNU program: installation and answering questions. Working conditions: ! I can do part-time (less than 20 hours/week) work for a long term and ! full-time work for a short term (a month or two). I can either work ! in or near Boston or via the Internet. My schedule is fairly ! flexible. I prefer that any Emacs Lisp package I write have the GNU ! GPL copying conditions. ! ! Rates: $45/hour, provided I don't have to travel far. ! Entered: 18Feb93  Chris Welty --- 945,967 ---- Programs supported: ! GNU Emacs and Taylor UUCP: ! Installation, training, customization, bug fixing, troubleshooting, ! extension, development, porting, or answering any kind of question. ! Any other GNU program: ! The same things, but I don't necessarily have huge amounts of ! experience with the particular program. Working conditions: ! I can do part-time (less than 20 hours per week including travel) ! work. I can either work in or near Boston or via the Internet or via ! telephone. My schedule is fairly flexible. Any programs I write will ! normally have the copying conditions of the GNU General Public ! License. ! ! Rates: $60/hour as an independent contractor. ! travel and telephone expenses. ! higher rates if extensive travel is required. ! Updated: 21Sep93  Chris Welty diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/etc/TO-DO emacs-19.20/etc/TO-DO *** emacs-19.19/etc/TO-DO --- emacs-19.20/etc/TO-DO Sun Sep 12 04:44:58 1993 *************** *** 0 **** --- 1,83 ---- + Things useful to do for GNU Emacs: + + * Primitive for random access insertion of part of a file. + + * Making I/O streams for files, so that read and prin1 can + be used on files directly. The I/O stream itself would + serve as a function to read or write one character. + + * If a file you can't write is in a directory you can write, + make sure it works to modify and save this file. + + * Make dired's commands handle correctly the case where + ls has listed several subdirectories' contents. + It needs to be able to tell which directory each file + is really in, by searching backward for the line + which identifies the start of a directory. + + * Add more dired commands, such as sorting (use the + sort utility through call-process-region). + + * Make display.c record inverse-video-ness on + a character by character basis. Then make non-full-screen-width + mode lines inverse video, and display the marked location in + inverse video. + + * VMS code to list a file directory. Make dired work. + + Long range: + + Ideas for extending GNU Emacs to deal with arbitrary character sets. + + I would like GNU Emacs to be extended to handle all the world's alphabets + and word signs. I don't expect to have time to do such a thing in the next + few years, so here are my ideas on the best way to do it. + + * Each graphic is represented by a sequence of ordinary 8-bit characters. + + * All the characters that make up such a sequence have codes >= 0200. + + * The first character of such a sequence is between 0200 and 0237. + + * The remaining characters of such a sequence are all 0240 or higher. + + * The first character of the sequence determines the number of characters + in the sequence. Thus, 0200...0207 could start two-character sequences, + 0210...0227 could start three-character sequences, and 0230 could start + four-character sequences. (Codes 0231...0237 would be reserved.) + + * Several common alphabets, and some mathematical symbols, would get + two-character sequences. (Probably Greek, Russian, Hebrew(?), Arabic(?), + Korean, and Japanese kana). The remaining alphabets, and some versions of + Chinese, would get three-character sequences. Other sets of Chinese + characters would get four-character sequences. + + Each country that uses Chinese characters has its own standard character + set, and it is not easy to correlate them to avoid overlap. So there may + need to be several sets of Chinese characters. That is why they need so + much code space. + + True support for Hebrew and Arabic requires dealing with the problem of + writing direction for mixed text; I don't know what to do for that. + + * The functions that use syntax table would determine the + syntax of a sequence from its first character. + + * Functions in indent.c for computing widths and columns would + determine the width of a sequence from its first character. + So would display routines. + + * Only a few other editing routines would need any change. In + particular, searching and regexp matching might not need any change. + + * Most of the work required would be in redisplay. The only case that + needs to be supported is with X windows, since ordinary terminals + can't display all these characters anyway. + + * There might need to be code to translate files from this format + to whatever format is typically stored on disk. + + + I would be very unhappy with half-measures, such as support for + Japanese only. + diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/info/forms emacs-19.20/info/forms *** emacs-19.19/info/forms Sun Aug 15 01:42:29 1993 --- emacs-19.20/info/forms Tue Nov 9 02:34:32 1993 *************** *** 1,6 **** ! This is Info file ../info/forms, produced by Makeinfo-1.55 from the ! input file forms.texinfo. ! This file documents forms-mode, a forms based major mode for GNU Emacs. --- 1,6 ---- ! This is Info file ../info/forms, produced by Makeinfo-1.54 from the ! input file forms.texi. ! This file documents Forms mode, a form-editing major mode for GNU Emacs. *************** *** 10,53 ****  ! File: forms, Node: Top, Next: What is in a Forms, Up: (DIR) ! Forms mode is an Emacs major mode for working with simple plain-text ! databases in a forms-oriented manner. In forms mode, the information in ! these files is presented in an Emacs window in a user-defined format, ! one record at a time. Forms can be inspected read-only (viewing) or ! modified and updated. Forms mode is not a simple major mode, but requires two files to do ! its job: a control file and a data file. The data file holds the actual ! data which will be presented. The control file describes how it will be ! presented. * Menu: ! * What is in a Forms:: Introduction. ! * Data File Format:: How to format the data file. ! * Control File Format:: How to control forms mode. ! * Forms Format Description:: ! How to define the forms layout. ! * Modifying Forms Contents:: ! How to modify. ! * Forms Mode Commands:: The commands available, and how to use them. ! * Key Bindings:: Which keys are bound to what commands. ! * Miscellaneous:: Forms mode messages and other remarks. ! * Error Messages:: List of error messages forms mode can produce. ! * Examples:: Some examples. ! * Credits:: Thanks everyone. ! * Concept Index:: Index of Concepts ! * Variable Index:: Index of Variables. ! * Function Index:: Index of Functions.  ! File: forms, Node: What is in a Forms, Next: Data File Format, Prev: Top, Up: Top ! What is in a forms ! ================== ! Let's illustrate forms mode with an example. Suppose you are looking ! at your `/etc/passwd' file, and your screen looks as follows: ====== /etc/passwd ====== --- 10,53 ----  ! File: forms, Node: Top, Next: Forms Example, Prev: (DIR), Up: (DIR) ! Forms Mode ! ********** + Forms mode is an Emacs major mode for working with simple textual + data bases in a forms-oriented manner. In Forms mode, the information + in these files is presented in an Emacs window in a user-defined format, + one record at a time. The user can view records or modify their + contents. + Forms mode is not a simple major mode, but requires two files to do ! its job: a control file and a data file. The data file holds the ! actual data to be presented. The control file describes how to present ! it. * Menu: ! * Forms Example:: An example: editing the password data base. ! * Entering and Exiting Forms Mode:: ! How to visit a file in Forms mode. ! * Forms Commands:: Special commands to use while in Forms mode. ! * Data File Format:: How to format the data file. ! * Control File Format:: How to control forms mode. ! * Format Description:: How to define the forms layout. ! * Modifying Forms Contents:: How to modify. ! * Miscellaneous:: Forms mode messages and other remarks. ! * Error Messages:: List of error messages forms mode can produce. ! * Long Example:: A more complex control file example. ! * Credits:: Thanks everyone. ! * Index:: Index to this manual.  ! File: forms, Node: Forms Example, Next: Entering and Exiting Forms Mode, Prev: Top, Up: Top ! Forms Example ! ************* ! Let's illustrate Forms mode with an example. Suppose you are ! looking at the `/etc/passwd' file, and the screen looks like this: ====== /etc/passwd ====== *************** *** 66,213 **** The contents of the forms consists of the contents of the fields of ! the record (e.g. "root", "0", "1", "Super User") interspersed with ! normal text (e.g "User : ", "Uid: "). ! You can define yourself how text and fields will be used to make up ! the forms. ! When you modifiy the contents of the forms, it will be analyzed and ! the new contents of the fields of this record will be extracted. It ! possible, the file will be updated with the new contents.  ! File: forms, Node: Data File Format, Next: Control File Format, Prev: What is in a Forms, Up: Top ! Data file format ! ================ ! Files for use with forms mode are very simple - each record (line) ! forms the contents one form. Each record is supposed to consist of a ! number of fields. These fields are separated by the value of the string ! `forms-field-sep', which is a `TAB' by default. ! Fields may contain text which shows up in the forms in multiple ! lines. These lines are separated in the field using a PSEUDO-NEWLINE ! character which is defined by the value of the string ! `forms-multi-line'. Its default value is a Control-K character. If it ! is set to `nil' multiple line fields are prohibited.  ! File: forms, Node: Control File Format, Next: Forms Format Description, Prev: Data File Format, Up: Top ! Control file format ! =================== ! The control file serves two purposes. ! First, it defines the data file to use, and its properties. ! Second, the Emacs buffer it occupies will be used by the forms mode ! to display the forms. ! The contents of the control file are evaluated using the Emacs ! command `eval-current-buffer', hence must contain valid Emacs-lisp ! expressions. These expressions must set the following lisp variables ! to a suitable value: `forms-file' ! This variable must be set to the name of the data file. ! Example: (setq forms-file "my/data-file") `forms-format-list' This variable describes the way the fields of the record are ! formatted on the screen. See the next section for details. `forms-number-of-fields' This variable holds the number of fields in each record of the data ! file. ! Example: (setq forms-number-of-fields 10) ! An error will be given if one of the above values has not been set. ! Other variables that may be set from the control file are optional. ! Most of them have suitable default values. `forms-field-sep' This variable may be used to designate the string which separates ! the fields in the records of the data file. If not set, it ! defaults to a string containing a single `TAB' character. ! Example: (setq forms-field-sep "\t") `forms-read-only' ! If set to a value other than `nil', the data file is treated ! read-only. If the data file can not be written into, read-only ! mode is enforced. The default value for `forms-read-only' is ! derived from the access permissions of the data file. ! Example: (set forms-read-only t) `forms-multi-line' ! This variable may be set to allow multi-line text in fields. It ! should be set to a string of one character, which denotes the ! pseudo new-line character to be used to separate the text lines. ! Its default value is Control-K (octal 013). If set to `nil', ! multi-line text fields are prohibited. ! It may not be a character contained in `forms-field-sep'. ! Example: ! (setq forms-multi-line "\C-k") ! `forms-forms-scroll' ! *Note Forms Mode Commands:: for the description. ! `forms-forms-jump' ! *Note Forms Mode Commands:: for the description. `forms-new-record-filter' ! The control file may define a function `forms-new-record-filter', ! or set `forms-new-record-filter' to such a function. If so, this ! function is called when a new record is created to supply default ! values for fields. `forms-modified-record-filter' ! The control file may define a function ! `forms-modified-record-filter', or set ! `forms-modified-record-filter' to such a function. If so, this ! function is called when a record is modified, just before writing ! the modified record back to the data file. ! !  ! File: forms, Node: Forms Format Description, Next: Modifying Forms Contents, Prev: Control File Format, Up: Top ! ! The forms format description ! ============================ ! ! The value of the variable `forms-format-list' is used to specify the ! format of the forms. It must be a list of formatting elements, each of ! which can be a string, number, lisp list or a lisp symbol that ! evaluates to one of these. The formatting elements are processed in the order they appear in the list. ! A `string' formatting element is inserted in the forms "as is". ! ! A `number' element selects a field of the record. The contents of ! this field are inserted. The first field of the record has number 1 ! (one). ! ! A `lisp list' specifies a function call. This function is called ! every time a record is displayed, and its result, that must be a ! string, is inserted in the forms. The function should do nothing but ! returning a string. The fields of the record being displayed are ! available to this function as the list `forms-fields' and can be ! accessed using `(nth 'FIELD NUMBER` forms-fields)'. Fields are ! numbered starting from 1 (one). - A `lisp symbol' must evaluate to one of the above possibilities. - If a record does not contain the number of fields as specified in ! `forms-number-of-fields', a warning message will be printed. Excess fields are ignored, missing fields are set to empty. ! The control file which shows your `/etc/passwd' file as demonstrated ! in the beginning of this document might look as follows: ! ;; This demo visits /etc/passwd. (setq forms-file "/etc/passwd") --- 66,355 ---- The contents of the forms consists of the contents of the fields of ! the record (e.g. `root', `0', `1', `Super User') interspersed with ! normal text (e.g `User : ', `Uid: '). ! ! If you modify the contents of the fields, Forms mode will analyze ! your changes and update the file appropriately. You cannot modify the ! interspersed explanatory text (unless you go to some trouble about it), ! because that is marked read-only (*note Text Properties: (elisp)Text ! Properties.). ! ! The Forms mode control file specifies the relationship between the ! format of `/etc/passwd' and what appears on the screen in Forms mode. ! *Note Control File Format::. ! !  ! File: forms, Node: Entering and Exiting Forms Mode, Next: Forms Commands, Prev: Forms Example, Up: Top ! ! Entering and Exiting Forms Mode ! ******************************* ! ! `M-x forms-find-file RET CONTROL-FILE RET' ! Visit a database using Forms mode. Specify the name of the ! *control file*, not the data file! ! ! `M-x forms-find-file-other-window RET CONTROL-FILE RET' ! Similar, but displays the file in another window. ! ! The command `forms-find-file' evaluates the file CONTROL-FILE, and ! also visits it in Forms mode. What you see in its buffer is not the ! contents of this file, but rather a single record of the corresponding ! data file that is visited in its own buffer. So there are two buffers ! involved in Forms mode: the "forms buffer" that is initially used to ! visit the control file and that shows the records being browsed, and ! the "data buffer" that holds the data file being visited. The latter ! buffer is normally not visible. ! ! Initially, the first record is displayed in the forms buffer. The ! mode line displays the major mode name `Forms', followed by the minor ! mode `View' if the data base is read-only. The number of the current ! record (N) and the total number of records in the file(T) are shown in ! the mode line as `N/T'. For example: ! ! --%%-Emacs: passwd-demo (Forms View 1/54)----All------- ! ! If the buffer is not read-only, you may change the buffer to modify ! the fields in the record. When you move to a different record, the ! contents of the buffer are parsed using the specifications in ! `forms-format-list', and the data file is updated. If the record has ! fields that aren't included in the display, they are not changed. ! ! Entering Forms mode runs the normal hook `forms-mode-hooks' to ! perform user-defined customization. ! To save any modified data, you can use `C-x C-s' (`save-buffer'). ! This does not save the forms buffer (which would be rather useless), ! but instead saves the buffer visiting the data file. ! To terminate Forms mode, you can use `C-x C-s' (`save-buffer') and ! then kill the forms buffer. However, the data buffer will still ! remain. If this is not desired, you have to kill this buffer too.  ! File: forms, Node: Forms Commands, Next: Data File Format, Prev: Entering and Exiting Forms Mode, Up: Top ! Forms Commands ! ************** ! The commands of Forms mode belong to the `C-c' prefix, with one ! exception: TAB, which moves to the next field. Forms mode uses ! different key maps for normal mode and read-only mode. In read-only ! Forms mode, you can access most of the commands without the `C-c' ! prefix, but you must type ordinary letters instead of control ! characters; for example, type `n' instead of `C-c C-n'. ! ! `C-c C-n' ! Show the next record (`forms-next-record'). With a prefix ! argument N, show the Nth next record. ! ! `C-c C-p' ! Show the previous record (`forms-prev-record'). With a prefix ! argument N, show the Nth previous record. ! ! `C-c C-l' ! Jump to a record by number (`forms-jump-record'). Specify the ! record number with a prefix argument. ! `C-c <' ! Jump to the first record (`forms-first-record'). ! ! `C-c >' ! Jump to the last record (`forms-last-record'). This command also ! recalculates the number of records in the data file. ! ! `TAB' ! `C-c TAB' ! Jump to the next field in the current record (`forms-next-field'). ! With a numeric argument N, jump forward N fields. If this command ! would move past the last field, it wraps around to the first field. ! ! `C-c C-q' ! Toggles read-only mode (`forms-toggle-read-only'). In read-only ! Forms mode, you cannot edit the fields; most Forms mode commands ! can be accessed without the prefix `C-c' if you use the normal ! letter instead (for example, type `n' instead of `C-c C-n'). In ! edit mode, you can edit the fields and thus change the contents of ! the data base; you must begin Forms mode commands with `C-c'. ! Switching to edit mode is allowed only if you have write access to ! the data file. ! ! `C-c C-o' ! Create a new record and insert it before the current record ! (`forms-insert-record'). It starts out with empty (or default) ! contents for its fields; you can then edit the fields. With a ! prefix argument, the new record is created *after* the current one. ! See also `forms-modified-record-filter' in *Note Modifying Forms ! Contents::. ! ! `C-c C-k' ! Delete the current record (`forms-delete-record'). You are ! prompted for confirmation before the record is deleted unless a ! prefix argument has been provided. ! ! `C-c C-s REGEXP RET' ! Search for REGEXP in all records following this one ! (`forms-search'). If found, this record is shown. If you give an ! empty argument, the previous regexp is used again. ! ! `M-x forms-prev-field' ! Similar to `forms-next-field' but moves backwards. ! ! In addition, commands such as `C-x C-s' (`save-buffer') and `M-x ! revert-buffer' are useful in Forms mode just as in other modes. + The following function key definitions are set up in Forms mode + (whether read-only or not): + + `next' + forms-next-record + + `prior' + forms-prev-record + + `begin' + forms-first-record + + `end' + forms-last-record + + `S-Tab' + forms-prev-field +  ! File: forms, Node: Data File Format, Next: Control File Format, Prev: Forms Commands, Up: Top ! ! Data File Format ! **************** ! Files for use with Forms mode are very simple--each "record" ! (usually one line) forms the contents of one form. Each record consists ! of a number of "fields", which are separated by the value of the string ! `forms-field-sep', which is `"\t"' (a tab) by default. ! Fields may contain text which shows up in the forms in multiple ! lines. These lines are separated in the field using a "pseudo-newline" ! character which is defined by the value of the string ! `forms-multi-line'. Its default value is `"\^k"'. If it is set to ! `nil', multiple line fields are prohibited. ! !  ! File: forms, Node: Control File Format, Next: Format Description, Prev: Data File Format, Up: Top ! Control File Format ! ******************* ! The Forms mode "control file" serves two purposes. First, it names ! the data file to use, and defines its format and properties. Second, ! the Emacs buffer it occupies is used by Forms mode to display the forms. ! The contents of the control file are evaluated as a Lisp program. It ! should set the following Lisp variables to suitable values: `forms-file' ! This variable specifies the name of the data file. Example: ! (setq forms-file "my/data-file") `forms-format-list' This variable describes the way the fields of the record are ! formatted on the screen. For details, see *Note Format ! Description::. `forms-number-of-fields' This variable holds the number of fields in each record of the data ! file. Example: ! (setq forms-number-of-fields 10) ! If the control file doesn't set all of these variables, Forms mode ! reports an error. ! The control file can optionally set the following additional Forms ! mode variables. Most of them have default values that are good for most ! applications. `forms-field-sep' This variable may be used to designate the string which separates ! the fields in the records of the data file. If not set, it ! defaults to the string `"\t"' (a tab character). Example: ! (setq forms-field-sep "\t") `forms-read-only' ! If the value is non-`nil', the data file is treated read-only. ! (Forms mode also treats the data file as read-only if you don't ! have access to write it.) Example: ! (set forms-read-only t) `forms-multi-line' ! This variable specifies the "pseudo newline" separator that allows ! multi-line fields. This separator goes between the "lines" within ! a field--thus, the field doesn't really contain multiple lines, ! but it appears that way when displayed in Forms mode. If the ! value is `nil', multi-line text fields are prohibited. The pseudo ! newline must not be a character contained in `forms-field-sep'. ! The default value is `"\^k"', so the default pseudo newline is the ! character control-k. Example: ! (setq forms-multi-line "\^k") `forms-new-record-filter' ! This variable holds a function to be called whenever a new record ! is created to supply default values for fields. If it is `nil', ! no function is called. *Note Modifying Forms Contents::, for ! details. `forms-modified-record-filter' ! This variable holds a function to be called whenever a record is ! modified, just before updating the Forms data file. If it is ! `nil', no function is called. *Note Modifying Forms Contents::, ! for details. ! !  ! File: forms, Node: Format Description, Next: Modifying Forms Contents, Prev: Control File Format, Up: Top ! ! The Format Description ! ********************** ! ! The variable `forms-format-list' specifies the format of the data in ! the data file, and how to convert the data for display in Forms mode. ! Its value must be a list of Forms mode "formatting elements", each of ! which can be a string, a number, a Lisp list, or a Lisp symbol that ! evaluates to one of those. The formatting elements are processed in the order they appear in the list. ! STRING ! A string formatting element is inserted in the forms "as is," as ! text that the user cannot alter. ! ! NUMBER ! A number element selects a field of the record. The contents of ! this field are inserted in the display at this point. Field ! numbers count starting from 1 (one). ! ! LIST ! A formatting element that is a list specifies a function call. ! This function is called every time a record is displayed, and its ! result, which must be a string, is inserted in the display text. ! The function should do nothing but returning a string. ! ! The function you call can access the fields of the record as a ! list in the variable `forms-fields'. ! ! SYMBOL ! A symbol used as a formatting element should evaluate to a string, ! number, or list; the value is interpreted as a formatting element, ! as described above. If a record does not contain the number of fields as specified in ! `forms-number-of-fields', a warning message will be printed. Excess fields are ignored, missing fields are set to empty. ! The control file which displays `/etc/passwd' file as demonstrated ! in the beginning of this manual might look as follows: ! ! ;; This demo visits `/etc/passwd'. (setq forms-file "/etc/passwd") *************** *** 215,219 **** (setq forms-read-only t) ; to make sure (setq forms-field-sep ":") ! (setq forms-multi-line nil) ; not allowed (setq forms-format-list --- 357,362 ---- (setq forms-read-only t) ; to make sure (setq forms-field-sep ":") ! ;; Don't allow multi-line fields. ! (setq forms-multi-line nil) (setq forms-format-list *************** *** 231,621 **** "\n")) ! When functions are to be used in `forms-format-list' they must be ! quoted to prevent them from being evaluated too early: (setq forms-format-list ! (list "====== " forms-file " ======\n\n" "User : " 1 ! '(make-string 20 ?-) ... )) ! Alternatively, instead of quoting the functions, the whole list may ! be quoted: (setq forms-format-list ! '( "====== " forms-file " ======\n\n" "User : " 1 ! (make-string 20 ?-) ... )) ! Upon startup, the contents of `forms-format-list' are validated. If ! errors are encountered, processing is aborted with an error message ! which includes a descriptive text. *Note Error Messages::, for a ! detailed list of error messages.  ! File: forms, Node: Modifying Forms Contents, Next: Forms Mode Commands, Prev: Forms Format Description, Up: Top Modifying The Forms Contents ! ============================ ! If a forms is not read-only, it's contents can be modified. ! All normal editor commands may be used to change the forms. There is ! no distinction between the "fixed" text and the text from the fields of ! the records. However, upon completion, the forms is parsed to extract ! the new contents of the fields. The "fixed" portions of the forms are ! used to delimit the fields, these portions should therefore not be ! modified to avoid the risk that the field contents cannot be determined. ! Moreover, ambiguous field contents, which can not be discriminated from ! "fixed" text, must be avoided. ! ! If the contents of the forms cannot be recognized properly, this is ! signaled using a descriptive text. *Note Error Messages::, for more ! info. The cursor will indicate the last part of the forms which was ! successfully parsed. ! ! If `forms-modified-record-filter' has been set, this function is ! called before the new data is written to the data file. The function is ! called with one argument: a vector that contains the contents of the ! fields of the record. Fields can referenced or modified using the lisp ! functions `aref' and `aset'. The first field has number 1 (one). The ! function must return the (possibly modified) vector to the calling ! environment. (defun my-modified-record-filter (record) ! ;; modify second field (aset record 2 (current-time-string)) ! record ; return it ! ) (setq forms-modified-record-filter 'my-modified-record-filter) !  ! File: forms, Node: Forms Mode Commands, Next: Key Bindings, Prev: Modifying Forms Contents, Up: Top ! ! Forms mode commands ! =================== ! ! `M-x forms-find-file FILE' ! Visits FILE, runs `eval-current-buffer' on it, and puts the buffer ! into forms-mode. The first record of the data file will be loaded and ! shown. ! ! The modeline will display the major mode `"Forms"' followed by the ! minor mode `"View"' if the file is visited read-only. The number of ! the current record (N) and the total number of records (T) in the file ! is shown in the modeline as `"n/t"'. ! For example: ! --%%-Emacs: passwd-demo (Forms View 1/54)----All------- ! ! `M-x forms-find-file-other-window FILE' ! This command is similar to `forms-find-file', but visits the file in ! another window. ! ! If the buffer is not read-only, you may change the buffer to modify ! the fields in the record. When the current record is left, e.g. by ! switching to another record, the contents of the buffer are parsed ! using the specifications in `forms-format-list', and a new record is ! constructed which replaces the current record in the data file. Fields ! of the record which are not shown in the forms are not modified; they ! retain their original contents. ! ! Most forms mode commands are bound to keys, and are accessible with ! the conventional `C-c' prefix. In read-only mode this prefix is not ! used. *Note Key Bindings::, for the default key bindigs used by forms ! mode. ! ! The following commands are available within forms mode. ! ! `forms-next-record' ! shows the next record. With a prefix argument, show the n-th next ! record. ! ! `forms-prev-record' ! shows the previous record. With a prefix argument, show the n-th ! previous record. ! ! `forms-jump-record' ! jumps to a record by number. A prefix argument is used for the ! record number to jump to. If no prefix argument is supplied, a ! record number is asked for in the minibuffer. ! If an invalid record number is supplied, an error message is ! displayed reading the offending record number, and the allowable ! range of numbers. ! ! `forms-first-record' ! jumps to the first record. ! ! `forms-last-record' ! jumps to the last record. Also re-counts the number of records in ! the data file. ! ! `forms-next-field' ! jumps to the next field in the forms. With a numeric argument: ! jumps that many fields, or to the first field if there are not ! that many fields left. ! ! Jumping to fields is implemented using markers, which are placed ! in front of the fields. If the contents of the forms are modified, ! the markers are adjusted. However, if text around a marker has ! been deleted from the screen and inserted again it is possible ! that this marker no longer points at its field correctly. *Note ! Markers: (emacs)Markers, for more information on markers. ! ! `forms-view-mode' ! switches to read-only mode. Forms mode commands may no longer be ! prefixed with `C-c'. ! ! `forms-edit-mode' ! switches to edit mode. Forms mode commands must be prefixed with ! `C-c'. ! Switching to edit mode is only possible if write access to the data ! file is allowed. ! ! `forms-insert-record' ! create a new record, which is inserted before the current record. ! An empty form is presented, which can be filled in using familiar ! editor commands. With a prefix argument: the new record is created ! after the current one. ! ! If a function `forms-new-record-filter' was defined in the control ! file, this function is called to fill in default values for ! fields. The function is passed a vector of empty strings, one for ! each field. For convenience, an additional element is added so the ! numbers of the elements are the same as the numbers used in the ! forms description. The function must return the (updated) vector. ! ! Instead of defining the function, `forms-new-record-filter' may be ! set to a function. ! ! Example: ! (defun my-new-record-filter (fields) ! (aset fields 5 (login-name)) ! (aset fields 1 (current-time-string)) ! ;; and return it ! fields) ! (setq forms-new-record-filter 'my-new-record-filter) ! ! `forms-delete-record' ! deletes the current record. You are prompted for confirmation ! before the record is deleted unless a prefix argument has been ! provided. ! ! `forms-search REGEXP' ! searches for REGEXP in all records following this one. If found, ! this record is shown. ! The next time it is invoked, the previous regexp is the default, ! so you can do repeated searches by simply pressing RET in response ! to the prompt. ! ! `revert-buffer' ! reverts a possibly modified forms to its original state. It only ! affect the record currently in the forms. ! ! `forms-exit' ! terminates forms processing. The data file is saved if it has been ! modified. ! ! `forms-exit-no-save' ! aborts forms processing. If the data file has been modified Emacs ! will ask questions. ! ! `describe-mode' ! gives additional help. ! ! `save-buffer' ! saves the changes in the data file, if modified. ! ! If the variable `forms-forms-scrolls' is set to a value other than ! `nil' (which it is, by default), the Emacs functions `scroll-up' and ! `scroll-down' will perform a `forms-next-record' and ! `forms-prev-record' when in forms mode. So you can use your favourite ! page commands to page through the data file. ! ! Likewise, if the variable `forms-forms-jump' is not `nil' (which it ! is, by default), Emacs functions `beginning-of-buffer' and ! `end-of-buffer' will perform `forms-first-record' and ! `forms-last-record' when in forms mode. ! ! After forms mode is entered, functions contained in ! `forms-mode-hooks' are executed to perform user defined customization. ! !  ! File: forms, Node: Key Bindings, Next: Miscellaneous, Prev: Forms Mode Commands, Up: Top ! ! Key bindings ! ============ ! ! This section describes the key bindings as they are defined when ! invoking forms mode. ! All commands must be prefixed with `C-c' when editing a forms. If a ! forms is read-only, `C-c' is not used. The only exception to this rule ! is `forms-next-field', which is bound to `TAB' in all maps. ! ! `C-c TAB' ! `forms-next-field' ! ! `C-c SPC' ! `forms-next-record' ! ! `C-c <' ! `forms-first-record' ! ! `C-c >' ! `forms-first-record' ! ! `C-c d' ! `forms-delete-record' ! ! `C-c e' ! `forms-edit-mode' ! ! `C-c i' ! `forms-insert-record' ! ! `C-c j' ! `forms-jump-record' ! ! `C-c n' ! `forms-next-record' ! ! `C-c p' ! `forms-prev-record' ! ! `C-c q' ! `forms-exit' ! ! `C-c s REGEXP' ! `forms-search' ! ! `C-c v' ! `forms-view-mode' ! ! `C-c x' ! `forms-exit-no-save' ! ! `C-c ?' ! `describe-mode' ! ! `C-c DEL' ! `forms-prev-record'  ! File: forms, Node: Miscellaneous, Next: Error Messages, Prev: Key Bindings, Up: Top Miscellaneous ! ============= ! A global variable `forms-version' holds the version information of ! the current implementation of forms mode. It is very convenient to use symbolic names for the fields in a record. The function `forms-enumerate' provides an elegant means to ! define a series of variables to consecutive numbers. The function ! returns the higest number used, so it can be used to set ! `forms-number-of-fields' also: (setq forms-number-of-fields (forms-enumerate ! '(field1 field2 field3 ... ))) ! ! `field1' will be set to 1, `field2' to 2 and so on. ! Care has been taken to localize the current information of the forms ! mode, so it is possible to visit multiple files in forms mode ! simultaneously, even if they have different properties. ! Since buffer-local functions are not available in this version of GNU ! Emacs, the definitions of the filter functions ! `forms-new-record-filter' and `forms-modified-record-filter' are copied ! into internal, buffer local variables when forms-mode is initialized. ! If a control file is visited using the standard `find-file' ! commands, forms mode can be enabled with the command `M-x forms-mode'. ! Forms mode will be automatically enabled if the file contains the ! string `"-*- forms -*-"' somewhere in the first line. However, this ! makes it hard to edit the control file itself so you'd better think ! twice before using this. ! The default format for the data file, using TAB to separate fields ! and `C-k' to separate multi-line fields, matches the file format of ! some popular Macintosh database programs, e.g. FileMaker. So ! `forms-mode' could decrease the need to use Apple computers.  ! File: forms, Node: Error Messages, Next: Examples, Prev: Miscellaneous, Up: Top Error Messages ! ============== This section describes all error messages which can be generated by ! forms mode. ! `'forms-file' has not been set' The variable `forms-file' was not set by the control file. ! `'forms-number-of-fields' has not been set' The variable `forms-number-of-fields' was not set by the control file. ! `'forms-number-of-fields' must be > 0' The variable `forms-number-of-fields' did not contain a positive number. ! `'forms-field-sep' is not a string' ! `'forms-multi-line' must be nil or a one-character string' The variable `forms-multi-line' was set to something other than ! `nil or' a single-character string. ! `'forms-multi-line' is equal to 'forms-field-sep'' The variable `forms-multi-line' may not be equal to `forms-field-sep' for this would make it impossible to distinguish fields and the lines in the fields. ! `'forms-format-list' has not been set' ! `'forms-format-list' is not a list' ! The variable `forms-format-list' was not set to a lisp `list' by ! the control file. ! ! `Forms error: field number XX out of range 1..NN' ! A field number was supplied with a value of XX, which was not ! greater than zero and smaller than or equal to the number of ! fields in the forms, NN. ! ! `Forms error: not a function FUN' ! The first element of the lisp list specified in `forms-format-list' ! did not have a function value. ! `Invalid element in 'forms-format-list': XX' A list element was supplied in `forms-format-list' which was not a ! `string', `number' nor a `lisp list'. ! ! `Parse error: not looking at "..."' ! When re-parsing the contents of a forms, the text shown could not ! be found. ! ! `Parse error: cannot find "..."' ! When re-parsing the contents of a forms, the text shown, which ! separates two fields, could not be found. ! `Parse error: cannot parse adjacent fields XX and YY' ! Fields XX and YY were not separated by text, so could not be ! parsed again. ! ! `Record has XX fields instead of YY' The number of fields in this record in the data file did not match ! `forms-number-of-fields'. Missing fields will be set to empty. `Multi-line fields in this record - update refused!' The current record contains newline characters, hence can not be ! written back to the data file, for it would corrupt it. ! probably a field was set to a multi-line value, while the setting ! of `forms-multi-line' prohibited this. `Record number XX out of range 1..YY' ! A jump was made to non-existing record XX. YY denotes the number of records in the file. --- 374,554 ---- "\n")) ! When you construct the value of `forms-format-list', you should ! usually either quote the whole value, like this, (setq forms-format-list ! '( "====== " forms-file " ======\n\n" "User : " 1 ! (make-string 20 ?-) ... )) ! or quote the elements which are lists, like this: (setq forms-format-list ! (list "====== " forms-file " ======\n\n" "User : " 1 ! '(make-string 20 ?-) ... )) ! Forms mode validates the contents of `forms-format-list' when you ! visit a database. If there are errors, processing is aborted with an ! error message which includes a descriptive text. *Note Error ! Messages::, for a detailed list of error messages.  ! File: forms, Node: Modifying Forms Contents, Next: Miscellaneous, Prev: Format Description, Up: Top Modifying The Forms Contents ! **************************** ! If `forms-read-only' is `nil', the user can modify the fields and ! records of the database. ! All normal editing commands are available for editing the contents ! of the displayed record. You cannot delete or modify the fixed, ! explanatory text that comes from string formatting elements, but you ! can modify the actual field contents. ! ! If the variable `forms-modified-record-filter' is non-`nil', it is ! called as a function before the new data is written to the data file. ! The function receives one argument, a vector that contains the contents ! of the fields of the record. ! ! The function can refer to fields with `aref' and modify them with ! `aset'. The first field has number 1 (one); thus, element 0 of the ! vector is not used. The function should return the same vector it was ! passed; the (possibly modified) contents of the vector determine what is ! actually written in the file. Here is an example: (defun my-modified-record-filter (record) ! ;; Modify second field. (aset record 2 (current-time-string)) ! ;; Return the field vector. ! record) ! (setq forms-modified-record-filter 'my-modified-record-filter) ! If the variable `forms-new-record-filter' is non-`nil', its value is ! a function to be called to fill in default values for the fields of a ! new record. The function is passed a vector of empty strings, one for ! each field; it should return the same vector, with the desired field ! values stored in it. Fields are numbered starting from 1 (one). ! Example: ! ! (defun my-new-record-filter (fields) ! (aset fields 5 (login-name)) ! (aset fields 1 (current-time-string)) ! fields) ! ! (setq forms-new-record-filter 'my-new-record-filter)  ! File: forms, Node: Miscellaneous, Next: Error Messages, Prev: Modifying Forms Contents, Up: Top Miscellaneous ! ************* ! The global variable `forms-version' holds the version information of ! the Forms mode software. It is very convenient to use symbolic names for the fields in a record. The function `forms-enumerate' provides an elegant means to ! define a series of variables whose values are consecutive integers. The ! function returns the highest number used, so it can be used to set ! `forms-number-of-fields' also. For example: ! (setq forms-number-of-fields (forms-enumerate ! '(field1 field2 field3 ...))) ! This sets `field1' to 1, `field2' to 2, and so on. ! Care has been taken to keep the Forms mode variables buffer-local, ! so it is possible to visit multiple files in Forms mode simultaneously, ! even if they have different properties. ! If you have visited the control file in normal fashion with ! `find-file' or a like command, you can switch to Forms mode with the ! command `M-x forms-mode'. If you put `-*- forms -*-' in the first line ! of the control file, then visiting it enables Forms mode automatically. ! But this makes it hard to edit the control file itself, so you'd ! better think twice before using this. ! The default format for the data file, using `"\t"' to separate ! fields and `"\^k"' to separate lines within a field, matches the file ! format of some popular database programss, e.g. FileMaker. So ! `forms-mode' can decrease the need to use proprietary software.  ! File: forms, Node: Error Messages, Next: Long Example, Prev: Miscellaneous, Up: Top Error Messages ! ************** This section describes all error messages which can be generated by ! forms mode. Error messages that result from parsing the control file ! all start with the text `Forms control file error'. Messages generated ! while analyzing the definition of `forms-format-list' start with `Forms ! format error'. ! `Forms control file error: 'forms-file' has not been set' The variable `forms-file' was not set by the control file. ! `Forms control file error: 'forms-number-of-fields' has not been set' The variable `forms-number-of-fields' was not set by the control file. ! `Forms control file error: 'forms-number-of-fields' must be a number > 0' The variable `forms-number-of-fields' did not contain a positive number. ! `Forms control file error: 'forms-field-sep' is not a string' ! `Forms control file error: 'forms-multi-line' must be nil or a one-character string' The variable `forms-multi-line' was set to something other than ! `nil' or a single-character string. ! `Forms control file error: 'forms-multi-line' is equal to 'forms-field-sep'' The variable `forms-multi-line' may not be equal to `forms-field-sep' for this would make it impossible to distinguish fields and the lines in the fields. ! `Forms control file error: 'forms-new-record-filter' is not a function' ! `Forms control file error: 'forms-modified-record-filter' is not a function' ! The variable has been set to something else than a function. ! ! `Forms control file error: 'forms-format-list' has not been set' ! `Forms control file error: 'forms-format-list' is not a list' ! The variable `forms-format-list' was not set to a Lisp list by the ! control file. ! ! `Forms format error: field number XX out of range 1..NN' ! A field number was supplied in `forms-format-list' with a value of ! XX, which was not greater than zero and smaller than or equal to ! the number of fields in the forms, NN. ! ! `Forms format error: not a function FUN' ! The first element of a list which is an element of ! `forms-format-list' was not a valid Lisp function. ! `Forms format error: invalid element XX' A list element was supplied in `forms-format-list' which was not a ! string, number or list. ! `Warning: this record has XX fields instead of YY' The number of fields in this record in the data file did not match ! `forms-number-of-fields'. Missing fields will be made empty. `Multi-line fields in this record - update refused!' The current record contains newline characters, hence can not be ! written back to the data file, for it would corrupt it. Probably ! you inserted a newline in a field, while `forms-multi-line' was ! `nil'. `Record number XX out of range 1..YY' ! A jump was made to non-existing record XX. YY denotes the number of records in the file. *************** *** 623,633 **** An internal error prevented a specific record from being retrieved.  ! File: forms, Node: Examples, Next: Credits, Prev: Error Messages, Up: Top ! Examples ! ======== ! The following example exploits most of the features of forms-mode. This example is included in the distribution as file `forms-d2.el'. --- 556,583 ---- An internal error prevented a specific record from being retrieved. + `No write access to `"'FILE`"'' + An attempt was made to enable edit mode on a file that has been + write protected. + + ``"'REGEXP`"' not found' + The REGEXP could not be found in the data file, starting at the + current record location. + + `Warning: number of records changed to NN' + Forms mode's idea of the number of records has been adjusted to the + number of records actually present in the data file. + + `Problem saving buffers?' + An error occurred while saving the data file buffer. Most likely, + Emacs did ask to confirm deleting the buffer because it had been + modified, and you said `no'. +  ! File: forms, Node: Long Example, Next: Credits, Prev: Error Messages, Up: Top ! Long Example ! ************ ! The following example exploits most of the features of Forms mode. This example is included in the distribution as file `forms-d2.el'. *************** *** 647,651 **** (setq forms-file "forms-d2.dat") ! ;; Use 'forms-enumerate' to set field names and number thereof. (setq forms-number-of-fields (forms-enumerate --- 597,601 ---- (setq forms-file "forms-d2.dat") ! ;; Use `forms-enumerate' to set field names and number thereof. (setq forms-number-of-fields (forms-enumerate *************** *** 665,669 **** ;; (defun arch-tocol (target &optional fill) ! "Produces a string to skip to column TARGET. Prepends newline if needed. The optional FILL should be a character, used to fill to the column." (if (null fill) --- 615,620 ---- ;; (defun arch-tocol (target &optional fill) ! "Produces a string to skip to column TARGET. ! Prepends newline if needed. The optional FILL should be a character, used to fill to the column." (if (null fill) *************** *** 674,691 **** ;; (defun arch-rj (target field &optional fill) ! "Produces a string to skip to column TARGET minus the width of field FIELD. ! Prepends newline if needed. The optional FILL should be a character, used to fill to the column." (arch-tocol (- target (length (nth field forms-fields))) fill)) ;; Record filters. - ;; This example uses the (defun ...) method of defining. ;; ! (defun forms-new-record-filter (the-record) "Form a new record with some defaults." (aset the-record arch-from (user-full-name)) (aset the-record arch-date (current-time-string)) ! the-record ; return it ! ) ;; The format list. --- 625,643 ---- ;; (defun arch-rj (target field &optional fill) ! "Produces a string to skip to column TARGET\ ! minus the width of field FIELD. ! Prepends newline if needed. ! The optional FILL should be a character, used to fill to the column." (arch-tocol (- target (length (nth field forms-fields))) fill)) ;; Record filters. ;; ! (defun new-record-filter (the-record) "Form a new record with some defaults." (aset the-record arch-from (user-full-name)) (aset the-record arch-date (current-time-string)) ! the-record) ; return it ! (setq forms-new-record-filter 'new-record-filter) ;; The format list. *************** *** 719,833 ****  ! File: forms, Node: Credits, Next: Concept Index, Prev: Examples, Up: Top Credits ! ======= ! Forms mode is developed by Johan Vromans `' at Multihouse Research in the Netherlands. ! Harald Hanche-Olsen `' supplied the idea for the ! new record filter, and provided better replacements for some internal ! functions. ! ! Bugfixes and other useful suggestions were supplied by ! cwitty@portia.stanford.edu, Jonathan I. Kamens, Ignatios Souvatzis and ! Harald Hanche-Olsen. This documentation was slightly inspired by the documentation of "rolo mode" by Paul Davis at Schlumberger Cambridge Research ! `'. None of this would have been possible without GNU Emacs of the Free ! Software Foundation. Thanks, Richard! ! !  ! File: forms, Node: Concept Index, Next: Variable Index, Prev: Credits, Up: Top - Concept Index - ************* - - * Menu: - - * forms-mode: Top. - * pseudo-newline: Data File Format. -  ! File: forms, Node: Variable Index, Next: Function Index, Prev: Concept Index, Up: Top ! Variable Index ! ************** * Menu: * forms-field-sep: Control File Format. ! * forms-fields: Forms Format Description. * forms-file: Control File Format. ! * forms-format-list: Forms Format Description. * forms-format-list: Control File Format. ! * forms-forms-jump: Control File Format. ! * forms-forms-jump: Forms Mode Commands. ! * forms-forms-scroll: Forms Mode Commands. ! * forms-forms-scroll: Control File Format. ! * forms-mode-hooks: Forms Mode Commands. * forms-multi-line: Control File Format. * forms-number-of-fields: Control File Format. * forms-read-only: Control File Format. * forms-version: Miscellaneous. ! !  ! File: forms, Node: Function Index, Prev: Variable Index, Up: Top ! ! Function Index ! ************** ! ! * Menu: ! ! * beginning-of-buffer: Forms Mode Commands. ! * describe-mode: Forms Mode Commands. ! * end-of-buffer: Forms Mode Commands. ! * eval-current-buffer: Control File Format. ! * forms-delete-record: Forms Mode Commands. ! * forms-edit-mode: Forms Mode Commands. ! * forms-enumerate: Miscellaneous. ! * forms-exit: Forms Mode Commands. ! * forms-exit-no-save: Forms Mode Commands. ! * forms-find-file: Forms Mode Commands. ! * forms-find-file-other-window: Forms Mode Commands. ! * forms-first-record: Forms Mode Commands. ! * forms-insert-record: Forms Mode Commands. ! * forms-jump-record: Forms Mode Commands. ! * forms-last-record: Forms Mode Commands. ! * forms-modified-record-filter: Modifying Forms Contents. ! * forms-modified-record-filter: Control File Format. ! * forms-new-record-filter: Control File Format. ! * forms-next-field: Forms Mode Commands. ! * forms-next-record: Forms Mode Commands. ! * forms-prev-record: Forms Mode Commands. ! * forms-search: Forms Mode Commands. ! * forms-view-mode: Forms Mode Commands. ! * revert-buffer: Forms Mode Commands. ! * save-buffer: Forms Mode Commands. ! * scroll-down: Forms Mode Commands. ! * scroll-up: Forms Mode Commands.  Tag Table: ! Node: Top337 ! Node: What is in a Forms1615 ! Node: Data File Format2652 ! Node: Control File Format3368 ! Node: Forms Format Description6352 ! Node: Modifying Forms Contents9286 ! Node: Forms Mode Commands10941 ! Node: Key Bindings16738 ! Node: Miscellaneous17694 ! Node: Error Messages19457 ! Node: Examples22244 ! Node: Credits25306 ! Node: Concept Index26092 ! Node: Variable Index26320 ! Node: Function Index27312  End Tag Table --- 671,769 ----  ! File: forms, Node: Credits, Next: Index, Prev: Long Example, Up: Top Credits ! ******* ! Forms mode was developed by Johan Vromans while working at Multihouse Research in the Netherlands. ! Bug fixes and other useful suggestions were supplied by Richard ! Stallman (`rms@gnu.ai.mit.edu'), Harald Hanche-Olsen ! (`hanche@imf.unit.no'), `cwitty@portia.stanford.edu', Jonathan I. ! Kamens, Per Cederqvist (`ceder@signum.se'), and Ignatios Souvatzis. This documentation was slightly inspired by the documentation of "rolo mode" by Paul Davis at Schlumberger Cambridge Research ! (`davis%scrsu1%sdr.slb.com@relay.cs.net'). None of this would have been possible without GNU Emacs of the Free ! Software Foundation. Thanks, Richard!  ! File: forms, Node: Index, Prev: Credits, Up: Top ! Index ! ***** * Menu: + * TAB: Forms Commands. + * begin: Forms Commands. + * C-c <: Forms Commands. + * C-c >: Forms Commands. + * C-c TAB: Forms Commands. + * C-c C-k: Forms Commands. + * C-c C-l: Forms Commands. + * C-c C-n: Forms Commands. + * C-c C-o: Forms Commands. + * C-c C-p: Forms Commands. + * C-c C-q: Forms Commands. + * C-c C-s REGEXP RET: Forms Commands. + * control file: Control File Format. + * end: Forms Commands. + * field: Data File Format. + * forms-delete-record: Forms Commands. + * forms-enumerate: Miscellaneous. * forms-field-sep: Control File Format. ! * forms-field-sep: Data File Format. ! * forms-fields: Format Description. * forms-file: Control File Format. ! * forms-find-file: Entering and Exiting Forms Mode. ! * forms-find-file-other-window: Entering and Exiting Forms Mode. ! * forms-first-record: Forms Commands. * forms-format-list: Control File Format. ! * forms-format-list: Format Description. ! * forms-insert-record: Forms Commands. ! * forms-jump-record: Forms Commands. ! * forms-last-record: Forms Commands. ! * forms-mode: Miscellaneous. ! * forms-mode-hooks: Entering and Exiting Forms Mode. ! * forms-modified-record-filter: Control File Format. ! * forms-multi-line: Data File Format. * forms-multi-line: Control File Format. + * forms-new-record-filter: Control File Format. + * forms-next-field: Forms Commands. + * forms-next-record: Forms Commands. * forms-number-of-fields: Control File Format. + * forms-prev-field: Forms Commands. + * forms-prev-field: Forms Commands. + * forms-prev-record: Forms Commands. * forms-read-only: Control File Format. + * forms-search: Forms Commands. + * forms-toggle-read-only: Forms Commands. * forms-version: Miscellaneous. ! * next: Forms Commands. ! * prior: Forms Commands. ! * pseudo-newline: Data File Format. ! * record: Data File Format. ! * S-Tab: Forms Commands.  Tag Table: ! Node: Top335 ! Node: Forms Example1755 ! Node: Entering and Exiting Forms Mode2975 ! Node: Forms Commands5160 ! Node: Data File Format8242 ! Node: Control File Format8949 ! Node: Format Description11734 ! Node: Modifying Forms Contents14867 ! Node: Miscellaneous16754 ! Node: Error Messages18293 ! Node: Long Example21960 ! Node: Credits25032 ! Node: Index25768  End Tag Table diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/info/info emacs-19.20/info/info *** emacs-19.19/info/info Fri Aug 13 22:52:05 1993 --- emacs-19.20/info/info Wed Sep 22 15:33:49 1993 *************** *** 652,656 **** (*Note Active nodes: Node format.) ! `Info-path' List of directories to search for info files. Each element is a string (directory name) or nil (try default directory). --- 652,656 ---- (*Note Active nodes: Node format.) ! `Info-directory-list' List of directories to search for info files. Each element is a string (directory name) or nil (try default directory). *************** *** 658,662 **** `Info-directory' Standard directory for Info documentation files. Only used as ! part of Info-path.  Tag table: --- 658,662 ---- `Info-directory' Standard directory for Info documentation files. Only used as ! part of `Info-directory'.  Tag table: diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/info/sc.info emacs-19.20/info/sc.info *** emacs-19.19/info/sc.info --- emacs-19.20/info/sc.info Tue Nov 9 02:34:30 1993 *************** *** 0 **** --- 1,66 ---- + This is Info file ../info/sc.info, produced by Makeinfo-1.54 from the + input file sc.texi. + + This document describes the Supercite Version 3.1 package for citing + and attributing the replies for various GNU Emacs mail and news reading + subsystems. + + Copyright (C) 1993 Barry A. Warsaw + + Permission is granted to make and distribute verbatim copies of this + manual provided the copyright notice and this permission notice are + preserved on all copies. + +  + Indirect: + sc.info-1: 453 + sc.info-2: 48472 + sc.info-3: 98102 +  + Tag Table: + (Indirect) + Node: Top453 + Node: Introduction1158 + Node: Usage Overview3135 + Node: What Supercite Does Not Do4297 + Node: What Supercite Does5430 + Node: Citations8260 + Node: Citation Elements10554 + Node: Recognizing Citations12436 + Node: Information Keys and the Info Alist14486 + Node: Reference Headers17082 + Node: The Built-in Header Rewrite Functions18652 + Node: Electric References21102 + Node: Getting Connected23976 + Node: Emacs 19 MUAs27499 + Node: Emacs 18 MUAs28734 + Node: MH-E with any Emacsen30095 + Node: VM with any Emacsen31859 + Node: GNEWS with any Emacsen32926 + Node: Overloading for Non-conforming MUAs33653 + Node: Replying and Yanking36908 + Node: Reply Buffer Initialization37248 + Node: Filling Cited Text44136 + Node: Selecting an Attribution47610 + Node: Attribution Preferences48472 + Node: Anonymous Attributions52388 + Node: Author Names55429 + Node: Configuring the Citation Engine57917 + Node: Using Regi59647 + Node: Frames You Can Customize63521 + Node: Post-yank Formatting Commands66051 + Node: Citing Commands67201 + Node: Insertion Commands69926 + Node: Variable Toggling Shortcuts70866 + Node: Mail Field Commands73225 + Node: Miscellaneous Commands75595 + Node: Hints to MUA Authors76864 + Node: Version 3 Changes80916 + Node: Thanks and History83618 + Node: The Supercite Mailing List85219 + Node: Concept Index86552 + Node: Command Index92626 + Node: Key Index98102 + Node: Variable Index100129 +  + End Tag Table diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/info/sc.info-1 emacs-19.20/info/sc.info-1 *** emacs-19.19/info/sc.info-1 --- emacs-19.20/info/sc.info-1 Tue Nov 9 02:34:28 1993 *************** *** 0 **** --- 1,1092 ---- + This is Info file ../info/sc.info, produced by Makeinfo-1.54 from the + input file sc.texi. + + This document describes the Supercite Version 3.1 package for citing + and attributing the replies for various GNU Emacs mail and news reading + subsystems. + + Copyright (C) 1993 Barry A. Warsaw + + Permission is granted to make and distribute verbatim copies of this + manual provided the copyright notice and this permission notice are + preserved on all copies. + +  + File: sc.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir) + + This document describes the Supercite Version 3.1 package for citing + and attributing the replies for various GNU Emacs mail and news reading + subsystems. The manual is divided into the following chapters. + + * Menu: + + * Introduction:: + * Citations:: + * Getting Connected:: + * Replying and Yanking:: + * Selecting an Attribution:: + * Configuring the Citation Engine:: + * Post-yank Formatting Commands:: + * Information Keys and the Info Alist:: + * Reference Headers:: + * Hints to MUA Authors:: + * Version 3 Changes:: + * Thanks and History:: + * The Supercite Mailing List:: + + * Concept Index:: + * Command Index:: + * Key Index:: + * Variable Index:: + +  + File: sc.info, Node: Introduction, Next: Usage Overview, Prev: Top, Up: Top + + Introduction + ************ + + Supercite version 3.1 is a GNU Emacs package written entirely in + Emacs Lisp. It interfaces to most of the commonly used Emacs mail user + agents ("MUAs") and news user agents ("NUAs"), and provides + sophisticated facilities for the citing and attributing of message + replies. Supercite has a very specific and limited role in the process + of composing replies to both USENET network news and electronic mail. + + The preferred way to spell Supercite is with a capital `S', + lowercase `upercite'. There are a few alternate spellings out there + and I won't be terribly offended if you use them. People often ask + though... + + * Menu: + + * Usage Overview:: + * What Supercite Does Not Do:: + * What Supercite Does:: + + Supercite is only useful in conjunction with MUAs and NUAs such as + VM, GNUS, RMAIL, etc. (hereafter referred to collectively as MUAs). + Supercite is typically called by the MUA after a reply buffer has been + setup. Thereafter, Supercite's many commands and formatting styles are + available in that reply buffer until the reply is sent. Supercite is + re-initialized in each new reply buffer. + + Supercite is currently at major revision 3.1, and is known to work + in the following environments: + + Emacsen: + GNU Emacs 18.57 through 18.59, all current FSF Emacs 19, + all current Lucid Emacs 19, and Epoch 4. + + MUAs: + VM 4.37 and beyond (including VM version 5), RMAIL, MH-E 3.7 and + beyond, PCMAIL. + + NUAs: + RNEWS, GNUS 3.12 and beyond, GNEWS. + + For systems with version numbers, all known subsequent versions also + work with Supercite. For those systems without version numbers, + Supercite probably works with any recently released version. Note that + only some of these systems will work with Supercite "out of the box." + All others must overload interfacing routines to supply the necessary + glue. *Note Getting Connected:: for more details. + +  + File: sc.info, Node: Usage Overview, Next: What Supercite Does Not Do, Prev: Introduction, Up: Introduction + + Usage Overview + ============== + + Typical usage is as follows. You want to reply or followup to a + message in your MUA. You will probably hit `r' (i.e., "reply") or `f' + (i.e., "forward") to begin composing the reply. In response, the MUA + will create a reply buffer and initialize the outgoing mail headers + appropriately. The body of the reply will usually be empty at this + point. You now decide that you would like to include part of the + original message in your reply. To do this, you "yank" the original + message into the reply buffer, typically with a key stroke such as `C-c + C-y'. This sequence will invoke an MUA-specific function which fills + the body of the reply with the original message and then "attributes" + this text to its author. This is called "citing" and its effect is to + prefix every line from the original message with a special text tag. + Most MUAs provide some default style of citing; by using Supercite you + gain a wider flexibility in the look and style of citations. + Supercite's only job is to cite the original message. + +  + File: sc.info, Node: What Supercite Does Not Do, Next: What Supercite Does, Prev: Usage Overview, Up: Introduction + + What Supercite Doesn't Do + ========================= + + Because of this clear division of labor, there are useful features + which are the sole responsibility of the MUA, even though it might seem + that Supercite should provide them. For example, many people would + like to be able to yank (and cite) only a portion of the original + message. Since Supercite only modifies the text it finds in the reply + buffer as set up by the MUA, it is the MUA's responsibility to do + partial yanking. *Note Reply Buffer Initialization::. + + Another potentially useful thing would be for Supercite to set up the + outgoing mail headers with information it gleans from the reply buffer. + But by previously agreed upon convention, any text above the + `mail-header-separator' which separates mail headers from message + bodies cannot be modified by Supercite. Supercite, in fact, doesn't + know anything about the meaning of these headers, and never ventures + outside the designated region. *Note Hints to MUA Authors:: for more + details. + +  + File: sc.info, Node: What Supercite Does, Next: Citations, Prev: What Supercite Does Not Do, Up: Introduction + + What Supercite Does + =================== + + Supercite is invoked for the first time on a reply buffer via your + MUA's reply or forward command. This command will actually perform + citations by calling a hook variable to which Supercite's top-level + function `sc-cite-original' has been added. When `sc-cite-original' is + executed, the original message must be set up in a very specific way, + but this is handled automatically by the MUA. *Note Hints to MUA + Authors::. + + The first thing Supercite does, via `sc-cite-original', is to parse + through the original message's mail headers. It saves this data in an + "information association list", or "info alist". The information in + this list is used in a number of places throughout Supercite. *Note + Information Keys and the Info Alist::. + + After the mail header info is extracted, the headers are optionally + removed ("nuked") from the reply. Supercite then writes a "reference + header" into the buffer. This reference header is a string carrying + details about the citation it is about to perform. + + Next, Supercite visits each line in the reply, transforming the line + according to a customizable "script". Lines which were not previously + cited in the original message are given a citation, while already cited + lines remain untouched, or are coerced to your preferred style. + Finally, Supercite installs a keymap into the reply buffer so that you + have access to Supercite's post-yank formatting and reciting commands as + you subsequently edit your reply. You can tell that Supercite has been + installed into the reply buffer because that buffer's modeline will + display the minor mode string `SC'. + + When the original message is cited by `sc-cite-original', it will + (optionally) be filled by Supercite. However, if you manually edit the + cited text and want to re-fill it, you must use an add-on package such + as `filladapt' or `gin-mode'. These packages can recognize Supercited + text and will fill them appropriately. Emacs' built-in filling + routines, e.g. `fill-paragraph', do not recognize cited text and will + not re-fill them properly because it cannot guess the `fill-prefix' + being used. *Note Post-yank Formatting Commands:: for details. + + As mentioned above, Supercite provides commands to recite or uncite + regions of text in the reply buffer, and commands to perform other + beautifications on the cited original text, maintaining consistent and + informative citations throughout. Supercite tries to be as configurable + as possible to allow for a wide range of personalized citation styles, + but it is also immediately useful with the default configuration, once + it has been properly connected to your MUA. *Note Getting Connected:: + for more details. + +  + File: sc.info, Node: Citations, Next: Citation Elements, Prev: What Supercite Does, Up: Top + + Citations + ********* + + A "citation" is the acknowledgement of the original author of a mail + message in the body of the reply. There are two basic citation styles + which Supercite supports. The first, called "nested citations" is an + anonymous form of citation; in other words, an indication is made that + the cited line was written by someone *other* that the current message + author (i.e., other than you, the person composing the reply), but no + reference is made as to the identity of the original author. This + style should look familiar since its use on the net is widespread. + Here's an example of what a message buffer would look like using nested + citations after multiple replies: + + >> John originally wrote this + >> and this as well + > Jane said that John didn't know + > what he was talking about + And that's what I think too. + + * Menu: + + * Citation Elements:: + * Recognizing Citations:: + + Note that multiple inclusions of the original messages result in a + nesting of the ``>'' characters. This can sometimes be quite confusing + when many levels of citations are included since it may be difficult or + impossible to figure out who actually participated in the thread, and + multiple nesting of ``>'' characters can sometimes make the message + very difficult for the eye to scan. + + In "non-nested citations", each cited line begins with an + informative string attributing that line to the original author. Only + the first level of attribution will be shown; subsequent citations don't + nest the citation strings. The above dialog might look like this when + non-nested citations are used: + + John> John originally wrote this + John> and this as well + Jane> Jane said that John didn't know + Jane> what he was talking about + And that's what I think too. + + Notice here that my inclusion of Jane's inclusion of John's original + message did not result in a line cited with `Jane>John>'. + + Supercite supports both styles of citation, and the variable + `sc-nested-citation-p' controls which style it will use when citing + previously uncited text. When this variable is `nil' (the default), + non-nested citations are used. When non-`nil', nested citations are + used. + +  + File: sc.info, Node: Citation Elements, Next: Recognizing Citations, Prev: Citations, Up: Citations + + Citation Elements + ================= + + "Citation strings" are composed of one or more elements. Non-nested + citations are composed of four elements, three of which are directly + user definable. The elements are concatenated together, in this order: + + 1. The "citation leader". The citation leader is contained in the + variable `sc-citation-leader', and has the default value of a + string containing four spaces. + + 2. The "attribution string". This element is supplied automatically + by Supercite, based on your preferences and the original message's + mail headers, though you may be asked to confirm Supercite's + choice. *Note Selecting an Attribution:: for more details. + + 3. The "citation delimiter". This string, contained in the variable + `sc-citation-delimiter' visually separates the citation from the + text of the line. This variable has a default value of `">"' and + for best results, the string should consist of only a single + character. + + 4. The "citation separator". The citation separator is contained in + the variable `sc-citation-separator', and has the default value of + a string containing a single space. + + For example, suppose you were using the default values for the above + variables, and Supercite provided the attribution string `Jane'. In + this case, the composed, non-nested citation string used might be + something like `" Jane> "'. This citation string will be inserted + in front of every line in the original message that is not already + cited. + + Nested citations, being simpler than non-nested citations, are + composed of the same elements, sans the attribution string. Supercite + is smart enough to not put additional spaces between citation + delimiters for multi-level nested citations. + +  + File: sc.info, Node: Recognizing Citations, Next: Getting Connected, Prev: Citation Elements, Up: Citations + + Recognizing Citations + ===================== + + Supercite also recognizes citations in the original article, and can + transform these already cited lines in a number of ways. This is how + Supercite suppresses the multiple citing of non-nested citations. + Recognition of cited lines is controlled by variables analogous to those + that make up the citation string as mentioned previously. + + The variable `sc-citation-leader-regexp' describes how citation + leaders can look, by default it matches any number of spaces or tabs. + Note that since the lisp function `looking-at' is used to do the + matching, if you change this variable it need not start with a leading + `"^"'. + + Similarly, the variables `sc-citation-delimiter-regexp' and + `sc-citation-separator-regexp' respectively describe how citation + delimiters and separators can look. They follow the same rule as + `sc-citation-leader-regexp' above. + + When Supercite composes a citation string, it provides the + attribution automatically. The analogous variable which handles + recognition of the attribution part of citation strings is + `sc-citation-root-regexp'. This variable describes the attribution + root for both nested and non-nested citations. By default it can match + zero-to-many alphanumeric characters (also ".", "-", and "_"). But in + some situations, Supercite has to determine whether it is looking at a + nested or non-nested citation. Thus the variable + `sc-citation-nonnested-root-regexp' is used to describe only non-nested + citation roots. It is important to remember that if you change + `sc-citation-root-regexp' you should always also change + `sc-citation-nonnested-root-regexp'. + + Nemacs users: For best results, try setting + `sc-citation-root-regexp' to: + + "\\([-._a-zA-Z0-9]\\|\\cc\\|\\cC\\|\\ch\\|\\cH\\|\\ck\\|\\cK\\|\\ca\\|\\cg\\|\\cr\\|\\cu\\)*" + + Mule users: For best results, try setting `sc-citation-root-regexp' + to: + + "\\([-._a-zA-Z0-9]\\|\\cj\\)*" + +  + File: sc.info, Node: Information Keys and the Info Alist, Next: Reference Headers, Prev: Miscellaneous Commands, Up: Top + + Information Keys and the Info Alist + *********************************** + + "Mail header information keys" are nuggets of information that + Supercite extracts from the various mail headers of the original + message, placed in the reply buffer by the MUA. Information is kept in + the "Info Alist" as key-value pairs, and can be retrieved for use in + various places within Supercite, such as in header rewrite functions and + attribution selection. Other bits of data, composed and created by + Supercite, are also kept as key-value pairs in this alist. In the case + of mail fields, the key is the name of the field, omitting the trailing + colon. Info keys are always case insensitive (as are mail headers), and + the value for a corresponding key can be retrieved from the alist with + the `sc-mail-field' function. Thus, if the following fields were + present in the original article: + + Date: 08 April 1991, 17:32:09 EST + Subject: Better get out your asbestos suit + + then, the following lisp constructs return: + + (sc-mail-field "date") + ==> "08 April 1991, 17:32:09 EST" + + (sc-mail-field "subject") + ==> "Better get out your asbestos suit" + + Since the argument to `sc-mail-field' can be any string, it is + possible that the mail field will not be present on the info alist + (possibly because the mail header was not present in the original + message). In this case, `sc-mail-field' will return the value of the + variable `sc-mumble'. + + Supercite always places all mail fields found in the yanked original + article into the info alist. If possible, Supercite will also places + the following keys into the info alist: + + `"sc-attribution"' + the selected attribution string. + + `"sc-citation"' + the non-nested citation string. + + `"sc-from-address"' + email address extracted from the `From:' field. + + `"sc-reply-address"' + email address extracted from the `Reply-To:' field. + + `"sc-sender-address"' + email address extracted from the `Sender:' field. + + `"sc-emailname"' + email terminus extracted from the `From:' field. + + `"sc-initials"' + the author's initials. + + `"sc-author"' + the author's full name. + + `"sc-firstname"' + the author's first name. + + `"sc-lastname"' + the author's last name. + + `"sc-middlename-1"' + the author's first middle name. + + If the author's name has more than one middle name, they will appear + as info keys with the appropriate index (e.g., `"sc-middlename-2"', + ...). *Note Selecting an Attribution::. + +  + File: sc.info, Node: Reference Headers, Next: The Built-in Header Rewrite Functions, Prev: Information Keys and the Info Alist, Up: Top + + Reference Headers + ***************** + + Supercite will insert an informative "reference header" at the + beginning of the cited body of text, which display more detail about the + original article and provides the mapping between the attribution and + the original author in non-nested citations. Whereas the citation + string usually only contains a portion of the original author's name, + the reference header can contain such information as the author's full + name, email address, the original article's subject, etc. In fact any + information contained in the info alist can be inserted into a reference + header. + + * Menu: + + * The Built-in Header Rewrite Functions:: + * Electric References:: + + There are a number of built-in "header rewrite functions" supplied + by Supercite, but you can write your own custom header rewrite functions + (perhaps using the built-in ones as examples). The variable + `sc-rewrite-header-list' contains the list of such header rewrite + functions. This list is consulted both when inserting the initial + reference header, and when displaying "electric references". *Note + Electric References::. + + When Supercite is initially run on a reply buffer (via + `sc-cite-original'), it will automatically call one of these functions. + The one it uses is defined in the variable `sc-preferred-header-style'. + The value of this variable is an integer which is an index into the + `sc-rewrite-header-list', beginning at zero. + +  + File: sc.info, Node: The Built-in Header Rewrite Functions, Next: Electric References, Prev: Reference Headers, Up: Reference Headers + + The Built-in Header Rewrite Functions + ===================================== + + Below are examples of the various built-in header rewrite functions. + Please note the following: first, the text which appears in the + examples below as INFOKEY indicates that the corresponding value of the + info key from the info alist will be inserted there. (*Note + Information Keys and the Info Alist::). For example, in + `sc-header-on-said' below, DATE and FROM correspond to the values of the + `Date:' and `From:' mail headers respectively. + + Also, the string `">>>>>"' below is really the value of the variable + `sc-reference-tag-string'. This variable is used in all built-in + header rewrite functions, and you can customize its value to change the + tag string globally. + + Finally, the references headers actually written may omit certain + parts of the header if the info key associated with INFOKEY is not + present in the info alist. In fact, for all built-in headers, if the + `From:' field is not present in the mail headers, the entire reference + header will be omitted (but this usually signals a serious problem + either in your MUA or in Supercite's installation). + + `sc-no-header' + This function produces no header. It should be used instead of + `nil' to produce a blank header. This header can possibly contain + a blank line after the `mail-header-separator' line. + + `sc-no-blank-line-or-header' + This function is similar to `sc-no-header' except that any blank + line after the `mail-header-separator' line will be removed. + + `sc-header-on-said' + `>>>>> On DATE, FROM said:' + + `sc-header-inarticle-writes' + `>>>>> In article MESSAGE-ID, FROM writes:' + + `sc-header-regarding-adds' + `>>>>> Regarding SUBJECT; FROM adds:' + + `sc-header-attributed-writes' + `>>>>> "SC-ATTRIBUTION" == SC-AUTHOR writes:' + + `sc-header-author-writes' + `>>>>> SC-AUTHOR writes:' + + `sc-header-verbose' + `>>>>> On DATE,' + `>>>>> SC-AUTHOR' + `>>>>> from the organization of ORGANIZATION' + `>>>>> who can be reached at: SC-REPLY-ADDRESS' + `>>>>> (whose comments are cited below with: "SC-CITE")' + `>>>>> had this to say in article MESSAGE-ID' + `>>>>> in newsgroups NEWSGROUPS' + `>>>>> concerning the subject of SUBJECT' + `>>>>> see REFERENCES for more details' + +  + File: sc.info, Node: Electric References, Next: Hints to MUA Authors, Prev: The Built-in Header Rewrite Functions, Up: Reference Headers + + Electric References + =================== + + By default, when Supercite cites the original message for the first + time, it just goes ahead and inserts the reference header indexed by + `sc-preferred-header-style'. However, you may want to select different + reference headers based on the type of reply or forwarding you are + doing. You may also want to preview the reference header before + deciding whether to insert it into the reply buffer or not. Supercite + provides an optional "electric reference" mode which you can drop into + to give you this functionality. + + If the variable `sc-electric-references-p' is non-`nil', Supercite + will bring up an electric reference mode buffer and place you into a + recursive edit. The electric reference buffer is read-only, so you + cannot directly modify the reference text until you exit electric + references and insert the text into the reply buffer. But you can cycle + through all the reference header rewrite functions in your + `sc-rewrite-header-list'. + + You can also set a new preferred header style, jump to any header, or + jump to the preferred header. The header will be shown in the electric + reference buffer and the header index and function name will appear in + the echo area. + + The following commands are available while in electric reference mode + (shown here with their default key bindings): + + `sc-eref-next' (`n') + Displays the next reference header in the electric reference + buffer. If the variable `sc-electric-circular-p' is non-`nil', + invoking `sc-eref-next' while viewing the last reference header in + the list will wrap around to the first header. + + `sc-eref-prev' (`p') + Displays the previous reference header in the electric reference + buffer. If the variable `sc-electric-circular-p' is non-`nil', + invoking `sc-eref-prev' will wrap around to the last header. + + `sc-eref-goto' (`g') + Goes to a specified reference header. The index (into the + `sc-rewrite-header-list') can be specified as a numeric argument to + the command. Otherwise, Supercite will query you for the index in + the minibuffer. + + `sc-eref-jump' (`j') + Display the preferred reference header, i.e., the one indexed by + the current value of `sc-preferred-header-style'. + + `sc-eref-setn' (`s') + Set the preferred reference header (i.e., + `sc-preferred-header-style') to the currently displayed header. + + `sc-eref-exit' (LFD, RET, and ESC C-c) + Exit from electric reference mode and insert the current header + into the reply buffer. + + `sc-eref-abort' (`q', `x') + Exit from electric reference mode without inserting the current + header. + + Supercite will execute the hook `sc-electric-mode-hook' before entering + electric reference mode. + +  + File: sc.info, Node: Getting Connected, Next: Emacs 19 MUAs, Prev: Recognizing Citations, Up: Top + + Getting Connected + ***************** + + Hitting `C-c C-y' in your MUA's reply buffer yanks and cites the + original message into the reply buffer. In reality, the citation of the + original message is performed via a call through a configurable hook + variable. The name of this variable has been agreed to in advance as + part of the "citation interface specification". By default this hook + variable has a `nil' value, which the MUA recognizes to mean, "use your + default citation function". When you add Supercite's citation function + to the hook, thereby giving the variable a non-`nil' value, it tells + the MUA to run the hook via `run-hooks' instead of using the default + citation. + + * Menu: + + * Emacs 19 MUAs:: + * Emacs 18 MUAs:: + * MH-E with any Emacsen:: + * VM with any Emacsen:: + * GNEWS with any Emacsen:: + * Overloading for Non-conforming MUAs:: + + Early in Supercite's development, the Supercite author, a few MUA + authors, and some early Supercite users got together and agreed upon a + standard interface between MUAs and citation packages (of which + Supercite is currently the only known add-on :-). With the recent + release of the Free Software Foundation's GNU Emacs 19, the interface + has undergone some modification and it is possible that not all MUAs + support the new interface yet. Some support only the old interface and + some do not support the interface at all. Still, it is possible for all + known MUAs to use Supercite, and the following sections will outline the + procedures you need to follow. + + To learn exactly how to connect Supercite to the software systems you + are using, read the appropriate following sections. For details on the + interface specifications, or if you are writing or maintaining an MUA, + *note Hints to MUA Authors::.. + + The first thing that everyone should do, regardless of the MUA you + are using is to set up Emacs so it will load Supercite at the + appropriate time. You can either dump Supercite into your Emacs binary + (ask your local Emacs guru how to do this if you don't know), or you + can set up an "autoload" for Supercite. To do the latter, put the + following in your `.emacs' file: + + (autoload 'sc-cite-original "supercite" "Supercite 3.1" t) + (autoload 'sc-submit-bug-report "supercite" "Supercite 3.1" t) + + The function `sc-cite-original' is the top-level Supercite function + designed to be run from the citation hook. It expects `point' and + `mark' to be set around the region to cite, and it expects the original + article's mail headers to be present within this region. Note that + Supercite *never* touches any text outside this region. Note further + that for Emacs 19, the region need not be active for `sc-cite-original' + to do its job. *Note Hints to MUA Authors::. + + The other step in the getting connected process is to make sure your + MUA calls `sc-cite-original' at the right time. As mentioned above, + some MUAs handle this differently. Read the sections that follow + pertaining to the MUAs you are using. + + One final note. After Supercite is loaded into your Emacs session, + it runs the hook `sc-load-hook'. You can put any customizations into + this hook since it is only run once. This will not work, however, if + your Emacs maintainer has put Supercite into your dumped Emacs' image. + In that case, you can use the `sc-pre-hook' variable, but this will get + executed every time `sc-cite-original' is called. *Note Reply Buffer + Initialization::. + +  + File: sc.info, Node: Emacs 19 MUAs, Next: Emacs 18 MUAs, Prev: Getting Connected, Up: Getting Connected + + GNUS, RMAIL, or RNEWS with any Emacs 19 + ======================================= + + These MUAs, distributed with both FSF and Lucid GNU Emacs 19, use + Emacs' built-in yanking facility, which provides the citing hook + variable `mail-citation-hook'. By default, this hook's value is `nil', + but by adding the following to your `.emacs' file, you can tell these + MUAs to use Supercite to perform the citing of the original message: + + (add-hook 'mail-citation-hook 'sc-cite-original) + + GNUS users may also want to add the following bit of lisp as well. + This prevents GNUS from inserting its default attribution header. + Otherwise, both GNUS and Supercite will insert an attribution header: + + (setq news-reply-header-hook nil) + + Note that the `mail-citation-hook' interface described above was not + supported in FSF Emacs 19 until version 19.16 and in Lucid Emacs 19 + until version 19.8. If you are running an earlier version of one of + these Emacsen, you will need to either upgrade to the latest version, or + use the unsupported "overloading" feature provided with Supercite. + *Note Overloading for Non-conforming MUAs::. + +  + File: sc.info, Node: Emacs 18 MUAs, Next: MH-E with any Emacsen, Prev: Emacs 19 MUAs, Up: Getting Connected + + GNUS, RMAIL, PCMAIL, RNEWS with Emacs 18 or Epoch 4 + =================================================== + + These MUAs use Emacs' built-in yanking and citing routines, + contained in the `sendmail.el' file. `sendmail.el' for Emacs 18, and + its derivative Epoch 4, do not know anything about the citation + interface required by Supercite. To connect Supercite to any of these + MUAs under Emacs 18 or Epoch 4, you should first *note Overloading for + Non-conforming MUAs::.. Then follow the directions for using these + MUAs under Emacs 19. *Note Emacs 19 MUAs::. + + Note that those instructions will tell you to use the function + `add-hook'. This function is new with Emacs 19 and you will not have it + by default if you are running Emacs 18 or Epoch 4. You can either + substitute the appropriate call to `setq', or you can use the + `add-hook' function that is provided in the `sc-unsupp.el' file of + unsupported Supercite hacks and ideas. Or you can upgrade to some + Emacs 19 variant! :-) + + To use `setq' instead of `add-hook', you would, for example, change + this: + + (add-hook 'mail-citation-hook 'sc-cite-original) + + to: + + (setq mail-citation-hook 'sc-cite-original) + + Note the lack of of a single quote on the first argument to `setq'. + +  + File: sc.info, Node: MH-E with any Emacsen, Next: VM with any Emacsen, Prev: Emacs 18 MUAs, Up: Getting Connected + + MH-E with any Emacsen + ===================== + + MH-E 4.x conforms to the `mail-citation-hook' interface supported by + other MUAs. At the time of this writing, MH-E 4.0 has not been + released, but if you have it, put this in your `.emacs' file to connect + Supercite and MH-E 4.x: + + (add-hook 'mail-citation-hook 'sc-cite-original) + + Note that if you are using Emacs 18 or Epoch 4, you will not have the + `add-hook' function. *Note Emacs 18 MUAs:: for details on how to + proceed without `add-hook'. + + MH-E version 3.x uses a slightly different interface than other MUAs. + MH-E provides a hook variable `mh-yank-hooks', but it doesn't act like + a hook, and doing an `add-hook' will not work. + + To connect Supercite to MH-E 3.x, you should instead add the + following to your `.emacs' file: + + (add-hook 'mh-yank-hooks 'sc-cite-original) + + You also need to make sure that MH-E includes all the original mail + headers in the yanked message. The variable that controls this is + `mh-yank-from-start-of-msg'. By default, this variable has the value + `t', which tells MH-E to include all the mail headers when yanking the + original message. Before you switched to using Supercite, you may have + set this variable to other values so as not to include the mail headers + in the yanked message. Since Supercite requires these headers (and + cleans them out for you), you need to make sure the value is `t'. This + lisp, in your `.emacs' file will do the trick: + + (setq mh-yank-from-start-of-msg t) + + Note that versions of MH-E before 3.7 did not provide the + `mh-yank-hooks' variable. Your only option is to upgrade to MH-E + version 3.7 or later. + +  + File: sc.info, Node: VM with any Emacsen, Next: GNEWS with any Emacsen, Prev: MH-E with any Emacsen, Up: Getting Connected + + VM with any Emacsen + =================== + + Since release 4.40, VM has supported the citation interface required + by Supercite. But since the interface has changed recently the details + of getting connected differ with the version of VM you are using. + + If you are running any release of VM after 4.40, you can add the + following to your `.emacs' to connect Supercite with VM: + + (add-hook 'mail-yank-hooks 'sc-cite-original) + + Note that if you are using Emacs 18 or Epoch 4, you will not have the + `add-hook' function. *Note Emacs 18 MUAs:: for details on how to + proceed without `add-hook'. + + Since version 5.34, VM has supported the newer `mail-citation-hook' + interface, but `mail-yank-hooks' is still being supported for backward + compatibility. If you are running a newer version of VM and you want + to maintain consistency with other MUAs, use this bit of code instead: + + (add-hook 'mail-citation-hook 'sc-cite-original) + +  + File: sc.info, Node: GNEWS with any Emacsen, Next: Overloading for Non-conforming MUAs, Prev: VM with any Emacsen, Up: Getting Connected + + GNEWS with any Emacsen + ====================== + + As far as I know, no version of GNEWS supports the citation interface + required by Supercite. To connect Supercite with GNEWS, please first + *note Overloading for Non-conforming MUAs::.. + + After you have followed the directions in that section. You should + add the following lisp code to your `.emacs' file: + + (add-hook 'mail-citation-hook 'sc-cite-original) + + Note that if you are using Emacs 18 or Epoch 4, you will not have the + `add-hook' function. *Note Emacs 18 MUAs:: for details on how to + proceed without `add-hook'. + +  + File: sc.info, Node: Overloading for Non-conforming MUAs, Next: Replying and Yanking, Prev: GNEWS with any Emacsen, Up: Getting Connected + + Overloading for Non-conforming MUAs + =================================== + + As mentioned elsewhere, some MUAs do not provide the necessary hooks + to connect with Supercite. Supercite version 3.1 provides an + unsupported mechanism, called "overloading" which redefines certain key + functions in the MUA, so that it will call the `mail-citation-hook' + variable instead of the MUA's default hard-coded citing routines. Since + most newer versions of the known MUAs support the `mail-citation-hook' + variable, it is recommended that you upgrade if at all possible. But + if you can't upgrade, at least you're not out of luck! Once you set up + overloading properly, you should follow the directions for connecting + Supercite to the Emacs 19 MUAs. *Note Emacs 19 MUAs::. + + Users of Bob Weiner's Hyperbole package take note. Hyperbole + provides the necessary overloads (and a whole lot more!) and you can + potentially clobber it if you were to load Supercite's overloading after + Hyperbole's. For this reason, Supercite will *not* perform any + overloading if it finds the variable `hyperb:version' is `boundp' (i.e. + it exists because Hyperbole has been loaded into your Emacs session). + If this is the case, Supercite will display a warning message in the + minibuffer. You should consult the Hyperbole manual for further + details. + + Overloading involves the re-definition of the citing function with + the new, `mail-citation-hook' savvy version. The function in + `sc-oloads.el' that does this is `sc-perform-overloads'. This function + is smart enough to only overload the MUA functions when it is + absolutely necessary, based on the version numbers it can figure out. + Also, `sc-perform-overloads' will only install the new functions once. + It is also smart enough to do nothing if the MUA is not yet loaded. + + The tricky part is finding the right time and place to perform the + overloading. It must be done after the MUA has been loaded into your + Emacs session, but before the first time you try to yank in a message. + Fortunately, this has been figured out for you. + + If you must overload, you should put the following lisp code in your + `.emacs' file, to make sure the `sc-oloads.el' file gets loaded at the + right time: + + (autoload 'sc-perform-overloads "sc-oloads" "Supercite 3.1" t) + + Then you must make sure that the function `sc-perform-overloads' + gets run at the right time. For GNUS, put this in your `.emacs' file: + + (setq news-reply-mode-hook 'sc-perform-overloads) + (setq mail-setup-hook 'sc-perform-overloads) + + If you are using RNEWS, put this in your `.emacs' file: + + (setq news-reply-mode-hook 'sc-perform-overloads) + + If you are using RMAIL or PCMAIL, put this in your `.emacs' file: + + (setq mail-setup-hook 'sc-perform-overloads) + + If you are using GNEWS, put this in your `.emacs' file: + + (setq news-reply-mode-hook 'sc-perform-overloads) + (setq gnews-ready-hook 'sc-perform-overloads) + + Now go back and follow the directions for getting the Emacs 19 MUAs + connected to Supercite. Be sure to *note Emacs 18 MUAs::. on + substitutes for Emacs 19's `add-hook' function. + +  + File: sc.info, Node: Replying and Yanking, Next: Reply Buffer Initialization, Prev: Overloading for Non-conforming MUAs, Up: Top + + Replying and Yanking + ******************** + + This chapter explains what happens when you reply and yank an + original message from an MUA. + + * Menu: + + * Reply Buffer Initialization:: + * Filling Cited Text:: + +  + File: sc.info, Node: Reply Buffer Initialization, Next: Filling Cited Text, Prev: Replying and Yanking, Up: Replying and Yanking + + Reply Buffer Initialization + =========================== + + Executing `sc-cite-original' performs the following steps as it + initializes the reply buffer: + + 1. *Runs `sc-pre-hook'.* This hook variable is run before + `sc-cite-original' does any other work. You could conceivably use + this hook to set certain Supercite variables based on the reply + buffer's mode or name (i.e., to do something different based on + whether you are replying or following up to an article). + + 2. *Inserts Supercite's keymap.* Supercite provides a number of + commands for performing post-yank modifications to the reply + buffer. These commands are installed on Supercite's top-level + keymap. Since Supercite has to interface with a wide variety of + MUAs, it does not install all of its commands directly into the + reply buffer's keymap. Instead, it puts its commands on a keymap + prefix, then installs this prefix onto the buffer's keymap. What + this means is that you typically have to type more characters to + invoke a Supercite command, but Supercite's keybindings can be + made much more consistent across MUAs. + + You can control what key Supercite uses as its keymap prefix by + changing the variable `sc-mode-map-prefix'. By default, this + variable is set to `C-c C-p'; a finger twister perhaps, but + unfortunately the best default due to the scarcity of available + keybindings in many MUAs. + + 3. *Turns on Supercite minor mode.* The modeline of the reply buffer + should indicate that Supercite is active in that buffer by + displaying the string `SC'. + + 4. *Sets the "Undo Boundary".* Supercite sets an undo boundary before + it begins to modify the original yanked text. This allows you to + easily undo Supercite's changes to affect alternative citing + styles. + + 5. *Processes the the mail headers.* All previously retrieved info + key-value pairs are deleted from the info alist, then the mail + headers in the body of the yanked message are scanned. Info + key-value pairs are created for each header found. Also, such + useful information as the author's name and email address are + extracted. If the variable `sc-mail-warn-if-non-rfc822-p' is + non-`nil', then Supercite will warn you if it finds a mail header + that does not conform to RFC822. This is rare and indicates a + problem either with your MUA or the original author's MUA, or some + MTA (mail transport agent) along the way. + + Once the info keys have been extracted from the mail headers, the + headers are nuked from the reply buffer. You can control exactly + which headers are removed or kept, but by default, all headers are + removed. + + There are two variables which control mail header nuking. The + variable `sc-nuke-mail-headers' controls the overall behavior of + the header nuking routines. By setting this variable to `'all', + you automatically nuke all mail headers. Likewise, setting this + variable to `'none' inhibits nuking of any mail headers. In + between these extremes, you can tell Supercite to nuke only a + specified list of mail headers by setting this variable to + `'specified', or to keep only a specified list of headers by + setting it to `'keep'. + + If `sc-nuke-mail-headers' is set to `'specified' or `'keep', then + the variable `sc-nuke-mail-header-list' is consulted for the list + of headers to nuke or keep. This variable contains a list of + regular expressions. If the mail header line matches a regular + expression in this list, the header will be nuked or kept. The + line is matched against the regexp using `looking-at' rooted at + the beginning of the line. + + If the variable `sc-blank-lines-after-headers' is non-`nil', it + contains the number of blank lines remaining in the buffer after + mail headers are nuked. By default, only one blank line is left + in the buffer. + + 6. *Selects the attribution and citation strings.* Once the mail + headers have been processed, Supercite selects a attribution + string and a citation string which it will use to cite the + original message. *Note Selecting an Attribution:: for details. + + 7. *Cites the message body.* After the selection of the attribution + and citation strings, Supercite cites the original message by + inserting the citation string prefix in front of every uncited + line. You may not want Supercite to automatically cite very long + messages however. For example, some email could contain a smaller + header section followed by a huge uuencoded message. It wouldn't + make sense to cite the uuencoded message part when responding to + the original author's short preface. For this reason, Supercite + provides a variable which limits the automatic citation of long + messages to a certain maximum number of lines. The variable is + called `sc-cite-region-limit'. If this variable contains an + integer, messages with more lines that this will not be cited at + all, and a warning message will be displayed. Supercite has + performed everything necessary, though, for you to manually cite + only the small portion of the original message that you want to + use. + + If `sc-cite-region-limit' contains a non-`nil' value, the original + message will always be cited, regardless of its size. If the + variable contains the value `nil', the region will never be cited + automatically. Use this if you always want to be able to edit and + cite the message manually. + + The variable `sc-cite-blank-lines-p' controls whether blank lines + in the original message should be cited or not. If this variable + is non-`nil', blank lines will be cited just like non-blank lines. + Otherwise, blank lines will be treated as paragraph separators. + + Citing of the original message is highly configurable. Supercite's + default setup does a pretty good job of citing many common forms of + previously cited messages. But there are as many citation styles + out there as people on the net, or just about! It would be + impossible for Supercite to anticipate every style in existence, + and you probably wouldn't encounter them all anyway. But you can + configure Supercite to recognize those styles you see often. + *Note Configuring the Citation Engine:: for details. + + 8. *Runs `sc-post-hook'.* This variable is very similar to + `sc-pre-hook', except that it runs after `sc-cite-original' is + finished. This hook is provided mostly for completeness and + backward compatibility. Perhaps it could be used to reset certain + variables set in `sc-pre-hook'. + +  + File: sc.info, Node: Filling Cited Text, Next: Selecting an Attribution, Prev: Reply Buffer Initialization, Up: Replying and Yanking + + Filling Cited Text + ================== + + Supercite will automatically fill newly cited text from the original + message unless the variable `sc-auto-fill-region-p' has a `nil' value. + Supercite will also re-fill paragraphs when you manually cite or + re-cite text. + + However, during normal editing, Supercite itself cannot be used to + fill paragraphs. This is a change from version 2. There are other + add-on lisp packages which do filling much better than Supercite ever + did. The two best known are "filladapt" and "gin-mode". Both work well + with Supercite and both are available at the normal Emacs Lisp archive + sites. "gin-mode" works pretty well out of the box, but if you use + "filladapt", you may want to run the function `sc-setup-filladapt' from + your `sc-load-hook'. This simply makes "filladapt" a little more + Supercite savvy than its default setup. + + Also, Supercite will collapse leading whitespace between the citation + string and the text on a line when the variable `sc-fixup-whitespace-p' + is non-`nil'. The default value for this variable is `nil'. + + Its important to understand that Supercite's automatic filling + (during the initial citation of the reply) is very fragile. That is + because figuring out the `fill-prefix' for a particular paragraph is a + really hard thing to do automatically. This is especially the case when + the original message contains code or some other text where leading + whitespace is important to preserve. For this reason, many Supercite + users typically run with `sc-auto-fill-region-p' (and possibly also + `sc-fixup-whitespace-p') set to `nil'. They then manually fill each + cited paragraph in the reply buffer. + + I usually run with both these variables containing their default + values. When Supercite's automatic filling breaks on a particular + message, I will use Emacs' undo feature to undo back before the + citation was applied to the original message. Then I'll toggle the + variables and manually cite those paragraphs that I don't want to fill + or collapse whitespace on. *Note Variable Toggling Shortcuts::. + + If you find that Supercite's automatic filling is just too fragile + for your tastes, you might consider one of these alternate approaches. + Also, to make life easier, a shortcut function to toggle the state of + both of these variables is provided on the key binding `C-c C-p C-p' + (with the default value of `sc-mode-map-prefix'; *note Post-yank + Formatting Commands::.). + + You will noticed that the minor mode string will show the state of + these variables as qualifier characters. When both variables are `nil', + the Supercite minor mode string will display `SC'. When just + `sc-auto-fill-region-p' is non-`nil', the string will display `SC:f', + and when just `sc-fixup-whitespace-p' is non-`nil', the string will + display `SC:w'. When both variables are non-`nil', the string will + display `SC:fw'. Note that the qualifiers chosen are mnemonics for the + default bindings of the toggling function for each respective variable. + *Note Variable Toggling Shortcuts::. + + Why are these variables not set to `nil' by default? It is because + many users won't manually fill paragraphs that are Supercited, and there + have been widespread complaints on the net about mail and news messages + containing lines greater than about 72 characters. So the default is to + fill cited text. + +  + File: sc.info, Node: Selecting an Attribution, Next: Attribution Preferences, Prev: Filling Cited Text, Up: Top + + Selecting an Attribution + ************************ + + As you know, the attribution string is the part of the author's name + that will be used to composed a non-nested citation string. Supercite + scans the various mail headers present in the original article and uses + a number of heuristics to extract strings which it puts into the + "attribution association list" or "attribution alist". This is + analogous, but different than, the info alist previously mentioned. Each + element in the attribution alist is a key-value pair containing such + information as the author's first name, middle names, and last name, the + author's initials, and the author's email terminus. + + * Menu: + + * Attribution Preferences:: + * Anonymous Attributions:: + * Author Names:: + diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/info/sc.info-2 emacs-19.20/info/sc.info-2 *** emacs-19.19/info/sc.info-2 --- emacs-19.20/info/sc.info-2 Tue Nov 9 02:34:30 1993 *************** *** 0 **** --- 1,1048 ---- + This is Info file ../info/sc.info, produced by Makeinfo-1.54 from the + input file sc.texi. + + This document describes the Supercite Version 3.1 package for citing + and attributing the replies for various GNU Emacs mail and news reading + subsystems. + + Copyright (C) 1993 Barry A. Warsaw + + Permission is granted to make and distribute verbatim copies of this + manual provided the copyright notice and this permission notice are + preserved on all copies. + +  + File: sc.info, Node: Attribution Preferences, Next: Anonymous Attributions, Prev: Selecting an Attribution, Up: Selecting an Attribution + + Attribution Preferences + ======================= + + When you cite an original message, you can tell Supercite which part + of the author's name you would prefer it to use as the attribution. The + variable `sc-preferred-attribution-list' controls this; it contains + keys which are matched against the attribution alist in the given order. + The first value of a key that produces a non-`nil', non-empty string + match is used as the attribution string, and if no keys match, a + secondary mechanism is used to generate the attribution. *Note + Anonymous Attributions::. + + The following preferences are always available in the attribution + alist (barring error): + + `"emailname"' + the author's email terminus. + + `"initials"' + the author's initials. + + `"firstname"' + the author's first name. + + `"lastname"' + the author's last name. + + `"middlename-1"' + the author's first middle name. + + `"sc-lastchoice"' + the last attribution string you have selected. This is useful when + you recite paragraphs in the reply. + + `"sc-consult"' + consults the customizable list `sc-attrib-selection-list' which can + be used to select special attributions based on the value of any + info key. See below for details. + + `"x-attribution"' + the original author's suggestion for attribution string choice. + See below for details. + + Middle name indexes can be any positive integer greater than zero, + though it is unlikely that many authors will have more than one middle + name, if that many. + + At this point, let me digress into a discussion of etiquette. It is + my belief that while the style of the citations is a reflection of the + personal tastes of the replier (i.e., you), the attribution selection is + ultimately the personal choice of the original author. In a sense it is + his or her "net nickname", and therefore the author should have some + say in the selection of attribution string. Imagine how you would feel + if someone gave you a nickname that you didn't like? + + For this reason, Supercite recognizes a special mail header, + `X-Attribution:', which if present, tells Supercite the attribution + string preferred by the original author. It is the value of this header + that is associated with the `"x-attribution"' key in the attribution + alist. Currently, you can override the preference of this key by + changing `sc-preferred-attribution-list', but that isn't polite, and in + the future Supercite may hard-code this. For now, it is suggested that + if you change the order of the keys in this list, that + `"x-attribution"' always be first, or possible second behind only + `"sc-lastchoice"'. This latter is the default. + + The value `"sc-consult"' in `sc-preferred-attribution-list' has a + special meaning during attribution selection. When Supercite + encounters this preference, it begins processing a customizable list of + attributions, contained in the variable `sc-attrib-selection-list'. + Each element in this list contains lists of the following form: + + (INFOKEY ((REGEXP . ATTRIBUTION) + (REGEXP . ATTRIBUTION) + (...))) + + where INFOKEY is a key for `sc-mail-field' and REGEXP is a regular + expression to match against the INFOKEY's value. If REGEXP matches the + INFOKEY's value, the ATTRIBUTION is used as the attribution string. + Actually, ATTRIBUTION can be a string or a list; if it is a list, it is + `eval'uated and the return value (which must be a string), is used as + the attribution. + + This can be very useful for when you are replying to net + acquaintances who do not use the `X-Attribution:' mail header. You may + know what nickname they would prefer to use, and you can set up this + list to match against a specific mail field, e.g., `From:', allowing you + to cite your friend's message with the appropriate attribution. + +  + File: sc.info, Node: Anonymous Attributions, Next: Author Names, Prev: Attribution Preferences, Up: Selecting an Attribution + + Anonymous Attributions + ====================== + + When the author's name cannot be found in the `From:' mail header, a + fallback author name and attribution string must be supplied. The + fallback author name is contained in the variable + `sc-default-author-name' and the fallback attribution string is + contained in the variable `sc-default-attribution'. Default values for + these variables are `"Anonymous"' and `"Anon"', respectively. Note that + in most circumstances, getting the default author name or attribution + is a sign that something is set up incorrectly. + + Also, if the preferred attribution, which you specified in your + `sc-preferred-attribution-alist' variable cannot be found, a secondary + method can be employed to find a valid attribution string. The variable + `sc-use-only-preference-p' controls what happens in this case. If the + variable's value is non-`nil', then `sc-default-author-name' and + `sc-default-attribution' are used, otherwise, the following steps are + taken to find a valid attribution string, and the first step to return + a non-`nil', non-empty string becomes the attribution: + + 1. Use the last selected attribution, if there is one. + + 2. Use the value of the `"x-attribution"' key. + + 3. Use the author's first name. + + 4. Use the author's last name. + + 5. Use the author's initials. + + 6. Find the first non-`nil', non-empty attribution string in the + attribution alist. + + 7. `sc-default-attribution' is used. + + Once the attribution string has been automatically selected, a + number of things can happen. If the variable `sc-confirm-always-p' is + non-`nil', you are queried for confirmation of the chosen attribution + string. The possible values for completion are those strings in the + attribution alist, however you are not limited to these choices. You + can type any arbitrary string at the confirmation prompt. The string + you enter becomes the value associated with the `"sc-lastchoice"' key + in the attribution alist. + + Once an attribution string has been selected, Supercite will force + the string to lower case if the variable `sc-downcase-p' is non-`nil'. + + Two hook variables provide even greater control of the attribution + selection process. The hook `sc-attribs-preselect-hook' is run before + any attribution is selected. Likewise, the hook + `sc-attribs-postselect-hook' is run after the attribution is selected + (and the corresponding citation string is built), but before these + values are committed for use by Supercite. During the post-selection + hook, the local variables `attribution' and `citation' are bound to the + appropriate strings. By changing these variables in your hook + functions, you change the attribution and citation strings used by + Supercite. One possible use of this would be to override any + automatically derived attribution string when it is only one character + long; e.g. you prefer to use `"initials"' but the author only has one + name. + +  + File: sc.info, Node: Author Names, Next: Configuring the Citation Engine, Prev: Anonymous Attributions, Up: Selecting an Attribution + + Author Names + ============ + + Supercite employs a number of heuristics to decipher the author's + name based on value of the `From:' mail field of the original message. + Supercite can recognize almost all of the common `From:' field formats + in use. If you encounter a `From:' field that Supercite cannot parse, + please report this bug. *Note The Supercite Mailing List::. + + There are a number of Supercite variables that control how author + names are extracted from the `From:' header. Some headers may contain a + descriptive title as in: + + From: computer!speedy!doe (John Xavier-Doe -- Decent Hacker) + + Supercite knows which part of the `From:' header is email address + and which part is author name, but in this case the string `"Decent + Hacker"' is not part of the author's name. You can tell Supercite to + ignore the title, while still recognizing hyphenated names through the + use of a regular expression in the variable `sc-titlecue-regexp'. This + variable has the default value of `"\\\\s +-+\\\\s +"'. Any text after + this regexp is encountered is ignored as noise. + + Some `From:' headers may contain extra titles in the name fields not + separated by a title cue, but which are nonetheless not part of the + author's name proper. Examples include the titles "Dr.", "Mr.", "Ms.", + "Jr.", "Sr.", and "III" (e.g., Thurston Howe, the Third). Also, some + companies prepend or append the name of the division, organization, or + project on the author's name. All of these titles are noise which + should be ignored. The variable `sc-name-filter-alist' is used for + this purpose. As implied by its name, this variable is an association + list, where each element is a cons cell of the form: + + (REGEXP . POSITION) + + where REGEXP is a regular expression that is matched (using + `string-match') against each element of the `From:' field's author + name. POSITION is a position indicator, starting at zero. Thus to + strip out all titles of "Dr.", "Mr.", etc. from the name, + `sc-name-filter-alist' would have an entry such as: + + ("^\\(Mr\\|Mrs\\|Ms\\|Dr\\)[.]?$" . 0) + + which only removes them if they appear as the first word in the name. + The position indicator is an integer, or one of the two special symbols + `last' or `any'. `last' always matches against the last word in the + name field, while `any' matches against every word in the name field. + +  + File: sc.info, Node: Configuring the Citation Engine, Next: Using Regi, Prev: Author Names, Up: Top + + Configuring the Citation Engine + ******************************* + + At the heart of Supercite is a regular expression interpreting engine + called "Regi". Regi operates by interpreting a data structure called a + Regi-frame (or just "frame"), which is a list of Regi-entries (or just + "entry"). Each entry contains a predicate, typically a regular + expression, which is matched against a line of text in the current + buffer. If the predicate matches true, an associated expression is + `eval'uated. In this way, an entire region of text can be transformed + in an *awk*-like manner. Regi is used throughout Supercite, from mail + header information extraction, to header nuking, to citing text. + + * Menu: + + * Using Regi:: + * Frames You Can Customize:: + + While the details of Regi are discussed below (*note Using Regi::.), + only those who wish to customize certain aspects of Supercite need + concern themselves with it. It is important to understand though, that + any conceivable citation style that can be described by a regular + expression can be recognized by Supercite. This leads to some + interesting applications. For example, if you regularly recieve email + from a co-worker that uses an uncommon citation style (say one that + employs a `|' or `}' character at the front of the line), it is + possible for Supercite to recognize this and *coerce* the citation to + your preferred style, for consistency. In theory, it is possible for + Supercite to recognize such things as uuencoded messages or C code and + cite or fill those differently than normal text. None of this is + currently part of Supercite, but contributions are welcome! + +  + File: sc.info, Node: Using Regi, Next: Frames You Can Customize, Prev: Configuring the Citation Engine, Up: Configuring the Citation Engine + + Using Regi + ========== + + Regi works by interpreting frames with the function + `regi-interpret'. A frame is a list of arbitrary size where each + element is a entry of the following form: + + (PRED FUNC [NEGATE-P [CASE-FOLD-SEARCH]]) + + Regi starts with the first entry in a frame, evaluating the PRED of + that entry against the beginning of the line that `point' is on. If + the PRED evaluates to true (or false if the optional NEGATE-P is + non-`nil'), then the FUNC for that entry is `eval'uated. How + processing continues is determined by the return value for FUNC, and is + described below. If PRED was false the next entry in the frame is + checked until all entries have been matched against the current line. + If no entry matches, `point' is moved forward one line and the frame is + reset to the first entry. + + PRED can be a string, a variable, a list or one of the following + symbols: `t', `begin', `end', or `every'. If PRED is a string, or a + variable or list that `eval'uates to a string, it is interpreted as a + regular expression. This regexp is matched against the current line, + from the beginning, using `looking-at'. This match folds case if the + optional CASE-FOLD-SEARCH is non-`nil'. If PRED is not a string, or + does not `eval'uate to a string, it is interpreted as a binary value + (`nil' or non-`nil'). + + The four special symbol values for PRED are recognized: + + `t' + Always produces a true outcome. + + `begin' + Always executed before the frame is interpreted. This can be used + to initialize some global variables for example. + + `end' + Always executed after frame interpreting is completed. This can be + used to perform any necessary post-processing. + + `every' + Executes whenever the frame is reset, usually after the entire + frame has been matched against the current line. + + Note that NEGATE-P and CASE-FOLD-SEARCH are ignored if PRED is one + of these special symbols. Only the first occurance of each symbol in a + frame is used; any duplicates are ignored. Also note that for + performance reasons, the entries associated with these symbols are + removed from the frame during the main interpreting loop. + + Your FUNC can return certain values which control continued Regi + processing. By default, if your FUNC returns `nil' (as it should be + careful to do explicitly), Regi will reset the frame to the first + entry, and advance `point' to the beginning of the next line. If a + list is returned from your function, it can contain any combination of + the following elements: + + the symbol `continue' + This tells Regi to continue processing entries after a match, + instead of reseting the frame and moving `point'. In this way, + lines of text can have multiple matches, but you have to be + careful to avoid entering infinite loops. + + the symbol `abort' + This tells Regi to terminate frame processing. However, any `end' + entry is still processed. + + the list `(frame . NEWFRAME)' + This tells Regi to substitute NEWFRAME as the frame it is + interpreting. In other words, your FUNC can modify the Regi frame + on the fly. NEWFRAME can be a variable containing a frame, or it + can be the frame in-lined. + + the list `(step . STEP)' + Tells Regi to move STEP number of lines forward as it continues + processing. By default, Regi moves forward one line. STEP can be + zero or negative of course, but watch out for infinite loops. + + During execution of your FUNC, the following variables will be + temporarily bound to some useful information: + + `curline' + The current line in the buffer that Regi is `looking-at', as a + string. + + `curframe' + The current frame being interpreted. + + `curentry' + The current frame entry being interpreted. + +  + File: sc.info, Node: Frames You Can Customize, Next: Post-yank Formatting Commands, Prev: Using Regi, Up: Configuring the Citation Engine + + Frames You Can Customize + ======================== + + As mentioned earlier, Supercite uses various frames to perform + certain jobs such as mail header information extraction and mail header + nuking. However, these frames are not available for you to customize, + except through abstract interfaces such as `sc-nuke-mail-header', et al. + + However, the citation frames Supercite uses provide a lot of + customizing power and are thus available to you to change to suit your + needs. The workhorse of citation is the frame contained in the variable + `sc-default-cite-frame'. This frame recognizes many situations, such + as blank lines, which it interprets as paragraph separators. It also + recognizes previously cited nested and non-nested citations in the + original message. By default it will coerce non-nested citations into + your preferred citation style, and it will add a level of citation to + nested citations. It will also simply cite uncited lines in your + preferred style. + + In a similar vein, there are default frames for "unciting" and + "reciting", contained in the variables `sc-default-uncite-frame' and + `sc-default-recite-frame' respectively. + + As mentioned earlier (*note Recognizing Citations::.), citations are + recognized through the values of the regular expressions + `sc-citation-root-regexp', et al. To recognize odd styles, you could + modify these variables, or you could modify the default citing frame. + Alternatively, you could set up association lists of frames for + recognizing specific alternative forms. + + For each of the actions - citing, unciting, and reciting - an alist + is consulted to find the frame to use (`sc-cite-frame-alist', + `sc-uncite-frame-alist', and `sc-recite-frame-alist' respectively). + These frames can contain alists of the form: + + ((INFOKEY (REGEXP . FRAME) (REGEXP . FRAME) ...) + (INFOKEY (REGEXP . FRAME) (REGEXP . FRAME) ...) + (...)) + + Where INFOKEY is a key suitable for `sc-mail-field', REGEXP is a + regular expression which is `string-match''d against the value of the + `sc-mail-field' key, and FRAME is the frame to use if a match occurred. + FRAME can be a variable containing a frame or a frame in-lined. + + When Supercite is about to cite, uncite, or recite a region, it + consults the appropriate alist and attempts to find a frame to use. If + one is not found from the alist, then the appropriate default frame is + used. + +  + File: sc.info, Node: Post-yank Formatting Commands, Next: Citing Commands, Prev: Frames You Can Customize, Up: Top + + Post-yank Formatting Commands + ***************************** + + Once the original message has been yanked into the reply buffer, and + `sc-cite-original' has had a chance to do its thing, a number of useful + Supercite commands will be available to you. Since there is wide + variety in the keymaps that MUAs set up in their reply buffers, it is + next to impossible for Supercite to properly sprinkle its commands into + the existing keymap. For this reason Supercite places its commands on a + separate keymap, putting this keymap onto a prefix key in the reply + buffer. You can customize the prefix key Supercite uses by changing the + variable `sc-mode-map-prefix'. By default, the `sc-mode-map-prefix' is + `C-c C-p'; granted, not a great choice, but unfortunately the best + general solution so far. In the rest of this chapter, we'll assume + you've installed Supercite's keymap on the default prefix. + + * Menu: + + * Citing Commands:: + * Insertion Commands:: + * Variable Toggling Shortcuts:: + * Mail Field Commands:: + * Miscellaneous Commands:: + +  + File: sc.info, Node: Citing Commands, Next: Insertion Commands, Prev: Post-yank Formatting Commands, Up: Post-yank Formatting Commands + + Commands to Manually Cite, Recite, and Uncite + ============================================= + + Probably the three most common post-yank formatting operations that + you will perform will be the manual citing, reciting, and unciting of + regions of text in the reply buffer. Often you may want to recite a + paragraph to use a nickname, or manually cite a message when setting + `sc-cite-region-limit' to `nil'. The following commands perform these + functions on the region of text between `point' and `mark'. Each of + them sets the "undo boundary" before modifying the region so that the + command can be undone in the standard Emacs way. + + A quick note about Emacs 19. Unlike in Emacs 18, the region + delimited by `point' and `mark' can have two states. It can be + "active" or "inactive". Although the FSF Emacs 19 and Lucid Emacs 19 + use different terminology and functions, both employ the same + convention such that when the region is inactive, commands that modify + the region should generate an error. The user needs to explicitly + activate the region before successfully executing the command. All + Supercite commands conform to this convention. + + Here is the list of Supercite citing commands: + + `sc-cite-region' (`C-c C-p c') + This command cites each line in the region of text by interpreting + the selected frame from `sc-cite-frame-alist', or the default + citing frame `sc-default-cite-frame'. It runs the hook + `sc-pre-cite-hook' before interpreting the frame. With an optional + universal argument (`C-u'), it temporarily sets + `sc-confirm-always-p' to `t' so you can confirm the attribution + string for a single manual citing. *Note Configuring the Citation + Engine::. + + `sc-uncite-region' (`C-c C-p u') + This command removes any citation strings from the beginning of + each cited line in the region by interpreting the selected frame + from `sc-uncite-frame-alist', or the default unciting frame + `sc-default-uncite-frame'. It runs the hook `sc-pre-uncite-hook' + before interpreting the frame. *Note Configuring the Citation + Engine::. + + `sc-recite-region' (`C-c C-p r') + This command recites each line the region by interpreting the + selected frame from `sc-recite-frame-alist', or the default + reciting frame `sc-default-recite-frame'. It runs the hook + `sc-pre-recite-hook' before interpreting the frame. *Note + Configuring the Citation Engine::. + + Supercite will always ask you to confirm the attribution when + reciting a region, regardless of the value of + `sc-confirm-always-p'. + +  + File: sc.info, Node: Insertion Commands, Next: Variable Toggling Shortcuts, Prev: Citing Commands, Up: Post-yank Formatting Commands + + Insertion Commands + ================== + + These two functions insert various strings into the reply buffer. + + `sc-insert-reference' (`C-c C-p w') + Inserts a reference header into the reply buffer at `point'. With + no arguments, the header indexed by `sc-preferred-header-style' is + inserted. An optional numeric argument is the index into + `sc-rewrite-header-list' indicating which reference header to + write. + + With just the universal argument (`C-u'), electric reference mode + is entered, regardless of the value of `sc-electric-references-p'. + + `sc-insert-citation' (`C-c C-p i') + Inserts the current citation string at the beginning of the line + that `point' is on. If the line is already cited, Supercite will + issue an error and will not cite the line. + +  + File: sc.info, Node: Variable Toggling Shortcuts, Next: Mail Field Commands, Prev: Insertion Commands, Up: Post-yank Formatting Commands + + Variable Toggling Shortcuts + =========================== + + Supercite defines a number of commands that make it easier for you to + toggle and set various Supercite variables as you are editing the reply + buffer. For example, you may want to turn off filling or whitespace + cleanup, but only temporarily. These toggling shortcut commands make + this easy to do. + + Like Supercite commands in general, the toggling commands are placed + on a keymap prefix within the greater Supercite keymap. For the default + value of `sc-mode-map-prefix', this will be `C-c C-p C-t'. + + The following commands toggle the value of certain Supercite + variables which take only a binary value: + + `C-c C-p C-t b' + Toggles the variable `sc-mail-nuke-blank-lines-p'. + + `C-c C-p C-t c' + Toggles the variable `sc-confirm-always-p'. + + `C-c C-p C-t d' + Toggles the variable `sc-downcase-p'. + + `C-c C-p C-t e' + Toggles the variable `sc-electric-references-p'. + + `C-c C-p C-t f' + Toggles the variable `sc-auto-fill-region-p'. + + `C-c C-p C-t o' + Toggles the variable `sc-electric-circular-p'. + + `C-c C-p C-t s' + Toggles the variable `sc-nested-citation-p'. + + `C-c C-p C-t u' + Toggles the variable `sc-use-only-preferences-p'. + + `C-c C-p C-t w' + Toggles the variable `sc-fixup-whitespace-p'. + + The following commands let you set the value of multi-value + variables, in the same way that Emacs' `set-variable' does: + + `C-c C-p C-t a' + Sets the value of the variable `sc-preferred-attribution-list'. + + `C-c C-p C-t l' + Sets the value of the variable `sc-cite-region-limit'. + + `C-c C-p C-t n' + Sets the value of the variable `sc-mail-nuke-mail-headers'. + + `C-c C-p C-t N' + Sets the value of the variable `sc-mail-header-nuke-list'. + + `C-c C-p C-t p' + Sets the value of the variable `sc-preferred-header-style'. + + One special command is provided to toggle both + `sc-auto-fill-region-p' and `sc-fixup-whitespace-p' together. This is + because you typically want to run Supercite with either variable as + `nil' or non-`nil'. The command to toggle these variables together is + bound on `C-c C-p C-p'. + + Finally, the command `C-c C-p C-t h' (also `C-c C-p C-t ?') brings + up a Help message on the toggling keymap. + +  + File: sc.info, Node: Mail Field Commands, Next: Miscellaneous Commands, Prev: Variable Toggling Shortcuts, Up: Post-yank Formatting Commands + + Mail Field Commands + =================== + + These commands allow you to view, modify, add, and delete various + bits of information from the info alist. *Note Information Keys and + the Info Alist::. + + `sc-mail-field-query' (`C-c C-p f') + Allows you to interactively view, modify, add, and delete info + alist key-value pairs. With no argument, you are prompted (with + completion) for a info key. The value associated with that key is + displayed in the minibuffer. With an argument, this command will + first ask if you want to view, modify, add, or delete an info key. + Viewing is identical to running the command with no arguments. + + If you want to modify the value of a key, Supercite will first + prompt you (with completion) for the key of the value you want to + change. It will then put you in the minibuffer with the key's + current value so you can edit the value as you wish. When you hit + RET, the key's value is changed. For those of you running Emacs + 19, minibuffer history is kept for the values. + + If you choose to delete a key-value pair, Supercite will prompt + you (with completion) for the key to delete. + + If you choose to add a new key-value pair, Supercite firsts + prompts you for the key to add. Note that completion is turned on + for this prompt, but you can type any key name here, even one that + does not yet exist. After entering the key, Supercite prompts you + for the key's value. It is not an error to enter a key that + already exists, but the new value will override any old value. It + will not replace it though; if you subsequently delete the + key-value pair, the old value will reappear. + + `sc-mail-process-headers' (`C-c C-p g') + This command lets you re-initialize Supercite's info alist from + any set of mail headers in the region between `point' and `mark'. + This function is especially useful for replying to digest messages + where Supercite will initially set up its information for the + digest originator, but you want to cite each component article + with the real message author. Note that unless an error during + processing occurs, any old information is lost. + +  + File: sc.info, Node: Miscellaneous Commands, Next: Information Keys and the Info Alist, Prev: Mail Field Commands, Up: Post-yank Formatting Commands + + Miscellaneous Commands + ====================== + + `sc-open-line' (`C-c C-p o') + Similar to Emacs' standard `open-line' commands, but inserts the + citation string in front of the new line. As with `open-line', an + optional numeric argument inserts that many new lines. + + `sc-describe' (`C-c C-p h' and `C-c C-p ?') + This function has been obsoleted by the TeXinfo manual you are now + reading. It is still provided for compatibility, but it will + eventually go away. + + `sc-version' (`C-c C-p v') + Echos the version of Supercite you are using. With the optional + universal argument (`C-u'), this command inserts the version + information into the current buffer. + + `sc-submit-bug-report' (`C-c C-p C-b') + If you encounter a bug, or wish to suggest an enhancement, use this + command to set up an outgoing mail buffer, with the proper address + to the Supercite maintainer automatically inserted in the `To:' + field. This command also inserts information that the Supercite + maintainer can use to recreate your exact setup, making it easier + to verify your bug. + +  + File: sc.info, Node: Hints to MUA Authors, Next: Version 3 Changes, Prev: Electric References, Up: Top + + Hints to MUA Authors + ******************** + + In June of 1989, some discussion was held between the various MUA + authors, the Supercite author, and other Supercite users. These + discussions centered around the need for a standard interface between + MUAs and Supercite (or any future Supercite-like packages). This + interface was formally proposed by Martin Neitzel on Fri, 23 Jun 89, in + a mail message to the Supercite mailing list: + + Martin> Each news/mail-reader should provide a form of + Martin> mail-yank-original that + + Martin> 1: inserts the original message incl. header into the + Martin> reply buffer; no indentation/prefixing is done, the header + Martin> tends to be a "full blown" version rather than to be + Martin> stripped down. + + Martin> 2: `point' is at the start of the header, `mark' at the + Martin> end of the message body. + + Martin> 3: (run-hooks 'mail-yank-hooks) + + Martin> [Supercite] should be run as such a hook and merely + Martin> rewrite the message. This way it isn't anymore + Martin> [Supercite]'s job to gather the original from obscure + Martin> sources. [...] + + This specification was adopted, but with the recent release of FSF + GNU Emacs 19, it has undergone a slight modification. Instead of the + variable `mail-yank-hooks', the new preferred hook variable that the + MUA should provide is `mail-citation-hook'. `mail-yank-hooks' can be + provided for backward compatibility, but `mail-citation-hook' should + always take precedence. Richard Stallman (of the FSF) suggests that + the MUAs should `defvar' `mail-citation-hook' to `nil' and perform some + default citing when that is the case. Take a look at Emacs 19's + `sendmail.el' file, specifically the `mail-yank-original' defun for + details. + + If you are writing a new MUA package, or maintaining an existing MUA + package, you should make it conform to this interface so that your users + will be able to link Supercite easily and seamlessly. To do this, when + setting up a reply or forward buffer, your MUA should follow these + steps: + + 1. Insert the original message, including the mail headers into the + reply buffer. At this point you should not modify the raw text in + any way, and you should place all the original headers into the + body of the reply. This means that many of the mail headers will + be duplicated, one copy above the `mail-header-separator' line and + one copy below, however there will probably be more headers below + this line. + + 2. Set `point' to the beginning of the line containing the first mail + header in the body of the reply. Set `mark' at the end of the + message text. It is very important that the region be set around + the text Supercite is to modify and that the mail headers are + within this region. Supercite will not venture outside the region + for any reason, and anything within the region is fair game, so + don't put anything that *must* remain unchanged inside the region. + Further note that for Emacs 19, the region need not be set + active. Supercite will work properly when the region is inactive, + as should any other like-minded package. + + 3. Run the hook `mail-citation-hook'. You will probably want to + provide some kind of default citation functions in cases where the + user does not have Supercite installed. By default, your MUA + should `defvar' `mail-citation-hook' to `nil', and in your yanking + function, check its value. If it finds `mail-citation-hook' to be + `nil', it should perform some default citing behavior. User who + want to connect to Supercite then need only add `sc-cite-original' + to this list of hooks using `add-hook'. + + If you do all this, your users will not need to overload your + routines to use Supercite, and your MUA will join the ranks of those + that conform to this interface "out of the box." + +  + File: sc.info, Node: Version 3 Changes, Next: Thanks and History, Prev: Hints to MUA Authors, Up: Top + + Version 3 Changes + ***************** + + With version 3, Supercite has undergone an almost complete rewrite, + and has hopefully benefitted in a number of ways, including vast + improvements in the speed of performance, a big reduction in size of the + code and in the use of Emacs resources, and a much cleaner and flexible + internal architecture. The central construct of the info alist, and its + role in Supercite has been expanded, and the other central concept, the + general package Regi, was developed to provide a theoretically unlimited + flexibility. + + But most of this work is internal and not of very great importance + to the casual user. There have been some changes at the user-visible + level, but for the most part, the Supercite configuration variables from + version 2 should still be relevant to version 3. Below, I briefly + outline those user-visible things that have changed since version 2. For + details, look to other sections of this manual. + + 1. Supercite proper now comes in a single file, `supercite.el', which + contains everything except the unsupported noodlings, overloading + (which should be more or less obsolete with the release of Emacs + 19), and the general lisp packages `reporter.el' and `regi.el'. + Finally, the TeXinfo manual comes in its own file as well. In + particular, the file `sc.el' from the version 2 distribution is + obsolete, as is the file `sc-elec.el'. + + 2. `sc-spacify-name-chars' is gone in version 3. + + 3. `sc-nickname-alist' is gone in version 3. The + `sc-attrib-selection-list' is a more general construct supporting + the same basic feature. + + 4. The version 2 variable `sc-preferred-attribution' has been changed + to `sc-preferred-attribution-list', and has been expanded upon to + allow you to specify an ordered list of preferred attributions. + + 5. `sc-mail-fields-list' has been removed, and header nuking in + general has been greatly improved, giving you wider flexibility in + specifying which headers to keep and remove while presenting a + simplified interface to commonly chosen defaults. + + 6. Post-yank paragraph filling has been completely removed from + Supercite, other packages just do it better than Supercite ever + would. Supercite will still fill newly cited paragraphs. + + 7. The variable `sc-all-but-cite-p' has been replaced by + `sc-cite-region-limit'. + + 8. Keymap hacking in the reply buffer has been greatly simplified, + with, I believe, little reduction in functionality. + + 9. Hacking of the reply buffer's docstring has been completely + eliminated. + +  + File: sc.info, Node: Thanks and History, Next: The Supercite Mailing List, Prev: Version 3 Changes, Up: Top + + Thanks and History + ****************** + + The Supercite package was derived from its predecessor Superyank 1.11 + which was inspired by various bits of code and ideas from Martin Neitzel + and Ashwin Ram. They were the folks who came up with the idea of + non-nested citations and implemented some rough code to provide this + style. Superyank and Supercite version 2 evolved to the point where much + of the attribution selection mechanism was automatic, and features have + been continuously added through the comments and suggestions of the + Supercite mailing list participants. Supercite version 3 represents a + nearly complete rewrite with many of the algorithms and coding styles + being vastly improved. Hopefully Supercite version 3 is faster, + smaller, and much more flexible than its predecessors. + + In the version 2 manual I thanked some specific people for their + help in developing Supercite 2. You folks know who you are and your + continued support is greatly appreciated. I wish to thank everyone on + the Supercite mailing list, especially the brave alpha testers, who + helped considerably in testing out the concepts and implementation of + Supercite version 3. Special thanks go out to the MUA and Emacs + authors Kyle Jones, Stephen Gildea, Richard Stallman, and Jamie + Zawinski for coming to a quick agreement on the new + `mail-citation-hook' interface, and for adding the magic lisp to their + code to support this. + + All who have helped and contributed have been greatly appreciated. + +  + File: sc.info, Node: The Supercite Mailing List, Next: Concept Index, Prev: Thanks and History, Up: Top + + The Supercite Mailing List + ************************** + + The author runs a simple mail expanding mailing list for discussion + of issues related to Supercite. This includes enhancement requests, bug + reports, general help questions, etc. To subscribe or unsubscribe to + the mailing list, send a request to the administrative address: + + Internet: supercite-request@anthem.nlm.nih.gov + UUCP: uunet!anthem.nlm.nih.gov!supercite-request + + Please be sure to include the most reliable and shortest (preferably + Internet) address back to you. To post articles to the list, send your + message to this address (you do not need to be a member to post, but be + sure to indicate this in your article or replies may not be CC'd to + you): + + Internet: supercite@anthem.nlm.nih.gov + UUCP: uunet!anthem.nlm.nih.gov!supercite + + If you are sending bug reports, they should go to the following + address, but *please*! use the command `sc-submit-bug-report' since it + will be much easier for me to duplicate your problem if you do so. It + will set up a mail buffer automatically with this address on the `To:' + line: + + Internet: supercite-help@anthem.nlm.nih.gov + UUCP: uunet!anthem.nlm.nih.gov!supercite-help + +  + File: sc.info, Node: Concept Index, Next: Command Index, Prev: The Supercite Mailing List, Up: Top + + Concept Index + ************* + + * Menu: + + * .emacs file: Overloading for Non-conforming MUAs. + * .emacs file: Getting Connected. + * .emacs file: VM with any Emacsen. + * .emacs file: Emacs 19 MUAs. + * .emacs file: Emacs 18 MUAs. + * .emacs file: MH-E with any Emacsen. + * add-hook substitute: Emacs 18 MUAs. + * attribute, attributing: Usage Overview. + * attribution info field (sc-): Information Keys and the Info Alist. + * attribution list: Selecting an Attribution. + * attribution string: Citation Elements. + * author info field (sc-): Information Keys and the Info Alist. + * author names: Author Names. + * autoload: Getting Connected. + * citation: Citations. + * citation delimiter: Citation Elements. + * citation info field (sc-): Information Keys and the Info Alist. + * citation interface specification: Getting Connected. + * citation leader: Citation Elements. + * citation separator: Citation Elements. + * citation string: Citation Elements. + * cite, citing: Usage Overview. + * electric references: Electric References. + * emailname info field (sc-): Information Keys and the Info Alist. + * entries (Regi): Configuring the Citation Engine. + * filladapt: What Supercite Does. + * filladapt: Filling Cited Text. + * filling paragraphs: Filling Cited Text. + * firstname info field (sc-): Information Keys and the Info Alist. + * frames (Regi): Configuring the Citation Engine. + * from-address info field (sc-): Information Keys and the Info Alist. + * gin-mode: What Supercite Does. + * gin-mode: Filling Cited Text. + * header rewrite functions: Reference Headers. + * header rewrite functions, built-in: The Built-in Header Rewrite Functions. + * Hyperbole: Overloading for Non-conforming MUAs. + * Info Alist: Information Keys and the Info Alist. + * info alist: What Supercite Does. + * information extracted from mail fields: Information Keys and the Info Alist. + * information keys: Information Keys and the Info Alist. + * initials info field (sc-): Information Keys and the Info Alist. + * keymap prefix: Reply Buffer Initialization. + * lastname info field (sc-): Information Keys and the Info Alist. + * mail-citation-hook: MH-E with any Emacsen. + * mailing list address: The Supercite Mailing List. + * mark: Getting Connected. + * middlename-1 info field (sc-): Information Keys and the Info Alist. + * modeline: Reply Buffer Initialization. + * modeline: What Supercite Does. + * MUA: Introduction. + * nested citations: Citations. + * non-nested citations: Citations. + * NUA: Introduction. + * nuking mail headers: What Supercite Does. + * overloading: Emacs 18 MUAs. + * overloading: Overloading for Non-conforming MUAs. + * point: Getting Connected. + * reciting: Frames You Can Customize. + * reference header: What Supercite Does. + * reference headers: Reference Headers. + * Regi: Configuring the Citation Engine. + * regi.el file: Version 3 Changes. + * reply-address info field (sc-): Information Keys and the Info Alist. + * reporter.el file: Version 3 Changes. + * sc-attribution info field: Information Keys and the Info Alist. + * sc-author info field: Information Keys and the Info Alist. + * sc-citation info field: Information Keys and the Info Alist. + * sc-elec.el from version 2: Version 3 Changes. + * sc-emailname info field: Information Keys and the Info Alist. + * sc-firstname info field: Information Keys and the Info Alist. + * sc-from-address info field: Information Keys and the Info Alist. + * sc-initials info field: Information Keys and the Info Alist. + * sc-lastname info field: Information Keys and the Info Alist. + * sc-middlename-1 info field: Information Keys and the Info Alist. + * sc-oloads.el: Overloading for Non-conforming MUAs. + * sc-reply-address info field: Information Keys and the Info Alist. + * sc-sender-address info field: Information Keys and the Info Alist. + * sc-unsupp.el file: Version 3 Changes. + * sc-unsupp.el file: Emacs 18 MUAs. + * sc.el from version 2: Version 3 Changes. + * sender-address info field (sc-): Information Keys and the Info Alist. + * sendmail.el: Hints to MUA Authors. + * sendmail.el file: Emacs 18 MUAs. + * setq as a substitute for add-hook: Emacs 18 MUAs. + * supercite mailing list address: The Supercite Mailing List. + * supercite.el file: Version 3 Changes. + * toggling variables: Variable Toggling Shortcuts. + * unciting: Frames You Can Customize. + * undo boundary: Reply Buffer Initialization. + * yank: Usage Overview. + +  + File: sc.info, Node: Command Index, Next: Key Index, Prev: Concept Index, Up: Top + + Command Index + ************* + + Since all supercite commands are prepended with the string "`sc-'", + each appears under its `sc-'COMMAND name and its COMMAND name. + + * Menu: + + * add-hook: Emacs 18 MUAs. + * add-hook: MH-E with any Emacsen. + * cite-original (sc-): Getting Connected. + * cite-original (sc-): Reply Buffer Initialization. + * cite-region (sc-): Citing Commands. + * defvar: Hints to MUA Authors. + * describe (sc-): Miscellaneous Commands. + * eref-abort (sc-): Electric References. + * eref-exit (sc-): Electric References. + * eref-goto (sc-): Electric References. + * eref-jump (sc-): Electric References. + * eref-next (sc-): Electric References. + * eref-prev (sc-): Electric References. + * eref-setn (sc-): Electric References. + * eval: Using Regi. + * fill-paragraph: What Supercite Does. + * header-attributed-writes (sc-): The Built-in Header Rewrite Functions. + * header-author-writes (sc-): The Built-in Header Rewrite Functions. + * header-inarticle-writes (sc-): The Built-in Header Rewrite Functions. + * header-on-said (sc-): The Built-in Header Rewrite Functions. + * header-regarding-adds (sc-): The Built-in Header Rewrite Functions. + * header-verbose (sc-): The Built-in Header Rewrite Functions. + * insert-citation (sc-): Insertion Commands. + * insert-reference (sc-): Insertion Commands. + * looking-at: Using Regi. + * mail-field (sc-): Attribution Preferences. + * mail-field (sc-): Information Keys and the Info Alist. + * mail-field-query (sc-): Mail Field Commands. + * mail-process-headers (sc-): Mail Field Commands. + * mail-yank-original: Hints to MUA Authors. + * no-blank-line-or-header (sc-): The Built-in Header Rewrite Functions. + * no-header (sc-): The Built-in Header Rewrite Functions. + * open-line: Miscellaneous Commands. + * open-line (sc-): Miscellaneous Commands. + * perform-overloads (sc-): GNEWS with any Emacsen. + * recite-region (sc-): Citing Commands. + * regi-interpret: Using Regi. + * sc-cite-original: Reply Buffer Initialization. + * sc-cite-original: What Supercite Does. + * sc-cite-original: Getting Connected. + * sc-cite-region: Citing Commands. + * sc-describe: Miscellaneous Commands. + * sc-eref-abort: Electric References. + * sc-eref-exit: Electric References. + * sc-eref-goto: Electric References. + * sc-eref-jump: Electric References. + * sc-eref-next: Electric References. + * sc-eref-prev: Electric References. + * sc-eref-setn: Electric References. + * sc-header-attributed-writes: The Built-in Header Rewrite Functions. + * sc-header-author-writes: The Built-in Header Rewrite Functions. + * sc-header-inarticle-writes: The Built-in Header Rewrite Functions. + * sc-header-on-said: The Built-in Header Rewrite Functions. + * sc-header-regarding-adds: The Built-in Header Rewrite Functions. + * sc-header-verbose: The Built-in Header Rewrite Functions. + * sc-insert-citation: Insertion Commands. + * sc-insert-reference: Insertion Commands. + * sc-mail-field: Information Keys and the Info Alist. + * sc-mail-field: Attribution Preferences. + * sc-mail-field-query: Mail Field Commands. + * sc-mail-process-headers: Mail Field Commands. + * sc-no-blank-line-or-header: The Built-in Header Rewrite Functions. + * sc-no-header: The Built-in Header Rewrite Functions. + * sc-open-line: Miscellaneous Commands. + * sc-perform-overloads: Overloading for Non-conforming MUAs. + * sc-perform-overloads: GNEWS with any Emacsen. + * sc-recite-region: Citing Commands. + * sc-setup-filladapt: Filling Cited Text. + * sc-submit-bug-report: Miscellaneous Commands. + * sc-submit-bug-report: Getting Connected. + * sc-uncite-region: Citing Commands. + * sc-version: Miscellaneous Commands. + * set-variable: Variable Toggling Shortcuts. + * setq: Emacs 18 MUAs. + * setup-filladapt (sc-): Filling Cited Text. + * string-match: Frames You Can Customize. + * submit-bug-report (sc-): Getting Connected. + * submit-bug-report (sc-): Miscellaneous Commands. + * uncite-region (sc-): Citing Commands. + * version (sc-): Miscellaneous Commands. + diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/info/sc.info-3 emacs-19.20/info/sc.info-3 *** emacs-19.19/info/sc.info-3 --- emacs-19.20/info/sc.info-3 Tue Nov 9 02:34:30 1993 *************** *** 0 **** --- 1,191 ---- + This is Info file ../info/sc.info, produced by Makeinfo-1.54 from the + input file sc.texi. + + This document describes the Supercite Version 3.1 package for citing + and attributing the replies for various GNU Emacs mail and news reading + subsystems. + + Copyright (C) 1993 Barry A. Warsaw + + Permission is granted to make and distribute verbatim copies of this + manual provided the copyright notice and this permission notice are + preserved on all copies. + +  + File: sc.info, Node: Key Index, Next: Variable Index, Prev: Command Index, Up: Top + + Key Index + ********* + + * Menu: + + * C-c C-p: Post-yank Formatting Commands. + * C-c C-p: Reply Buffer Initialization. + * C-c C-p ?: Miscellaneous Commands. + * C-c C-p c: Citing Commands. + * C-c C-p C-b: Miscellaneous Commands. + * C-c C-p C-p: Variable Toggling Shortcuts. + * C-c C-p C-p: Filling Cited Text. + * C-c C-p C-t: Variable Toggling Shortcuts. + * C-c C-p f: Mail Field Commands. + * C-c C-p f: Mail Field Commands. + * C-c C-p g: Mail Field Commands. + * C-c C-p h: Miscellaneous Commands. + * C-c C-p i: Insertion Commands. + * C-c C-p o: Miscellaneous Commands. + * C-c C-p r: Citing Commands. + * C-c C-p u: Citing Commands. + * C-c C-p v: Miscellaneous Commands. + * C-c C-p w: Insertion Commands. + * C-c C-y: Usage Overview. + * C-u: Citing Commands. + * f: Usage Overview. + * g: Electric References. + * j: Electric References. + * LFD: Electric References. + * n: Electric References. + * p: Electric References. + * q: Electric References. + * r: Usage Overview. + * RET: Electric References. + * s: Electric References. + * x: Electric References. + +  + File: sc.info, Node: Variable Index, Prev: Key Index, Up: Top + + Variable Index + ************** + + Since all supercite variables are prepended with the string "`sc-'", + each appears under its `sc-'VARIABLE name and its VARIABLE name. + + * Menu: + + * attrib-selection-list: Version 3 Changes. + * attrib-selection-list (sc-): Attribution Preferences. + * attrib-selection-list (sc-): Attribution Preferences. + * attribs-postselect-hook (sc-): Anonymous Attributions. + * attribs-preselect-hook (sc-): Anonymous Attributions. + * auto-fill-region-p (sc-): Filling Cited Text. + * blank-lines-after-headers (sc-): Reply Buffer Initialization. + * citation-delimiter (sc-): Citation Elements. + * citation-delimiter-regexp (sc-): Recognizing Citations. + * citation-leader (sc-): Citation Elements. + * citation-leader-regexp (sc-): Recognizing Citations. + * citation-nonnested-root-regexp (sc-): Recognizing Citations. + * citation-root-regexp (sc-): Recognizing Citations. + * citation-separator (sc-): Citation Elements. + * citation-separator-regexp (sc-): Recognizing Citations. + * cite-blank-lines-p (sc-): Reply Buffer Initialization. + * cite-region-limit: Version 3 Changes. + * cite-region-limit (sc-)b: Reply Buffer Initialization. + * confirm-always-p: Citing Commands. + * confirm-always-p (sc-): Reply Buffer Initialization. + * confirm-always-p (sc-): Anonymous Attributions. + * confirm-always-p (sc-): Citing Commands. + * default-attribution (sc-): Anonymous Attributions. + * default-author-name (sc-): Anonymous Attributions. + * downcase-p (sc-): Anonymous Attributions. + * electric-circular-p (sc-): Electric References. + * electric-mode-hook (sc-): Electric References. + * electric-references-p (sc-): Electric References. + * fill-prefix: What Supercite Does. + * fill-prefix: Filling Cited Text. + * fixup-whitespace-p (sc-): Filling Cited Text. + * gnews-ready-hook: GNEWS with any Emacsen. + * hyperb:version: Overloading for Non-conforming MUAs. + * load-hook (sc-): Filling Cited Text. + * load-hook (sc-): Getting Connected. + * mail-citation-hook: Overloading for Non-conforming MUAs. + * mail-citation-hook: Emacs 19 MUAs. + * mail-citation-hook: VM with any Emacsen. + * mail-citation-hook: Hints to MUA Authors. + * mail-citation-hook: Emacs 18 MUAs. + * mail-header-separator: What Supercite Does Not Do. + * mail-warn-if-non-rfc822-p (sc-): Reply Buffer Initialization. + * mail-yank-hooks: Hints to MUA Authors. + * mail-yank-hooks: VM with any Emacsen. + * mh-yank-from-start-of-msg: MH-E with any Emacsen. + * mh-yank-hooks: MH-E with any Emacsen. + * mode-map-prefix (sc-): Reply Buffer Initialization. + * mode-map-prefix (sc-): Post-yank Formatting Commands. + * mumble (sc-): Information Keys and the Info Alist. + * name-filter-alist (sc-): Author Names. + * nested-citation-p (sc-): Citations. + * news-reply-mode-hook: GNEWS with any Emacsen. + * news-reply-mode-hook: Overloading for Non-conforming MUAs. + * nuke-mail-header-list (sc-): Reply Buffer Initialization. + * nuke-mail-headers (sc-): Reply Buffer Initialization. + * post-hook (sc-): Reply Buffer Initialization. + * pre-cite-hook (sc-): Citing Commands. + * pre-hook (sc-): Reply Buffer Initialization. + * pre-hook (sc-): Getting Connected. + * preferred-attribution-list (sc-): Selecting an Attribution. + * preferred-header-style (sc-): Reference Headers. + * preferred-header-style (sc-): Insertion Commands. + * reference-tag-string (sc-): The Built-in Header Rewrite Functions. + * rewrite-header-list (sc-): Reference Headers. + * sc-attrib-selection-list: Attribution Preferences. + * sc-attrib-selection-list: Attribution Preferences. + * sc-attrib-selection-list: Version 3 Changes. + * sc-attribs-postselect-hook: Anonymous Attributions. + * sc-attribs-preselect-hook: Anonymous Attributions. + * sc-auto-fill-region-p: Filling Cited Text. + * sc-blank-lines-after-headers: Reply Buffer Initialization. + * sc-citation-delimiter: Citation Elements. + * sc-citation-delimiter-regexp: Recognizing Citations. + * sc-citation-leader: Citation Elements. + * sc-citation-leader-regexp: Recognizing Citations. + * sc-citation-nonnested-root-regexp: Recognizing Citations. + * sc-citation-root-regexp: Recognizing Citations. + * sc-citation-separator: Citation Elements. + * sc-citation-separator-regexp: Recognizing Citations. + * sc-cite-blank-lines-p: Reply Buffer Initialization. + * sc-cite-frame-alist: Frames You Can Customize. + * sc-cite-region-limit: Reply Buffer Initialization. + * sc-cite-region-limit: Citing Commands. + * sc-cite-region-limit: Version 3 Changes. + * sc-confirm-always-p: Anonymous Attributions. + * sc-confirm-always-p: Citing Commands. + * sc-confirm-always-p: Reply Buffer Initialization. + * sc-confirm-always-p: Citing Commands. + * sc-default-attribution: Anonymous Attributions. + * sc-default-author-name: Anonymous Attributions. + * sc-default-cite-frame: Frames You Can Customize. + * sc-default-recite-frame: Frames You Can Customize. + * sc-default-uncite-frame: Frames You Can Customize. + * sc-downcase-p: Anonymous Attributions. + * sc-electric-circular-p: Electric References. + * sc-electric-mode-hook: Electric References. + * sc-electric-references-p: Electric References. + * sc-fixup-whitespace-p: Filling Cited Text. + * sc-load-hook: Getting Connected. + * sc-load-hook: Filling Cited Text. + * sc-mail-field: Frames You Can Customize. + * sc-mail-warn-if-non-rfc822-p: Reply Buffer Initialization. + * sc-mode-map-prefix: Post-yank Formatting Commands. + * sc-mode-map-prefix: Reply Buffer Initialization. + * sc-mumble: Information Keys and the Info Alist. + * sc-name-filter-alist: Author Names. + * sc-nested-citation-p: Citations. + * sc-nuke-mail-header: Frames You Can Customize. + * sc-nuke-mail-header-list: Reply Buffer Initialization. + * sc-nuke-mail-headers: Reply Buffer Initialization. + * sc-post-hook: Reply Buffer Initialization. + * sc-pre-cite-hook: Citing Commands. + * sc-pre-hook: Reply Buffer Initialization. + * sc-pre-hook: Getting Connected. + * sc-preferred-attribution-list: Selecting an Attribution. + * sc-preferred-header-style: Reference Headers. + * sc-preferred-header-style: Insertion Commands. + * sc-recite-frame-alist: Frames You Can Customize. + * sc-reference-tag-string: The Built-in Header Rewrite Functions. + * sc-rewrite-header-list: Reference Headers. + * sc-titlecue-regexp: Author Names. + * sc-uncite-frame-alist: Frames You Can Customize. + * sc-use-only-preference-p: Anonymous Attributions. + * titlecue-regexp (sc-): Author Names. + * use-only-preference-p (sc-): Anonymous Attributions. + + diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lib-src/ChangeLog emacs-19.20/lib-src/ChangeLog *** emacs-19.19/lib-src/ChangeLog Sat Aug 14 19:04:32 1993 --- emacs-19.20/lib-src/ChangeLog Thu Nov 11 10:32:08 1993 *************** *** 1,2 **** --- 1,98 ---- + Thu Nov 11 10:08:43 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * Version 19.20 released. + + Mon Nov 8 19:56:20 MET 1993 Tom Hageman (tom@basil.icce.rug.nl) + + * etags.c: (C_entries): Keep track of ()-parenthesis level so that + functions returning a pointer to a function, a la `signal', can be + parsed. This also required new state `fstartlist' to `FUNCST'. + (SAVE_TOKEN, RESTORE_TOKEN, TOKEN_SAVED_P): 1-deep token save stack. + (C_entries, CNL): use it to isolate preprocessor directive processing + from the other state engines. + (begtk): add '~', for C++ class destructors. + + Tue Nov 2 19:46:52 1993 Francesco Potorti` (pot@cnuce.cnr.it) + + * etags.c (consider_token): removed unused variable firsttok. + (prolog_getit): call pfnote with the right number of arguments. + + Tue Oct 19 02:50:31 1993 Paul Eggert (eggert@twinsun.com) + + * rcs2log (printlogline): Don't generate lines containing only + white space. + + Mon Oct 4 00:31:33 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * Makefile.in (${archlibdir}): + Install ${SCRIPTS} from ${srcdir}, not cwd. + + Sun Oct 3 15:54:26 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * Makefile.in: Fixed typos or brainos of whoever thought `@' was + the comment character. + + Fri Oct 1 10:44:25 1993 Francesco Potorti` (pot@cnuce.cnr.it) + + * etags.c (process_file): dead code removed. + (S_ISREG): #define it using S_IFREG if not defined. + (process_file): regular files have nothing to do with symlinks. + + Tue Sep 28 14:10:32 1993 Brian Fox (bfox@ai.mit.edu) + + * Makefile.in (${archlibdir}): Install ${SCRIPTS} from ${srcdir}, not + from current directory. Only chmod and chgrp files that we + installed, which excludes ${INSTALLABLE_SCRIPTS}. They go in + ${bindir}. + (INSTALLFLAGS): Deleted definition, since it is an unused variable + now. + + Mon Sep 27 09:02:40 1993 Brian Fox (bfox@ai.mit.edu) + + * Makefile.in (INSTALL, INSTALL_PROGRAM, INSTALL_DATA): Let + configure figure out the correct values for these variables. + + Tue Sep 14 00:55:44 1993 Brian Fox (bfox@ai.mit.edu) + + * Makefile.in (archlibdir): Only install execuatables internally + used by emacs; don't install bindir binaries here. + + Fri Sep 24 01:03:32 1993 Paul Eggert (eggert@twinsun.com) + + * rcs2log: Add -h, -n, -r options. + By default, look for *,v files as well as RCS/*,v files. + Use $TMPDIR (default /tmp) instead of /tmp. + + Mon Sep 20 18:06:12 1993 Francesco Potorti` (pot at fly) + + * etags.c (C_entries): is_func is initialised here instead of in + consider_token for the sake of the yacc rules section. + (C_entries): Now class, struct, enum, union and typedef produce + named tags. + + Sat Sep 11 21:37:09 1993 Roland McGrath (roland@baalperazim.gnu.ai.mit.edu) + + * yow.c: Include , instead of "src/paths.h". + + Fri Sep 10 00:47:13 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * Support configuring in a different directory when ${srcdir} has + already been configured. + * Makefile.in (ALL_CFLAGS, CPP_CFLAGS): Put -I. -I../src before + -I${srcdir} -I${srcdir}/../src. + (b2m, movemail, fakemail, env, emacsserver, emacsclient, + getdate.o, timer.o, timer): Remove `-I${srcdir}/../src', since it + is already in CPP_FLAGS. + * etags.c, emacsclient.c, wakeup.c, timer.c, b2m.c, fakemail.c, + movemail.c, emacsserver.c: Include instead of "config.h". + + Wed Aug 25 01:19:33 1993 Paul Eggert (eggert@twinsun.com) + + * rcs2log: Change /{/ to /\{/ for Posix ERE compatibility; + otherwise, HP awk complains. + + * vcdiff: Append /usr/ccs/bin and /usr/sccs to PATH, since these + are common hangouts for SCCS commands. + Sat Aug 14 00:23:11 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lib-src/Makefile.in emacs-19.20/lib-src/Makefile.in *** emacs-19.19/lib-src/Makefile.in Thu Aug 12 18:23:48 1993 --- emacs-19.20/lib-src/Makefile.in Mon Oct 4 00:31:27 1993 *************** *** 13,26 **** SHELL = /bin/sh ! # ==================== Things `configure' might edit ==================== ! CC=cc ! CFLAGS=-g ! ALLOCA= ! C_SWITCH_SYSTEM= ! LOADLIBES= ! YACC=yacc ! version=version-not-set ! configname=configuration-name-not-set # ==================== Where To Install Things ==================== --- 13,26 ---- SHELL = /bin/sh ! # ==================== Things `configure' will edit ==================== ! CC=@CC@ ! CFLAGS=@CFLAGS@ ! ALLOCA=@ALLOCA@ ! C_SWITCH_SYSTEM=@c_switch_system@ ! LOADLIBES=@libsrc_libs@ ! YACC=@YACC@ ! version=@version@ ! configname=@configuration@ # ==================== Where To Install Things ==================== *************** *** 29,54 **** # subdirectories of this directory. The default values for many of # the variables below are expressed in terms of this one, so you may ! # not need to change them. ! prefix=/usr/local - # Like `prefix', but used for architecture-specific files. - exec_prefix=${prefix} - # Where to install Emacs and other binaries that people will want to ! # run directly (like etags). ! bindir=${exec_prefix}/bin # Where to install and expect executable files to be run by Emacs # rather than directly by users, and other architecture-dependent ! # data. ${archlibdir} is usually below this. ! libdir=${exec_prefix}/lib ! ! # Where to find the source code. This is ! # set by the configure script's `--srcdir' option. ! # However, the value of ${srcdir} in this makefile ! # is not identical to what was specified with --srcdir. ! # The variable here has `/lib-src' added at the end. ! srcdir=@srcdir@/lib-src ! VPATH=@srcdir@/lib-src # ==================== Emacs-specific directories ==================== --- 29,57 ---- # subdirectories of this directory. The default values for many of # the variables below are expressed in terms of this one, so you may ! # not need to change them. This is set with the --prefix option to ! # `../configure'. ! prefix=@prefix@ ! ! # Like `prefix', but used for architecture-specific files. This is ! # set with the --exec-prefix option to `../configure'. ! exec_prefix=@exec_prefix@ # Where to install Emacs and other binaries that people will want to ! # run directly (like etags). This is set with the --bindir option ! # to `../configure'. ! bindir=@bindir@ # Where to install and expect executable files to be run by Emacs # rather than directly by users, and other architecture-dependent ! # data. ${archlibdir} is usually below this. This is set with the ! # --libdir option to `../configure'. ! libdir=@libdir@ ! ! # Where to find the source code. This is set by the configure ! # script's `--srcdir' option. However, the value of ${srcdir} in ! # this makefile is not identical to what was specified with --srcdir, ! # since the variable here has `/lib-src' added at the end. ! srcdir=@srcdir@ ! VPATH=@srcdir@ # ==================== Emacs-specific directories ==================== *************** *** 60,83 **** # This path usually includes the Emacs version and configuration name, # so that multiple configurations for multiple versions of Emacs may ! # be installed at once. ! archlibdir=${libdir}/emacs/${version}/${configname} ! ! # ====================== Developer's configuration ======================= ! ! # The following assignments make sense if you're running Emacs on a single ! # machine, one version at a time, and you want changes to the lisp and etc ! # directories in the source tree to show up immediately in your working ! # environment. It saves a great deal of disk space by not duplicating the ! # lisp and etc directories. ! # ! # archlibdir=${srcdir}/bin # ==================== Utility Programs for the Build ==================== ! # Allow the user to specify the install program. ! INSTALL = install ! INSTALLFLAGS = -c ! INSTALL_PROGRAM = ${INSTALL} ! INSTALL_DATA = ${INSTALL} # ============================= Targets ============================== --- 63,76 ---- # This path usually includes the Emacs version and configuration name, # so that multiple configurations for multiple versions of Emacs may ! # be installed at once. This can be set with the --archlibdir option ! # to `../configure'. ! archlibdir=@archlibdir@ # ==================== Utility Programs for the Build ==================== ! # ../configure figures out the correct values for these. ! INSTALL = @INSTALL@ ! INSTALL_PROGRAM = @INSTALL_PROGRAM@ ! INSTALL_DATA = @INSTALL_DATA@ # ============================= Targets ============================== *************** *** 106,112 **** ### the information in ../src/config.h. ALL_CFLAGS = ${C_SWITCH_SYSTEM} -Demacs -DHAVE_CONFIG_H \ ! -I${srcdir} -I${srcdir}/../src -I. -I../src ${CFLAGS} CPP_CFLAGS = ${C_SWITCH_SYSTEM} -Demacs -DHAVE_CONFIG_H \ ! -I${srcdir} -I${srcdir}/../src -I. -I../src ${CPPFLAGS} ${CFLAGS} # This is the default compilation command. # But we should never rely on it, because some make version --- 99,105 ---- ### the information in ../src/config.h. ALL_CFLAGS = ${C_SWITCH_SYSTEM} -Demacs -DHAVE_CONFIG_H \ ! -I. -I../src -I${srcdir} -I${srcdir}/../src ${CFLAGS} CPP_CFLAGS = ${C_SWITCH_SYSTEM} -Demacs -DHAVE_CONFIG_H \ ! -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS} # This is the default compilation command. # But we should never rely on it, because some make version *************** *** 124,134 **** ./make-path ${archlibdir} if [ `(cd ${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \ ! for file in ${UTILITIES} ${INSTALLABLES}; do \ ! cp $${file} ${archlibdir} ; \ ! chmod 755 ${archlibdir}/$${file} ; \ done ; \ ! cd ${srcdir}; for file in ${SCRIPTS} ${INSTALLABLE_SCRIPTS}; do \ ! cp $${file} ${archlibdir} ; \ ! chmod 755 ${archlibdir}/$${file} ; \ done ; \ fi --- 117,127 ---- ./make-path ${archlibdir} if [ `(cd ${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \ ! for file in ${UTILITIES}; do \ ! $(INSTALL_PROGRAM) $$file ${archlibdir}/$$file ; \ ! chmod 755 ${archlibdir}/$$file ; \ done ; \ ! for file in ${SCRIPTS}; do \ ! $(INSTALL_PROGRAM) ${srcdir}/$$file ${archlibdir}/$$file ; \ ! chmod 755 ${archlibdir}/$$file ; \ done ; \ fi *************** *** 136,140 **** @echo "Changing the owner and group of Emacs's utility programs to \`bin'." @echo "(You may ignore errors here if you don't care about this.)" ! -for file in ${EXECUTABLES} ; do \ chgrp bin ${archlibdir}/$${file} ; \ chown bin ${archlibdir}/$${file} ; \ --- 129,133 ---- @echo "Changing the owner and group of Emacs's utility programs to \`bin'." @echo "(You may ignore errors here if you don't care about this.)" ! -for file in ${UTILITIES} ${SCRIPTS} ; do \ chgrp bin ${archlibdir}/$${file} ; \ chown bin ${archlibdir}/$${file} ; \ *************** *** 232,239 **** b2m: ${srcdir}/b2m.c ../src/config.h ! $(CC) -I${srcdir}/../src ${CPP_CFLAGS} ${srcdir}/b2m.c $(LOADLIBES) -o b2m movemail: ${srcdir}/movemail.c ../src/config.h ! $(CC) -I${srcdir}/../src ${CPP_CFLAGS} ${srcdir}/movemail.c $(LOADLIBES) -o movemail cvtmail: ${srcdir}/cvtmail.c --- 225,232 ---- b2m: ${srcdir}/b2m.c ../src/config.h ! $(CC) ${CPP_CFLAGS} ${srcdir}/b2m.c $(LOADLIBES) -o b2m movemail: ${srcdir}/movemail.c ../src/config.h ! $(CC) ${CPP_CFLAGS} ${srcdir}/movemail.c $(LOADLIBES) -o movemail cvtmail: ${srcdir}/cvtmail.c *************** *** 241,245 **** fakemail: ${srcdir}/fakemail.c ../src/config.h ! $(CC) -I${srcdir}/../src ${CPP_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail yow: ${srcdir}/yow.c ../src/paths.h --- 234,238 ---- fakemail: ${srcdir}/fakemail.c ../src/config.h ! $(CC) ${CPP_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail yow: ${srcdir}/yow.c ../src/paths.h *************** *** 247,257 **** env: ${srcdir}/env.c ../src/config.h ! $(CC) -DEMACS -I${srcdir}/../src ${CPP_CFLAGS} ${srcdir}/env.c $(LOADLIBES) -o env emacsserver: ${srcdir}/emacsserver.c ../src/config.h ! $(CC) -I${srcdir}/../src ${CPP_CFLAGS} ${srcdir}/emacsserver.c $(LOADLIBES) -o emacsserver emacsclient: ${srcdir}/emacsclient.c ../src/config.h ! $(CC) -I${srcdir}/../src ${CPP_CFLAGS} ${srcdir}/emacsclient.c $(LOADLIBES) -o emacsclient hexl: ${srcdir}/hexl.c --- 240,250 ---- env: ${srcdir}/env.c ../src/config.h ! $(CC) -DEMACS ${CPP_CFLAGS} ${srcdir}/env.c $(LOADLIBES) -o env emacsserver: ${srcdir}/emacsserver.c ../src/config.h ! $(CC) ${CPP_CFLAGS} ${srcdir}/emacsserver.c $(LOADLIBES) -o emacsserver emacsclient: ${srcdir}/emacsclient.c ../src/config.h ! $(CC) ${CPP_CFLAGS} ${srcdir}/emacsclient.c $(LOADLIBES) -o emacsclient hexl: ${srcdir}/hexl.c *************** *** 261,270 **** getdate.o: ${srcdir}/getdate.y ../src/config.h ${YACC} ${YFLAGS} ${srcdir}/getdate.y ! $(CC) -I${srcdir}/../src $(CPP_CFLAGS) -c y.tab.c mv y.tab.o getdate.o timer.o: ${srcdir}/timer.c ../src/config.h ! $(CC) -c -I${srcdir}/../src $(CPP_CFLAGS) ${srcdir}/timer.c timer: ${TIMEROBJS} ! $(CC) -I${srcdir}/../src $(ALL_CFLAGS) ${TIMEROBJS} $(LOADLIBES) -o timer make-path: ${srcdir}/make-path.c ../src/config.h --- 254,263 ---- getdate.o: ${srcdir}/getdate.y ../src/config.h ${YACC} ${YFLAGS} ${srcdir}/getdate.y ! $(CC) $(CPP_CFLAGS) -c y.tab.c mv y.tab.o getdate.o timer.o: ${srcdir}/timer.c ../src/config.h ! $(CC) -c $(CPP_CFLAGS) ${srcdir}/timer.c timer: ${TIMEROBJS} ! $(CC) $(ALL_CFLAGS) ${TIMEROBJS} $(LOADLIBES) -o timer make-path: ${srcdir}/make-path.c ../src/config.h diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lib-src/alloca.c emacs-19.20/lib-src/alloca.c *** emacs-19.19/lib-src/alloca.c Wed Aug 11 03:27:10 1993 --- emacs-19.20/lib-src/alloca.c Mon Sep 20 16:03:30 1993 *************** *** 23,31 **** #ifdef HAVE_CONFIG_H #include "config.h" #endif /* If compiling with GCC 2, this file's not needed. */ ! #if defined (__GNUC__) && __GNUC__ >= 2 /* If someone has defined alloca as a macro, there must be some other way alloca is supposed to work. */ --- 23,36 ---- #ifdef HAVE_CONFIG_H + #if defined (emacs) || defined (CONFIG_BROKETS) + #include + #else #include "config.h" #endif + #endif /* If compiling with GCC 2, this file's not needed. */ ! #if !defined (__GNUC__) || __GNUC__ < 2 ! /* If someone has defined alloca as a macro, there must be some other way alloca is supposed to work. */ diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lib-src/b2m.c emacs-19.20/lib-src/b2m.c *** emacs-19.19/lib-src/b2m.c Wed Aug 11 16:52:19 1993 --- emacs-19.20/lib-src/b2m.c Sun Sep 12 04:45:06 1993 *************** *** 20,24 **** #include ! #include "../src/config.h" #ifdef USG --- 20,24 ---- #include ! #include <../src/config.h> #ifdef USG diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lib-src/emacsclient.c emacs-19.20/lib-src/emacsclient.c *** emacs-19.19/lib-src/emacsclient.c Sun Aug 15 01:37:22 1993 --- emacs-19.20/lib-src/emacsclient.c Sun Sep 12 04:45:09 1993 *************** *** 20,24 **** #define NO_SHORTNAMES ! #include "../src/config.h" #undef read #undef write --- 20,24 ---- #define NO_SHORTNAMES ! #include <../src/config.h> #undef read #undef write diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lib-src/emacsserver.c emacs-19.20/lib-src/emacsserver.c *** emacs-19.19/lib-src/emacsserver.c Sun Aug 15 01:37:23 1993 --- emacs-19.20/lib-src/emacsserver.c Sun Sep 12 04:45:10 1993 *************** *** 26,30 **** #define NO_SHORTNAMES ! #include "../src/config.h" #undef read #undef write --- 26,30 ---- #define NO_SHORTNAMES ! #include <../src/config.h> #undef read #undef write diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lib-src/etags.c emacs-19.20/lib-src/etags.c *** emacs-19.19/lib-src/etags.c Sat Aug 14 02:38:15 1993 --- emacs-19.20/lib-src/etags.c Mon Nov 8 14:17:50 1993 *************** *** 25,32 **** * Gnu Emacs TAGS format and modifications by RMS? * Sam Kendall added C++. */ #ifdef HAVE_CONFIG_H ! #include "../src/config.h" #endif --- 25,34 ---- * Gnu Emacs TAGS format and modifications by RMS? * Sam Kendall added C++. + * + * Francesco Potorti` (pot@cnuce.cnr.it) is the current maintainer. 9.8 */ #ifdef HAVE_CONFIG_H ! #include <../src/config.h> #endif *************** *** 36,39 **** --- 38,45 ---- #include + #if !defined (S_ISREG) && defined (S_IFREG) + # define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) + #endif + #include "getopt.h" *************** *** 137,141 **** char *file; /* file name */ logical is_func; /* use pattern or line no */ ! logical rewritten; /* list name separately */ logical been_warned; /* set if noticed dup */ int lno; /* line number tag is on */ --- 143,147 ---- char *file; /* file name */ logical is_func; /* use pattern or line no */ ! logical named; /* list name separately */ logical been_warned; /* set if noticed dup */ int lno; /* line number tag is on */ *************** *** 158,162 **** char *xmalloc (); char *xrealloc (); ! int L_isdef (); int PF_funcs (); int total_size_of_entries (); --- 164,168 ---- char *xmalloc (); char *xrealloc (); ! int L_isdef (), L_isquote (); int PF_funcs (); int total_size_of_entries (); *************** *** 325,329 **** int len; LINENO lineno; ! logical rewritten; } TOKEN; --- 331,335 ---- int len; LINENO lineno; ! logical named; } TOKEN; *************** *** 348,352 **** *endtk = " \t\n\"'#()[]{}=-+%*/&|^~!<>;,.:?", /* token ending chars */ /* token starting chars */ ! *begtk = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz$", /* valid in-token chars */ *intk = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz$0123456789"; --- 354,358 ---- *endtk = " \t\n\"'#()[]{}=-+%*/&|^~!<>;,.:?", /* token ending chars */ /* token starting chars */ ! *begtk = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz$~", /* valid in-token chars */ *intk = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz$0123456789"; *************** *** 431,435 **** printf ("ETAGS "); #endif ! printf ("for Emacs version 19.0.\n"); exit (0); --- 437,441 ---- printf ("ETAGS "); #endif ! printf ("for Emacs version 19.\n"); exit (0); *************** *** 783,792 **** struct stat stat_buf; ! stat (file, &stat_buf); ! if (!(stat_buf.st_mode & S_IFREG) ! #ifdef S_IFLNK ! || !(stat_buf.st_mode & S_IFLNK) ! #endif ! ) { fprintf (stderr, "Skipping %s: it is not a regular file.\n", file); --- 789,793 ---- struct stat stat_buf; ! if (stat (file, &stat_buf) || !S_ISREG (stat_buf.st_mode)) { fprintf (stderr, "Skipping %s: it is not a regular file.\n", file); *************** *** 799,815 **** return; } - if (emacs_tags_format) - { - char *cp = etags_rindex (file, '/'); - if (cp) - ++cp; - else - cp = file; - } find_entries (file); if (emacs_tags_format) { ! fprintf (outf, "\f\n%s,%d\n", ! file, total_size_of_entries (head)); put_entries (head); free_tree (head); --- 800,807 ---- return; } find_entries (file); if (emacs_tags_format) { ! fprintf (outf, "\f\n%s,%d\n", file, total_size_of_entries (head)); put_entries (head); free_tree (head); *************** *** 992,999 **** /* Should take a TOKEN* instead!! */ void ! pfnote (name, is_func, rewritten, linestart, linelen, lno, cno) char *name; /* tag name */ logical is_func; /* function or type name? */ ! logical rewritten; /* tag different from text of definition? */ char *linestart; int linelen; --- 984,991 ---- /* Should take a TOKEN* instead!! */ void ! pfnote (name, is_func, named, linestart, linelen, lno, cno) char *name; /* tag name */ logical is_func; /* function or type name? */ ! logical named; /* tag different from text of definition? */ char *linestart; int linelen; *************** *** 1030,1039 **** if (fp && fp[1] != '\0' && fp[2] == '\0') *fp = 0; ! rewritten = TRUE; } np->name = savestr (name); np->file = curfile; np->is_func = is_func; ! np->rewritten = rewritten; np->lno = lno; /* UNCOMMENT THE +1 HERE: */ --- 1022,1031 ---- if (fp && fp[1] != '\0' && fp[2] == '\0') *fp = 0; ! named = TRUE; } np->name = savestr (name); np->file = curfile; np->is_func = is_func; ! np->named = named; np->lno = lno; /* UNCOMMENT THE +1 HERE: */ *************** *** 1173,1177 **** if (emacs_tags_format) { ! if (node->rewritten) { fprintf (outf, "%s\177%s\001%d,%d\n", --- 1165,1169 ---- if (emacs_tags_format) { ! if (node->named) { fprintf (outf, "%s\177%s\001%d,%d\n", *************** *** 1258,1262 **** total += strlen (node->pat) + 1; total += number_len ((long) node->lno) + 1 + number_len (node->cno) + 1; ! if (node->rewritten) total += 1 + strlen (node->name); /* \001name */ } --- 1250,1254 ---- total += strlen (node->pat) + 1; total += number_len ((long) node->lno) + 1 + number_len (node->cno) + 1; ! if (node->named) total += 1 + strlen (node->name); /* \001name */ } *************** *** 1333,1337 **** /* - * etags.c 4.2 1993/03/22 12:13:40 pot Exp * C functions are recognized using a simple finite automaton. * funcdef is its state variable. --- 1325,1328 ---- *************** *** 1339,1343 **** typedef enum { ! fnone, ftagseen, finlist, flistseen } FUNCST; FUNCST funcdef; --- 1330,1339 ---- typedef enum { ! fnone, /* nothing seen */ ! ftagseen, /* function-like tag seen */ ! fstartlist, /* just after open parenthesis */ ! finlist, /* in parameter list */ ! flistseen, /* after parameter list */ ! fignore, /* before open brace */ } FUNCST; FUNCST funcdef; *************** *** 1349,1353 **** typedef enum { ! tnone, ttypedseen, tinbody, tend } TYPEDST; TYPEDST typdef; --- 1345,1352 ---- typedef enum { ! tnone, /* nothing seen */ ! ttypedseen, /* typedef keyword seen */ ! tinbody, /* inside typedef body */ ! tend, /* just before typedef tag */ } TYPEDST; TYPEDST typdef; *************** *** 1366,1370 **** stagseen, /* struct-like tag seen */ scolonseen, /* colon seen after struct-like tag */ ! sinbody /* in struct body: recognize member func defs*/ } STRUCTST; STRUCTST structdef; --- 1365,1369 ---- stagseen, /* struct-like tag seen */ scolonseen, /* colon seen after struct-like tag */ ! sinbody, /* in struct body: recognize member func defs*/ } STRUCTST; STRUCTST structdef; *************** *** 1384,1388 **** dsharpseen, /* '#' seen as first char on line */ ddefineseen, /* '#' and 'define' seen */ ! dignorerest /* ignore rest of line */ } DEFINEST; DEFINEST definedef; --- 1383,1387 ---- dsharpseen, /* '#' seen as first char on line */ ddefineseen, /* '#' and 'define' seen */ ! dignorerest, /* ignore rest of line */ } DEFINEST; DEFINEST definedef; *************** *** 1413,1416 **** --- 1412,1424 ---- #define newlinepos (lbs[newndx].linepos) + /* Save and restore token state. This is used when preprocessor defines + are handled, to avoid disturbing active function/typedef/struct states. */ + #define TOKEN_SAVED_P (savetok.lineno > 0) + #define SAVE_TOKEN (savetok = tok, savetok.p = (char *) tokoff, \ + savetok.len = toklen, strcpy(savenameb, nameb)) + #define RESTORE_TOKEN (tok = savetok, tokoff = (int) tok.p, \ + toklen = tok.len, strcpy(nameb, savenameb), \ + savetok.lineno = 0) + #define CNL_SAVE_DEFINEDEF \ do { \ *************** *** 1426,1435 **** do { \ CNL_SAVE_DEFINEDEF; \ definedef = dnone; \ } while (FALSE) ! #define MAKE_TAG_FROM_NEW_LB(isfun) pfnote (tokb, isfun, tok.rewritten, \ newlb.buffer, tokoff + toklen + 1, tok.lineno, GET_CHARNO (newlinepos)) ! #define MAKE_TAG_FROM_OTH_LB(isfun) pfnote (tokb, isfun, tok.rewritten, \ othlb.buffer, tokoff + toklen + 1, tok.lineno, GET_CHARNO (othlinepos)) --- 1434,1445 ---- do { \ CNL_SAVE_DEFINEDEF; \ + if (TOKEN_SAVED_P) \ + RESTORE_TOKEN; \ definedef = dnone; \ } while (FALSE) ! #define MAKE_TAG_FROM_NEW_LB(isfun) pfnote (nameb, isfun, tok.named, \ newlb.buffer, tokoff + toklen + 1, tok.lineno, GET_CHARNO (newlinepos)) ! #define MAKE_TAG_FROM_OTH_LB(isfun) pfnote (nameb, isfun, tok.named, \ othlb.buffer, tokoff + toklen + 1, tok.lineno, GET_CHARNO (othlinepos)) *************** *** 1442,1452 **** int curndx, newndx; /* indices for current and new lb */ TOKEN tok; /* latest token read for funcdef & structdef */ ! char tokb[BUFSIZ]; /* latest token name for funcdef & structdef */ register int tokoff; /* offset in line of start of latest token */ register int toklen; /* length of latest token */ int cblev; /* current curly brace level */ logical incomm, inquote, inchar, quotednl, midtoken; logical cplpl; curndx = newndx = 0; lineno = 0; --- 1452,1467 ---- int curndx, newndx; /* indices for current and new lb */ TOKEN tok; /* latest token read for funcdef & structdef */ ! char nameb[BUFSIZ]; /* latest token name for funcdef & structdef */ register int tokoff; /* offset in line of start of latest token */ register int toklen; /* length of latest token */ int cblev; /* current curly brace level */ + int parlev; /* current parenthesis level */ logical incomm, inquote, inchar, quotednl, midtoken; logical cplpl; + TOKEN savetok; /* saved token during preprocessor handling */ + logical saveisfunc; + char savenameb[BUFSIZ]; /* ouch! */ + savetok.lineno = 0; curndx = newndx = 0; lineno = 0; *************** *** 1459,1462 **** --- 1474,1478 ---- midtoken = inquote = inchar = incomm = quotednl = FALSE; cblev = 0; + parlev = 0; cplpl = c_ext & C_PLPL; *************** *** 1525,1531 **** --- 1541,1551 ---- case '"': inquote = TRUE; + if (funcdef != finlist && funcdef != fignore) + funcdef = fnone; continue; case '\'': inchar = TRUE; + if (funcdef != finlist && funcdef != fignore) + funcdef = fnone; continue; case '/': *************** *** 1541,1545 **** break; } ! continue; case '%': if ((c_ext & YACC) && *lp == '%') --- 1561,1566 ---- break; } ! else ! break; case '%': if ((c_ext & YACC) && *lp == '%') *************** *** 1555,1558 **** --- 1576,1581 ---- continue; } + else + break; case '#': if (lp == newlb.buffer + 1 && definedef == dnone) *************** *** 1566,1570 **** || (cblev == 1 && cplpl && structdef == sinbody)) && definedef != dignorerest ! && funcdef != finlist) { if (midtoken) --- 1589,1594 ---- || (cblev == 1 && cplpl && structdef == sinbody)) && definedef != dignorerest ! && (funcdef != finlist ! || (definedef != dnone && definedef != dignorerest))) { if (midtoken) *************** *** 1572,1576 **** if (endtoken (c)) { ! if (cplpl && c == ':' && *lp == ':' && intoken (*(lp + 1))) { /* --- 1596,1600 ---- if (endtoken (c)) { ! if (cplpl && c == ':' && *lp == ':' && begtoken(*(lp + 1))) { /* *************** *** 1583,1592 **** else { ! logical is_func; tok.lineno = lineno; tok.p = newlb.buffer + tokoff; tok.len = toklen; ! tok.rewritten = FALSE; if (yacc_rules || consider_token (c, lp, &tok, --- 1607,1616 ---- else { ! logical is_func = FALSE; tok.lineno = lineno; tok.p = newlb.buffer + tokoff; tok.len = toklen; ! tok.named = FALSE; if (yacc_rules || consider_token (c, lp, &tok, *************** *** 1594,1613 **** { if (structdef == sinbody ! && definedef == dnone && is_func) ! { /* function defined in C++ class body */ ! sprintf (tokb, "%s::%.*s", ((structtag[0] == '\0') ? "_anonymous_" : structtag), tok.len, tok.p); - tok.rewritten = TRUE; } else { ! sprintf (tokb, "%.*s", tok.len, tok.p); } ! if (funcdef == ftagseen ! || structdef == stagseen || typdef == tend) { if (newndx == curndx) --- 1618,1644 ---- { if (structdef == sinbody ! && definedef == dnone ! && is_func) ! /* function defined in C++ class body */ ! { ! tok.named = TRUE; ! sprintf (nameb, "%s::%.*s", ((structtag[0] == '\0') ? "_anonymous_" : structtag), tok.len, tok.p); } else { ! sprintf (nameb, "%.*s", tok.len, tok.p); } ! if (structdef == stagseen || typdef == tend) + tok.named = TRUE; + + if (definedef == dnone + && (funcdef == ftagseen + || structdef == stagseen + || typdef == tend)) { if (newndx == curndx) *************** *** 1628,1642 **** else if (begtoken (c)) { ! switch (funcdef) { ! case flistseen: ! MAKE_TAG_FROM_OTH_LB (TRUE); ! /* FALLTHRU */ ! case ftagseen: ! funcdef = fnone; break; } - if (structdef == stagseen) - structdef = snone; if (!yacc_rules || lp == newlb.buffer + 1) { --- 1659,1696 ---- else if (begtoken (c)) { ! switch (definedef) { ! case dnone: ! switch (funcdef) ! { ! case fstartlist: ! funcdef = finlist; ! continue; ! case flistseen: ! MAKE_TAG_FROM_OTH_LB (TRUE); ! funcdef = fignore; ! break; ! case ftagseen: ! funcdef = fnone; ! break; ! } ! if (structdef == stagseen) ! structdef = snone; break; + case dsharpseen: + /* Take a quick peek ahead for define directive, + so we can avoid saving the token when not absolutely + necessary. [This is a speed hack.] */ + if (c == 'd' && strneq(lp, "efine", 5) + && iswhite(*(lp + 5))) + { + SAVE_TOKEN; + definedef = ddefineseen; + lp += 6; + } + else + definedef = dignorerest; + continue; } if (!yacc_rules || lp == newlb.buffer + 1) { *************** *** 1651,1667 **** /* Detect end of line, colon, comma, semicolon and various braces ! after having handled the last token on the line.*/ switch (c) { case ':': if (structdef == stagseen) structdef = scolonseen; ! else if (yacc_rules && funcdef == ftagseen) ! { ! MAKE_TAG_FROM_OTH_LB (FALSE); ! funcdef == fnone; ! } break; case ';': if (cblev == 0 && typdef == tend) { --- 1705,1734 ---- /* Detect end of line, colon, comma, semicolon and various braces ! after having handled a token.*/ switch (c) { case ':': + if (definedef != dnone) + break; if (structdef == stagseen) structdef = scolonseen; ! else ! switch (funcdef) ! { ! case ftagseen: ! if (yacc_rules) ! { ! MAKE_TAG_FROM_OTH_LB (FALSE); ! funcdef = fignore; ! } ! break; ! case fstartlist: ! funcdef = fnone; ! break; ! } break; case ';': + if (definedef != dnone) + break; if (cblev == 0 && typdef == tend) { *************** *** 1669,1678 **** MAKE_TAG_FROM_OTH_LB (FALSE); } ! funcdef = fnone; /* FALLTHRU */ case ',': /* FALLTHRU */ case '[': ! if (funcdef != finlist) funcdef = fnone; if (structdef == stagseen) --- 1736,1748 ---- MAKE_TAG_FROM_OTH_LB (FALSE); } ! if (funcdef != fignore) ! funcdef = fnone; /* FALLTHRU */ case ',': /* FALLTHRU */ case '[': ! if (definedef != dnone) ! break; ! if (funcdef != finlist && funcdef != fignore) funcdef = fnone; if (structdef == stagseen) *************** *** 1680,1699 **** break; case '(': switch (funcdef) { case ftagseen: ! funcdef = finlist; break; - case finlist: case flistseen: ! funcdef = fnone; break; } break; case ')': ! if (funcdef == finlist) ! funcdef = flistseen; break; case '{': if (typdef == ttypedseen) typdef = tinbody; --- 1750,1785 ---- break; case '(': + if (definedef != dnone) + break; switch (funcdef) { case ftagseen: ! funcdef = fstartlist; break; case flistseen: ! funcdef = finlist; break; } + parlev++; break; case ')': ! if (definedef != dnone) ! break; ! if (--parlev == 0) ! { ! switch (funcdef) ! { ! case fstartlist: ! case finlist: ! funcdef = flistseen; ! break; ! } ! } ! else if (parlev < 0) /* can happen due to ill-conceived #if's. */ ! parlev = 0; break; case '{': + if (definedef != dnone) + break; if (typdef == ttypedseen) typdef = tinbody; *************** *** 1710,1725 **** break; } ! cblev++; ! /* FALLTHRU */ ! case '*': ! if (funcdef == flistseen) { MAKE_TAG_FROM_OTH_LB (TRUE); funcdef = fnone; } break; case '}': if (!noindentypedefs && lp == newlb.buffer + 1) ! cblev = 0; /* reset curly brace level if first column */ else if (cblev > 0) cblev--; --- 1796,1823 ---- break; } ! switch (funcdef) { + case flistseen: MAKE_TAG_FROM_OTH_LB (TRUE); + /* FALLTHRU */ + case fignore: funcdef = fnone; } + cblev++; break; + case '*': + if (definedef != dnone) + break; + if (funcdef == fstartlist) + funcdef = fnone; /* avoid tagging `foo' in `foo (*bar()) ()' */ + break; case '}': + if (definedef != dnone) + break; if (!noindentypedefs && lp == newlb.buffer + 1) ! { ! cblev = 0; /* reset curly brace level if first column */ ! parlev = 0; /* also reset paren level, just in case... */ ! } else if (cblev > 0) cblev--; *************** *** 1732,1735 **** --- 1830,1854 ---- } break; + case '=': + case '#': + case '+': + case '-': + case '~': + case '&': + case '%': + case '/': + case '|': + case '^': + case '!': + case '<': + case '>': + case '.': + case '?': + if (definedef != dnone) + break; + /* These surely cannot follow a function tag. */ + if (funcdef != finlist && funcdef != fignore) + funcdef = fnone; + break; case '\0': /* If a macro spans multiple lines don't reset its state. */ *************** *** 1775,1784 **** logical *is_func; /* OUT */ { - logical firsttok; /* TRUE if have seen first token in ()'s */ Stab_entry *tokse = stab_find (get_C_stab (c_ext), tokp->p, tokp->len); enum sym_type toktype = stab_type (tokse); - *is_func = FALSE; /* not a function */ - /* * Advance the definedef state machine. --- 1894,1900 ---- *************** *** 1921,1925 **** { next_token_is_func = FALSE; ! *is_func = TRUE; return (TRUE); } --- 2037,2042 ---- { next_token_is_func = FALSE; ! funcdef = fnone; ! *is_func = TRUE; /* to force search string in ctags */ return (TRUE); } *************** *** 1932,1939 **** return (FALSE); default: ! funcdef = ftagseen; ! *is_func = TRUE; ! return (TRUE); } } --- 2049,2061 ---- return (FALSE); default: ! if (funcdef == fnone) ! { ! funcdef = ftagseen; ! *is_func = TRUE; ! return (TRUE); ! } } + + return (FALSE); } *************** *** 2344,2356 **** { /* Check for (foo::defmumble name-defined ... */ ! while (*dbp && *dbp != ':' && !isspace (*dbp) ! && *dbp != '(' && *dbp != ')') dbp++; if (*dbp == ':') { ! while (*dbp == ':') dbp++; ! if (L_isdef (dbp)) { while (!isspace (*dbp)) --- 2466,2480 ---- { /* Check for (foo::defmumble name-defined ... */ ! do dbp++; + while (*dbp && !isspace (*dbp) + && *dbp != ':' && *dbp != '(' && *dbp != ')'); if (*dbp == ':') { ! do dbp++; + while (*dbp == ':'); ! if (L_isdef (dbp - 1)) { while (!isspace (*dbp)) *************** *** 2368,2376 **** int L_isdef (dbp) ! char *dbp; { ! return ((dbp[1] == 'D' || dbp[1] == 'd') && ! (dbp[2] == 'E' || dbp[2] == 'e') && ! (dbp[3] == 'F' || dbp[3] == 'f')); } --- 2492,2512 ---- int L_isdef (dbp) ! register char *dbp; { ! return ((dbp[1] == 'd' || dbp[1] == 'D') ! && (dbp[2] == 'e' || dbp[2] == 'E') ! && (dbp[3] == 'f' || dbp[3] == 'F')); ! } ! ! int ! L_isquote (dbp) ! register char *dbp; ! { ! return ((*(++dbp) == 'q' || *dbp == 'Q') ! && (*(++dbp) == 'u' || *dbp == 'U') ! && (*(++dbp) == 'o' || *dbp == 'O') ! && (*(++dbp) == 't' || *dbp == 'T') ! && (*(++dbp) == 'e' || *dbp == 'E') ! && isspace(*(++dbp))); } *************** *** 2382,2389 **** char nambuf[BUFSIZ]; ! if (*dbp == 0) ! return; ! for (cp = dbp + 1; *cp && *cp != '(' && *cp != ' '; cp++) continue; c = cp[0]; cp[0] = 0; --- 2518,2534 ---- char nambuf[BUFSIZ]; ! if (*dbp == '\'') /* Skip prefix quote */ ! dbp++; ! else if (*dbp == '(' && L_isquote (dbp)) /* Skip "(quote " */ ! { ! dbp += 7; ! while (isspace(*dbp)) ! dbp++; ! } ! for (cp = dbp /*+1*/; *cp && *cp != '(' && *cp != ' ' && *cp != ')'; cp++) continue; + if (cp == dbp) + return; + c = cp[0]; cp[0] = 0; *************** *** 2736,2740 **** strcpy (nambuf, save_s); *s = tmpc; ! pfnote (nambuf, TRUE, save_s, strlen (nambuf), lineno, linecharno); } --- 2881,2885 ---- strcpy (nambuf, save_s); *s = tmpc; ! pfnote (nambuf, TRUE, FALSE, save_s, strlen (nambuf), lineno, linecharno); } diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lib-src/fakemail.c emacs-19.20/lib-src/fakemail.c *** emacs-19.19/lib-src/fakemail.c Sun Aug 15 01:37:28 1993 --- emacs-19.20/lib-src/fakemail.c Sun Sep 12 04:45:14 1993 *************** *** 20,24 **** #define NO_SHORTNAMES ! #include "../src/config.h" #if defined (BSD) && !defined (BSD4_1) && !defined (USE_FAKEMAIL) --- 20,24 ---- #define NO_SHORTNAMES ! #include <../src/config.h> #if defined (BSD) && !defined (BSD4_1) && !defined (USE_FAKEMAIL) diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lib-src/getdate.y emacs-19.20/lib-src/getdate.y *** emacs-19.19/lib-src/getdate.y Fri Aug 13 12:55:02 1993 --- emacs-19.20/lib-src/getdate.y Tue Nov 9 10:04:47 1993 *************** *** 15,20 **** --- 15,24 ---- #ifdef HAVE_CONFIG_H + #if defined (emacs) || defined (CONFIG_BROKETS) + #include + #else #include "config.h" #endif + #endif /* Since the code of getdate.y is not included in the Emacs executable *************** *** 28,31 **** --- 32,54 ---- #endif + /* The following block of alloca-related preprocessor directives is here + solely to allow compilation by non GNU-C compilers of the C parser + produced from this file by old versions of bison. Newer versions of + bison include a block similar to this one in bison.simple. */ + + #ifdef __GNUC__ + #define alloca __builtin_alloca + #else + #ifdef HAVE_ALLOCA_H + #include + #else + #ifdef _AIX + #pragma alloca + #else + void *alloca (); + #endif + #endif + #endif + #ifdef __GNUC__ #undef alloca *************** *** 38,42 **** #pragma alloca #else ! char *alloca (); #endif #endif --- 61,65 ---- #pragma alloca #else ! void *alloca (); #endif #endif *************** *** 75,79 **** #endif ! #if defined(HAVE_SYS_TIMEB_H) || (!defined(USG) && defined(HAVE_FTIME)) #include #else --- 98,102 ---- #endif ! #if defined(HAVE_SYS_TIMEB_H) #include #else *************** *** 605,608 **** --- 628,633 ---- return -1; return ((Hours + 12) * 60L + Minutes) * 60L + Seconds; + default: + abort (); } /* NOTREACHED */ diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lib-src/getopt.c emacs-19.20/lib-src/getopt.c *** emacs-19.19/lib-src/getopt.c Sun Aug 15 01:37:29 1993 --- emacs-19.20/lib-src/getopt.c Mon Sep 20 16:03:23 1993 *************** *** 22,29 **** #ifdef HAVE_CONFIG_H /* We use instead of "config.h" so that a compilation using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h ! (which it would do because getopt.c was found in $srcdir). */ #include #endif --- 22,33 ---- #ifdef HAVE_CONFIG_H + #if defined (emacs) || defined (CONFIG_BROKETS) /* We use instead of "config.h" so that a compilation using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h ! (which it would do because it found this file in $srcdir). */ #include + #else + #include "config.h" + #endif #endif diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lib-src/getopt1.c emacs-19.20/lib-src/getopt1.c *** emacs-19.19/lib-src/getopt1.c Sun Aug 15 01:37:34 1993 --- emacs-19.20/lib-src/getopt1.c Mon Sep 20 16:03:21 1993 *************** *** 18,25 **** #ifdef HAVE_CONFIG_H /* We use instead of "config.h" so that a compilation using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h ! (which it would do because getopt1.c was found in $srcdir). */ #include #endif --- 18,29 ---- #ifdef HAVE_CONFIG_H + #if defined (emacs) || defined (CONFIG_BROKETS) /* We use instead of "config.h" so that a compilation using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h ! (which it would do because it found this file in $srcdir). */ #include + #else + #include "config.h" + #endif #endif diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lib-src/movemail.c emacs-19.20/lib-src/movemail.c *** emacs-19.19/lib-src/movemail.c Sun Aug 15 01:37:41 1993 --- emacs-19.20/lib-src/movemail.c Sun Sep 12 04:45:17 1993 *************** *** 54,58 **** #include #define NO_SHORTNAMES /* Tell config not to load remap.h */ ! #include "../src/config.h" #ifdef USG --- 54,58 ---- #include #define NO_SHORTNAMES /* Tell config not to load remap.h */ ! #include <../src/config.h> #ifdef USG diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lib-src/rcs2log emacs-19.20/lib-src/rcs2log *** emacs-19.19/lib-src/rcs2log Mon Aug 9 18:06:00 1993 --- emacs-19.20/lib-src/rcs2log Mon Oct 18 22:50:31 1993 *************** *** 3,7 **** # RCS to ChangeLog generator ! # Generate a change log prefix from RCS/* and the existing ChangeLog (if any). # Output the new prefix to standard output. # You can edit this prefix by hand, and then prepend it to ChangeLog. --- 3,7 ---- # RCS to ChangeLog generator ! # Generate a change log prefix from RCS files and the ChangeLog (if any). # Output the new prefix to standard output. # You can edit this prefix by hand, and then prepend it to ChangeLog. *************** *** 13,17 **** # Author: Paul Eggert ! # $Id: rcs2log,v 1.13 1993/08/09 22:06:00 eggert Exp $ # Copyright 1992, 1993 Free Software Foundation, Inc. --- 13,17 ---- # Author: Paul Eggert ! # $Id: rcs2log,v 1.16 1993/10/19 02:50:31 eggert Exp $ # Copyright 1992, 1993 Free Software Foundation, Inc. *************** *** 37,42 **** --- 37,49 ---- # defaults + : ${TMPDIR=/tmp} + hostname= # name of local host (if empty, will deduce it later) indent=8 # indent of log line + initialize_fullname= # awk assignments to set up fullname array + initialize_mailaddr= # awk assignments to set up mailaddr array length=79 # suggested max width of log line + logins= # login names for people we know fullnames and mailaddresses of + loginsout= # temporary file holding sorted logins + rlog_options= # options to pass to rlog tabwidth=8 # width of horizontal tab *************** *** 45,51 **** case $1 in -i) indent=${2?};; -l) length=${2?};; -t) tabwidth=${2?};; ! -*) echo >&2 "$0: usage: $0 [-i indent] [-l length] [-t tabwidth] [file ...]" exit 1;; *) break --- 52,75 ---- case $1 in -i) indent=${2?};; + -h) hostname=${2?};; -l) length=${2?};; + -n) logins=$logins$nl${2?} + loginsout=$TMPDIR/rcs2log$$l + case $2${3?}${4?} in + *\"* | *\\* | *"$nl"*) + echo >&2 "$0: -n '$2' '$3' '$4': special characters not allowed" + exit 1 + esac + initialize_fullname="$initialize_fullname + fullname[\"$2\"] = \"$3\"" + initialize_mailaddr="$initialize_mailaddr + mailaddr[\"$2\"] = \"$4\"" + shift; shift;; + -r) rlog_options=$rlog_options$nl${2?};; -t) tabwidth=${2?};; ! -*) echo >&2 "$0: usage: $0 [options] [file ...] ! Options: ! [-h hostname] [-i indent] [-l length] [-n login fullname mailaddr]... ! [-r rlog_option]... [-t tabwidth]" exit 1;; *) break *************** *** 121,131 **** 0) files= ! for file in RCS/.* RCS/* do case $file in ! RCS/. | RCS/..) ;; ! RCS/.\* | RCS/\*) test -f "$file" && files=$files$nl$file;; ! *) files=$files$nl$file esac done case $files in --- 145,155 ---- 0) files= ! for file in RCS/.* RCS/* .*,v *,v do case $file in ! RCS/. | RCS/..) continue;; ! RCS/.\* | RCS/\* | .\*,v | \*,v) test -f "$file" || continue esac + files=$files$nl$file done case $files in *************** *** 138,146 **** esac ! rlogout=/tmp/chg$$ trap exit 1 2 13 15 ! trap 'rm -f $rlogout; exit 1' 0 ! rlog "$datearg" "$@" >$rlogout || exit --- 162,170 ---- esac ! rlogout=$TMPDIR/rcs2log$$r trap exit 1 2 13 15 ! trap "rm -f $loginsout $rlogout; exit 1" 0 ! rlog "$datearg" $rlog_options "$@" >$rlogout || exit *************** *** 150,157 **** # you have to fix the resulting output by hand. ! initialize_fullname= authors=` sed -n 's|^date: *[0-9]*/[0-9][0-9]/[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]; *author: *\([^; ]*\).*|\1|p' <$rlogout | ! sort -u ` case $authors in --- 174,188 ---- # you have to fix the resulting output by hand. ! case $loginsout in ! ?*) sort -u -o $loginsout </dev/null` || { ! echo >&2 "$0: cannot deduce hostname" ! exit 1 ! } --- 271,283 ---- }' ! case $hostname in ! '') ! hostname=`( ! hostname || uname -n || uuname -l || cat /etc/whoami ! ) 2>/dev/null` || { ! echo >&2 "$0: cannot deduce hostname" ! exit 1 ! } ! esac *************** *** 279,284 **** CR=" " # <-- There is a single CR between the " chars here. ! # Initialize the fullname associative array. '"$initialize_fullname"' # Initialize indent string. --- 317,323 ---- CR=" " # <-- There is a single CR between the " chars here. ! # Initialize the fullname and mailaddr associative arrays. '"$initialize_fullname"' + '"$initialize_mailaddr"' # Initialize indent string. *************** *** 325,329 **** sep = "\n" if (date == "") sep = "" ! if (newlog ~ /^{[^ }]*}[ ]/) { i = index(newlog, "}") newclumpname = substr(newlog, 1, i) --- 364,368 ---- sep = "\n" if (date == "") sep = "" ! if (newlog ~ /^\{[^ }]*}[ ]/) { i = index(newlog, "}") newclumpname = substr(newlog, 1, i) *************** *** 361,373 **** days_since_Sunday_before_epoch = EPOCH_WEEKDAY + year * 365 + int((year + 3) / 4) - int((year + 99) / 100) + int((year + 399) / 400) + mo[month-1] + leap + day - 1 ! # Print "date fullname (email address)" if the fullname is known; ! # print "date author" otherwise. ! # Get the fullname from the associative array. ! # The email address is just author@thishostname. ! printf "%s %s %2d %s %d ", w[days_since_Sunday_before_epoch%7], m[month-1], day, $3, year if (fullname[author]) ! printf "%s (%s@%s)\n\n", fullname[author], author, "'"$hostname"'" else ! printf "%s\n\n", author } if (! filesknown[$1]) { --- 400,415 ---- days_since_Sunday_before_epoch = EPOCH_WEEKDAY + year * 365 + int((year + 3) / 4) - int((year + 99) / 100) + int((year + 399) / 400) + mo[month-1] + leap + day - 1 ! # Print "date fullname (email address)". ! # Get fullname and email address from associative arrays; ! # default to author and author@hostname if not in arrays. if (fullname[author]) ! auth = fullname[author] ! else ! auth = author ! printf "%s %s %2d %s %d %s ", w[days_since_Sunday_before_epoch%7], m[month-1], day, $3, year, auth ! if (mailaddr[author]) ! printf "(%s)\n\n", mailaddr[author] else ! printf "(%s@%s)\n\n", author, "'"$hostname"'" } if (! filesknown[$1]) { *************** *** 389,391 **** # Exit successfully. ! exec rm -f $rlogout --- 431,433 ---- # Exit successfully. ! exec rm -f $loginsout $rlogout diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lib-src/timer.c emacs-19.20/lib-src/timer.c *** emacs-19.19/lib-src/timer.c Sun Aug 15 01:37:47 1993 --- emacs-19.20/lib-src/timer.c Sun Sep 12 04:45:19 1993 *************** *** 18,22 **** #include /* time_t */ ! #include "../src/config.h" #ifdef USG #undef SIGIO --- 18,22 ---- #include /* time_t */ ! #include <../src/config.h> #ifdef USG #undef SIGIO diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lib-src/vcdiff emacs-19.20/lib-src/vcdiff *** emacs-19.19/lib-src/vcdiff Sun Aug 15 01:37:57 1993 --- emacs-19.20/lib-src/vcdiff Wed Aug 25 04:19:16 1993 *************** *** 4,12 **** # This version is more compatible with rcsdiff(1). # ! # $Id: vcdiff,v 1.2 1993/06/30 18:54:08 eggert Exp $ # DIFF="diff" usage="$0: Usage: vcdiff [-q] [-r] [-r] [diffopts] sccsfile..." echo= --- 4,14 ---- # This version is more compatible with rcsdiff(1). # ! # $Id: vcdiff,v 1.3 1993/08/25 08:18:56 eggert Exp $ # DIFF="diff" usage="$0: Usage: vcdiff [-q] [-r] [-r] [diffopts] sccsfile..." + + PATH=$PATH:/usr/ccs/bin:/usr/sccs # common SCCS hangouts echo= diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lib-src/wakeup.c emacs-19.20/lib-src/wakeup.c *** emacs-19.19/lib-src/wakeup.c Sun Aug 15 01:37:48 1993 --- emacs-19.20/lib-src/wakeup.c Sun Sep 12 04:09:18 1993 *************** *** 1,5 **** /* Program to produce output at regular intervals. */ ! #include "config.h" #include --- 1,5 ---- /* Program to produce output at regular intervals. */ ! #include #include diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lib-src/yow.c emacs-19.20/lib-src/yow.c *** emacs-19.19/lib-src/yow.c Sun Aug 15 01:37:49 1993 --- emacs-19.20/lib-src/yow.c Sat Sep 11 21:34:41 1993 *************** *** 10,14 **** #include #include ! #include "../src/paths.h" /* For PATH_DATA. */ #define BUFSIZE 80 --- 10,14 ---- #include #include ! #include <../src/paths.h> /* For PATH_DATA. */ #define BUFSIZE 80 diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/ChangeLog emacs-19.20/lisp/ChangeLog *** emacs-19.19/lisp/ChangeLog Sun Aug 15 01:45:00 1993 --- emacs-19.20/lisp/ChangeLog Thu Nov 11 10:01:28 1993 *************** *** 1,2 **** --- 1,1351 ---- + Thu Nov 11 02:16:55 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * Version 19.20 released. + + * man.el (Man-section-regexp): Allow section names l, n, L, N. + + Wed Nov 10 21:46:27 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * map-ynp.el (map-y-or-n-p): Handle help-char values other than chars. + + * c-mode.el (c-indent-region): When looking for a sexp that ends + past this line, make sure it really starts on this line. + + * replace.el (occur-mode): Run occur-mode-hook. + + Wed Nov 10 20:53:06 1993 Robert J. Chassell (bob@kropotkin.gnu.ai.mit.edu) + + * texinfo.el (texinfo-texi2dvi-command): Separate `texi2dvi' + command from `tex' command so `texinfo-format-region' can use + straight `tex' command. + (texinfo-format-buffer): Use `texinfo-texi2dvi-command' + (texinfo-delete-from-print-queue): Revise documentation. + (texinfo-quit-job): Use comint-send-input. + + * texinfmt.el (texinfo-format-region): Change `texinfo-[start + end]-of-header' to `tex-[start end]-of-header'. + + Wed Nov 10 15:38:24 1993 Brian Fox (bfox@mole.gnu.ai.mit.edu) + + * rmail.el (rmail-start-mail): Don't do other frame unless we have + a window system, irregardless of the state of rmail-mail-new-frame. + + * man.el (Man-filter-list): Include anything starting with + alphabetics, and containing "Last change:". + (manual-entry): Don't call `Man-downcase' since + Man-translate-references has already done the right thing. + + * info.el (Info-extract-menu-item): Quote `*' in the menu-item + leadin re-search to prevent us from finding node names which + contain the text of another node name within them. + + * files.el (find-backup-file-name): Don't fatal-error on + directories that are hard to read; fall back on ~/%backup%. + + * hexl.el (hexl-mode): Use `add-hook' to modify buffer local + `write-contents-hooks'. + (hexl-mode-exit): Remove our hook when turning off Hexl mode. + + * files.el (file-truename): Treat ~USER like just ~. + + * subr.el (remove-hook): New function, analogous to add-hook. This + is now the recommended way to remove a hook that you have added. + + Tue Nov 9 02:11:05 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * texinfo.el (texinfo-mode-map): Add C-c C-e bindings for texinfmt.el. + + * texnfo-upd.el (texinfo-sequential-node-update): Add autoload. + (texinfo-update-node, texinfo-every-node-update): Add autoload. + + * comint.el (comint-postoutput-scroll-to-bottom): + Don't alter point in a window if it's after the process-mark. + Don't treat minibuffer window specially. + + * menu-bar.el (menu-bar-edit-menu): Add menu items for searching. + + * etags.el (etags-list-tags): Return t if found the file. + (list-tags): Clear first-time when we go around the loop. + Supply file name in error message. + Remove dir names from files when preparing for completion. + + Mon Nov 8 18:40:24 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * shell.el: Doc fixes. + + Mon Nov 8 19:05:34 1993 Simon Marshall (Simon.Marshall@mail.esrin.esa.it) + + * comint.el (comint-preinput-scroll-to-bottom): Added + comint-magic-space to list of commands recognised as inserting. + + * comint.el (comint-output-filter): Corrected check for killed + buffer. + + Mon Nov 8 16:16:32 1993 Robert J. Chassell (bob@geech.gnu.ai.mit.edu) + + * texinfo.el (texinfo-show-structure): Indent appendices properly. + + Mon Nov 8 07:42:24 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * disp-table.el (describe-current-display-table): + Don't get error if no display table now. + (describe-display-table): Put all the output in the temp buffer. + + * ws-mode.el (wordstar-mode): Add autoload. + + * pascal.el: New file. + * thingatpt.el: New file. + * mouse-sel.el: New file. + + * ispell.el (ispell-message): Delete excess (beginning-of-line). + + * frame.el (set-frame-configuration): Iconify frames + rather than making them invisible. + + * register.el (jump-to-register): Rename prefix arg to DELETE + and invert its sense. + + * comint.el (comint-postoutput-scroll-to-bottom): + Walk the windows even if scroll is nil. + + Sun Nov 7 03:09:57 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * ispell.el (ispell-message): If gnus, but no mail-yank-prefix, + use ispell-message-cite-regexp. Turn off case-fold-search + for the searching and matching in this function. + + * ispell.el (ispell-message): Stop if ispell-region returns nil. + (ispell-next, ispell-word): Catch ispell-quit, not quit. + (ispell-next): Return t if exit normally (no throw to ispell-quit). + (ispell-command-loop): For q, throw to ispell-quit. + Explicitly handle C-g. + (ispell): If we don't call ispell-next, return t. + + * compare-w.el (compare-windows-skip-whitespace): Return t + if there is whitespace before point. + + * iso-acc.el (iso-accents-mode): Doc fix. + + * comint.el (comint-postoutput-scroll-to-bottom): + Always keep point at end in all buffers if was at end. + comint-scroll-to-bottom-on-output controls what to do + if point was not already at the end. + + * iso-acc.el: Support ~ and /. Support 'Y, 'y, "y. + Delete the `compose' support. + (iso-accents-list): Fix typo in ^A code. Support ~< and ~>. + + * iso-transl.el: Alter isearch-mode-map so C-x 8 works in search. + + * frame.el (set-frame-configuration): If NODELETE, make the + unwanted frames invisible. + + Sun Nov 7 11:19:25 1993 Ethan Bradford (ethanb@ptolemy.astro.washington.edu) + + * ispell.el (ispell-non-empty-string): New function. + (ispell-message): Add autoload. + Choose a citation regexp automatically. + Don't fail if there is no following cited line after filled lines. + + Fri Nov 5 23:15:57 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * man.el (Man-frame-parameters): New variable. + (Man-notify-when-ready): Handle `newframe' as Man-notify value. + + Thu Nov 4 07:01:50 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * ange-ftp.el (ange-ftp-load): Handle extra args after the file name. + + Wed Nov 3 15:42:09 1993 Edward M. Reingold (reingold@emr.cs.uiuc.edu) + + * tex-mode.el (tex-alt-print): New function for menu bar. + (tex-define-common-keys, tex-mode-map): Move some items from + tex-define-common-keys to tex-mode-map. + Add more menu-enable properties. + (tex-append): Cope with both the original + Pascal-based TeX and the newer C-based TeX. + + Wed Nov 3 14:59:49 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * frame.el (other-frame): Subtract 1 from hpos for new mouse position. + + * sendmail.el (sendmail-send-it): Don't insert Sender. + + * tex-mode.el (tex-validate-region, tex-region): + Enable menu items if only mark is active. + + Tue Nov 2 19:44:53 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * mouse.el (mouse-drag-region): Set this-command to mouse-set-point + if not setting the mark. + (mouse-save-then-kill): Consider mark-active only in transient mark md. + + Wed Oct 27 17:32:56 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * tex-mode.el (tex-define-common-keys): Define menu items. + + Tue Oct 26 16:45:48 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * comint.el (comint-mode-map): Merge menu bar item Output into Input. + Rename Completion to Complete. + + * font-lock.el (font-lock-fontify-buffer): Don't turn + font-lock-mode on and off; just call font-lock-set-defaults. + + Tue Oct 26 14:08:10 1993 Lawrence R. Dodd (dodd@roebling.poly.edu) + + * ispell.el (ispell-look-command): New user variable. + (ispell-do-look, ispell-lookup-build-list): Use it as + PROGRAM for call-process instead of just "look". + + * ispell.el (ispell-complete-word-interior-frag): New command. + (ispell-complete-word): New command. + (ispell-menu-map): Add bindings for them. + (ispell-gnu-look-still-broken-p, ispell-look-dictionary): New vars. + + * text-mode.el (text-mode-map): Bind ispell-complete-word to M-TAB. + + Tue Oct 26 14:07:22 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * simple.el (eval-expression): Fix typo: missing paren. + (read-expression-map): Use an indirection to minibuffer-local-map + rather than copying it. + + Mon Oct 25 23:28:41 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * bookmark.el (bookmark-load, bookmark-write-file): + Bind enable-local-variables instead of enable-local-eval. + + Mon Oct 25 20:09:53 1993 Karl Fogel (kfogel@mole.gnu.ai.mit.edu) + + * bookmark.el (bookmark-load, bookmark-write-file): Made + enable-local-eval be nil when loading a bookmark file, since + bookmark context strings can contain eval forms from the files in + which the bookmarks are set, and we don't want them evalled when + .emacs-bkmrks is found! + + Got rid of ###autoload to put a bookmark menu on the menu-bar. + Now it will appear on the File menu -- that change is made in + menu-bar.el. See below: + + * menu-bar.el: Added a define-key for menu-bar-bookmark-map, so + that bookmarks will appear on the File menu of the menu-bar, right + after the Print Buffer item. + + Mon Oct 25 15:48:39 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * comint.el (comint-scroll-to-bottom-on-input): Default to nil. + (comint-mode): Use pre-command-hook, not before-change-function. + (comint-preinput-scroll-to-bottom): Take no arguments. + (comint-output-filter-functions): + Renamed from comint-output-filter-hook. + (comint-output-filter): Pass STRING as arg to output hook functions. + (comint-preinput-scroll-to-bottom): Take an arg. + Move point to new process mark if it was at the old one. + Scroll so only if point is at or after the process mark. + When scrolling, put end of text on bottom line, regardless of point. + + Mon Oct 25 02:07:36 1993 Brian Fox (bfox@albert.gnu.ai.mit.edu) + + * ispell.el (ispell): If the buffer to spell has no associated + file, or, the associated file has a special handler, use a + temporary file with the buffer contents to pass to the local + ispell process. + + * dired.el (provide): Provide "dired" before running user hooks. + + * ange-ftp.el (ange-ftp-dired-uncache): Fix parens so that `(setq + ...' is a result of the if statement, and not a top level + expression. + + * simple.el (eval-expression, edit-and-eval-command): Let + minibuffer-history-sexp-flag be 't during the call to + read-from-minibuffer. + + Sun Oct 24 19:18:52 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * iso-acc.el: Define "dead keys" in key-translation-map, + not in global-map. + (iso-accents-compose): New subroutine to do the composition. + Method of doing so is new. + (iso-accents-accent-key): Use iso-accents-compose. + (iso-accents-compose-key): New function. + + Sat Oct 23 17:25:41 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * isearch.el (isearch-yank): Handle `kill' as chunk type. + (isearch-yank-kill): New command, on M-y and mouse-2. + + * frame.el (make-frame): Use before-make-frame-hook and + after-make-frame-hook. + + * comint.el (comint-scroll-to-bottom-on-output) + (comint-scroll-to-bottom-on-input): Default to nil if baud-rate<=9600. + + Fri Oct 22 13:10:53 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * comint.el (comint-filename-prefix): Deleted. + * rlogin.el (rlogin, rlogin-mode): Use comint-file-name-prefix, + not comint-filename-prefix. + + Thu Oct 21 22:22:08 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * shell.el (shell-after-partial-filename): Renamed from + shell-after-partial-pathname. + * comint.el (comint-after-partial-file-name-command): + Renamed from comint-after-partial-pathname-command. + (comint-match-partial-file-name, comint-after-partial-file-name): + Renamed from comint-match-partial-pathname, etc. + + Thu Oct 21 23:10:27 1993 Simon Marshall (Simon.Marshall@mail.esrin.esa.it) + + * shell.el (shell-after-partial-pathname): New subroutine. + + * shell.el: Renamed shell-command-execonly to + shell-completion-execonly for consistency. + + * shell.el (shell-read-input-ring, shell-input-ring-file-name): + Moved to, and renamed in, comint.el. + + * shell.el (shell-dynamic-complete-command): Make sure local + completion-ignore-case is nil. + + * shell.el (shell-mode): Set buffer-local variable paragraph-start + to comint-prompt-regexp so paragraph motion/mark commands work on + output groups. + Set comint-after-partial-pathname to it. + (shell-read-input-ring): Use find-file-noselect. + + * shell.el (shell-match-cmd-w/optional-arg): Removed. + + * comint.el (comint-last-output-start): New variable to record + where most recent process output started from. + (comint-mode): Initialise it. + (comint-output-filter): Set it. + + * comint.el (comint-previous-matching-input-string): Moved to + comint-previous-matching-input-position. + (comint-previous-matching-input-string): Use it. + (comint-search-arg, comint-search-start, + comint-previous-input-string): New subroutines. + (comint-previous-input, comint-next-input, + comint-previous-matching-input, comint-next-matching-input, + comint-previous-matching-input-from-input, + comint-next-matching-input-from-input): Use them. + + * comint.el (comint-mode-map): Added signal menu-bar. Moved + comint-backward/forward-matching-input to output menu-bar, since + they move within the buffer rather than do input. + + * comint.el (comint-send-input, comint-after-pmark-p, + comint-kill-input, comint-proc-query): Removed serialisation of + obtaining the process mark's marker-position. + + * comint.el, shell.el: Commented out comint/shell-load-hooks. + + * comint.el (comint-dynamic-simple-complete): New subroutine. + + * comint.el (comint-dynamic-complete-filename-command): New variable. + (comint-after-partial-pathname-command): New variable. + (comint-after-partial-pathname): New subroutine. + (comint-dynamic-complete): Use them. + (comint-mode): Make them local. + + * comint.el, shell.el: Renamed comint-dynamic-complete-command to + comint-dynamic-complete-command-command for consistency. + Renamed comint-file-name-addsuffix/autolist/recexact to + comint-completion-addsuffix/autolist/recexact for consistency. + + * comint.el (comint-replace-by-expanded-history): Check if input + ring size is not big enough for relative reference. + + * comint.el (comint-read-input-ring, comint-input-ring-file-name): + From shell.el. + (shell-write-input-ring): New subroutine. + + * comint.el (comint-file-name-prefix): New variable. + (comint-directory): New inline subroutine. + (comint-dynamic-complete-filename, comint-dynamic-complete-variable, + comint-dynamic-list-filename-completions): Use it. + + * comint.el (comint-dynamic-complete-filename, + comint-dynamic-complete-variable, + comint-dynamic-list-filename-completions): Make sure local + completion-ignore-case is nil. + + * comint.el (comint-next-prompt, comint-previous-prompt): Use + paragraph-start and paragraph motion commands rather than + re-search-forward and re-search-backward commands. + + * comint.el (comint-dynamic-list-input-ring, + comint-previous-matching-input-string): Use ring-empty-p rather + than zerop and ring-length. + + * comint.el (comint-input-ignoredups): New variable. + (comint-send-input, shell-read-input-ring): Use it. + (comint-mode): Make comint-input-ignoredups local. Doc fix. + + * comint.el (comint-scroll-to-bottom-on-input): New variable. + (comint-scroll-to-bottom-on-output): New variable. + (comint-scroll-show-maximum-output): New variable. + (comint-output-filter-hook): New variable, defaults to + comint-postoutput-scroll-to-bottom. + + * comint.el (comint-output-filter): Renamed from comint-filter + for consistency. Now calls comint-output-filter-hook. + + * comint.el (comint-preinput-scroll-to-bottom): New subroutine. + (comint-postoutput-scroll-to-bottom): New subroutine. + (comint-show-maximum-output): New command. + (comint-copy-old-input): New command. + + * comint.el (comint-send-input): Run comint-output-filter-hook if + necessary as a kludge to prevent messy redisplays. + + * comint.el (comint-mode-map): Added comint-show-maximum-output to + C-c C-e and menu-bar output, and comint-copy-old-input to C-c C-i + and menu-bar input. + + * comint.el (comint-mode): Make local variables + comint-scroll-to-bottom-on-input, before-change-function, + comint-scroll-to-bottom-on-output, comint-scroll-show-maximum-output, + and comint-output-filter-hook. + + Thu Oct 21 13:51:51 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * simple.el (blink-matching-open): Treat / syntax like \ syntax. + + * texinfmt.el (texinfo-format-begin-end): Bind cmd locally. + (texinfo-defun-type): Renamed from command-type in various fns. + (texinfo-command-start, texinfo-command-end, texinfo-command-name) + (texinfo-defun-type, texinfo-last-node-pos, texinfo-stack) + (texinfo-short-index-cmds-alist) + (texinfo-short-index-format-cmds-alist, texinfo-format-filename) + (texinfo-footnote-number, texinfo-start-of-header) + (texinfo-end-of-header, texinfo-raisesections-alist) + (texinfo-lowersections-alist): Add defvars. + + Wed Oct 20 14:06:31 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * cdl.el: New file. + + Wed Oct 20 08:00:51 1993 Brian Fox (bfox@gnu.ai.mit.edu) + + * forms.el (forms--set-minor-mode): Rewrite so that describe-mode + can parse the value of minor-mode-alist correctly. The string + " View" is now dependent on the value of forms-read-only. + + Wed Oct 20 08:00:51 1993 Johan Vromans (jv@mh.nl) + + * forms.el: Documentation: `forms-forms-scroll' and `forms-forms-jump' + now default to nil. + `forms-new-record-filter' and `forms-modified-record-filter' + cannot be redefined as functions. + Commands and keymaps are changed. + Add function key defs. + (forms-version): Docstring includes full RCS id. + (forms-forms-scroll): Defaults to nil. + (forms-forms-jump): Defaults to nil. + (forms-mode-edit-map, forms-mode-ro-map): Additional keymaps + for edit mode and read-only mode. + (forms--new-record-filter, forms--modified-record-filter): Deleted. + (forms-mode): Docstring now includes the key bindings, since + both edit mode and read-only mode must be supported. + Changed `forms-new-record-filter' and `forms-modified-record-filter' + semantics: the variable must point to a function and may + not be defined as a function anymore. + Use three keymaps: `forms-mode-map' (C-c commands), + `forms-mode-edit-map' (normal mode) and `forms-mode-ro-map' + (read-only mode). The maps are not buffer local. + Changed the text of error messages to be more descriptive, and + consistent with the documentation. + Moved setting up write-file-hooks and revert-buffer-function + to function `forms--change-commands'. + (forms--process-format-list): Changed error messages to be + more descriptive. + (forms--set-keymaps): Setup the three keymaps. + (forms--mode-commands): Use new command key bindings. + (forms--mode-commands1): New helper function for + `forms--mode-commands'. + (forms--change-commands): Handle setup of + local-write-file-hooks and revert-buffer-function. + (forms--help): Show new command bindings. + (forms--show-record): Replaced `forms--modified-record-filter' by + `forms-modified-record-filter'. + (forms-jump-record): Changed error message. + (forms-toggle-read-only): New function, replaces + `forms-view-mode' and `forms-edit-mode'. + (forms-view-mode, forms-edit-mode): Deleted. + (forms-insert-record): Replaced `forms--new-record-filter' by + `forms-new-record-filter'. + (forms-insert-record, forms-delete-record): Disallow in read-only + mode. + (forms-prev-field): New function. + + Tue Oct 19 09:50:13 1993 Edward M. Reingold (reingold@emr.cs.uiuc.edu) + + * calendar.el (calendar-week-start-day): New var (autoloaded) to + allow the calendar week to start on any day, not just Sunday. + (calendar-mod): New support function. + (calendar-cursor-to-visible-date, generate-calendar-month, + calendar-beginning-of-week, calendar-end-of-week): Rewritten to + use new var calendar-week-start-day. + + * holidays.el (holiday-easter-etc): Fix Ascension Day string. + + * diary.el (list-sexp-diary-entries): Fix doc string. + + * solar.el (solar-n-hemi-seasons, solar-s-hemi-seasons): New vars. + (solar-equinoxes-solstices): Use them to fix names for + southern hemisphere. + + * calendar.el (calendar-day-name-array, calendar-month-name-array, + calendar-islamic-month-name-array, + calendar-hebrew-month-name-array-common-year, + calendar-hebrew-month-name-array-leap-year): Change to defvar. + + * diary.el (hebrew-calendar-parashiot-names): Change to defvar. + + Mon Oct 18 03:54:58 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * etags.el (list-tags): Fix completing-read call interactive spec; + TABLE and PREDICATE args were reversed, and more processing was + needed on tags-table-files. + + Mon Oct 18 02:41:47 1993 Noah Friedman (friedman@gnu.ai.mit.edu) + + * rlogin.el (rlogin-initially-track-cwd): New variable. + (rlogin): Use it to determine whether enable directory tracking + via ange-ftp. + (rlogin-mode): Make `comint-filename-prefix' local here. + + * rlogin.el (rlogin): Arguments to function are now a string with + multiple words (hostname first) and an optional prefix. + (rlogin-with-args): Function deleted. + + * rlogin.el (rlogin): Set process filter after calling + `rlogin-mode' since the latter called `comint-mode', which sets + its own initial process filter. + Mon Oct 18 20:28:36 1993 Barry A. Warsaw, ITB (warsaw@anthem) + + * reporter.el: + (reporter-submit-bug-report, reporter-mailer): reporter-mailer + variable can now take a list of mailers, trying each one until an + commandp one is found. + + * reporter.el: Fixed elisp archive address. + Handle dumping of buffer local variables via reporter-eval-buffer. + + Thu Oct 14 18:28:24 1993 Paul Eggert (eggert@twinsun.com) + + * vc.el (vc-backend-checkout): Do not set umask to value that does + not allow user-write permission while `co' is running; this breaks + versions of `co' that need to write temporary files. + + Wed Oct 13 20:11:51 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * rmailout.el (rmail-output-file-alist): Doc fix. + + Wed Oct 13 02:20:53 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * supercite.el, regi.el: New files. + * sc-elec.el: Files deleted. + * sc.el: Just load supercite. + + Tue Oct 12 16:57:23 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * files.el (abbreviated-home-dir): Doc fix. + + Mon Oct 11 20:53:34 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * map-ynp.el (map-y-or-n-p): Take new optional arg to not set + cursor-in-echo-area. + + Sun Oct 10 18:13:18 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * rmail.el (rmail-retry-setup-hook): New hook variable. + (rmail-retry-failure): Use that variable. + + * pp.el: New file. + + Sat Oct 9 17:43:44 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * ispell.el (ispell-message-cite-regexp): Add definition. + + Sat Oct 9 03:12:59 1993 Karl Fogel (kfogel@occs.cs.oberlin.edu) + + * bookmark.el (bookmark-write): Add numbered backups for bookmark file. + (bookmark-version-control): New variable. + + * bookmark.el (bookmark-jump): bookmark-jump now gives a + default value if no bookmark is entered manually. + (bookmark-set): Default to bookmark-current-bookmark or + buffer-name the way bookmark-jump does. + + * bookmark.el (ctl-x-map): Check if C-x r is a prefix + before using it as one. + + * bookmark.el: Include string "Bookmarks" in defining + [menu-bar bookmark] in global-map in the menu-bar code. + + * bookmark.el (menu-bar-bookmark-map): Supply t as 4th arg of autoload. + + * bookmark.el (bookmark-jump-noselect): New subroutine taken from + bookmark-jump. Support compressed files. + (bookmark-jump): Call bookmark-jump-noselect. + Offer to relocate if necessary, but change default dir to that of + the old bookmark in read-file-name. + + * bookmark.el: (bookmark-set, bookmark-rename, bookmark-delete, + bookmark-write-file, bookmark-load, Bookmark-menu-show-filenames, + Bookmark-menu-hide-filenames, Bookmark-menu-bookmark, + Bookmark-menu-save, Bookmark-menu-load): Fixed the save-excursion + bugs by wrapping things in save-window-excursion as well. + + (bookmark-make-menu-bar-alist): Added sorting. + + (bookmark-map): Added new keybindings. + (bookmark-try-default-file): Set bookmarks-already-loaded to t + after the load. + + * bookmark.el (list-bookmarks): Added bookmark menu stuff. + (Bookmark-menu-*): New functions. + + Sat Oct 9 15:59:31 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + + * isearch.el, reporter.el: Change comments saying they're not yet + part of GNU Emacs. + + Fri Oct 8 22:01:33 1993 Jonathan I. Kamens (jik@security.ov.com) + + * timezone.el (timezone-parse-date): Handle new style 22-AUG-1993. + + * rmail.el (rmail): Really don't get new mail if file name was given. + (rmail-reformat-message): Move past Mail-from as well as Summary-line. + (rmail-toggle-header): Likewise. + (rmail-next-undeleted-message): Return t unless hit end of buffer. + (rmail-delete-forward): Likewise. + (mail-unsent-separator): Add `Original message follows'. + (rmail-resend): Handle mail-self-blind. + + * files.el (hack-local-variables): If buffer has no file, + display its buffer name. + + * rmailout.el (rmail-output): If message was shown with full headers, + copy the full headers (or each message copied) into the file. + New local var original-headers-p, header-beginning, mail-from. + Bind locals outside the while loop. Kill tembuf only after loop. + If message has a saved mail-from field, use that. + Detect reaching end of rmail buffer; display # messages copied. + + Wed Oct 6 23:02:55 1993 Morten Welinder (terra@diku.dk) + + * desktop.el: Internal clean-up. Save information about current + tags files, don't save the tags buffers (to save reload time). + Don't save desktop-globals-to-save (desktop files must be erased + for this to take effect, sorry.) Save "mark-activity" and + allow multi-dir direds. + + Mon Oct 4 21:56:46 1993 Brian Fox (bfox@albert.gnu.ai.mit.edu) + + * telnet.el (rsh): Add `host' to args passed to make-comint. + + Mon Oct 4 20:22:11 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * rmail.el (rmail-convert-to-babyl-format): Protect against + nonsensical content-length values. + + Mon Oct 4 20:51:01 1993 Eric S. Raymond (eric@mole.gnu.ai.mit.edu) + + * vc.el (vc-next-action): Fix (throw ... ) invocation to work with 19; + allows vc-next-action on all marked files in a dired buffer to work. + + (vc-finish-logentry) There isn't necessarily a *VC-log-entry* buffer + to remove if this function was called from within a dired buffer. Fix + its handling of this case. + + Sat Oct 2 15:53:27 1993 Brian J. Fox (bfox@ai.mit.edu) + + * simple.el (edit-and-eval-command): Let `read-from-minibuffer' + manipulate the history list, don't manipulate it directly. + (repeat-complex-command): Same thing. + + Fri Oct 1 18:40:22 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * mailabbrev.el (build-mail-abbrevs): Pass just 1 arg to + substitute-in-file-name. + + Mon Sep 27 04:36:31 1993 Paul Eggert (eggert@twinsun.com) + + * vc.el (vc-find-binary): Fix bug; it always claimed success. + + Sun Sep 26 16:00:42 1993 Johan Vromans (jv@mh.nl) + + * forms.el: Version 2.3. + Documentation: `forms-forms-scroll' and `forms-forms-jump' + now default to nil. + `forms-new-record-filter' and `forms-modified-record-filter' + cannot be redefined as functions. + Commands and keymaps are changed. + Add function key defs. + (forms-version): Docstring includes full RCS id. + (forms-forms-scroll): Defaults to nil. + (forms-forms-jump): Defaults to nil. + (forms-mode-edit-map, forms-mode-ro-map): Additional keymaps + for edit mode and read-only mode. + (forms--new-record-filter, forms--modified-record-filter): Deleted. + (forms-mode): Docstring now includes the key bindings, since + both edit mode and read-only mode must be supported. + Changed `forms-new-record-filter' and `forms-modified-record-filter' + semantics: the variable must point to a function and may + not be defined as a function anymore. + Use three keymaps: `forms-mode-map' (C-c commands), + `forms-mode-edit-map' (normal mode) and `forms-mode-ro-map' + (read-only mode). The maps are not buffer local. + Changed the text of error messages to be more descriptive, and + consistent with the documentation. + Moved setting up write-file-hooks and revert-buffer-function + to function `forms--change-commands'. + (forms--process-format-list): Changed error messages to be + more descriptive. + (forms--set-keymaps): Setup the three keymaps. + (forms--mode-commands): Use new command key bindings. + (forms--mode-commands1): New helper function for + `forms--mode-commands'. + (forms--change-commands): Handle setup of + local-write-file-hooks and revert-buffer-function. + (forms--help): Show new command bindings. + (forms--show-record): Replaced `forms--modified-record-filter' by + `forms-modified-record-filter'. + (forms-jump-record): Changed error message. + (forms-toggle-read-only): New function, replaces + `forms-view-mode' and `forms-edit-mode'. + (forms-view-mode, forms-edit-mode): Deleted. + (forms-insert-record): Replaced `forms--new-record-filter' by + `forms-new-record-filter'. + (forms-insert-record, forms-delete-record): Disallow in read-only + mode. + (forms-prev-field): New function. + + Sun Sep 26 21:36:07 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * disass.el (disassemble-internal): Allow a call to byte-code + as argument. + + Fri Sep 24 00:08:17 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * ispell.el (ispell-message): Handle cited messages. + + * frame.el (other-frame): Warp the mouse so that the other + frame actually stays selected. + + Wed Sep 22 12:37:21 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * mouse.el (mouse-delete-max-match): New function. + (mouse-choose-completion): Use that. Now supports buffers + other than minibuffer. + + * comint.el (comint-version): Deleted--no need for separate version. + (comint-input-ring-index): Make this a permanent local. + (comint-mode): Don't alter comint-input-ring-index or comint-input-ring + if already set meaningfully. + + Tue Sep 21 16:23:23 1993 Simon Marshall (Simon.Marshall@mail.esrin.esa.it) + + * comint.el (comint-mode-map): Added keys M-R/S for + comint-previous/next-matching-input-from-input and to completion + menu-bar. Added comint-forward/backward-matching-input and + comint-previous/next-matching-input to completion menu-bar. + + * comint.el (comint-mode): Doc fix for functionality. + + * comint.el (comint-exec-1): Uses setenv. + (comint-update-env): Removed. + + * comint.el (comint-input-ring-size): Incremented to 32, as with + command history. + (comint-dynamic-list-input-ring): Check for zero + length ring. Use ring length, not ring size, when generating + list. Use buffer " *Input History*". + (comint-previous-matching-input-string): Check for zero-length ring. + Check last item in case at end of cycle and it's a match. + (comint-searching-input-ring): New subroutine. + + * comint.el (comint-regexp-arg): New subroutine. + + * comint.el (comint-previous-matching-input-from-input): New command. + (comint-next-matching-input-from-input): New command. + + * comint.el (comint-replace-by-expanded-history): Fix for matching + inside quotes. Fix to allow argument subrange specifiers. Fix to + identify and reject absolute input number references. + + * comint.el (comint-within-quotes): New subroutine. + (comint-how-many-region): New subroutine. + (comint-args): New subroutine. + (comint-delim-arg): New subroutine. + (comint-arguments): New subroutine. + (comint-delimiter-argument-list): New variable. + + * comint.el (comint-send-input): Inserts input arguments into ring + separated by single spaces. + + * comint.el (comint-filter): Checks the buffer's process to make + sure it's still there. Otherwise, set-buffer will fail. + + * comint.el (comint-backward-matching-input): New command. + (comint-forward-matching-input): New command. + + * comint.el (comint-next-prompt, comint-previous-prompt): + Error if reach beg/end of buffer. + + * comint.el (comint-dynamic-complete): Fix for absolute input + number references. + (comint-dynamic-complete-filename): Changed listings + function to comint-dynamic-list-filename-completions. Uses + file-directory-p rather than string-match to test for directories. + (comint-dynamic-list-completions): Changed to list the + list of completions supplied as the function argument. Use buffer + " *Completions*". + + * comint.el (comint-match-partial-pathname): New subroutine. + (comint-dynamic-complete-variable): New command. + (comint-dynamic-list-filename-completions): New function. + + * shell.el (shell-delimiter-argument-list): New variable. + (shell-input-ring-file-name): New variable. + + * shell.el (shell-mode-map): Changed file name completions listing + binding to new name comint-dynamic-list-filename-completions. + + * shell.el (shell-mode): Call new function shell-read-input-ring + and shell-dirstack on start up. Doc fix for new functionality. + + * shell.el (shell-mode): Set shell-input-ring-file-name depending + on the command that was invoked for the inferior shell. Set + comint-delimiter-argument-list to shell-delimiter-argument-list. + + * shell.el (shell-read-input-ring): New function. + + * shell.el (shell-directory-tracker): Use comint-arguments. + + * shell.el (shell-front-match): Removed. + (shell-match-cmd-w/optional-arg): Removed. + + * shell.el (shell-process-popd): Fixed bug when numeric argument + equal to length of stack including current directory. + (shell-process-pushd): Fixed missing ()s in cond. + + * shell.el (shell-dynamic-complete-command): Uses exec-path minus + trailing emacs library path. Uses "." for nil elements in + exec-path. Uses string-match rather than funcall to test + candidate extensions. Uses member on completions list rather than + file-exists-p to test for existence. Uses file-directory-p rather + than funcall to test for directory. Uses directories only if in + current directory. Uses comint-dynamic-list-completions. + + Tue Sep 21 07:42:31 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * loaddefs.el (global-map): Add bindings for menu and find keys. + (function-key-map): Add translation for labeled help key. + + * mouse.el (mouse-drag-region): Put the text on the kill ring. + Don't set mark if region is empty. + (mouse-yank-at-click): Set this-command. + (mouse-start-end): Fix double-click-on-closeparen case. + (mouse-save-then-kill): When used repeatedly at different places, + alter the nearer end of the region. This applies regardless of how + the previous selection was made. + (mouse-drag-secondary, mouse-secondary-save-then-kill): + Rewrite for xterm-style dragging and extending. + + * comint.el (comint-previous-input): + Don't use replace-match; just insert before deleting. + (comint-magic-space): Use self-insert command. + (comint-history-file-name): New variable. + + Tue Sep 21 03:18:47 1993 Brian Fox (bfox@albert.gnu.ai.mit.edu) + + * edebug.el (edebug-enter): Don't call the current function being + debugged in pre-command-hook or post-command-hook. + + Mon Sep 20 23:43:49 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * edmacro.el: Total rewrite by Gillespie. + + Mon Sep 20 17:38:06 1993 Simon Marshall (Simon.Marshall@mail.esrin.esa.it) + + * shell.el (shell-command-regexp, shell-command-execonly) + (shell-pushd-tohome, shell-pushd-dextract) + (shell-pushd-dunique): New variables. + + * shell.el (shell-mode-map): Bound shell-forward/backward-command + to C-c C-f and C-c C-b. + + * shell.el (shell-mode): Set comint variables for which + shells have different values: + comint-get-current-command, comint-dynamic-complete-command. + + * shell.el (shell-directory-tracker): Parse through + command sequences for directory commands. + (shell-process-popd): Signal error if can't + process argument/stack. Fixed bug when no argument and no stack. + (shell-process-cd): Signal error if can't process argument. + (shell-process-pushd): Signal error if can't + process argument/stack. Handle shell-pushd-tohome, + shell-pushd-dextract, and shell-pushd-dunique. + + * shell.el (shell-forward-command, shell-backward-command) + (shell-dynamic-complete-command): New commands. + + Mon Sep 20 14:57:52 1993 Simon Marshall (Simon.Marshall@mail.esrin.esa.it) + + * comint.el (comint-mode): Initialize comint-input-ring before + running comint-mode-hook. + + * comint.el (comint-input-autoexpand): New variable. + (comint-dynamic-complete-command): New variable. + (comint-get-current-command): New variable. + + * comint.el (comint-read-input-ring): New function. + + * comint.el (comint-send-input): Handle history expansion. + (comint-input-sentinel): Doc fix. + + * comint.el (comint-mode-map): Added key binding for C-c C-h. + Added menu bars for completion, input and output. + + * comint.el (comint-dynamic-list-input-ring): New function. + + * comint.el (comint-previous-input-string): New subroutine. + (comint-previous-input): Use it. + (comint-previous-matching-input-string): New subroutine. + (comint-previous-matching-input): Use it. + + * comint.el (comint-replace-by-expanded-history): New command. + (comint-magic-space): New command. + (comint-replace-by-expanded-filename): Now replaces + expanded match for a filename, and then calls filename completion + comint-dynamic-complete-filename to do file name completion. + + * comint.el (comint-kill-output): Don't kill prompt. + (comint-show-output): Don't move point if it's + visible where it is, and if point is moved, put it after prompt. + + * comint.el (comint-dynamic-complete): Totally new definition. + (comint-dynamic-complete-filename): New name for old + function comint-dynamic-complete, completes files and lists + candidates, souped up for configurability. + (comint-dynamic-complete-variable): New command. + (comint-file-name-autolist): New variable. + (comint-file-name-addsuffix): New variable, + (comint-file-name-recexact): New variable. + + Mon Sep 20 11:39:04 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * mouse.el (mouse-save-then-kill): If follows a multi-click selection, + extend the selection. + (mouse-save-then-kill-delete-region): New subroutine. + (mouse-selection-click-count): New variable. + (mouse-drag-region): Set it. + + * ispell.el (ispell-message): New command, with menu bar item. + + Sat Sep 19 22:05:38 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * menu-bar.el (revert-buffer): + Enable menu item when the buffer is modified. + + Fri Sep 17 10:31:48 1993 Brian Fox (bfox@inferno) + + * simple.el (kill-region): Use `equal' instead of `eq' to compare + markers `beg' and `end'. They might be two different markers that + point to the same place. + + * rmail.el (rmail-forward): Insert the forwarded message + on the line which follows mail-header-separator, not at the end of + the buffer. + + * diary.el (diary-syntax-table): Make sure that we use a copy of + standard-syntax-table, and not the table itself. + + * compile.el (compile-reinitialize-errors): Use ">=" to compare + `find-at-least' to the `length' of compilation-error-list. + + * simula.el (simula-mode-syntax-table): Make sure that we use a + copy of standard-syntax-table, and not the table itself. + + * compile.el (compile-internal): Back out jimb change of making + buffer read-only. It is non-ergonomic. + + * vc.el (vc-print-log): Delete extraneous lines of RCS output if + present. + + * dired.el (dired-mode): Don't change the value of + case-fold-search. + + Wed Sep 15 12:56:44 1993 Brian Fox (bfox@inferno) + + * files.el (local-write-file-hooks): Make this variable + buffer-local. + + * dired.el (dired-build-subdir-alist): Call `expand-file-name' to + clean up the subdirectory title (removing extra "./"). + + Tue Aug 31 21:16:29 1993 Paul Eggert (eggert@twinsun.com) + + * vc.el (vc-do-command): Remove debugging output. Use (forward-line + -1) instead of (previous-line 1). + + Tue Sep 14 00:58:34 1993 Brian Fox (bfox@inferno) + + * rmail.el (rmail-convert-file): If the file is empty, don't + convert it after inserting the BABYL header. + + * cal-dst.el (calendar-absolute-from-time): Fix typo by + interchanging (floor) and (%). + + * byte-opt.el (side-effect-free-fns): Add "-" and "1-" to the + list. + + * subr.el (suppress-keymap): Use substitute-key-definition instead + of manually checking each key (we were using 127 instead of 255 + anyway). + + * loaddefs.el (ctl-x-map): `C-x r c' now runs `clear-rectangle'. + + * texinfmt.el (texinfo-format-region texinfo-format-buffer): Add + ###autoload cookies. + (batch-texinfo-format): Use `buffer-disable-undo' instead of + obsolete function `buffer-flush-undo'. + + * solar.el (s-hemi-seasons n-hemi-seasons): New constants are + hemisphere dependent list of season names. The names are + "international"; i.e., `vernal' and `autumnal' are used + consistently. + (solar-equinoxes-solstices): Use new constants, allowing southern + hemisphere reports to be meaningful. + (sunrise-sunset): Use `frame-width' instead of `screen-width'. + + * calendar.el (calendar-mode): Fix typos in documentation string. + + * outline.el (outline-minor-mode): Force update of modeline when + outline-minor-mode is toggled. + + Thu Aug 26 23:07:00 1993 Jim Blandy (blandy@comano.cscs.ch) + + * add-log.el (add-log-full-name, add-log-mailing-address): New + variables. + (add-change-log-entry): Don't ask for the login name and site name + separately; instead, prompt for a mailing address; that's more + useful. Set add-log-full-name and add-log-mailing-address, so + that the values specified persist after being specified once. + Create a new change log entry if the mailing address doesn't + match; don't just compare the date, full name, and login name. + + Wed Sep 1 10:31:28 1993 Brian Fox (bfox@inferno) + + * tex-mode.el (slitex-mode): Add ###autoload magic cookie. + + Fri Aug 27 00:40:59 1993 Brian Fox (bfox@sonderbar) + + * diff.el (diff): Doc fix. + + Tue Aug 17 23:50:18 1993 Brian Fox (bfox@inferno) + + * version.el: Changed comment to refer to actual filename + "inc-vers.el" instead of "inc-version.el". + + Fri Sep 17 17:24:00 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * mouse.el (mouse-set-region): Put region in kill ring. + (mouse-drag-region): Handle double and triple clicks + when displaying region and when setting it. + (mouse-skip-word, mouse-start-end): New functions. + + Fri Sep 17 14:42:39 1993 Stig@netcom.com (Jonathan Stigelman) + + * hilit19.el: + - (hilit-rehighlight-region): added (save-restriction (widen)) + to avoid hangups in dired. + - Also slight improvements to fortran patterns and + hilit-default-face-table doc string + - added optional case-fold argument to hilit-set-mode-patterns + - added hilit-rehighlight-buffer-quietly to dired-after-readin-hook + - fixed bug in hilit-string-find that mishandled some strings: "\\" + - work-around for bug in next-overlay-change + - the pattern matcher now starts it's searches from the end of the + most recently highlighted region (which is not necessarily the end + of the most recently matched regex). + - code moved from hilit-highlight-region to hilit-set-mode-patterns. + This will affect you if you pass your patterns directly to + hilit-highlight-region....use a pseudo-mode instead. + - twiddled C/C++, latex, texinfo, fortran, nroff patterns. + - added calendar-mode, icon-mode and pascal-mode patterns + - diverged lisp-mode and emacs-lisp-mode...also added lisp keywords. + + Fri Sep 17 14:52:33 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * yow.el (read-zippyism): New function. + + * cookie1.el (read-cookie): New function. + + Fri Sep 17 13:51:33 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * files.el (directory-abbrev-alist): Doc fix. + + Thu Sep 16 10:52:37 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * gud.el (perldb): New function, plus subroutines. + + * text-mode.el (indented-text-mode): Make only blank lines + separate or start paragraphs. Doc fix. + + * font-lock.el (font-lock-fontify-region): Don't add `font-lock' props. + (font-lock-unfontify-region): Don't remove `font-lock' props. + (font-lock-hack-keywords): Don't add `font-lock' props. + Handle values other than t and nil for allow-overlap-p specially. + (c-font-lock-keywords-1): Don't override how comments in #if... appear. + Highlight text after #else or #endif. + + Wed Sep 15 19:22:28 1993 Paul Eggert (eggert@twinsun.com) + + * vc.el (vc-version-other-window): New function. + (vc-backend-checkout): Add optional arg workfile, which specifies + where to put the working file. + * vc-hooks.el (vc-prefix-map): Bind C-x v ~ to + vc-version-other-window. + + Wed Sep 15 17:45:50 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * rmail.el (rmail-forward): Insert the text right after the + header separator. + + * iso-acc.el: Set up keymap at load time. + (iso-accents-mode): Not here. Just setq iso-accents-minor-mode. + (iso-accents-minor-mode): Make it local in all buffers. + + Tue Sep 14 12:51:30 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * iso-acc.el: New file. + Rename `iso-accents' to `iso-accents-mode' and change comments + accordingly. Fix doc strings. + (iso-accents-minor-mode): Now a user option. + (iso-accents-mode): Positive arg means enable. + No arg means toggle. + + Mon Sep 13 19:49:45 1993 Per Cederqvist (ceder@signum.se) + + * forms.el: Change typos in comments. + (forms-delete-record, forms--update): Use `delete-region' instead of + `kill-line' to avoid messing around with the kill ring. + + Mon Sep 13 23:35:33 1993 Johan Vromans (jv@mh.nl) + + * forms.el: Release 2.1 for Emacs 19.19. + (forms--process-format-list): No need to prepend a text item + anymore. + (forms--ro-modification-start): Renamed to `forms--iif-start. + (forms--ro-properties): Renamed to `forms--iif-properties'. + (forms--romh): Renamed to `forms--iif-hook'. Rewritten to use + `insert-in-front-hooks' instead of `modification-hooks'. + (forms--romh-post-command-hook): Renamed to + `forms--iif-post-command-hook'. Rewritten to use + `insert-in-front-hooks' instead of `modification-hooks'. + (forms--make-format, forms--make-format-elt-using-text-properties): + Use `insert-in-front-hooks' instead of `modification-hooks'. + Remove `forms--electric' code. Use `front-sticky' and + `rear-nonsticky' text properties to control the insertion of text + between read-only fields. + (forms--show-record): Remove `forms--electric' code. + + Sun Sep 12 07:24:21 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * sc.el (sc-glom-headers): Bind mark-active around calling region-... + (sc-cite-original): Likewise. + + Sat Sep 11 06:39:46 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * font-lock.el (font-lock-fontify-region): Put on `font-lock' + property as well as `face' property. + (font-lock-hack-keywords): Likewise. + + * rmail.el (rmail-convert-file): Narrow to exclude the Babyl header. + + Fri Sep 10 01:05:45 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * paths.el (rmail-spool-directory): Use "/var/mail/" if + system-type is netbsd. + + Thu Sep 9 00:31:27 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + + * rlogin.el: require 'shell. + + Wed Sep 8 12:06:37 1993 Paul Eggert (eggert@twinsun.com) + + * vc.el (vc-backend-steal): Fix typo when invoking the 'rcs' + command to steal the lock. + + Wed Sep 8 02:22:59 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * shell.el (shell-dirstack-message): Recognize ~ by matching the + expansion of "~" with comint-filename-prefix prepended. Strip + comint-filename-prefix from elts. + + * comint.el (comint-filename-prefix): New variable. + (comint-replace-by-expanded-filename, comint-dynamic-complete, + comint-dynamic-list-completions): Prepend it to absolute file + names before completing. + * shell.el (shell-cd): New function, like `cd' but prepend + comint-filename-prefix. + (shell-resync-dirs, shell-process-cd, shell-process-pushd, + shell-process-popd): Use shell-cd in place of cd. + * rlogin.el (rlogin): After rlogin-mode, set + comint-filename-prefix locally to indicate the host, and cd to + /HOST:~/. + (rlogin-mode-map): Start with (cons 'keymap shell-mode-map), + rather than with a full copy of comint-mode-map. + + * ange-ftp.el (ange-ftp-file-executable-p): New function, handles + file-executable-p. + + Tue Sep 7 13:06:55 1993 Ron Schnell (ronnie@media.mit.edu) + + * dunnet.el (dun-save-game): Use correct name of endgame question. + + Tue Sep 7 04:35:26 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * files.el (hack-local-variables-prop-line): Ignore any specification + for `mode:', since set-auto-mode has already handled it. + (set-auto-mode): Clean up. Handle more than one `mode:' spec in -*-. + + * rmail.el (rmail-convert-file): Exclude the Babyl header + when calling rmail-convert-to-babyl-format. + + * startup.el (command-line): Setq inhibit-startup-message to nil. + + Mon Sep 6 18:48:08 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * register.el (jump-to-register): Take new optional arg NODELETE + (prefix arg); pass through to set-frame-configuration. + * frame.el (set-frame-configuration): Take new optional arg + NODELETE; if non-nil, don't delete any frames. + + * register.el (window-configuration-to-register): Fix + prompt string in interactive spec. + (frame-configuration-to-register): Likewise. + + * menu-bar.el: Don't clobber existing binding for menu-bar in + global-map. + + Mon Sep 6 22:37:51 1993 Paul Eggert (eggert@twinsun.com) + + * cal-dst.el (calendar-time-zone-daylight-rules): Remove + special case for Israel. Israel has changed its daylight + savings time rules. We don't know what the current rules are, + but the special case was definitely incorrect. + + Mon Sep 6 18:15:29 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * etags.el (tag-exact-match-p): Return true if TAG is the explicit + tag name. + + Mon Sep 6 08:48:50 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * simula.el: Doc fixes. + (simula-mode-syntax-table): Copy the syntax table. + + Mon Aug 30 12:17:43 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * etags.el (next-file): If arg is neither t nor nil, then eval it + to return initial list of files. + (tags-loop-continue): Doc fix. + (tags-search, tags-query-replace): Take optional final arg and pass to + tags-loop-continue (through to next-file) instead of t if non-nil. + + Sun Aug 29 10:29:22 1993 Paul Eggert (eggert@twinsun.com) + + * solar.el (solar-degrees-to-quadrant): Use `floor' not `truncate'. + (solar-sunrise, solar-sunset, solar-longitude-of-sun): + Undo Aug 19 patch; not needed with new `mod'. + + Sun Aug 29 08:21:25 1993 Edward M. Reingold (reingold@emr.cs.uiuc.edu) + + * solar.el (solar-equinoxes-solstices): Invert seasons in southern + hemisphere. Use "Autumnal" not "Fall". + + Sat Aug 28 02:41:19 1993 Paul Eggert (eggert@twinsun.com) + + * cal-dst.el (calendar-time-zone-daylight-rules): Scan through the + next few years until at most one rule remains; if none remain, then + just use the first candidate rule; it's wrong in general, but it's + right for at least one year. This is a better heuristic in case the + underlying time zone implementation has bugs (which is all too + common). If possible, don't convert back and forth between gregorian + and absolute; this speeds things up noticeably. This uses the new + calendar-nth-named-absday function. + + (calendar-current-time-zone): Some locales start DST at a different + time of day than they end; allow for this by yielding both times. The + performance speedups in calendar.el are great enough that we now no + longer need the "Checking time zone data..." message. If + current-time-zone yields nil, don't bother with + calendar-next-time-zone-transition. Use clearer names for local vars. + + (calendar-time-zone, calendar-daylight-time-offset, + calendar-{standard,daylight}-time-zone-name, + calendar-daylight-savings-{starts,ends}): Default to US Eastern rules + for information that is not available. + + (calendar-daylight-savings-{starts,ends}-time): New vars, replacing + calendar-daylight-savings-switchover-time, to support locales that + start DST at a different time of day than they end. + + (calendar-absolute-from-time): Fix typo by interchanging floor and mod. + + * calendar.el (solar-holidays): Use new + calendar-daylight-savings-{starts,ends}-time vars instead of old + calendar-daylight-savings-switchover-time var. + + (calendar-last-day-of-month): Tune by testing month before year. + (calendar-absolute-from-gregorian): Tune by computing (1- year) once. + + (calendar-nth-named-absday): New function, used to improve performance + in calendar-time-zone-daylight-rules. + (calendar-nth-named-day): Use it. + + * solar.el (solar-time-string): + Use new calendar-daylight-savings-{starts,ends}-time + vars instead of old calendar-daylight-savings-switchover-time var. + + Thu Aug 26 20:56:51 1993 Paul Eggert (eggert@twinsun.com) + + * vc.el (vc-locked-example): Renamed from vc-quiescent-p. Now + yields example of why current directory is not quiescent. All + callers changed to use this. + + * vc-hooks.el (vc-find-file-hook, vc-file-not-found-hook): Use + add-hook to install these hooks. + + Thu Aug 19 14:21:25 1993 Edward M. Reingold (reingold@emr.cs.uiuc.edu) + + * solar.el (solar-sunrise, solar-sunset, solar-longitude-of-sun): + Make both arguments to solar-mod float. + + (sunrise-sunset): Change screen-width to frame-width. + + * calendar.el (calendar-absolute-from-iso, + american-calendar-display-form, european-calendar-display-form): + Fix typos in doc strings doc strings. + + (calendar-mode-map): Use "[prior]" and "[next]" in key bindings. + + Wed Aug 18 12:48:40 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * texinfo.el (texinfo-environment-regexp): Match cartouche. + + * upd-copyr.el (update-copyright): Handle two-digit years with + apostrophes. + Sat Aug 14 03:54:40 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/abbrevlist.el emacs-19.20/lisp/abbrevlist.el *** emacs-19.19/lisp/abbrevlist.el --- emacs-19.20/lisp/abbrevlist.el Sun Sep 12 04:45:34 1993 *************** *** 0 **** --- 1,52 ---- + ;;; abbrevlist.el --- list one abbrev table alphabetically ordered. + + ;; Copyright (C) 1986, 1992 Free Software Foundation, Inc. + ;; Suggested by a previous version by Gildea. + + ;; Maintainer: FSF + ;; Keywords: abbrev + + ;; This file is part of GNU Emacs. + + ;; GNU Emacs is free software; you can redistribute it and/or modify + ;; it under the terms of the GNU General Public License as published by + ;; the Free Software Foundation; either version 2, or (at your option) + ;; any later version. + + ;; GNU Emacs is distributed in the hope that it will be useful, + ;; but WITHOUT ANY WARRANTY; without even the implied warranty of + ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ;; GNU General Public License for more details. + + ;; You should have received a copy of the GNU General Public License + ;; along with GNU Emacs; see the file COPYING. If not, write to + ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + + ;;; Code: + + (defun list-one-abbrev-table (abbrev-table output-buffer) + "Display alphabetical listing of ABBREV-TABLE in buffer OUTPUT-BUFFER." + (with-output-to-temp-buffer output-buffer + (save-excursion + (let ((abbrev-list nil) (first-column 0)) + (set-buffer standard-output) + (mapatoms + (function (lambda (abbrev) + (setq abbrev-list (cons abbrev abbrev-list)))) + abbrev-table) + (setq abbrev-list (sort abbrev-list 'string-lessp)) + (while abbrev-list + (if (> (+ first-column 40) (frame-width)) + (progn + (insert "\n") + (setq first-column 0))) + (indent-to first-column) + (insert (symbol-name (car abbrev-list))) + (indent-to (+ first-column 8)) + (insert (symbol-value (car abbrev-list))) + (setq first-column (+ first-column 40)) + (setq abbrev-list (cdr abbrev-list))))))) + + (provide 'abbrevlist) + + ;;; abbrevlist.el ends here diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/add-log.el emacs-19.20/lisp/add-log.el *** emacs-19.19/lisp/add-log.el Sun Aug 15 01:18:59 1993 --- emacs-19.20/lisp/add-log.el Sun Sep 19 10:16:39 1993 *************** *** 38,41 **** --- 38,52 ---- instead) with no arguments. It returns a string or nil if it cannot guess.") + ;;;###autoload + (defvar add-log-full-name (user-full-name) + "*Full name of user, for inclusion in ChangeLog daily headers. + This defaults to the value returned by the `user-full-name' function.") + + ;;;###autoload + (defvar add-log-mailing-address (concat (user-login-name) "@" (system-name)) + "*Electronic mail address of user, for inclusion in ChangeLog daily headers. + This defaults to the value returned by `user-login-name', followed by + an `@' character, followed by the value returned by `system-name'.") + (defun change-log-name () (or change-log-default-name *************** *** 111,130 **** (interactive (list current-prefix-arg (prompt-for-change-log-name))) ! (let* ((full-name (if whoami ! (read-input "Full name: " (user-full-name)) ! (user-full-name))) ;; Note that some sites have room and phone number fields in ;; full name which look silly when inserted. Rather than do ;; anything about that here, let user give prefix argument so that ;; s/he can edit the full name field in prompter if s/he wants. ! (login-name (if whoami ! (read-input "Login name: " (user-login-name)) ! (user-login-name))) ! (site-name (if whoami ! (read-input "Site name: " (system-name)) ! (system-name))) ! (defun (funcall (or add-log-current-defun-function ! 'add-log-current-defun))) ! paragraph-end entry) (setq file-name (find-change-log file-name)) --- 122,137 ---- (interactive (list current-prefix-arg (prompt-for-change-log-name))) ! (if whoami ! (progn ! (setq add-log-full-name (read-input "Full name: " add-log-full-name)) ;; Note that some sites have room and phone number fields in ;; full name which look silly when inserted. Rather than do ;; anything about that here, let user give prefix argument so that ;; s/he can edit the full name field in prompter if s/he wants. ! (setq add-log-mailing-address ! (read-input "Mailing address: " add-log-mailing-address)))) ! (let ((defun (funcall (or add-log-current-defun-function ! 'add-log-current-defun))) ! paragraph-end entry) (setq file-name (find-change-log file-name)) *************** *** 148,157 **** (if (looking-at (concat (regexp-quote (substring (current-time-string) 0 10)) ! ".* " (regexp-quote full-name) ! " (" (regexp-quote login-name) "@")) (forward-line 1) (insert (current-time-string) ! " " full-name ! " (" login-name "@" site-name ")\n\n")) ;; Search only within the first paragraph. --- 155,164 ---- (if (looking-at (concat (regexp-quote (substring (current-time-string) 0 10)) ! ".* " (regexp-quote add-log-full-name) ! " (" (regexp-quote add-log-mailing-address))) (forward-line 1) (insert (current-time-string) ! " " add-log-full-name ! " (" add-log-mailing-address ")\n\n")) ;; Search only within the first paragraph. diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/advice.el emacs-19.20/lisp/advice.el *** emacs-19.19/lisp/advice.el Sun Aug 15 01:19:05 1993 --- emacs-19.20/lisp/advice.el Mon Oct 4 21:54:14 1993 *************** *** 91,95 **** ;; Advice has enough features now to justify an info file, however, I ;; didn't have the time yet to do all the necessary formatting. So, ! ;; until I do have the time or some kind soul does it for me I cramped ;; everything into the source file. Because about 50% of this file is ;; documentation it should be in outline-mode by default, but it is not. --- 91,95 ---- ;; Advice has enough features now to justify an info file, however, I ;; didn't have the time yet to do all the necessary formatting. So, ! ;; until I do have the time or some kind soul does it for me I crammed ;; everything into the source file. Because about 50% of this file is ;; documentation it should be in outline-mode by default, but it is not. diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/ange-ftp.el emacs-19.20/lisp/ange-ftp.el *** emacs-19.19/lisp/ange-ftp.el Wed Aug 11 17:42:27 1993 --- emacs-19.20/lisp/ange-ftp.el Thu Nov 4 07:02:26 1993 *************** *** 857,861 **** ;;;; ------------------------------------------------------------ ! (defconst ange-ftp-version "$Revision: 1.32 $") (defvar ange-ftp-data-buffer-name " *ftp data*" --- 857,861 ---- ;;;; ------------------------------------------------------------ ! (defconst ange-ftp-version "$Revision: 1.35 $") (defvar ange-ftp-data-buffer-name " *ftp data*" *************** *** 3082,3085 **** --- 3082,3091 ---- (ange-ftp-real-file-readable-p file))) + (defun ange-ftp-file-executable-p (file) + (setq file (expand-file-name file)) + (if (ange-ftp-ftp-name file) + (file-exists-p file) + (ange-ftp-real-file-executable-p file))) + (defun ange-ftp-delete-file (file) (interactive "fDelete file: ") *************** *** 3629,3639 **** tmp1)))) ! (defun ange-ftp-load (file) (if (ange-ftp-ftp-name file) (let ((copy (ange-ftp-file-local-copy file))) (unwind-protect ! (load copy) (delete-file copy))) ! (ange-ftp-real-load file))) ;; Calculate default-unhandled-directory for a given ange-ftp buffer. --- 3635,3645 ---- tmp1)))) ! (defun ange-ftp-load (file &rest args) (if (ange-ftp-ftp-name file) (let ((copy (ange-ftp-file-local-copy file))) (unwind-protect ! (apply 'load copy args) (delete-file copy))) ! (apply 'ange-ftp-real-load file args))) ;; Calculate default-unhandled-directory for a given ange-ftp buffer. *************** *** 3789,3792 **** --- 3795,3799 ---- (put 'file-writable-p 'ange-ftp 'ange-ftp-file-writable-p) (put 'file-readable-p 'ange-ftp 'ange-ftp-file-readable-p) + (put 'file-executable-p 'ange-ftp 'ange-ftp-file-executable-p) (put 'file-symlink-p 'ange-ftp 'ange-ftp-file-symlink-p) (put 'delete-file 'ange-ftp 'ange-ftp-delete-file) *************** *** 3858,3861 **** --- 3865,3871 ---- (let (file-name-handler-alist) (apply 'file-readable-p args))) + (defun ange-ftp-real-file-executable-p (&rest args) + (let (file-name-handler-alist) + (apply 'file-executable-p args))) (defun ange-ftp-real-file-symlink-p (&rest args) (let (file-name-handler-alist) *************** *** 3931,3936 **** (defun ange-ftp-dired-uncache (dir) ! (if (ange-ftp-ftp-name (expand-file-name dir))) ! (setq ange-ftp-ls-cache-file nil)) (defvar ange-ftp-sans-version-alist nil --- 3941,3946 ---- (defun ange-ftp-dired-uncache (dir) ! (if (ange-ftp-ftp-name (expand-file-name dir)) ! (setq ange-ftp-ls-cache-file nil))) (defvar ange-ftp-sans-version-alist nil diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/bookmark.el emacs-19.20/lisp/bookmark.el *** emacs-19.19/lisp/bookmark.el Sat Aug 14 15:50:12 1993 --- emacs-19.20/lisp/bookmark.el Mon Oct 25 23:29:11 1993 *************** *** 1,10 **** ;;; bookmark.el --- set bookmarks, jump to them later. ! ;; Copyright (C) 1993 Free Software Foundation, Inc. ;; Author: Karl Fogel ;; Maintainer: Karl Fogel ;; Created: July, 1993 ! ;; Version: 1.7.3 (interim) ;; Keywords: bookmarks, placeholders --- 1,10 ---- ;;; bookmark.el --- set bookmarks, jump to them later. ! ;; Copyright (C) 1993 Free Software Foundation ;; Author: Karl Fogel ;; Maintainer: Karl Fogel ;; Created: July, 1993 ! ;; Version: 2.5 ;; Keywords: bookmarks, placeholders *************** *** 27,35 **** ;; Thanks to David Bremner for thinking of and ;; then implementing the bookmark-current-bookmark idea. He even ! ;; sent *patches*, bless his soul... ;; Thanks to Gregory M. Saunders for ;; fixing and improving bookmark-time-to-save-p. ;; Based on info-bookmark.el, by Karl Fogel and Ken Olstad ;; . --- 27,57 ---- ;; Thanks to David Bremner for thinking of and ;; then implementing the bookmark-current-bookmark idea. He even ! ;; sent *patches*, bless his soul... ;; Thanks to Gregory M. Saunders for ;; fixing and improving bookmark-time-to-save-p. + ;; Thanks go to Andrew V. Klein for the code that + ;; sorts the alist before presenting it to the user (in list-bookmarks + ;; and the menu-bar). + + ;; And much thanks to David Hughes for many small + ;; suggestions and the code to implement them (like + ;; Bookmark-menu-check-position, and some of the Lucid compatibility + ;; stuff). + + ;; Kudos (whatever they are) go to Jim Blandy + ;; for his eminently sensible suggestion to separate bookmark-jump + ;; into bookmark-jump and bookmark-jump-noselect, which made many + ;; other things cleaner as well. + + ;; Thanks to Roland McGrath for encouragement and help with defining + ;; autoloads on the menu-bar. + + ;; Jonathan Stigelman gave patches for default + ;; values in bookmark-jump and bookmark-set. Everybody please keep + ;; all the keystrokes they save thereby and send them to him at the + ;; end of each year :-) (No, seriously, thanks Jonathan!) + ;; Based on info-bookmark.el, by Karl Fogel and Ken Olstad ;; . *************** *** 38,42 **** ;; bookmark|Karl Fogel|kfogel@cs.oberlin.edu| ;; Setting bookmarks in files or directories, jumping to them later.| ! ;; 16-July-93|Version: 1.7.2|~/misc/bookmark.el.Z| ;; FAVORITE CHINESE RESTAURANT: --- 60,66 ---- ;; bookmark|Karl Fogel|kfogel@cs.oberlin.edu| ;; Setting bookmarks in files or directories, jumping to them later.| ! ;; 16-July-93|Version: 2.5|~/misc/bookmark.el.Z| ! ! ;; Enough with the credits already, get on to the good stuff: ;; FAVORITE CHINESE RESTAURANT: *************** *** 64,72 **** ;; there were any. ;; ! ;; It is not advisable to sort the bookmark list when it is presented ! ;; to the user, because it is already sorted in what is probably the ! ;; most useful way: order of creation, with most recently created ! ;; bookmarks coming first and older ones toward the end (renaming does ! ;; not count as creating) -- which is what we want, most of the time. ;;; Code: --- 88,95 ---- ;; there were any. ;; ! ;; The bookmark list is sorted lexically by default, but you can turn ! ;; this off by setting bookmark-sort-flag to nil. If it is nil, then ! ;; the list will be presented in the order it is recorded ! ;; (chronologically), which is actually fairly useful as well. ;;; Code: *************** *** 75,86 **** (or (fboundp 'defalias) (fset 'defalias 'fset)) ! ;; these are the distribution keybindings suggested by RMS, everything ;; else will be done with M-x or the menubar: ! (define-key ctl-x-map "rb" 'bookmark-jump) ! (define-key ctl-x-map "rm" 'bookmark-set) ! (define-key ctl-x-map "rl" 'bookmark-locate) ;; define the map, so it can be bound by those who desire to do so: (defvar bookmark-map nil "Keymap containing bindings to bookmark functions. --- 98,119 ---- (or (fboundp 'defalias) (fset 'defalias 'fset)) ! ;; suggested for lucid compatibility by david hughes: ! (or (fboundp 'frame-height) (fset 'frame-height 'screen-height)) ! ! ;; some people have C-x r set to rmail or whatever. We don't want to ! ;; assume that C-x r is a prefix map just because it's distributed ! ;; that way... ! ;; These are the distribution keybindings suggested by RMS, everything ;; else will be done with M-x or the menubar: ! ;;;###autoload ! (if (symbolp (key-binding "\C-xr")) ! nil ! (progn (define-key ctl-x-map "rb" 'bookmark-jump) ! (define-key ctl-x-map "rm" 'bookmark-set) ! (define-key ctl-x-map "rl" 'list-bookmarks))) ;; define the map, so it can be bound by those who desire to do so: + ;;;###autoload (defvar bookmark-map nil "Keymap containing bindings to bookmark functions. *************** *** 90,108 **** functions have a binding in this keymap.") (define-prefix-command 'bookmark-map) ;; Read the help on all of these functions for details... ! ;; "x" marks the spot! (define-key bookmark-map "x" 'bookmark-set) (define-key bookmark-map "j" 'bookmark-jump) (define-key bookmark-map "i" 'bookmark-insert) (define-key bookmark-map "f" 'bookmark-locate) ; "f" for "find" (define-key bookmark-map "r" 'bookmark-rename) ! ;; deletes bookmarks (define-key bookmark-map "d" 'bookmark-delete) ! ;; loads new file (define-key bookmark-map "l" 'bookmark-load) ! ;; saves them in file ! (define-key bookmark-map "w" 'bookmark-write) (define-key bookmark-map "s" 'bookmark-save) --- 123,153 ---- functions have a binding in this keymap.") + ;;;###autoload (define-prefix-command 'bookmark-map) ;; Read the help on all of these functions for details... ! ;;;###autoload (define-key bookmark-map "x" 'bookmark-set) + ;;;###autoload + (define-key bookmark-map "m" 'bookmark-set) ; "m" for "mark" + ;;;###autoload (define-key bookmark-map "j" 'bookmark-jump) + ;;;###autoload + (define-key bookmark-map "g" 'bookmark-jump) ; "g" for "go" + ;;;###autoload (define-key bookmark-map "i" 'bookmark-insert) + ;;;###autoload + (define-key bookmark-map "e" 'edit-bookmarks) + ;;;###autoload (define-key bookmark-map "f" 'bookmark-locate) ; "f" for "find" + ;;;###autoload (define-key bookmark-map "r" 'bookmark-rename) ! ;;;###autoload (define-key bookmark-map "d" 'bookmark-delete) ! ;;;###autoload (define-key bookmark-map "l" 'bookmark-load) ! ;;;###autoload ! (define-key bookmark-map "w" 'bookmark-write) ! ;;;###autoload (define-key bookmark-map "s" 'bookmark-save) *************** *** 112,127 **** instead, let the various bookmark functions do it for you.") ;; just add the hook to make sure that people don't lose bookmarks ;; when they kill Emacs, unless they don't want to save them. ! (add-hook 'kill-emacs-hook (function ! (lambda () ! (and (featurep 'bookmark) ! bookmark-alist ! (bookmark-time-to-save-p t) ! (bookmark-save))))) ;; more stuff added by db. (defvar bookmark-current-bookmark nil "Name of bookmark most recently used in the current file. --- 157,174 ---- instead, let the various bookmark functions do it for you.") + (defvar bookmarks-already-loaded nil) + ;; just add the hook to make sure that people don't lose bookmarks ;; when they kill Emacs, unless they don't want to save them. ! ;;;###autoload (add-hook 'kill-emacs-hook (function ! (lambda () (and (featurep 'bookmark) ! bookmark-alist ! (bookmark-time-to-save-p t) ! (bookmark-save))))) ;; more stuff added by db. + (defvar bookmark-current-bookmark nil "Name of bookmark most recently used in the current file. *************** *** 155,161 **** --- 202,220 ---- "*File in which to save bookmarks by default.") + (defvar bookmark-version-control 'nospecial + "This variable controls whether or not to make numbered backups of + the master bookmark file. It can have four values: t, nil, never, and + nospecial. The first three have the same meaning that they do for the + variable version-control, and the final value nospecial means just use + the value of version-control.") + (defvar bookmark-completion-ignore-case t "*Non-nil means bookmark functions ignore case in completion.") + (defvar bookmark-sort-flag t + "*Non-nil means that bookmarks will be displayed sorted by bookmark + name. Otherwise they will be displayed in LIFO order (that is, most + recently set ones come first, oldest ones come last).") + (defvar bookmark-search-size 500 "Length of the context strings recorded on either side of a bookmark.") *************** *** 165,170 **** (defvar bookmark-current-buffer nil) (defun bookmark-set (&optional parg) - "Set a bookmark named NAME inside a file. With prefix arg, will not overwrite a bookmark that has the same name --- 224,229 ---- (defvar bookmark-current-buffer nil) + ;;;###autoload (defun bookmark-set (&optional parg) "Set a bookmark named NAME inside a file. With prefix arg, will not overwrite a bookmark that has the same name *************** *** 191,212 **** (if (not (bookmark-buffer-file-name)) (error "Buffer not visiting a file or directory.")) (setq bookmark-current-point (point)) (setq bookmark-yank-point (point)) (setq bookmark-current-buffer (current-buffer)) ! (let ((str ! (read-from-minibuffer ! "Set bookmark: " ! nil ! (let ((now-map (copy-keymap minibuffer-local-map))) ! (progn (define-key now-map "\C-w" ! 'bookmark-yank-word) ! (define-key now-map "\C-v" ! 'bookmark-insert-current-file-name) ! (define-key now-map "\C-u" ! 'bookmark-insert-current-bookmark)) ! now-map)))) (progn (bookmark-make parg str) ! (setq bookmark-current-bookmark str) (goto-char bookmark-current-point)))) --- 250,279 ---- (if (not (bookmark-buffer-file-name)) (error "Buffer not visiting a file or directory.")) + (bookmark-try-default-file) (setq bookmark-current-point (point)) (setq bookmark-yank-point (point)) (setq bookmark-current-buffer (current-buffer)) ! (let* ((default (or bookmark-current-bookmark ! (buffer-name (current-buffer)))) ! (str ! (read-from-minibuffer ! (format "Set bookmark (%s): " default) ! nil ! (let ((now-map (copy-keymap minibuffer-local-map))) ! (progn (define-key now-map "\C-w" ! 'bookmark-yank-word) ! (define-key now-map "\C-v" ! 'bookmark-insert-current-file-name) ! (define-key now-map "\C-u" ! 'bookmark-insert-current-bookmark)) ! now-map)))) ! (and (string-equal str "") (setq str default)) (progn (bookmark-make parg str) ! (setq bookmark-current-bookmark str) ! (if (get-buffer "*Bookmark List*") ;rebuild the bookmark list ! (save-excursion ! (save-window-excursion ! (list-bookmarks)))) (goto-char bookmark-current-point)))) *************** *** 226,231 **** (interactive) (let ((str (save-excursion ! (set-buffer bookmark-current-buffer) ! (bookmark-buffer-file-name)))) (insert (substring str --- 293,298 ---- (interactive) (let ((str (save-excursion ! (set-buffer bookmark-current-buffer) ! (bookmark-buffer-file-name)))) (insert (substring str *************** *** 239,249 **** ;; the bookmark currently being set. (let ((string (save-excursion ! (set-buffer bookmark-current-buffer) ! (goto-char bookmark-yank-point) ! (buffer-substring ! (point) ! (save-excursion ! (forward-word 1) ! (setq bookmark-yank-point (point))))))) (insert string))) --- 306,316 ---- ;; the bookmark currently being set. (let ((string (save-excursion ! (set-buffer bookmark-current-buffer) ! (goto-char bookmark-yank-point) ! (buffer-substring ! (point) ! (save-excursion ! (forward-word 1) ! (setq bookmark-yank-point (point))))))) (insert string))) *************** *** 298,305 **** (defun bookmark-try-default-file () ! (if (and (null bookmark-alist) ! (file-readable-p (expand-file-name bookmark-file))) ! (bookmark-load bookmark-file))) (defun bookmark-jump (str) "Jump to bookmark BOOKMARK (a point in some file). --- 365,385 ---- (defun bookmark-try-default-file () ! (and (not bookmarks-already-loaded) ! (null bookmark-alist) ! (file-readable-p (expand-file-name bookmark-file)) ! (progn ! (bookmark-load bookmark-file t t) ! (setq bookmarks-already-loaded t)))) ! ! (defun bookmark-maybe-sort-alist () ! ;;Return the bookmark-alist for display. If the bookmark-sort-flag ! ;;is non-nil, then return a sorted copy of the alist. ! (if bookmark-sort-flag ! (setq bookmark-alist ! (sort (copy-alist bookmark-alist) ! (function ! (lambda (x y) (string-lessp (car x) (car y)))))))) + ;;;###autoload (defun bookmark-jump (str) "Jump to bookmark BOOKMARK (a point in some file). *************** *** 307,377 **** `bookmark-alist' is nil. If that happens, you need to load in some bookmarks. See help on function `bookmark-load' for more about ! this." ! (interactive (let ((completion-ignore-case ! bookmark-completion-ignore-case)) ! (list (completing-read ! "Jump to bookmark: " ! bookmark-alist ! nil ! 0)))) ! (let ((whereto-list (car (cdr (assoc str bookmark-alist))))) ! (let ((file (car whereto-list)) ! (forward-str (car (cdr whereto-list))) ! (behind-str (car (cdr (cdr whereto-list)))) ! (place (car (cdr (cdr (cdr whereto-list)))))) ! (if (file-exists-p (expand-file-name file)) ! (progn ! (find-file (expand-file-name file)) ! (goto-char place) ! ;; Go searching forward first. Then, if forward-str exists and ! ;; was found in the file, we can search backward for behind-str. ! ;; Rationale is that if text was inserted between the two in the ! ;; file, it's better to be put before it so you can read it, ! ;; rather than after and remain perhaps unaware of the changes. ! (if forward-str ! (if (search-forward forward-str (point-max) t) ! (backward-char bookmark-search-size))) ! (if behind-str ! (if (search-backward behind-str (point-min) t) ! (forward-char bookmark-search-size))) ! ;; added by db ! (setq bookmark-current-bookmark str)) ! (error ! (concat "File " ! file ! " does not exist. Suggest deleting bookmark \"" ! str ! "\"")))))) ! (defun bookmark-locate (str) ! "Insert the name of the file associated with BOOKMARK. ! \(This is not the same as the contents of that file\)." (interactive (let ((completion-ignore-case bookmark-completion-ignore-case)) ! (list (completing-read ! "Insert bookmark location: " ! bookmark-alist ! nil ! 0)))) ! (insert (car (car (cdr (assoc str bookmark-alist)))))) (defun bookmark-rename (old &optional new) ! "Change the name of BOOKMARK to NEWNAME. ! If called from keyboard, prompts for OLD and NEWNAME. ! If called from menubar, prompts for NEWNAME. ! If called from Lisp, prompts for NEWNAME if only BOOKMARK was passed ! as an argument. If called with two strings, then no prompting is ! done. You must pass at least BOOKMARK when calling from Lisp. While you are entering the new name, consecutive C-w's insert consectutive words from the text of the buffer into the new bookmark name, and C-v inserts the name of the file." - (interactive (let ((completion-ignore-case bookmark-completion-ignore-case)) ! (list (completing-read "Old bookmark name: " ! bookmark-alist ! nil ! 0)))) (progn (setq bookmark-current-point (point)) --- 387,539 ---- `bookmark-alist' is nil. If that happens, you need to load in some bookmarks. See help on function `bookmark-load' for more about ! this. ! If the file pointed to by BOOKMARK no longer exists, you will be asked ! if you wish to give the bookmark a new location, and bookmark-jump ! will then jump to the new location, as well as recording it in place ! of the old one in the permanent bookmark record." ! (interactive (progn (bookmark-try-default-file) ! (let* ((completion-ignore-case ! bookmark-completion-ignore-case) ! (default ! (or (and ! (assoc bookmark-current-bookmark ! bookmark-alist) ! bookmark-current-bookmark) ! (and (assoc (buffer-name (current-buffer)) ! bookmark-alist) ! (buffer-name (current-buffer))))) ! (str ! (completing-read ! (if default ! (format "Jump to bookmark (%s): " ! default) ! "Jump to bookmark: ") ! bookmark-alist ! nil ! 0))) ! (and (string-equal "" str) ! (setq str default)) ! (list str)))) ! (let ((cell (bookmark-jump-noselect str))) ! (and cell ! (switch-to-buffer (car cell)) ! (goto-char (cdr cell))))) ! ! (defun bookmark-jump-noselect (str) ! ;; a leetle helper for bookmark-jump :-) ! ;; returns (BUFFER . POINT) ! (let ((whereto-list (car (cdr (assoc str bookmark-alist))))) ! (let* ((file (expand-file-name (car whereto-list))) ! (orig-file file) ! (forward-str (car (cdr whereto-list))) ! (behind-str (car (cdr (cdr whereto-list)))) ! (place (car (cdr (cdr (cdr whereto-list)))))) ! (if (or ! (file-exists-p file) ! ;; else try some common compression extensions ! ;; and Emacs better handle it right! ! (setq file ! (or ! (let ((altname (concat file ".Z"))) ! (and (file-exists-p altname) ! altname)) ! (let ((altname (concat file ".gz"))) ! (and (file-exists-p altname) ! altname)) ! (let ((altname (concat file ".z"))) ! (and (file-exists-p altname) ! altname))))) ! (save-excursion ! (set-buffer (find-file-noselect file)) ! (goto-char place) ! ;; Go searching forward first. Then, if forward-str exists and ! ;; was found in the file, we can search backward for behind-str. ! ;; Rationale is that if text was inserted between the two in the ! ;; file, it's better to be put before it so you can read it, ! ;; rather than after and remain perhaps unaware of the changes. ! (if forward-str ! (if (search-forward forward-str (point-max) t) ! (backward-char bookmark-search-size))) ! (if behind-str ! (if (search-backward behind-str (point-min) t) ! (forward-char bookmark-search-size))) ! ;; added by db ! (setq bookmark-current-bookmark str) ! (cons (current-buffer) (point))) ! (progn ! (ding) ! (if (y-or-n-p (concat (file-name-nondirectory orig-file) ! " nonexistent. Relocate \"" ! str ! "\"? ")) ! (progn ! (bookmark-relocate str) ! ;; gasp! It's a recursive function call in Emacs Lisp! ! (bookmark-jump-noselect str)) ! (message ! "Bookmark not relocated, but deleting it would be a good idea.") ! nil)))))) ! ! ;;;###autoload ! (defun bookmark-relocate (str) ! "Relocate BOOKMARK -- prompts for a filename, and makes an already ! existing bookmark point to that file, instead of the one it used to ! point at. Useful when a file has been renamed after a bookmark was ! set in it." ! (interactive (let ((completion-ignore-case ! bookmark-completion-ignore-case)) ! (progn (bookmark-try-default-file) ! (list (completing-read ! "Bookmark to relocate: " ! bookmark-alist ! nil ! 0))))) ! (let* ((bmrk (assoc str bookmark-alist)) ! (bmrk-filename (car (car (cdr bmrk)))) ! (newloc (expand-file-name ! (read-file-name ! (format "Relocate %s to: " str) ! (file-name-directory bmrk-filename))))) ! (setcar (car (cdr bmrk)) newloc))) ! ! ;;;###autoload ! (defun bookmark-locate (str &optional no-insertion) ! "Insert the name of the file associated with BOOKMARK. ! Optional second arg NO-INSERTION means merely return the filename as a ! string." (interactive (let ((completion-ignore-case bookmark-completion-ignore-case)) ! (progn (bookmark-try-default-file) ! (list (completing-read ! "Insert bookmark location: " ! bookmark-alist ! nil ! 0))))) ! (let ((where (car (car (cdr (assoc str bookmark-alist)))))) ! (if no-insertion ! where ! (insert where)))) + ;;;###autoload (defun bookmark-rename (old &optional new) ! "Change the name of OLD-BOOKMARK to NEWNAME. ! If called from keyboard, prompts for OLD-BOOKMARK and NEWNAME. ! If called from menubar, OLD-BOOKMARK is selected from a menu, and ! prompts for NEWNAME. ! If called from Lisp, prompts for NEWNAME if only OLD-BOOKMARK was ! passed as an argument. If called with two strings, then no prompting ! is done. You must pass at least OLD-BOOKMARK when calling from Lisp. While you are entering the new name, consecutive C-w's insert consectutive words from the text of the buffer into the new bookmark name, and C-v inserts the name of the file." (interactive (let ((completion-ignore-case bookmark-completion-ignore-case)) ! (progn (bookmark-try-default-file) ! (list (completing-read "Old bookmark name: " ! bookmark-alist ! nil ! 0))))) (progn (setq bookmark-current-point (point)) *************** *** 393,396 **** --- 555,560 ---- (setcar cell str) (setq bookmark-current-bookmark str) + (if (get-buffer "*Bookmark List*") + (save-excursion (save-window-excursion (list-bookmarks)))) (setq bookmark-alist-modification-count (1+ bookmark-alist-modification-count)) *************** *** 398,401 **** --- 562,566 ---- (bookmark-save)))))) + ;;;###autoload (defun bookmark-insert (str) "Insert the text of the file pointed to by bookmark BOOKMARK. *************** *** 406,434 **** (interactive (let ((completion-ignore-case bookmark-completion-ignore-case)) ! (list (completing-read ! "Insert bookmark contents: " ! bookmark-alist ! nil ! 0)))) ! (let ((whereto-list (car (cdr (assoc str bookmark-alist))))) ! (let ((file (car whereto-list))) ! (if (file-readable-p (expand-file-name file)) ! (let ((str-to-insert ! (save-excursion ! (find-file (expand-file-name file)) ! (prog1 ! (buffer-substring (point-min) (point-max)) ! (bury-buffer)))) ! (orig-point (point))) ! (insert str-to-insert) ! (push-mark) ! (goto-char orig-point)) ! (error ! (concat "File " ! file ! " does not exist. Suggest deleting bookmark \"" ! str ! "\"")))))) (defun bookmark-delete (str) "Delete the bookmark named NAME from the bookmark list. --- 571,590 ---- (interactive (let ((completion-ignore-case bookmark-completion-ignore-case)) ! (progn (bookmark-try-default-file) ! (list (completing-read ! "Insert bookmark contents: " ! bookmark-alist ! nil ! 0))))) ! (let ((orig-point (point)) ! (str-to-insert ! (save-excursion ! (set-buffer (car (bookmark-jump-noselect str))) ! (buffer-substring (point-min) (point-max))))) ! (insert str-to-insert) ! (push-mark) ! (goto-char orig-point))) + ;;;###autoload (defun bookmark-delete (str) "Delete the bookmark named NAME from the bookmark list. *************** *** 437,450 **** not be deleted. Defaults to the \"current\" bookmark \(that is, the one most recently used in this file, if any\)." - (interactive (let ((completion-ignore-case bookmark-completion-ignore-case)) ! (list ! (completing-read ! "Delete bookmark: " ! bookmark-alist ! nil ! 0 ! bookmark-current-bookmark)))) (let ((will-go (assoc str bookmark-alist))) (setq bookmark-alist (delq will-go bookmark-alist)) --- 593,606 ---- not be deleted. Defaults to the \"current\" bookmark \(that is, the one most recently used in this file, if any\)." (interactive (let ((completion-ignore-case bookmark-completion-ignore-case)) ! (progn (bookmark-try-default-file) ! (list ! (completing-read ! "Delete bookmark: " ! bookmark-alist ! nil ! 0 ! bookmark-current-bookmark))))) (let ((will-go (assoc str bookmark-alist))) (setq bookmark-alist (delq will-go bookmark-alist)) *************** *** 453,456 **** --- 609,614 ---- (or (assoc bookmark-current-bookmark bookmark-alist) (setq bookmark-current-bookmark nil))) + (if (get-buffer "*Bookmark List*") + (save-excursion (save-window-excursion (list-bookmarks)))) (setq bookmark-alist-modification-count (1+ bookmark-alist-modification-count)) *************** *** 473,480 **** --- 631,644 ---- nil))) + ;;;###autoload (defun bookmark-write () + "Write bookmarks to a file \(for which the user will be prompted + interactively\). Don't use this in Lisp programs; use bookmark-save + instead." (interactive) + (bookmark-try-default-file) (bookmark-save t)) + ;;;###autoload (defun bookmark-save (&optional parg file) "Save currently defined bookmarks. *************** *** 493,496 **** --- 657,661 ---- `bookmark-file'." (interactive "P") + (bookmark-try-default-file) (cond ((and (null parg) (null file)) *************** *** 513,524 **** (defun bookmark-write-file (file) (save-excursion ! (message (format "Saving bookmarks to file %s." file)) ! (set-buffer (find-file-noselect file)) ! (goto-char (point-min)) ! (delete-region (point-min) (point-max)) ! (print bookmark-alist (current-buffer)) ! (write-file file) ! (kill-buffer (current-buffer)))) (defun bookmark-load (file &optional revert no-msg) "Load bookmarks from FILE (which must be in bookmark format). --- 678,700 ---- (defun bookmark-write-file (file) (save-excursion ! (save-window-excursion ! (if (>= baud-rate 9600) ! (message (format "Saving bookmarks to file %s." file))) ! (set-buffer (let ((enable-local-variables nil)) ! (find-file-noselect file))) ! (goto-char (point-min)) ! (delete-region (point-min) (point-max)) ! (print bookmark-alist (current-buffer)) ! (let ((version-control ! (cond ! ((null bookmark-version-control) nil) ! ((eq 'never bookmark-version-control) 'never) ! ((eq 'nospecial bookmark-version-control) version-control) ! (t ! t)))) ! (write-file file) ! (kill-buffer (current-buffer)))))) + ;;;###autoload (defun bookmark-load (file &optional revert no-msg) "Load bookmarks from FILE (which must be in bookmark format). *************** *** 535,582 **** explicitly." (interactive ! (list (read-file-name ! (format "Load bookmarks from: (%s) " ! bookmark-file) ! ;;Default might not be used often, ! ;;but there's no better default, and ! ;;I guess it's better than none at all. ! "~/" bookmark-file 'confirm))) (setq file (expand-file-name file)) (if (file-readable-p file) (save-excursion ! (if (null no-msg) ! (message (format "Loading bookmarks from %s..." file))) ! (set-buffer (find-file-noselect file)) ! (goto-char (point-min)) ! (let ((blist (car (read-from-string ! (buffer-substring (point-min) (point-max)))))) ! (if (listp blist) ! (progn ! (if (not revert) ! (setq bookmark-alist-modification-count ! (1+ bookmark-alist-modification-count)) ! (setq bookmark-alist-modification-count 0)) ! (setq bookmark-alist ! (append blist (if (not revert) bookmark-alist)))) ! (error (format "Invalid bookmark list in %s." file)))) ! (kill-buffer (current-buffer)) ! (if (null no-msg) ! (message (format "Loading bookmarks from %s... done" file)))) (error (format "Cannot read bookmark file %s." file)))) ;;;; bookmark menu bar stuff ;;;; ! (defvar bookmark-menu-bar-length 70 "*Maximum length of a bookmark name displayed on a popup menu.") - (defvar bookmark-enable-menu-bar t - "*Non-nil means put a bookmark menu on the menu bar. - \(Assuming that you are running Emacs under a windowing system, such - as X.\)") - (defun bookmark-make-menu-bar-alist () ! (if (not bookmark-alist) ! (if (file-readable-p bookmark-file) ! (bookmark-load bookmark-file))) (if bookmark-alist (mapcar (lambda (cell) --- 711,1169 ---- explicitly." (interactive ! (progn (bookmark-try-default-file) ! (list (read-file-name ! (format "Load bookmarks from: (%s) " ! bookmark-file) ! ;;Default might not be used often, ! ;;but there's no better default, and ! ;;I guess it's better than none at all. ! "~/" bookmark-file 'confirm)))) (setq file (expand-file-name file)) (if (file-readable-p file) (save-excursion ! (save-window-excursion ! (if (and (null no-msg) (>= baud-rate 9600)) ! (message (format "Loading bookmarks from %s..." file))) ! (set-buffer (let ((enable-local-variables nil)) ! (find-file-noselect file))) ! (goto-char (point-min)) ! (let ((blist (car (read-from-string ! (buffer-substring (point-min) (point-max)))))) ! (if (listp blist) ! (progn ! (if (not revert) ! (setq bookmark-alist-modification-count ! (1+ bookmark-alist-modification-count)) ! (setq bookmark-alist-modification-count 0)) ! (setq bookmark-alist ! (append blist (if (not revert) bookmark-alist))) ! (if (get-buffer "*Bookmark List*") ! (save-excursion (list-bookmarks)))) ! (error (format "Invalid bookmark list in %s." file)))) ! (kill-buffer (current-buffer))) ! (if (and (null no-msg) (>= baud-rate 9600)) ! (message (format "Loading bookmarks from %s... done" file)))) (error (format "Cannot read bookmark file %s." file)))) + ;;;; bookmark-menu-mode stuff ;;;; + + (defvar Bookmark-menu-bookmark-column nil) + + (defvar Bookmark-menu-hidden-bookmarks ()) + + (defvar Bookmark-menu-file-column 30 + "*Column at which to display filenames in a buffer listing bookmarks. + You can toggle whether files are shown with \\\\[Bookmark-menu-toggle-filenames].") + + (defvar Bookmark-menu-toggle-filenames t + "*Non-nil means show filenames when listing bookmarks. + This may result in truncated bookmark names. To disable this, put the + following in your .emacs: + + \(setq Bookmark-menu-toggle-filenames nil\)") + + (defvar Bookmark-menu-mode-map nil) + + (if Bookmark-menu-mode-map + nil + (setq Bookmark-menu-mode-map (make-keymap)) + (suppress-keymap Bookmark-menu-mode-map t) + (define-key Bookmark-menu-mode-map "q" 'Bookmark-menu-quit) + (define-key Bookmark-menu-mode-map "v" 'Bookmark-menu-select) + (define-key Bookmark-menu-mode-map "w" 'Bookmark-menu-locate) + (define-key Bookmark-menu-mode-map "2" 'Bookmark-menu-2-window) + (define-key Bookmark-menu-mode-map "1" 'Bookmark-menu-1-window) + (define-key Bookmark-menu-mode-map "j" 'Bookmark-menu-this-window) + (define-key Bookmark-menu-mode-map "f" 'Bookmark-menu-this-window) + (define-key Bookmark-menu-mode-map "o" 'Bookmark-menu-other-window) + (define-key Bookmark-menu-mode-map "\C-o" 'Bookmark-menu-switch-other-window) + (define-key Bookmark-menu-mode-map "s" 'Bookmark-menu-save) + (define-key Bookmark-menu-mode-map "k" 'Bookmark-menu-delete) + (define-key Bookmark-menu-mode-map "\C-d" 'Bookmark-menu-delete-backwards) + (define-key Bookmark-menu-mode-map "x" 'Bookmark-menu-execute) + (define-key Bookmark-menu-mode-map "\C-k" 'Bookmark-menu-delete) + (define-key Bookmark-menu-mode-map "d" 'Bookmark-menu-delete) + (define-key Bookmark-menu-mode-map " " 'next-line) + (define-key Bookmark-menu-mode-map "n" 'next-line) + (define-key Bookmark-menu-mode-map "p" 'previous-line) + (define-key Bookmark-menu-mode-map "\177" 'Bookmark-menu-backup-unmark) + (define-key Bookmark-menu-mode-map "?" 'describe-mode) + (define-key Bookmark-menu-mode-map "u" 'Bookmark-menu-unmark) + (define-key Bookmark-menu-mode-map "m" 'Bookmark-menu-mark) + (define-key Bookmark-menu-mode-map "l" 'Bookmark-menu-load) + (define-key Bookmark-menu-mode-map "r" 'Bookmark-menu-rename) + (define-key Bookmark-menu-mode-map "t" 'Bookmark-menu-toggle-filenames)) + + ;; Bookmark Menu mode is suitable only for specially formatted data. + (put 'Bookmark-menu-mode 'mode-class 'special) + + ;; need to display whether or not bookmark exists as a buffer in flag + ;; column. + + ;; Format: + ;; FLAGS BOOKMARK (/FILE/NAME/HERE/WHAT/REGEXP/TO/USE?) + ;; goto bookmark-column and then search till "(/[^)]*)$" or "(/.*)$" ? + + ;;;###autoload + (defalias 'edit-bookmarks 'list-bookmarks) + + ;;;###autoload + (defun list-bookmarks () + "Display a list of existing bookmarks. + The list is displayed in a buffer named `*Bookmark List*'. + The leftmost column displays a D if the bookmark is flagged for + deletion, or > if it is flagged for displaying." + (interactive) + (bookmark-try-default-file) + (switch-to-buffer (get-buffer-create "*Bookmark List*")) + (let ((buffer-read-only nil)) + (delete-region (point-max) (point-min)) + (goto-char (point-min)) ;sure are playing it safe... + (insert "% Bookmark\n- --------\n") + (bookmark-maybe-sort-alist) + (let ((lst bookmark-alist)) + (while lst + (insert + (concat " " (car (car lst)) "\n")) + (setq lst (cdr lst))))) + (goto-char (point-min)) + (forward-line 2) + (bookmark-menu-mode) + (if Bookmark-menu-toggle-filenames + (Bookmark-menu-toggle-filenames t))) + + (defun bookmark-menu-mode () + "Major mode for editing a list of bookmarks. + Each line describes one of the bookmarks in Emacs. + Letters do not insert themselves; instead, they are commands. + \\ + \\[Bookmark-menu-mark] -- mark bookmark to be displayed. + \\[Bookmark-menu-select] -- select bookmark of line point is on. + Also show bookmarks marked using m in other windows. + \\[Bookmark-menu-toggle-filenames] -- toggle displaying of filenames (they may obscure long bookmark names). + \\[Bookmark-menu-locate] -- display (in minibuffer) location of this bookmark. + \\[Bookmark-menu-1-window] -- select this bookmark in full-frame window. + \\[Bookmark-menu-2-window] -- select this bookmark in one window, + together with bookmark selected before this one in another window. + \\[Bookmark-menu-this-window] -- select this bookmark in place of the bookmark menu buffer. + \\[Bookmark-menu-other-window] -- select this bookmark in another window, + so the bookmark menu bookmark remains visible in its window. + \\[Bookmark-menu-switch-other-window] -- switch the other window to this bookmark. + \\[Bookmark-menu-rename] -- rename this bookmark \(prompts for new name\). + \\[Bookmark-menu-delete] -- mark this bookmark to be deleted, and move down. + \\[Bookmark-menu-delete-backwards] -- mark this bookmark to be deleted, and move up. + \\[Bookmark-menu-execute] -- delete marked bookmarks. + \\[Bookmark-menu-save] -- save the current bookmark list in the default file. + With a prefix arg, prompts for a file to save in. + \\[Bookmark-menu-load] -- load in a file of bookmarks (prompts for file.) + \\[Bookmark-menu-unmark] -- remove all kinds of marks from current line. + With prefix argument, also move up one line. + \\[Bookmark-menu-backup-unmark] -- back up a line and remove marks." + (kill-all-local-variables) + (use-local-map Bookmark-menu-mode-map) + (setq truncate-lines t) + (setq buffer-read-only t) + (setq major-mode 'bookmark-menu-mode) + (setq mode-name "Bookmark Menu") + (run-hooks 'bookmark-menu-mode-hook)) + + (defun Bookmark-menu-toggle-filenames (&optional parg) + "Toggle whether filenames are shown in the bookmark list. + Optional argument SHOW means show them unconditionally." + (interactive) + (cond + (parg + (setq Bookmark-menu-toggle-filenames nil) + (Bookmark-menu-show-filenames) + (setq Bookmark-menu-toggle-filenames t)) + (Bookmark-menu-toggle-filenames + (Bookmark-menu-hide-filenames) + (setq Bookmark-menu-toggle-filenames nil)) + (t + (Bookmark-menu-show-filenames) + (setq Bookmark-menu-toggle-filenames t)))) + + (defun Bookmark-menu-show-filenames (&optional force) + (if (and (not force) Bookmark-menu-toggle-filenames) + nil ;already shown, so do nothing + (save-excursion + (save-window-excursion + (goto-char (point-min)) + (forward-line 2) + (setq Bookmark-menu-hidden-bookmarks ()) + (let ((buffer-read-only nil)) + (while (< (point) (point-max)) + (let ((bmrk (Bookmark-menu-bookmark))) + (setq Bookmark-menu-hidden-bookmarks + (cons bmrk Bookmark-menu-hidden-bookmarks)) + (move-to-column Bookmark-menu-file-column t) + (delete-region (point) (progn (end-of-line) (point))) + (insert " ") + (bookmark-locate bmrk) + (forward-line 1)))))))) + + (defun Bookmark-menu-hide-filenames (&optional force) + (if (and (not force) Bookmark-menu-toggle-filenames) + ;; nothing to hide if above is nil + (save-excursion + (save-window-excursion + (goto-char (point-min)) + (forward-line 2) + (setq Bookmark-menu-hidden-bookmarks + (nreverse Bookmark-menu-hidden-bookmarks)) + (save-excursion + (goto-char (point-min)) + (search-forward "Bookmark") + (backward-word 1) + (setq Bookmark-menu-bookmark-column (current-column))) + (save-excursion + (let ((buffer-read-only nil)) + (while Bookmark-menu-hidden-bookmarks + (move-to-column Bookmark-menu-bookmark-column t) + (kill-line) + (insert (car Bookmark-menu-hidden-bookmarks)) + (setq Bookmark-menu-hidden-bookmarks + (cdr Bookmark-menu-hidden-bookmarks)) + (forward-line 1)))))))) + + ;; if you look at this next function from far away, it resembles a + ;; gun. But only with this comment above... + (defun Bookmark-menu-check-position () + ;; Returns t if on a line with a bookmark. + ;; Otherwise, repositions and returns t. + ;; written by David Hughes + ;; Mucho thanks, David! -karl + (cond ((< (count-lines (point-min) (point)) 2) + (goto-char (point-min)) + (forward-line 2) + t) + ((and (bolp) (eobp)) + (beginning-of-line 0) + t) + (t + t))) + + (defun Bookmark-menu-bookmark () + ;; return a string which is bookmark of this line. + (if (Bookmark-menu-check-position) + (save-excursion + (save-window-excursion + (goto-char (point-min)) + (search-forward "Bookmark") + (backward-word 1) + (setq Bookmark-menu-bookmark-column (current-column))))) + (if Bookmark-menu-toggle-filenames + (Bookmark-menu-hide-filenames)) + (save-excursion + (save-window-excursion + (beginning-of-line) + (forward-char Bookmark-menu-bookmark-column) + (prog1 + (buffer-substring (point) + (progn + (end-of-line) + (point))) + ;; well, this is certainly crystal-clear: + (if Bookmark-menu-toggle-filenames + (Bookmark-menu-toggle-filenames t)))))) + + (defun Bookmark-menu-mark () + "Mark bookmark on this line to be displayed by \\\\[Bookmark-menu-select] command." + (interactive) + (beginning-of-line) + (if (Bookmark-menu-check-position) + (let ((buffer-read-only nil)) + (delete-char 1) + (insert ?>) + (forward-line 1)))) + + (defun Bookmark-menu-select () + "Select this line's bookmark; also display bookmarks marked with `>'. + You can mark bookmarks with the \\\\[Bookmark-menu-mark] command." + (interactive) + (if (Bookmark-menu-check-position) + (let ((bmrk (Bookmark-menu-bookmark)) + (menu (current-buffer)) + (others ()) + tem) + (goto-char (point-min)) + (while (re-search-forward "^>" nil t) + (setq tem (Bookmark-menu-bookmark)) + (let ((buffer-read-only nil)) + (delete-char -1) + (insert ?\ )) + (or (string-equal tem bmrk) + (memq tem others) + (setq others (cons tem others)))) + (setq others (nreverse others) + tem (/ (1- (frame-height)) (1+ (length others)))) + (delete-other-windows) + (bookmark-jump bmrk) + (bury-buffer menu) + (if (equal (length others) 0) + nil + (while others + (split-window nil tem) + (other-window 1) + (bookmark-jump (car others)) + (setq others (cdr others))) + (other-window 1))))) + + (defun Bookmark-menu-save (parg) + "Save the current list into a bookmark file. + With a prefix arg, prompts for a file to save them in." + (interactive "P") + (save-excursion + (save-window-excursion + (bookmark-save parg)))) + + (defun Bookmark-menu-load () + "Load a bookmark file and rebuild list." + (interactive) + (if (Bookmark-menu-check-position) + (save-excursion + (save-window-excursion + (call-interactively 'bookmark-load))))) + + (defun Bookmark-menu-1-window () + "Select this line's bookmark, alone, in full frame." + (interactive) + (if (Bookmark-menu-check-position) + (progn + (bookmark-jump (Bookmark-menu-bookmark)) + (bury-buffer (other-buffer)) + (delete-other-windows)))) + + (defun Bookmark-menu-2-window () + "Select this line's bookmark, with previous buffer in second window." + (interactive) + (if (Bookmark-menu-check-position) + (let ((bmrk (Bookmark-menu-bookmark)) + (menu (current-buffer)) + (pop-up-windows t)) + (delete-other-windows) + (switch-to-buffer (other-buffer)) + (let ((buff (car (bookmark-jump-noselect bmrk)))) + (pop-to-buffer buff)) + (bury-buffer menu)))) + + (defun Bookmark-menu-this-window () + "Select this line's bookmark in this window." + (interactive) + (if (Bookmark-menu-check-position) + (bookmark-jump (Bookmark-menu-bookmark)))) + + (defun Bookmark-menu-other-window () + "Select this line's bookmark in other window, leaving bookmark menu visible." + (interactive) + (if (Bookmark-menu-check-position) + (let ((buff (car (bookmark-jump-noselect (Bookmark-menu-bookmark))))) + (switch-to-buffer-other-window buff)))) + + (defun Bookmark-menu-switch-other-window () + "Make the other window select this line's bookmark. + The current window remains selected." + (interactive) + (if (Bookmark-menu-check-position) + (let ((buff (car (bookmark-jump-noselect (Bookmark-menu-bookmark))))) + (display-buffer buff)))) + + (defun Bookmark-menu-quit () + "Quit the bookmark menu." + (interactive) + (let ((buffer (current-buffer))) + (switch-to-buffer (other-buffer)) + (bury-buffer buffer))) + + (defun Bookmark-menu-unmark (&optional backup) + "Cancel all requested operations on bookmark on this line and move down. + Optional ARG means move up." + (interactive "P") + (beginning-of-line) + (if (Bookmark-menu-check-position) + (progn + (let ((buffer-read-only nil)) + (delete-char 1) + ;; any flags to reset according to circumstances? How about a + ;; flag indicating whether this bookmark is being visited? + ;; well, we don't have this now, so maybe later. + (insert " ")) + (forward-line (if backup -1 1))))) + + (defun Bookmark-menu-backup-unmark () + "Move up and cancel all requested operations on bookmark on line above." + (interactive) + (forward-line -1) + (if (Bookmark-menu-check-position) + (progn + (Bookmark-menu-unmark) + (forward-line -1)))) + + (defun Bookmark-menu-delete () + "Mark bookmark on this line to be deleted by \\\\[Bookmark-menu-execute] command." + (interactive) + (beginning-of-line) + (if (Bookmark-menu-check-position) + (let ((buffer-read-only nil)) + (delete-char 1) + (insert ?D) + (forward-line 1)))) + + (defun Bookmark-menu-delete-backwards () + "Mark bookmark on this line to be deleted by \\\\[Bookmark-menu-execute] command + and then move up one line" + (interactive) + (Bookmark-menu-delete) + (forward-line -2) + (if (Bookmark-menu-check-position) + (forward-line 1))) + + (defun Bookmark-menu-execute () + "Delete bookmarks marked with \\\\[Buffer-menu-delete] commands." + (interactive) + (let ((hide-em Bookmark-menu-toggle-filenames)) + (if hide-em (Bookmark-menu-hide-filenames)) + (setq Bookmark-menu-toggle-filenames nil) + (goto-char (point-min)) + (forward-line 1) + (let ((deaders ())) + (while (re-search-forward "^D" (point-max) t) + (setq deaders (cons (Bookmark-menu-bookmark) deaders))) + (mapcar (lambda (str) + (setq bookmark-alist + (delq (assoc str bookmark-alist) bookmark-alist))) + deaders)) + (list-bookmarks) + (goto-char (point-min)) + (forward-line 2) + (setq Bookmark-menu-toggle-filenames hide-em) + (if Bookmark-menu-toggle-filenames + (Bookmark-menu-toggle-filenames t)))) + + (defun Bookmark-menu-rename () + "Rename bookmark on current line. Prompts for a new name." + (interactive) + (if (Bookmark-menu-check-position) + (let ((bmrk (Bookmark-menu-bookmark)) + (thispoint (point))) + (bookmark-rename bmrk) + (list-bookmarks) + (goto-char thispoint)))) + + (defun Bookmark-menu-locate () + "Display location of this bookmark. Displays in the minibuffer." + (interactive) + (if (Bookmark-menu-check-position) + (let ((bmrk (Bookmark-menu-bookmark))) + (message (bookmark-locate bmrk t))))) + ;;;; bookmark menu bar stuff ;;;; ! (defvar bookmark-menu-bar-length 70 "*Maximum length of a bookmark name displayed on a popup menu.") (defun bookmark-make-menu-bar-alist () ! (bookmark-try-default-file) ! (bookmark-maybe-sort-alist) (if bookmark-alist (mapcar (lambda (cell) *************** *** 598,605 **** (str (x-popup-menu event (list menu-label ! (cons menu-str ! menu))))) ! (if str ! (apply func-sym (list str))))) (defun bookmark-menu-bar-insert (event) --- 1185,1190 ---- (str (x-popup-menu event (list menu-label ! (cons menu-str menu))))) ! (if str (apply func-sym (list str))))) (defun bookmark-menu-bar-insert (event) *************** *** 611,617 **** (interactive "e") (bookmark-make-menu-bar-with-function 'bookmark-insert ! "Bookmark Insert Menu" ! "--- Insert Contents ---" ! event)) (defun bookmark-menu-bar-jump (event) --- 1196,1202 ---- (interactive "e") (bookmark-make-menu-bar-with-function 'bookmark-insert ! "Bookmark Insert Menu" ! "--- Insert Contents ---" ! event)) (defun bookmark-menu-bar-jump (event) *************** *** 623,629 **** (interactive "e") (bookmark-make-menu-bar-with-function 'bookmark-jump ! "Bookmark Jump Menu" ! "--- Jump to Bookmark ---" ! event)) (defun bookmark-menu-bar-locate (event) --- 1208,1214 ---- (interactive "e") (bookmark-make-menu-bar-with-function 'bookmark-jump ! "Bookmark Jump Menu" ! "--- Jump to Bookmark ---" ! event)) (defun bookmark-menu-bar-locate (event) *************** *** 632,646 **** (interactive "e") (bookmark-make-menu-bar-with-function 'bookmark-locate ! "Bookmark Locate Menu" ! "--- Insert Location ---" ! event)) (defun bookmark-menu-bar-rename (event) ! "Change the name of BOOKMARK to NEWNAME. ! If called from keyboard, prompts for OLD and NEWNAME. ! If called from menubar, prompts for NEWNAME. ! If called from Lisp, prompts for NEWNAME if only BOOKMARK was passed ! as an argument. If called with two strings, then no prompting is ! done. You must pass at least BOOKMARK when calling from Lisp. While you are entering the new name, consecutive C-w's insert --- 1217,1232 ---- (interactive "e") (bookmark-make-menu-bar-with-function 'bookmark-locate ! "Bookmark Locate Menu" ! "--- Insert Location ---" ! event)) (defun bookmark-menu-bar-rename (event) ! "Change the name of OLD-BOOKMARK to NEWNAME. ! If called from keyboard, prompts for OLD-BOOKMARK and NEWNAME. ! If called from menubar, OLD-BOOKMARK is selected from a menu, and ! prompts for NEWNAME. ! If called from Lisp, prompts for NEWNAME if only OLD-BOOKMARK was ! passed as an argument. If called with two strings, then no prompting ! is done. You must pass at least OLD-BOOKMARK when calling from Lisp. While you are entering the new name, consecutive C-w's insert *************** *** 649,655 **** (interactive "e") (bookmark-make-menu-bar-with-function 'bookmark-rename ! "Bookmark Rename Menu" ! "--- Rename Bookmark ---" ! event)) (defun bookmark-menu-bar-delete (event) --- 1235,1241 ---- (interactive "e") (bookmark-make-menu-bar-with-function 'bookmark-rename ! "Bookmark Rename Menu" ! "--- Rename Bookmark ---" ! event)) (defun bookmark-menu-bar-delete (event) *************** *** 661,762 **** (interactive "e") (bookmark-make-menu-bar-with-function 'bookmark-delete ! "Bookmark Delete Menu" ! "--- Delete Bookmark ---" ! event)) ! (if (and bookmark-enable-menu-bar window-system) ! (progn ! (defvar menu-bar-bookmark-map ! (make-sparse-keymap "Bookmark functions")) ! ! ;; make bookmarks appear toward the right side of the menu. ! (if (boundp 'menu-bar-final-items) ! (if menu-bar-final-items ! (setq menu-bar-final-items ! (cons 'bookmark menu-bar-final-items))) ! (setq menu-bar-final-items '(bookmark))) ! ! (define-key global-map [menu-bar bookmark] ! (cons "Bookmarks" menu-bar-bookmark-map)) ! ! (define-key menu-bar-bookmark-map [load] ! '(" Load a bookmark file" . bookmark-load)) ! ! (define-key menu-bar-bookmark-map [write] ! '("Write \(to another file\)" . bookmark-write)) ! ! (define-key menu-bar-bookmark-map [save] ! '("Save \(in default file\)" . bookmark-save)) ! ! (define-key menu-bar-bookmark-map [delete] ! '(" Delete a bookmark" . bookmark-menu-bar-delete)) ! ! (define-key menu-bar-bookmark-map [rename] ! '(" Rename bookmark" . bookmark-menu-bar-rename)) ! ! (define-key menu-bar-bookmark-map [locate] ! '(" Insert location" . bookmark-menu-bar-locate)) ! ! (define-key menu-bar-bookmark-map [insert] ! '(" Insert contents" . bookmark-menu-bar-insert)) ! ! (define-key menu-bar-bookmark-map [set] ! '(" Set bookmark" . bookmark-set)) ! ! (define-key menu-bar-bookmark-map [jump] ! '(" Go to bookmark" . bookmark-menu-bar-jump)))) ! ! ;; not using properties because they make the menu sluggish in coming ! ;; up -- too many tests to make. Instead, choosing a useless menu ! ;; item just gets you an error now (see ! ;; bookmark-make-menu-bar-with-function) ! ;; ! ;; (put 'bookmark-menu-bar-jump 'menu-enable ! ;; '(or bookmark-alist ! ;; (and (file-readable-p bookmark-file) ! ;; (progn (bookmark-load bookmark-file) ! ;; bookmark-alist)))) ! ;; ! ;; (put 'bookmark-menu-bar-insert 'menu-enable ! ;; '(or bookmark-alist ! ;; (and (file-readable-p bookmark-file) ! ;; (progn (bookmark-load bookmark-file) ! ;; bookmark-alist)))) ! ;; ! ;; (put 'bookmark-menu-bar-locate 'menu-enable ! ;; '(or bookmark-alist ! ;; (and (file-readable-p bookmark-file) ! ;; (progn (bookmark-load bookmark-file) ! ;; bookmark-alist)))) ! ;; ! ;; (put 'bookmark-menu-bar-rename 'menu-enable ! ;; '(or bookmark-alist ! ;; (and (file-readable-p bookmark-file) ! ;; (progn (bookmark-load bookmark-file) ! ;; bookmark-alist)))) ! ;; ! ;; (put 'bookmark-menu-bar-delete 'menu-enable ! ;; '(or bookmark-alist ! ;; (and (file-readable-p bookmark-file) ! ;; (progn (bookmark-load bookmark-file) ! ;; bookmark-alist)))) ! ;; ! ;; (put 'bookmark-menu-bar-save 'menu-enable ! ;; '(or bookmark-alist ! ;; (and (file-readable-p bookmark-file) ! ;; (progn (bookmark-load bookmark-file) ! ;; bookmark-alist)))) ! ;; ! ;; (put 'bookmark-menu-bar-write 'menu-enable ! ;; '(or bookmark-alist ! ;; (and (file-readable-p bookmark-file) ! ;; (progn (bookmark-load bookmark-file) ! ;; bookmark-alist)))) ! ;;;; end bookmark menu-bar stuff ;;;; ! ;; load the default bookmark file, if it exists, and the ! ;; bookmark-alist is nil: ! (bookmark-try-default-file) (provide 'bookmark) --- 1247,1301 ---- (interactive "e") (bookmark-make-menu-bar-with-function 'bookmark-delete ! "Bookmark Delete Menu" ! "--- Delete Bookmark ---" ! event)) ! ;; Thanks to Roland McGrath for fixing menubar.el so that the ! ;; following works, and for explaining what to do to make it work. ! (defvar menu-bar-bookmark-map (make-sparse-keymap "Bookmark functions.")) ! ! ;; make bookmarks appear toward the right side of the menu. ! (if (boundp 'menu-bar-final-items) ! (if menu-bar-final-items ! (setq menu-bar-final-items ! (cons 'bookmark menu-bar-final-items))) ! (setq menu-bar-final-items '(bookmark))) ! (define-key menu-bar-bookmark-map [load] ! '("Load a bookmark file" . bookmark-load)) ! ! (define-key menu-bar-bookmark-map [write] ! '("Write \(to another file\)" . bookmark-write)) ! ! (define-key menu-bar-bookmark-map [save] ! '("Save \(in default file\)" . bookmark-save)) ! ! (define-key menu-bar-bookmark-map [edit] ! '("Edit Bookmark List" . list-bookmarks)) ! ! (define-key menu-bar-bookmark-map [delete] ! '("Delete bookmark" . bookmark-menu-bar-delete)) ! ! (define-key menu-bar-bookmark-map [rename] ! '("Rename bookmark" . bookmark-menu-bar-rename)) ! ! (define-key menu-bar-bookmark-map [locate] ! '("Insert location" . bookmark-menu-bar-locate)) ! ! (define-key menu-bar-bookmark-map [insert] ! '("Insert contents" . bookmark-menu-bar-insert)) ! ! (define-key menu-bar-bookmark-map [set] ! '("Set bookmark" . bookmark-set)) ! ! (define-key menu-bar-bookmark-map [jump] ! '("Jump to bookmark" . bookmark-menu-bar-jump)) ! ! ;;;###autoload (autoload 'menu-bar-bookmark-map "bookmark" nil t 'keymap) ! ! (fset 'menu-bar-bookmark-map (symbol-value 'menu-bar-bookmark-map)) ! ! ;;;; end bookmark menu-bar stuff ;;;; (provide 'bookmark) diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/byte-opt.el emacs-19.20/lisp/byte-opt.el *** emacs-19.19/lisp/byte-opt.el Sun Aug 15 01:19:27 1993 --- emacs-19.20/lisp/byte-opt.el Sat Sep 18 21:56:54 1993 *************** *** 974,978 **** ;;; I wonder if I missed any :-\) (let ((side-effect-free-fns ! '(% * + / /= 1+ < <= = > >= append aref ash assoc assq boundp buffer-file-name buffer-local-variables buffer-modified-p buffer-substring capitalize car cdr concat coordinates-in-window-p --- 974,978 ---- ;;; I wonder if I missed any :-\) (let ((side-effect-free-fns ! '(% * + - / /= 1+ 1- < <= = > >= append aref ash assoc assq boundp buffer-file-name buffer-local-variables buffer-modified-p buffer-substring capitalize car cdr concat coordinates-in-window-p diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/c-mode.el emacs-19.20/lisp/c-mode.el *** emacs-19.19/lisp/c-mode.el Sun Aug 15 01:19:29 1993 --- emacs-19.20/lisp/c-mode.el Thu Nov 11 00:24:34 1993 *************** *** 1138,1141 **** --- 1138,1148 ---- (setq this-indent (- this-indent c-indent-level))) (if (= (following-char) ?{) + ;; Don't move an open-brace in column 0. + ;; This is good when constructs such as + ;; `extern "C" {' surround a function definition + ;; that should be indented as usual. + ;; It is also good for nested functions. + ;; It is bad when an open-brace is indented at column 0 + ;; and you want to fix that, but we can't win 'em all. (if (zerop (current-column)) (setq this-indent 0) *************** *** 1190,1194 **** ;; Indent one line as with TAB. (let ((shift-amt (c-indent-line)) ! nextline sexpend) (save-excursion ;; Find beginning of following line. --- 1197,1201 ---- ;; Indent one line as with TAB. (let ((shift-amt (c-indent-line)) ! nextline sexpbeg sexpend) (save-excursion ;; Find beginning of following line. *************** *** 1204,1211 **** (error (setq sexpend nil) (goto-char nextline))) ! (skip-chars-forward " \t\n"))) ;; If that sexp ends within the region, ;; indent it all at once, fast. ! (if (and sexpend (> sexpend nextline) (<= sexpend endmark)) (progn (indent-c-exp) --- 1211,1224 ---- (error (setq sexpend nil) (goto-char nextline))) ! (skip-chars-forward " \t\n")) ! ;; Make sure the sexp we found really starts on the ! ;; current line and extends past it. ! (goto-char sexpend) ! (backward-sexp 1) ! (setq sexpbeg (point))) ;; If that sexp ends within the region, ;; indent it all at once, fast. ! (if (and sexpend (> sexpend nextline) (<= sexpend endmark) ! (< sexpbeg nextline)) (progn (indent-c-exp) diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/cal-dst.el emacs-19.20/lisp/cal-dst.el *** emacs-19.19/lisp/cal-dst.el Tue Aug 10 15:13:49 1993 --- emacs-19.20/lisp/cal-dst.el Sat Sep 18 22:33:22 1993 *************** *** 63,69 **** (cons (+ calendar-system-time-basis ;; floor((2^16 h +l) / (60*60*24)) ! (* 512 (mod h 675)) (floor u 675)) ;; (2^16 h +l) % (60*60*24) ! (+ (* (mod u 675) 128) (floor l 128))))) (defun calendar-time-from-absolute (abs-date s) --- 63,69 ---- (cons (+ calendar-system-time-basis ;; floor((2^16 h +l) / (60*60*24)) ! (* 512 (floor h 675)) (floor u 675)) ;; (2^16 h +l) % (60*60*24) ! (+ (* (% u 675) 128) (% l 128))))) (defun calendar-time-from-absolute (abs-date s) *************** *** 154,199 **** (list 'calendar-nth-named-day 1 weekday m 'year j) l))) ! l) ! ;; Israel is special. ! (if (zerop weekday) ! (if (< m 7) ! (list ! '(calendar-gregorian-from-absolute ! (calendar-dayname-on-or-before ! 0 ! (calendar-absolute-from-hebrew ! (list 1 28 (+ year 3760)))))) ! (list '(calendar-gregorian-from-absolute ! (calendar-dayname-on-or-before ! 0 ! (- (calendar-absolute-from-hebrew ! (list 7 1 (+ year 3761))) 3)))))))) (prevday-sec (- -1 utc-diff)) ;; last sec of previous local day ! last-surviving-rule ! (i 1)) ! ;; Scan through the next few years; take the rule that explains them best. ! (while (and candidate-rules (cdr candidate-rules) (<= i 28)) ! (let ((year (+ y i)) ! new-rules) ! (while candidate-rules ! (let* ((rule (car candidate-rules)) ! (date (calendar-absolute-from-gregorian (eval rule)))) ! (or (equal (current-time-zone ! (calendar-time-from-absolute date prevday-sec)) ! (current-time-zone ! (calendar-time-from-absolute (1+ date) prevday-sec))) ! (progn ! (setq new-rules (cons rule new-rules)) ! (setq last-surviving-rule rule)))) ! (setq candidate-rules (cdr candidate-rules))) ! (setq candidate-rules (nreverse new-rules))) ! (setq i (1+ i))) ! last-surviving-rule)) (defun calendar-current-time-zone () "Return UTC difference, dst offset, names and rules for current time zone. ! Returns (UTC-DIFF DST-OFFSET STD-ZONE DST-ZONE DST-STARTS DST-ENDS DST-SWITCH), ! based on a heuristic probing of what the system knows: UTC-DIFF is an integer specifying the number of minutes difference between --- 154,197 ---- (list 'calendar-nth-named-day 1 weekday m 'year j) l))) ! l))) (prevday-sec (- -1 utc-diff)) ;; last sec of previous local day ! (year (1+ y))) ! ;; Scan through the next few years until only one rule remains. ! (while ! (let ((rules candidate-rules) ! new-rules) ! (while ! (let* ! ((rule (car rules)) ! (date ! ;; The following is much faster than ! ;; (calendar-absolute-from-gregorian (eval rule)). ! (cond ((eq (car rule) 'calendar-nth-named-day) ! (eval (cons 'calendar-nth-named-absday (cdr rule)))) ! ((eq (car rule) 'calendar-gregorian-from-absolute) ! (eval (car (cdr rule)))) ! (t (let ((g (eval rule))) ! (calendar-absolute-from-gregorian g)))))) ! (or (equal ! (current-time-zone ! (calendar-time-from-absolute date prevday-sec)) ! (current-time-zone ! (calendar-time-from-absolute (1+ date) prevday-sec))) ! (setq new-rules (cons rule new-rules))) ! (setq rules (cdr rules)))) ! ;; If no rules remain, just use the first candidate rule; ! ;; it's wrong in general, but it's right for at least one year. ! (setq candidate-rules (if new-rules (nreverse new-rules) ! (list (car candidate-rules)))) ! (setq year (1+ year)) ! (cdr candidate-rules))) ! (car candidate-rules))) (defun calendar-current-time-zone () "Return UTC difference, dst offset, names and rules for current time zone. ! Returns (UTC-DIFF DST-OFFSET STD-ZONE DST-ZONE DST-STARTS DST-ENDS ! DST-STARTS-TIME DST-ENDS-TIME), based on a heuristic probing of what the ! system knows: UTC-DIFF is an integer specifying the number of minutes difference between *************** *** 206,217 **** time adjustment in effect. DST-STARTS and DST-ENDS are sexps in the variable `year' giving the daylight ! savings time start rules, in the form expected by `calendar-daylight-savings-starts'. ! DST-SWITCH is an integer giving the number of minutes after midnight that ! daylight savings time starts or ends. ! If the local area does not use a seasonal time adjustment, DST-OFFSET and ! DST-SWITCH are 0, STD-ZONE and DST-ZONE are equal, and DST-STARTS and DST-ENDS ! are nil. Some operating systems cannot provide all this information to Emacs; in this --- 204,214 ---- time adjustment in effect. DST-STARTS and DST-ENDS are sexps in the variable `year' giving the daylight ! savings time start and end rules, in the form expected by `calendar-daylight-savings-starts'. ! DST-STARTS-TIME and DST-ENDS-TIME are integers giving the number of minutes ! after midnight that daylight savings time starts and ends. ! If the local area does not use a seasonal time adjustment, STD-ZONE and ! DST-ZONE are equal, and all the DST-* integer variables are 0. Some operating systems cannot provide all this information to Emacs; in this *************** *** 220,258 **** (or calendar-current-time-zone-cache ! (progn ! (message "Checking time zone data...") ! (setq ! calendar-current-time-zone-cache ! (let* ((now (current-time)) ! (now-zone (current-time-zone now)) ! (now-utc-diff (car now-zone)) ! (now-name (car (cdr now-zone))) ! (next (calendar-next-time-zone-transition now))) ! (if (null next) ! (list (and now-utc-diff (/ now-utc-diff 60)) ! 0 now-name now-name nil nil 0) ! (let* ((next-zone (current-time-zone next)) ! (next-utc-diff (car next-zone)) ! (next-name (car (cdr next-zone))) ! (next-absdate-seconds ! (calendar-absolute-from-time next now-utc-diff)) ! (next-transitions ! (calendar-time-zone-daylight-rules ! (car next-absdate-seconds) now-utc-diff)) ! (nextnext (calendar-next-time-zone-transition next)) ! (now-transitions ! (calendar-time-zone-daylight-rules ! (car (calendar-absolute-from-time nextnext next-utc-diff)) ! next-utc-diff)) ! (now-is-std (< now-utc-diff next-utc-diff))) ! (list (/ (min now-utc-diff next-utc-diff) 60) ! (/ (abs (- now-utc-diff next-utc-diff)) 60) ! (if now-is-std now-name next-name) ! (if now-is-std next-name now-name) ! (if now-is-std next-transitions now-transitions) ! (if now-is-std now-transitions next-transitions) ! (/ (cdr next-absdate-seconds) 60)))))) ! (message "Checking time zone data...done"))) ! calendar-current-time-zone-cache) ;;; The following six defvars relating to daylight savings time should NOT be --- 217,254 ---- (or calendar-current-time-zone-cache ! (setq ! calendar-current-time-zone-cache ! (let* ((t0 (current-time)) ! (t0-zone (current-time-zone t0)) ! (t0-utc-diff (car t0-zone)) ! (t0-name (car (cdr t0-zone)))) ! (if (not t0-utc-diff) ! ;; Little or no time zone information is available. ! (list nil nil t0-name t0-name nil nil nil nil) ! (let* ((t1 (calendar-next-time-zone-transition t0)) ! (t2 (and t1 (calendar-next-time-zone-transition t1)))) ! (if (not t2) ! ;; This locale does not have daylight savings time. ! (list (/ t0-utc-diff 60) 0 t0-name t0-name nil nil 0 0) ! ;; Use heuristics to find daylight savings parameters. ! (let* ((t1-zone (current-time-zone t1)) ! (t1-utc-diff (car t1-zone)) ! (t1-name (car (cdr t1-zone))) ! (t1-date-sec (calendar-absolute-from-time t1 t0-utc-diff)) ! (t2-date-sec (calendar-absolute-from-time t2 t1-utc-diff)) ! (t1-rules (calendar-time-zone-daylight-rules ! (car t1-date-sec) t0-utc-diff)) ! (t2-rules (calendar-time-zone-daylight-rules ! (car t2-date-sec) t1-utc-diff)) ! (t1-time (/ (cdr t1-date-sec) 60)) ! (t2-time (/ (cdr t2-date-sec) 60))) ! (cons ! (/ (min t0-utc-diff t1-utc-diff) 60) ! (cons ! (/ (abs (- t0-utc-diff t1-utc-diff)) 60) ! (if (< t0-utc-diff t1-utc-diff) ! (list t0-name t1-name t1-rules t2-rules t2-time t1-time) ! (list t1-name t0-name t2-rules t1-rules t1-time t2-time) ! ))))))))))) ;;; The following six defvars relating to daylight savings time should NOT be *************** *** 261,268 **** ;;; which the code is INVOKED; so it's inappropriate to initialize them when ;;; Emacs is dumped---they should be initialized when calendar.el is loaded. (calendar-current-time-zone) ! (defvar calendar-time-zone (car calendar-current-time-zone-cache) "*Number of minutes difference between local standard time at `calendar-location-name' and Coordinated Universal (Greenwich) Time. For --- 257,265 ---- ;;; which the code is INVOKED; so it's inappropriate to initialize them when ;;; Emacs is dumped---they should be initialized when calendar.el is loaded. + ;;; They default to US Eastern time if time zone info is not available. (calendar-current-time-zone) ! (defvar calendar-time-zone (or (car calendar-current-time-zone-cache) -300) "*Number of minutes difference between local standard time at `calendar-location-name' and Coordinated Universal (Greenwich) Time. For *************** *** 270,274 **** (defvar calendar-daylight-time-offset ! (car (cdr calendar-current-time-zone-cache)) "*Number of minutes difference between daylight savings and standard time. --- 267,271 ---- (defvar calendar-daylight-time-offset ! (or (car (cdr calendar-current-time-zone-cache)) 60) "*Number of minutes difference between daylight savings and standard time. *************** *** 276,290 **** (defvar calendar-standard-time-zone-name ! (car (nthcdr 2 calendar-current-time-zone-cache)) "*Abbreviated name of standard time zone at `calendar-location-name'. For example, \"EST\" in New York City, \"PST\" for Los Angeles.") (defvar calendar-daylight-time-zone-name ! (car (nthcdr 3 calendar-current-time-zone-cache)) "*Abbreviated name of daylight-savings time zone at `calendar-location-name'. For example, \"EDT\" in New York City, \"PDT\" for Los Angeles.") (defvar calendar-daylight-savings-starts ! (car (nthcdr 4 calendar-current-time-zone-cache)) "*Sexp giving the date on which daylight savings time starts. This is an expression in the variable `year' whose value gives the Gregorian --- 273,289 ---- (defvar calendar-standard-time-zone-name ! (or (car (nthcdr 2 calendar-current-time-zone-cache)) "EST") "*Abbreviated name of standard time zone at `calendar-location-name'. For example, \"EST\" in New York City, \"PST\" for Los Angeles.") (defvar calendar-daylight-time-zone-name ! (or (car (nthcdr 3 calendar-current-time-zone-cache)) "EDT") "*Abbreviated name of daylight-savings time zone at `calendar-location-name'. For example, \"EDT\" in New York City, \"PDT\" for Los Angeles.") (defvar calendar-daylight-savings-starts ! (or (car (nthcdr 4 calendar-current-time-zone-cache)) ! (and (not (zerop calendar-daylight-time-offset)) ! '(calendar-nth-named-day 1 0 4 year))) "*Sexp giving the date on which daylight savings time starts. This is an expression in the variable `year' whose value gives the Gregorian *************** *** 298,315 **** '(10 1 year) ! For a more complex example, daylight savings time begins in Israel on the ! first Sunday after Passover ends on Nisan 21: ! '(calendar-gregorian-from-absolute ! (calendar-dayname-on-or-before ! 0 ! (calendar-absolute-from-hebrew (list 1 28 (+ year 3760))))) - because Nisan is the first month in the Hebrew calendar. - If the locale never uses daylight savings time, set this to nil.") (defvar calendar-daylight-savings-ends ! (car (nthcdr 5 calendar-current-time-zone-cache)) "*Sexp giving the date on which daylight savings time ends. This is an expression in the variable `year' whose value gives the Gregorian --- 297,310 ---- '(10 1 year) ! If it starts on the first Sunday in April, you would set it to ! '(calendar-nth-named-day 1 0 4 year) If the locale never uses daylight savings time, set this to nil.") (defvar calendar-daylight-savings-ends ! (or (car (nthcdr 5 calendar-current-time-zone-cache)) ! (and (not (zerop calendar-daylight-time-offset)) ! '(calendar-nth-named-day -1 0 10 year))) "*Sexp giving the date on which daylight savings time ends. This is an expression in the variable `year' whose value gives the Gregorian *************** *** 318,335 **** list and for correcting times of day in the solar and lunar calculations. ! For example, daylight savings time ends in Israel on the Sunday Selichot ! begins: ! '(calendar-gregorian-from-absolute ! (calendar-dayname-on-or-before ! 0 ! (- (calendar-absolute-from-hebrew (list 7 1 (+ year 3761))) 3))) If the locale never uses daylight savings time, set this to nil.") ! (defvar calendar-daylight-savings-switchover-time ! (car (nthcdr 6 calendar-current-time-zone-cache)) ! "*Number of minutes after midnight that daylight savings time begins/ends. ! If the locale never uses daylight savings time, set this to 0.") (provide 'cal-dst) --- 313,330 ---- list and for correcting times of day in the solar and lunar calculations. ! For example, if daylight savings time ends on the last Sunday in October: ! '(calendar-nth-named-day -1 0 10 year) If the locale never uses daylight savings time, set this to nil.") ! (defvar calendar-daylight-savings-starts-time ! (or (car (nthcdr 6 calendar-current-time-zone-cache)) 120) ! "*Number of minutes after midnight that daylight savings time starts.") ! ! (defvar calendar-daylight-savings-ends-time ! (or (car (nthcdr 7 calendar-current-time-zone-cache)) ! calendar-daylight-savings-starts-time) ! "*Number of minutes after midnight that daylight savings time ends.") (provide 'cal-dst) diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/calendar.el emacs-19.20/lisp/calendar.el *** emacs-19.19/lisp/calendar.el Tue Aug 10 01:52:32 1993 --- emacs-19.20/lisp/calendar.el Wed Oct 20 01:44:18 1993 *************** *** 9,13 **** ;; diary, holidays ! (defconst calendar-version "Version 5.1, released June 18, 1993") ;; This file is part of GNU Emacs. --- 9,13 ---- ;; diary, holidays ! (defconst calendar-version "Version 5.2, released October 20, 1993") ;; This file is part of GNU Emacs. *************** *** 102,105 **** --- 102,110 ---- ;;;###autoload + (defvar calendar-week-start-day 0 + "*The day of the week on which a week in the calendar begins. + 0 means Sunday (default), 1 means Monday, and so on.") + + ;;;###autoload (defvar view-diary-entries-initially nil "*If t, the diary entries for the current date will be displayed on entry. *************** *** 410,414 **** '((if dayname (concat dayname ", ")) day " " monthname " " year) "*Pseudo-pattern governing the way a date appears in the European style. ! See the documentation of calendar-date-display-forms for an explanation.") ;;;###autoload --- 415,419 ---- '((if dayname (concat dayname ", ")) day " " monthname " " year) "*Pseudo-pattern governing the way a date appears in the European style. ! See the documentation of calendar-date-display-form for an explanation.") ;;;###autoload *************** *** 416,420 **** '((if dayname (concat dayname ", ")) monthname " " day ", " year) "*Pseudo-pattern governing the way a date appears in the American style. ! See the documentation of calendar-date-display-forms for an explanation.") (defvar calendar-date-display-form --- 421,425 ---- '((if dayname (concat dayname ", ")) monthname " " day ", " year) "*Pseudo-pattern governing the way a date appears in the American style. ! See the documentation of calendar-date-display-form for an explanation.") (defvar calendar-date-display-form *************** *** 753,757 **** (if (fboundp 'atan) (solar-time-string ! (/ calendar-daylight-savings-switchover-time (float 60)) date --- 758,762 ---- (if (fboundp 'atan) (solar-time-string ! (/ calendar-daylight-savings-starts-time (float 60)) date *************** *** 764,768 **** (if (fboundp 'atan) (solar-time-string ! (/ (- calendar-daylight-savings-switchover-time calendar-daylight-time-offset) (float 60)) --- 769,773 ---- (if (fboundp 'atan) (solar-time-string ! (/ (- calendar-daylight-savings-ends-time calendar-daylight-time-offset) (float 60)) *************** *** 979,989 **** "The last day in MONTH during YEAR." (` (if (and ! (, (macroexpand (` (calendar-leap-year-p (, year))))) ! (= (, month) 2)) 29 (aref [31 28 31 30 31 30 31 31 30 31 30 31] (1- (, month)))))) ;;(defun calendar-last-day-of-month (month year) ;; "The last day in MONTH during YEAR." ! ;; (if (and (calendar-leap-year-p year) (= month 2)) ;; 29 ;; (aref [31 28 31 30 31 30 31 31 30 31 30 31] (1- month)))) --- 984,994 ---- "The last day in MONTH during YEAR." (` (if (and ! (= (, month) 2) ! (, (macroexpand (` (calendar-leap-year-p (, year)))))) 29 (aref [31 28 31 30 31 30 31 31 30 31 30 31] (1- (, month)))))) ;;(defun calendar-last-day-of-month (month year) ;; "The last day in MONTH during YEAR." ! ;; (if (and (= month 2) (calendar-leap-year-p year)) ;; 29 ;; (aref [31 28 31 30 31 30 31 31 30 31 30 31] (1- month)))) *************** *** 1025,1043 **** "The number of days elapsed between the Gregorian date 12/31/1 BC and DATE. The Gregorian date Sunday, December 31, 1 BC is imaginary." ! (` (let ((year (, (macroexpand (` (extract-calendar-year (, date))))))) (+ (, (macroexpand (` (calendar-day-number (, date)))));; Days this year ! (* 365 (1- year));; + Days in prior years ! (/ (1- year) 4);; + Julian leap years ! (- (/ (1- year) 100));; - century years ! (/ (1- year) 400)))));; + Gregorian leap years ;;(defun calendar-absolute-from-gregorian (date) ;; "The number of days elapsed between the Gregorian date 12/31/1 BC and DATE. ;;The Gregorian date Sunday, December 31, 1 BC is imaginary." ! ;; (let ((year (extract-calendar-year date))) ;; (+ (calendar-day-number date);; Days this year ! ;; (* 365 (1- year));; + Days in prior years ! ;; (/ (1- year) 4);; + Julian leap years ! ;; (- (/ (1- year) 100));; - century years ! ;; (/ (1- year) 400))));; + Gregorian leap years ;;;###autoload --- 1030,1049 ---- "The number of days elapsed between the Gregorian date 12/31/1 BC and DATE. The Gregorian date Sunday, December 31, 1 BC is imaginary." ! (` (let ((prior-years ! (1- (, (macroexpand (` (extract-calendar-year (, date)))))))) (+ (, (macroexpand (` (calendar-day-number (, date)))));; Days this year ! (* 365 prior-years);; + Days in prior years ! (/ prior-years 4);; + Julian leap years ! (- (/ prior-years 100));; - century years ! (/ prior-years 400)))));; + Gregorian leap years ;;(defun calendar-absolute-from-gregorian (date) ;; "The number of days elapsed between the Gregorian date 12/31/1 BC and DATE. ;;The Gregorian date Sunday, December 31, 1 BC is imaginary." ! ;; (let ((prior-years (1- (extract-calendar-year date)))) ;; (+ (calendar-day-number date);; Days this year ! ;; (* 365 prior-years);; + Days in prior years ! ;; (/ prior-years 4);; + Julian leap years ! ;; (- (/ prior-years 100));; - century years ! ;; (/ prior-years 400))));; + Gregorian leap years ;;;###autoload *************** *** 1320,1342 **** from the first character on the line and does not disturb the first INDENT characters on the line." ! (let* ((first-day-of-month (calendar-day-of-week (list month 1 year))) ! (first-saturday (- 7 first-day-of-month)) ! (last (calendar-last-day-of-month month year)) ! (heading (format "%s %d" (calendar-month-name month) year))) ! (goto-char (point-min)) ! (calendar-insert-indented ! heading (+ indent (/ (- 20 (length heading)) 2)) t) ! (calendar-insert-indented " S M Tu W Th F S" indent t) ! (calendar-insert-indented "" indent);; Move to appropriate spot on line ! ;; Add blank days before the first of the month ! (calendar-for-loop i from 1 to first-day-of-month do ! (insert " ")) ! ;; Put in the days of the month ! (calendar-for-loop i from 1 to last do ! (insert (format "%2d " i)) ! (and (= (% i 7) (% first-saturday 7)) ! (/= i last) ! (calendar-insert-indented "" 0 t) ;; Force onto following line ! (calendar-insert-indented "" indent)))));; Go to proper spot (defun calendar-insert-indented (string indent &optional newline) --- 1326,1357 ---- from the first character on the line and does not disturb the first INDENT characters on the line." ! (let* ((blank-days;; at start of month ! (calendar-mod ! (- (calendar-day-of-week (list month 1 year)) ! calendar-week-start-day) ! 7)) ! (last (calendar-last-day-of-month month year))) ! (goto-char (point-min)) ! (calendar-insert-indented ! (calendar-string-spread ! (list "" (format "%s %d" (calendar-month-name month) year) "") ? 20) ! indent t) ! (calendar-insert-indented "" indent);; Go to proper spot ! (calendar-for-loop i from 0 to 6 do ! (insert (substring (aref calendar-day-name-array ! (calendar-mod (+ calendar-week-start-day i) 7)) ! 0 2)) ! (insert " ")) ! (calendar-insert-indented "" 0 t);; Force onto following line ! (calendar-insert-indented "" indent);; Go to proper spot ! ;; Add blank days before the first of the month ! (calendar-for-loop i from 1 to blank-days do (insert " ")) ! ;; Put in the days of the month ! (calendar-for-loop i from 1 to last do ! (insert (format "%2d " i)) ! (and (zerop (calendar-mod (+ i blank-days) 7)) ! (/= i last) ! (calendar-insert-indented "" 0 t) ;; Force onto following line ! (calendar-insert-indented "" indent)))));; Go to proper spot (defun calendar-insert-indented (string indent &optional newline) *************** *** 1388,1394 **** (define-key calendar-mode-map "-" 'negative-argument) (define-key calendar-mode-map "\C-x>" 'scroll-calendar-right) ! (define-key calendar-mode-map "\ev" 'scroll-calendar-right-three-months) (define-key calendar-mode-map "\C-x<" 'scroll-calendar-left) ! (define-key calendar-mode-map "\C-v" 'scroll-calendar-left-three-months) (define-key calendar-mode-map "\C-b" 'calendar-backward-day) (define-key calendar-mode-map "\C-p" 'calendar-backward-week) --- 1403,1409 ---- (define-key calendar-mode-map "-" 'negative-argument) (define-key calendar-mode-map "\C-x>" 'scroll-calendar-right) ! (define-key calendar-mode-map [prior] 'scroll-calendar-right-three-months) (define-key calendar-mode-map "\C-x<" 'scroll-calendar-left) ! (define-key calendar-mode-map [next] 'scroll-calendar-left-three-months) (define-key calendar-mode-map "\C-b" 'calendar-backward-day) (define-key calendar-mode-map "\C-p" 'calendar-backward-week) *************** *** 1494,1502 **** The commands for cursor movement are:\\ ! \\[calendar-forward-day] one day forward \\[calendar-backward-day] one day backward ! \\[calendar-forward-week] one week forward \\[calendar-backward-week] one week backward \\[calendar-forward-month] one month forward \\[calendar-backward-month] one month backward ! \\[calendar-forward-year] one year forward \\[calendar-backward-year] one year backward ! \\[calendar-beginning-of-week] beginning of week \\[calendar-end-of-week] end of week \\[calendar-beginning-of-month] beginning of month \\[calendar-end-of-month] end of month \\[calendar-beginning-of-year] beginning of year \\[calendar-end-of-year] end of year --- 1509,1517 ---- The commands for cursor movement are:\\ ! \\[calendar-forward-day] one day forward \\[calendar-backward-day] one day backward ! \\[calendar-forward-week] one week forward \\[calendar-backward-week] one week backward \\[calendar-forward-month] one month forward \\[calendar-backward-month] one month backward ! \\[calendar-forward-year] one year forward \\[calendar-backward-year] one year backward ! \\[calendar-beginning-of-week] beginning of week \\[calendar-end-of-week] end of week \\[calendar-beginning-of-month] beginning of month \\[calendar-end-of-month] end of month \\[calendar-beginning-of-year] beginning of year \\[calendar-end-of-year] end of year *************** *** 1504,1510 **** \\[calendar-goto-date] go to date ! \\[calendar-goto-julian-date] go to Julian date \\[calendar-goto-astro-day-number] go to astronomical (Julian) day number ! \\[calendar-goto-hebrew-date] go to Hebrew date \\[calendar-goto-islamic-date] go to Islamic date ! \\[calendar-goto-iso-date] go to ISO date \\[calendar-goto-french-date] go to French Revolutionary date \\[calendar-goto-mayan-long-count-date] go to Mayan Long Count date --- 1519,1525 ---- \\[calendar-goto-date] go to date ! \\[calendar-goto-julian-date] go to Julian date \\[calendar-goto-astro-day-number] go to astronomical (Julian) day number ! \\[calendar-goto-hebrew-date] go to Hebrew date \\[calendar-goto-islamic-date] go to Islamic date ! \\[calendar-goto-iso-date] go to ISO date \\[calendar-goto-french-date] go to French Revolutionary date \\[calendar-goto-mayan-long-count-date] go to Mayan Long Count date *************** *** 1526,1532 **** The commands for calendar movement are: ! \\[scroll-calendar-right] scroll one month right \\[scroll-calendar-left] scroll one month left \\[scroll-calendar-right-three-months] scroll 3 months right \\[scroll-calendar-left-three-months] scroll 3 months left ! \\[calendar-current-month] display current month \\[calendar-other-month] display another month Whenever it makes sense, the above commands take prefix arguments that --- 1541,1547 ---- The commands for calendar movement are: ! \\[scroll-calendar-right] scroll one month right \\[scroll-calendar-left] scroll one month left \\[scroll-calendar-right-three-months] scroll 3 months right \\[scroll-calendar-left-three-months] scroll 3 months left ! \\[calendar-current-month] display current month \\[calendar-other-month] display another month Whenever it makes sense, the above commands take prefix arguments that *************** *** 1637,1647 **** \\[calendar-phases-of-moon] show times of quarters of the moon ! The times given will be at latitude `solar-latitude', longitude ! `solar-longitude' in time zone `solar-time-zone'. These variables, and the ! variables `solar-location-name', `solar-standard-time-zone-name', ! `solar-daylight-time-zone-name', `solar-daylight-savings-starts', ! `solar-daylight-savings-ends', `calendar-daylight-time-offset', ! and `calendar-daylight-savings-switchover-time' should be set for ! your location. To exit from the calendar use --- 1652,1663 ---- \\[calendar-phases-of-moon] show times of quarters of the moon ! The times given will be for location `calendar-location-name' at latitude ! `calendar-latitude', longitude `calendar-longitude'; set these variables for ! your location. The following variables are also consulted, and you must set ! them if your system does not initialize them properly: `calendar-time-zone', ! `calendar-daylight-time-offset', `calendar-standard-time-zone-name', ! `calendar-daylight-time-zone-name', `calendar-daylight-savings-starts', ! `calendar-daylight-savings-ends', `calendar-daylight-savings-starts-time', ! `calendar-daylight-savings-ends-time'. To exit from the calendar use *************** *** 1972,1989 **** (defun calendar-beginning-of-week (arg) ! "Move the cursor back ARG Sundays." (interactive "p") (calendar-cursor-to-nearest-date) (let ((day (calendar-day-of-week (calendar-cursor-to-date)))) (calendar-backward-day ! (if (= day 0) (* 7 arg) (+ day (* 7 (1- arg))))))) (defun calendar-end-of-week (arg) ! "Move the cursor forward ARG Saturdays." (interactive "p") (calendar-cursor-to-nearest-date) (let ((day (calendar-day-of-week (calendar-cursor-to-date)))) (calendar-forward-day ! (if (= day 6) (* 7 arg) (+ (- 6 day) (* 7 (1- arg))))))) (defun calendar-beginning-of-month (arg) --- 1988,2011 ---- (defun calendar-beginning-of-week (arg) ! "Move the cursor back ARG calendar-week-start-day's." (interactive "p") (calendar-cursor-to-nearest-date) (let ((day (calendar-day-of-week (calendar-cursor-to-date)))) (calendar-backward-day ! (if (= day calendar-week-start-day) ! (* 7 arg) ! (+ (calendar-mod (- day calendar-week-start-day) 7) ! (* 7 (1- arg))))))) (defun calendar-end-of-week (arg) ! "Move the cursor forward ARG calendar-week-start-day+6's." (interactive "p") (calendar-cursor-to-nearest-date) (let ((day (calendar-day-of-week (calendar-cursor-to-date)))) (calendar-forward-day ! (if (= day (calendar-mod (1- calendar-week-start-day) 7)) ! (* 7 arg) ! (+ (- 6 (calendar-mod (- day calendar-week-start-day) 7)) ! (* 7 (1- arg))))))) (defun calendar-beginning-of-month (arg) *************** *** 2107,2124 **** (list month day year))))) (defun calendar-cursor-to-visible-date (date) "Move the cursor to DATE that is on the screen." ! (let ((month (extract-calendar-month date)) ! (day (extract-calendar-day date)) ! (year (extract-calendar-year date))) ! (goto-line (+ 3 ! (/ (+ day -1 ! (calendar-day-of-week (list month 1 year))) ! 7))) ! (move-to-column (+ 6 ! (* 25 ! (1+ (calendar-interval ! displayed-month displayed-year month year))) ! (* 3 (calendar-day-of-week date)))))) (defun calendar-other-month (month year) --- 2129,2160 ---- (list month day year))))) + (defun calendar-mod (x y) + "Returns X % Y; value is *always* non-negative." + (let ((v (mod x y))) + (if (> 0 v) + (+ v y) + v))) + (defun calendar-cursor-to-visible-date (date) "Move the cursor to DATE that is on the screen." ! (let* ((month (extract-calendar-month date)) ! (day (extract-calendar-day date)) ! (year (extract-calendar-year date)) ! (first-of-month-weekday (calendar-day-of-week (list month 1 year)))) ! (goto-line (+ 3 ! (/ (+ day -1 ! (calendar-mod ! (- (calendar-day-of-week (list month 1 year)) ! calendar-week-start-day) ! 7)) ! 7))) ! (move-to-column (+ 6 ! (* 25 ! (1+ (calendar-interval ! displayed-month displayed-year month year))) ! (* 3 (calendar-mod ! (- (calendar-day-of-week date) ! calendar-week-start-day) ! 7)))))) (defun calendar-other-month (month year) *************** *** 2395,2402 **** (aref calendar-day-name-array (calendar-day-of-week date))) ! (defconst calendar-day-name-array ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday"]) ! (defconst calendar-month-name-array ["January" "February" "March" "April" "May" "June" "July" "August" "September" "October" "November" "December"]) --- 2431,2438 ---- (aref calendar-day-name-array (calendar-day-of-week date))) ! (defvar calendar-day-name-array ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday"]) ! (defvar calendar-month-name-array ["January" "February" "March" "April" "May" "June" "July" "August" "September" "October" "November" "December"]) *************** *** 2550,2553 **** --- 2586,2610 ---- (- date (% (- date dayname) 7))) + (defun calendar-nth-named-absday (n dayname month year &optional day) + "The absolute date of Nth DAYNAME in MONTH, YEAR before/after optional DAY. + A DAYNAME of 0 means Sunday, 1 means Monday, and so on. If N<0, + return the Nth DAYNAME before MONTH DAY, YEAR (inclusive). + If N>0, return the Nth DAYNAME after MONTH DAY, YEAR (inclusive). + + If DAY is omitted, it defaults to 1 if N>0, and MONTH's last day otherwise." + (if (> n 0) + (+ (* 7 (1- n)) + (calendar-dayname-on-or-before + dayname + (+ 6 (calendar-absolute-from-gregorian + (list month (or day 1) year))))) + (+ (* 7 (1+ n)) + (calendar-dayname-on-or-before + dayname + (calendar-absolute-from-gregorian + (list month + (or day (calendar-last-day-of-month month year)) + year)))))) + (defun calendar-nth-named-day (n dayname month year &optional day) "The date of Nth DAYNAME in MONTH, YEAR before/after optional DAY. *************** *** 2558,2574 **** If DAY is omitted, it defaults to 1 if N>0, and MONTH's last day otherwise." (calendar-gregorian-from-absolute ! (if (> n 0) ! (+ (* 7 (1- n)) ! (calendar-dayname-on-or-before ! dayname ! (+ 6 (calendar-absolute-from-gregorian ! (list month (or day 1) year))))) ! (+ (* 7 (1+ n)) ! (calendar-dayname-on-or-before ! dayname ! (calendar-absolute-from-gregorian ! (list month ! (or day (calendar-last-day-of-month month year)) ! year))))))) (defun calendar-print-day-of-year () --- 2615,2619 ---- If DAY is omitted, it defaults to 1 if N>0, and MONTH's last day otherwise." (calendar-gregorian-from-absolute ! (calendar-nth-named-absday n dayname month year day))) (defun calendar-print-day-of-year () *************** *** 2591,2595 **** commercial DATE has the form (week day year) in which week is in the range 1..52 and day is in the range 0..6 (1 = Monday, 2 = Tuesday, ..., 0 = ! Sunday). The The Gregorian date Sunday, December 31, 1 BC is imaginary." (let* ((week (extract-calendar-month date)) (day (extract-calendar-day date)) --- 2636,2640 ---- commercial DATE has the form (week day year) in which week is in the range 1..52 and day is in the range 0..6 (1 = Monday, 2 = Tuesday, ..., 0 = ! Sunday). The Gregorian date Sunday, December 31, 1 BC is imaginary." (let* ((week (extract-calendar-month date)) (day (extract-calendar-day date)) *************** *** 2751,2755 **** (list month day year)))) ! (defconst calendar-islamic-month-name-array ["Muharram" "Safar" "Rabi I" "Rabi II" "Jumada I" "Jumada II" "Rajab" "Sha'ban" "Ramadan" "Shawwal" "Dhu al-Qada" "Dhu al-Hijjah"]) --- 2796,2800 ---- (list month day year)))) ! (defvar calendar-islamic-month-name-array ["Muharram" "Safar" "Rabi I" "Rabi II" "Jumada I" "Jumada II" "Rajab" "Sha'ban" "Ramadan" "Shawwal" "Dhu al-Qada" "Dhu al-Hijjah"]) *************** *** 2881,2889 **** -1373429))) ;; Days elapsed before absolute date 1. ! (defconst calendar-hebrew-month-name-array-common-year ["Nisan" "Iyar" "Sivan" "Tammuz" "Av" "Elul" "Tishri" "Heshvan" "Kislev" "Teveth" "Shevat" "Adar"]) ! (defconst calendar-hebrew-month-name-array-leap-year ["Nisan" "Iyar" "Sivan" "Tammuz" "Av" "Elul" "Tishri" "Heshvan" "Kislev" "Teveth" "Shevat" "Adar I" "Adar II"]) --- 2926,2934 ---- -1373429))) ;; Days elapsed before absolute date 1. ! (defvar calendar-hebrew-month-name-array-common-year ["Nisan" "Iyar" "Sivan" "Tammuz" "Av" "Elul" "Tishri" "Heshvan" "Kislev" "Teveth" "Shevat" "Adar"]) ! (defvar calendar-hebrew-month-name-array-leap-year ["Nisan" "Iyar" "Sivan" "Tammuz" "Av" "Elul" "Tishri" "Heshvan" "Kislev" "Teveth" "Shevat" "Adar I" "Adar II"]) diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/cdl.el emacs-19.20/lisp/cdl.el *** emacs-19.19/lisp/cdl.el --- emacs-19.20/lisp/cdl.el Wed Oct 20 14:06:27 1993 *************** *** 0 **** --- 1,43 ---- + ;;; cdl.el -- Common Data Language (CDL) utility functions for Gnu Emacs + + ;; Copyright (C) 1993 Free Software Foundation, Inc. + + ;; Author: ATAE@spva.physics.imperial.ac.uk (Ata Etemadi) + ;; Keywords: data + + ;; This file is part of GNU Emacs. + + ;; GNU Emacs is free software; you can redistribute it and/or modify + ;; it under the terms of the GNU General Public License as published by + ;; the Free Software Foundation; either version 2, or (at your option) + ;; any later version. + + ;; GNU Emacs is distributed in the hope that it will be useful, + ;; but WITHOUT ANY WARRANTY; without even the implied warranty of + ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ;; GNU General Public License for more details. + + ;; You should have received a copy of the GNU General Public License + ;; along with GNU Emacs; see the file COPYING. If not, write to + ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + + ;;; Code: + + (defun cdl-get-file (filename) + "Run file through ncdump and insert result into buffer after point." + (interactive "fCDF file: ") + (message "ncdump in progress...") + (let ((start (point))) + (call-process "ncdump" nil t nil (expand-file-name filename)) + (goto-char start)) + (message "ncdump in progress...done")) + + (defun cdl-put-region (filename start end) + "Run region through ncgen and write results into a file." + (interactive "FNew CDF file: \nr") + (message "ncgen in progress...") + (call-process-region start end "ncgen" + nil nil nil "-o" (expand-file-name filename)) + (message "ncgen in progress...done")) + + ;;; cdl.el ends here. diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/comint.el emacs-19.20/lisp/comint.el *** emacs-19.19/lisp/comint.el Tue Aug 10 00:12:35 1993 --- emacs-19.20/lisp/comint.el Thu Nov 11 05:05:46 1993 *************** *** 4,7 **** --- 4,8 ---- ;; Author: Olin Shivers + ;; Adapted-by: Simon Marshall ;; Keywords: processes *************** *** 24,32 **** ;;; Commentary: - ;;; The changelog is at the end of this file. - ;;; Please send me bug reports, bug fixes, and extensions, so that I can ;;; merge them into the master source. ;;; - Olin Shivers (shivers@cs.cmu.edu) ;;; This file defines a general command-interpreter-in-a-buffer package --- 25,32 ---- ;;; Commentary: ;;; Please send me bug reports, bug fixes, and extensions, so that I can ;;; merge them into the master source. ;;; - Olin Shivers (shivers@cs.cmu.edu) + ;;; - Simon Marshall (s.marshall@dcs.hull.ac.uk) ;;; This file defines a general command-interpreter-in-a-buffer package *************** *** 66,74 **** ;;; m-p comint-previous-input Cycle backwards in input history ;;; m-n comint-next-input Cycle forwards ! ;;; m-r comint-previous-matching-input Previous input matching a regexp ! ;;; m-s comint-next-matching-input Next input that matches ;;; return comint-send-input ! ;;; c-a comint-bol Beginning of line; skip prompt. ! ;;; c-d comint-delchar-or-maybe-eof Delete char unless at end of buff. ;;; c-c c-u comint-kill-input ^u ;;; c-c c-w backward-kill-word ^w --- 66,75 ---- ;;; m-p comint-previous-input Cycle backwards in input history ;;; m-n comint-next-input Cycle forwards ! ;;; m-r comint-previous-matching-input Previous input matching a regexp ! ;;; m-s comint-next-matching-input Next input that matches ! ;;; m-c-r comint-previous-input-matching Search backwards in input history ;;; return comint-send-input ! ;;; c-a comint-bol Beginning of line; skip prompt ! ;;; c-d comint-delchar-or-maybe-eof Delete char unless at end of buff ;;; c-c c-u comint-kill-input ^u ;;; c-c c-w backward-kill-word ^w *************** *** 78,107 **** ;;; c-c c-o comint-kill-output Delete last batch of process output ;;; c-c c-r comint-show-output Show last batch of process output ;;; ! ;;; Not bound by default in comint-mode ;;; send-invisible Read a line w/o echo, and send to proc ! ;;; (These are bound in shell-mode) ! ;;; comint-dynamic-complete Complete filename at point. ! ;;; comint-dynamic-list-completions List completions in help buffer. ;;; comint-replace-by-expanded-filename Expand and complete filename at point; ;;; replace with expanded/completed name. ;;; comint-kill-subjob No mercy. ;;; comint-continue-subjob Send CONT signal to buffer's process ;;; group. Useful if you accidentally ;;; suspend your process (with C-c C-z). - ;;; - ;;; These used to be bound for RMS -- I prefer the input history stuff, - ;;; but you might like 'em. - ;;; m-P comint-msearch-input Search backwards for prompt - ;;; m-N comint-psearch-input Search forwards for prompt - ;;; C-cR comint-msearch-input-matching Search backwards for prompt & string ;;; comint-mode-hook is the comint mode hook. Basically for your keybindings. - ;;; comint-load-hook is run after loading in this package. ;;; Code: - (defconst comint-version "2.03") - (require 'ring) --- 79,104 ---- ;;; c-c c-o comint-kill-output Delete last batch of process output ;;; c-c c-r comint-show-output Show last batch of process output + ;;; c-c c-h comint-dynamic-list-input-ring List input history ;;; ! ;;; Not bound by default in comint-mode (some are in shell mode) ;;; send-invisible Read a line w/o echo, and send to proc ! ;;; comint-dynamic-complete-filename Complete filename at point. ! ;;; comint-dynamic-complete-variable Complete variable name at point. ! ;;; comint-dynamic-list-filename-completions List completions in help buffer. ;;; comint-replace-by-expanded-filename Expand and complete filename at point; ;;; replace with expanded/completed name. + ;;; comint-replace-by-expanded-history Expand history at point; + ;;; replace with expanded name. + ;;; comint-magic-space Expand history and add (a) space(s). ;;; comint-kill-subjob No mercy. + ;;; comint-show-maximum-output Show as much output as possible. ;;; comint-continue-subjob Send CONT signal to buffer's process ;;; group. Useful if you accidentally ;;; suspend your process (with C-c C-z). ;;; comint-mode-hook is the comint mode hook. Basically for your keybindings. ;;; Code: (require 'ring) *************** *** 109,125 **** ;;;============================================================================ ;;; Comint mode buffer local variables: ! ;;; comint-prompt-regexp - string comint-bol uses to match prompt. ! ;;; comint-last-input-start - marker Handy if inferior always echos ;;; comint-last-input-end - marker For comint-kill-output command ;;; comint-input-ring-size - integer For the input history ;;; comint-input-ring - ring mechanism ;;; comint-input-ring-index - number ... ;;; comint-last-input-match - string ... ;;; comint-get-old-input - function Hooks for specific ! ;;; comint-input-sentinel - function process-in-a-buffer ! ;;; comint-input-filter - function modes. ! ;;; comint-input-send - function ! ;;; comint-eol-on-send - boolean ! ;;; comint-process-echoes - boolean (defvar comint-prompt-regexp "^" --- 106,136 ---- ;;;============================================================================ ;;; Comint mode buffer local variables: ! ;;; comint-prompt-regexp - string comint-bol uses to match prompt ! ;;; comint-delimiter-argument-list - list For delimiters and arguments ! ;;; comint-last-input-start - marker Handy if inferior always echoes ;;; comint-last-input-end - marker For comint-kill-output command ;;; comint-input-ring-size - integer For the input history ;;; comint-input-ring - ring mechanism ;;; comint-input-ring-index - number ... + ;;; comint-input-autoexpand - symbol ... + ;;; comint-input-ignoredups - boolean ... ;;; comint-last-input-match - string ... ;;; comint-get-old-input - function Hooks for specific ! ;;; comint-get-current-command - function process-in-a-buffer ! ;;; comint-dynamic-complete-command-command - function modes. ! ;;; comint-after-partial-filename-command - ! ;;; comint-input-sentinel - function ... ! ;;; comint-input-filter - function ... ! ;;; comint-input-send - function ... ! ;;; comint-eol-on-send - boolean ... ! ;;; comint-process-echoes - boolean ... ! ;;; comint-scroll-to-bottom-on-input - symbol For scroll behavior ! ;;; comint-scroll-to-bottom-on-output - symbol ... ! ;;; comint-scroll-show-maximum-output - boolean ... ! ;;; ! ;;; Comint mode non-buffer local variables: ! ;;; comint-completion-addsuffix - boolean For file name completion ! ;;; comint-completion-autolist - boolean behavior ! ;;; comint-completion-recexact - boolean ... (defvar comint-prompt-regexp "^" *************** *** 137,141 **** This is a good thing to set in mode hooks.") ! (defvar comint-input-ring-size 30 "Size of input history ring.") --- 148,214 ---- This is a good thing to set in mode hooks.") ! (defvar comint-delimiter-argument-list () ! "List of characters to recognise as separate arguments in input. ! Strings comprising a character in this list will separate the arguments ! surrounding them, and also be regarded as arguments in their own right (unlike ! whitespace). See `comint-arguments'. ! Defaults to (), the empty list. ! ! Good choices: ! shell: \(\"|\" \"&\" \"<\" \">\" \"\(\" \")\" \";\") ! ! This is a good thing to set in mode hooks.") ! ! (defvar comint-input-autoexpand 'history ! "*If non-nil, expand input command history references on completion. ! This mirrors the optional behavior of tcsh (its autoexpand and histlit). ! ! If the value is `input', then the expansion is seen on input. ! If the value is `history', then the expansion is only when inserting ! into the buffer's input ring. See also `comint-magic-space' and ! `comint-dynamic-complete'. ! ! This variable is buffer-local.") ! ! (defvar comint-input-ignoredups nil ! "*If non-nil, don't add input matching the last on the input ring. ! This mirrors the optional behavior of bash. ! ! This variable is buffer-local.") ! ! (defvar comint-input-ring-file-name nil ! "*If non-nil, name of the file to read/write input history. ! See also `comint-read-input-ring' and `comint-write-input-ring'. ! ! This variable is buffer-local, and is a good thing to set in mode hooks.") ! ! (defvar comint-scroll-to-bottom-on-input nil ! "*Controls whether input to interpreter causes window to scroll. ! If nil, then do not scroll. If t or `all', scroll all windows showing buffer. ! If `this', scroll only the selected window. ! ! The default is nil. ! ! See `comint-preinput-scroll-to-bottom'. This variable is buffer-local.") ! ! (defvar comint-scroll-to-bottom-on-output nil ! "*Controls whether interpreter output causes window to scroll. ! If nil, then do not scroll. If t or `all', scroll all windows showing buffer. ! If `this', scroll only the selected window. ! If `others', scroll only those that are not the selected window. ! ! The default is nil. ! ! See variable `comint-scroll-show-maximum-output' and function ! `comint-postoutput-scroll-to-bottom'. This variable is buffer-local.") ! ! (defvar comint-scroll-show-maximum-output t ! "*Controls how interpreter output causes window to scroll. ! If non-nil, then show the maximum output when the window is scrolled. ! ! See variable `comint-scroll-to-bottom-on-output' and function ! `comint-postoutput-scroll-to-bottom'. This variable is buffer-local.") ! ! (defvar comint-input-ring-size 32 "Size of input history ring.") *************** *** 143,147 **** "*If non-nil, assume that the subprocess echoes any input. If so, delete one copy of the input so that only one copy eventually ! appears in the buffer. This variable is buffer-local.") --- 216,220 ---- "*If non-nil, assume that the subprocess echoes any input. If so, delete one copy of the input so that only one copy eventually ! appears in the buffer. This variable is buffer-local.") *************** *** 149,153 **** ;;; Here are the per-interpreter hooks. (defvar comint-get-old-input (function comint-get-old-input-default) ! "Function that submits old text in comint mode. This function is called when return is typed while the point is in old text. It returns the text to be submitted as process input. The default is --- 222,226 ---- ;;; Here are the per-interpreter hooks. (defvar comint-get-old-input (function comint-get-old-input-default) ! "Function that returns old text in comint mode. This function is called when return is typed while the point is in old text. It returns the text to be submitted as process input. The default is *************** *** 155,167 **** leading text matching `comint-prompt-regexp'.") (defvar comint-input-sentinel (function ignore) "Called on each input submitted to comint mode process by `comint-send-input'. ! Thus it can, for instance, track cd/pushd/popd commands issued to the csh.") (defvar comint-input-filter (function (lambda (str) (not (string-match "\\`\\s *\\'" str)))) "Predicate for filtering additions to input history. ! Only inputs answering true to this function are saved on the input ! history list. Default is to save anything that isn't all whitespace") (defvar comint-input-sender (function comint-simple-send) --- 228,274 ---- leading text matching `comint-prompt-regexp'.") + (defvar comint-after-partial-filename-command 'comint-after-partial-filename + "Function that returns non-nil if point is after a file name. + By default this is `comint-after-partial-filename'. + + This is a good thing to set in mode hooks.") + + (defvar comint-dynamic-complete-filename-command + 'comint-dynamic-complete-filename + "Function that dynamically completes the file name at point. + By default this is `comint-dynamic-complete-filename', though an alternative is + `comint-replace-by-expanded-filename'. + + This is a good thing to set in mode hooks.") + + (defvar comint-dynamic-complete-command-command + 'comint-dynamic-complete-filename + "Function that dynamically completes the command at point. + By default this is `comint-dynamic-complete-filename'. + + This is a good thing to set in mode hooks.") + + (defvar comint-get-current-command 'comint-get-old-input-default + "Function that returns the current command including arguments. + By default this is `comint-get-old-input-default', meaning the whole line. + + This is a good thing to set in mode hooks.") + (defvar comint-input-sentinel (function ignore) "Called on each input submitted to comint mode process by `comint-send-input'. ! Thus it can, for instance, track cd/pushd/popd commands issued to a shell.") (defvar comint-input-filter (function (lambda (str) (not (string-match "\\`\\s *\\'" str)))) "Predicate for filtering additions to input history. ! Takes one argument, the input. If non-nil, the input may be saved on the input ! history list. Default is to save anything that isn't all whitespace.") ! ! (defvar comint-output-filter-functions '(comint-postoutput-scroll-to-bottom) ! "Functions to call after output is inserted into the buffer. ! One possible function is `comint-postoutput-scroll-to-bottom'. ! These functions get one argument, a string containing the text just inserted. ! ! This variable is buffer-local.") (defvar comint-input-sender (function comint-simple-send) *************** *** 173,177 **** (defvar comint-eol-on-send t ! "*Non-nil means go to the end of the line before sending input to process. See `comint-send-input'.") --- 280,284 ---- (defvar comint-eol-on-send t ! "*Non-nil means go to the end of the line before sending input. See `comint-send-input'.") *************** *** 190,205 **** (defvar comint-ptyp t ! "True if communications via pty; false if by pipe. Buffer local. This is to work around a bug in Emacs process signalling.") - ;;(defvar comint-last-input-match "" - ;; "Last string searched for by comint input history search, for defaulting. - ;;Buffer local variable.") - (defvar comint-input-ring nil) (defvar comint-last-input-start) (defvar comint-last-input-end) ! (defvar comint-input-ring-index) (put 'comint-input-ring 'permanent-local t) (put 'comint-ptyp 'permanent-local t) --- 297,317 ---- (defvar comint-ptyp t ! "Non-nil if communications via pty; false if by pipe. Buffer local. This is to work around a bug in Emacs process signalling.") (defvar comint-input-ring nil) (defvar comint-last-input-start) (defvar comint-last-input-end) ! (defvar comint-input-ring-index nil ! "Index of last matched history element.") ! (defvar comint-matching-input-from-input-string "" ! "Input previously used to match input history.") (put 'comint-input-ring 'permanent-local t) + (put 'comint-input-ring-index 'permanent-local t) + (put 'comint-input-autoexpand 'permanent-local t) + (put 'comint-output-filter-functions 'permanent-local t) + (put 'comint-scroll-to-bottom-on-input 'permanent-local t) + (put 'comint-scroll-to-bottom-on-output 'permanent-local t) + (put 'comint-scroll-show-maximum-output 'permanent-local t) (put 'comint-ptyp 'permanent-local t) *************** *** 212,226 **** before submitting new input. ! This mode is typically customised to create Inferior Lisp mode, ! Shell mode, etc. This can be done by setting the hooks ! `comint-input-sentinel', `comint-input-filter', `comint-input-sender' and ! `comint-get-old-input' to appropriate functions, and the variable `comint-prompt-regexp' to the appropriate regular expression. An input history is maintained of size `comint-input-ring-size', and ! can be accessed with the commands \\[comint-next-input] and \\[comint-previous-input]. Commands with no default key bindings include `send-invisible', ! `comint-dynamic-complete', and `comint-list-dynamic-completions'. If you accidentally suspend your process, use \\[comint-continue-subjob] to continue it. --- 324,348 ---- before submitting new input. ! This mode is customised to create major modes such as Inferior Lisp ! mode, Shell mode, etc. This can be done by setting the hooks ! `comint-input-sentinel', `comint-input-filter', `comint-input-sender' ! and `comint-get-old-input' to appropriate functions, and the variable `comint-prompt-regexp' to the appropriate regular expression. An input history is maintained of size `comint-input-ring-size', and ! can be accessed with the commands \\[comint-next-input], \\[comint-previous-input], and \\[comint-dynamic-list-input-ring]. ! Input ring history expansion can be achieved with the commands ! \\[comint-replace-by-expanded-history] or \\[comint-magic-space]. ! Input ring expansion is controlled by the variable `comint-input-autoexpand', ! and addition is controlled by the variable `comint-input-ignoredups'. ! Commands with no default key bindings include `send-invisible', ! `comint-dynamic-complete', `comint-list-dynamic-completions', and ! `comint-magic-space'. + Input to, and output from, the subprocess can cause the window to scroll to + the end of the buffer. See variables `comint-output-filter-functions', + `comint-scroll-to-bottom-on-input', and `comint-scroll-to-bottom-on-output'. + If you accidentally suspend your process, use \\[comint-continue-subjob] to continue it. *************** *** 228,264 **** \\{comint-mode-map} ! Entry to this mode runs the hooks on comint-mode-hook" (interactive) ! ;; Do not remove this. All major modes must do this. ! (kill-all-local-variables) ! (setq major-mode 'comint-mode) ! (setq mode-name "Comint") ! (setq mode-line-process '(": %s")) ! (use-local-map comint-mode-map) ! (make-local-variable 'comint-last-input-start) ! (setq comint-last-input-start (make-marker)) ! (make-local-variable 'comint-last-input-end) ! (setq comint-last-input-end (make-marker)) ! ;;; (make-local-variable 'comint-last-input-match) ! ;;; (setq comint-last-input-match "") ! (make-local-variable 'comint-prompt-regexp) ; Don't set; default ! (make-local-variable 'comint-input-ring-size) ; ...to global val. ! (make-local-variable 'comint-input-ring) ! (make-local-variable 'comint-input-ring-index) ! (setq comint-input-ring-index 0) ! (make-local-variable 'comint-get-old-input) ! (make-local-variable 'comint-input-sentinel) ! (make-local-variable 'comint-input-filter) ! (make-local-variable 'comint-input-sender) ! (make-local-variable 'comint-eol-on-send) ! (make-local-variable 'comint-ptyp) ! (make-local-variable 'comint-exec-hook) ! (make-local-variable 'comint-process-echoes) ! (run-hooks 'comint-mode-hook) ! (or comint-input-ring ! (setq comint-input-ring (make-ring comint-input-ring-size)))) (if comint-mode-map nil (setq comint-mode-map (make-sparse-keymap)) (define-key comint-mode-map "\ep" 'comint-previous-input) --- 350,403 ---- \\{comint-mode-map} ! Entry to this mode runs the hooks on `comint-mode-hook'." (interactive) ! ;; Do not remove this. All major modes must do this. ! (kill-all-local-variables) ! (setq major-mode 'comint-mode) ! (setq mode-name "Comint") ! (setq mode-line-process '(": %s")) ! (use-local-map comint-mode-map) ! (make-local-variable 'comint-last-input-start) ! (setq comint-last-input-start (make-marker)) ! (make-local-variable 'comint-last-input-end) ! (setq comint-last-input-end (make-marker)) ! (make-local-variable 'comint-last-output-start) ! (setq comint-last-output-start (make-marker)) ! (make-local-variable 'comint-prompt-regexp) ; Don't set; default ! (make-local-variable 'comint-input-ring-size) ; ...to global val. ! (make-local-variable 'comint-input-ring) ! (make-local-variable 'comint-input-ring-file-name) ! (or (and (boundp 'comint-input-ring) comint-input-ring) ! (setq comint-input-ring (make-ring comint-input-ring-size))) ! (make-local-variable 'comint-input-ring-index) ! (or (and (boundp 'comint-input-ring-index) comint-input-ring-index) ! (setq comint-input-ring-index nil)) ! (make-local-variable 'comint-matching-input-from-input-string) ! (make-local-variable 'comint-input-autoexpand) ! (make-local-variable 'comint-input-ignoredups) ! (make-local-variable 'comint-delimiter-argument-list) ! (make-local-variable 'comint-after-partial-filename-command) ! (make-local-variable 'comint-dynamic-complete-filename-command) ! (make-local-variable 'comint-dynamic-complete-command-command) ! (make-local-variable 'comint-get-current-command) ! (make-local-variable 'comint-get-old-input) ! (make-local-variable 'comint-input-sentinel) ! (make-local-variable 'comint-input-filter) ! (make-local-variable 'comint-input-sender) ! (make-local-variable 'comint-eol-on-send) ! (make-local-variable 'comint-scroll-to-bottom-on-input) ! (make-local-variable 'comint-scroll-to-bottom-on-output) ! (make-local-variable 'comint-scroll-show-maximum-output) ! (make-local-variable 'pre-command-hook) ! (add-hook 'pre-command-hook 'comint-preinput-scroll-to-bottom) ! (make-local-variable 'comint-output-filter-functions) ! (make-local-variable 'comint-ptyp) ! (make-local-variable 'comint-exec-hook) ! (make-local-variable 'comint-process-echoes) ! (run-hooks 'comint-mode-hook)) (if comint-mode-map nil + ;; Keys: (setq comint-mode-map (make-sparse-keymap)) (define-key comint-mode-map "\ep" 'comint-previous-input) *************** *** 266,269 **** --- 405,410 ---- (define-key comint-mode-map "\er" 'comint-previous-matching-input) (define-key comint-mode-map "\es" 'comint-next-matching-input) + (define-key comint-mode-map [?\A-\M-r] 'comint-previous-matching-input-from-input) + (define-key comint-mode-map [?\A-\M-s] 'comint-next-matching-input-from-input) (define-key comint-mode-map "\C-m" 'comint-send-input) (define-key comint-mode-map "\C-d" 'comint-delchar-or-maybe-eof) *************** *** 274,286 **** (define-key comint-mode-map "\C-c\C-z" 'comint-stop-subjob) (define-key comint-mode-map "\C-c\C-\\" 'comint-quit-subjob) (define-key comint-mode-map "\C-c\C-o" 'comint-kill-output) (define-key comint-mode-map "\C-c\C-r" 'comint-show-output) ! ;;; prompt-search commands commented out 3/90 -Olin ! ; (define-key comint-mode-map "\eP" 'comint-msearch-input) ! ; (define-key comint-mode-map "\eN" 'comint-psearch-input) ! ; (define-key comint-mode-map "\C-cR" 'comint-msearch-input-matching) (define-key comint-mode-map "\C-c\C-n" 'comint-next-prompt) ! (define-key comint-mode-map "\C-c\C-p" 'comint-prev-prompt) (define-key comint-mode-map "\C-c\C-d" 'comint-send-eof) ) --- 415,500 ---- (define-key comint-mode-map "\C-c\C-z" 'comint-stop-subjob) (define-key comint-mode-map "\C-c\C-\\" 'comint-quit-subjob) + ;; " ; Stops emacs-19.19's hilit getting confused. + (define-key comint-mode-map "\C-c\C-m" 'comint-copy-old-input) (define-key comint-mode-map "\C-c\C-o" 'comint-kill-output) (define-key comint-mode-map "\C-c\C-r" 'comint-show-output) ! (define-key comint-mode-map "\C-c\C-e" 'comint-show-maximum-output) ! (define-key comint-mode-map "\C-c\C-h" 'comint-dynamic-list-input-ring) (define-key comint-mode-map "\C-c\C-n" 'comint-next-prompt) ! (define-key comint-mode-map "\C-c\C-p" 'comint-previous-prompt) (define-key comint-mode-map "\C-c\C-d" 'comint-send-eof) + ;; Menu bars: + ;; completion: + (define-key comint-mode-map [menu-bar completion] + (cons "Complete" (make-sparse-keymap "Complete"))) + (define-key comint-mode-map [menu-bar completion complete-expand] + '("Expand File Name" . comint-replace-by-expanded-filename)) + (define-key comint-mode-map [menu-bar completion complete-listing] + '("File Completion Listing" . comint-dynamic-list-filename-completions)) + (define-key comint-mode-map [menu-bar completion complete-variable] + '("Complete Variable Name" . comint-dynamic-complete-variable)) + (define-key comint-mode-map [menu-bar completion complete-command] + '("Complete Command Name" . (lambda () (interactive) + (funcall + comint-dynamic-complete-command-command)))) + (define-key comint-mode-map [menu-bar completion complete-file] + '("Complete File Name" . comint-dynamic-complete-filename)) + (define-key comint-mode-map [menu-bar completion complete] + '("Complete Before Point" . comint-dynamic-complete)) + ;; Input history: + (define-key comint-mode-map [menu-bar input] + (cons "In/Out" (make-sparse-keymap "In/Out"))) + (define-key comint-mode-map [menu-bar input kill-output] + '("Kill Current Output Group" . comint-kill-output)) + (define-key comint-mode-map [menu-bar input next-prompt] + '("Forward Output Group" . comint-next-prompt)) + (define-key comint-mode-map [menu-bar input previous-prompt] + '("Backward Output Group" . comint-previous-prompt)) + (define-key comint-mode-map [menu-bar input show-maximum-output] + '("Show Maximum Output" . comint-show-maximum-output)) + (define-key comint-mode-map [menu-bar input show-output] + '("Show Current Output Group" . comint-show-output)) + (define-key comint-mode-map [menu-bar input kill-input] + '("Kill Current Input" . comint-kill-input)) + (define-key comint-mode-map [menu-bar input copy-input] + '("Copy Old Input" . comint-copy-old-input)) + (define-key comint-mode-map [menu-bar input forward-matching-history] + '("Forward Matching Input..." . comint-forward-matching-input)) + (define-key comint-mode-map [menu-bar input backward-matching-history] + '("Backward Matching Input..." . comint-backward-matching-input)) + (define-key comint-mode-map [menu-bar input next-matching-history] + '("Next Matching Input..." . comint-next-matching-input)) + (define-key comint-mode-map [menu-bar input previous-matching-history] + '("Previous Matching Input..." . comint-previous-matching-input)) + (define-key comint-mode-map [menu-bar input next-matching-history-from-input] + '("Next Matching Current Input" . comint-next-matching-input-from-input)) + (define-key comint-mode-map [menu-bar input previous-matching-history-from-input] + '("Previous Matching Current Input" . comint-previous-matching-input-from-input)) + (define-key comint-mode-map [menu-bar input next-history] + '("Next Input" . comint-next-input)) + (define-key comint-mode-map [menu-bar input previous-history] + '("Previous Input" . comint-previous-input)) + (define-key comint-mode-map [menu-bar input list-history] + '("List Input History" . comint-dynamic-list-input-ring)) + (define-key comint-mode-map [menu-bar input expand-history] + '("Expand History Before Point" . comint-replace-by-expanded-history)) + ;; Signals + (define-key comint-mode-map [menu-bar signals] + (cons "Signals" (make-sparse-keymap "Signals"))) + (define-key comint-mode-map [menu-bar signals eof] + '("EOF" . comint-send-eof)) + (define-key comint-mode-map [menu-bar signals kill] + '("KILL" . comint-kill-subjob)) + (define-key comint-mode-map [menu-bar signals quit] + '("QUIT" . comint-quit-subjob)) + (define-key comint-mode-map [menu-bar signals cont] + '("CONT" . comint-continue-subjob)) + (define-key comint-mode-map [menu-bar signals stop] + '("STOP" . comint-stop-subjob)) + (define-key comint-mode-map [menu-bar signals break] + '("BREAK" . comint-interrupt-subjob)) + ;; Put them in the menu bar: + (setq menu-bar-final-items (append '(completion input output signals) + menu-bar-final-items)) ) *************** *** 297,301 **** (defun comint-check-proc (buffer) ! "True if there is a living process associated w/buffer BUFFER. Living means the status is `run' or `stop'. BUFFER can be either a buffer or the name of one." --- 511,515 ---- (defun comint-check-proc (buffer) ! "Return t if there is a living process associated w/buffer BUFFER. Living means the status is `run' or `stop'. BUFFER can be either a buffer or the name of one." *************** *** 333,337 **** ;; Crank up a new process (let ((proc (comint-exec-1 name buffer command switches))) ! (set-process-filter proc 'comint-filter) (make-local-variable 'comint-ptyp) (setq comint-ptyp process-connection-type) ; T if pty, NIL if pipe. --- 547,551 ---- ;; Crank up a new process (let ((proc (comint-exec-1 name buffer command switches))) ! (set-process-filter proc 'comint-output-filter) (make-local-variable 'comint-ptyp) (setq comint-ptyp process-connection-type) ; T if pty, NIL if pipe. *************** *** 359,420 **** (defun comint-exec-1 (name buffer command switches) ! (let ((process-environment ! (comint-update-env process-environment ! (list (format "TERMCAP=emacs:co#%d:tc=unknown" ! (frame-width)) ! "TERM=emacs" ! "EMACS=t")))) (apply 'start-process name buffer command switches))) ! ! ;; This is just (append new old-env) that compresses out shadowed entries. ! ;; It's also pretty ugly, mostly due to lisp's horrible iteration structures. ! (defun comint-update-env (old-env new) ! (let ((ans (reverse new)) ! (vars (mapcar (function (lambda (vv) ! (and (string-match "^[^=]*=" vv) ! (substring vv 0 (match-end 0))))) ! new))) ! (while old-env ! (let* ((vv (car old-env)) ; vv is var=value ! (var (and (string-match "^[^=]*=" vv) ! (substring vv 0 (match-end 0))))) ! (setq old-env (cdr old-env)) ! (cond ((not (and var (member var vars))) ! (if var (setq var (cons var vars))) ! (setq ans (cons vv ans)))))) ! (nreverse ans))) ! ! ;;; Input history retrieval commands ! ;;; M-p -- previous input M-n -- next input ! ;;; M-C-r -- previous input matching ! ;;; =========================================================================== (defun comint-previous-input (arg) "Cycle backwards through input history." (interactive "*p") ! (let ((len (ring-length comint-input-ring))) ! (cond ((<= len 0) ! (message "Empty input ring") ! (ding)) ! ((not (comint-after-pmark-p)) ! (message "Not after process mark") ! (ding)) ! (t ! (delete-region (point) ! (process-mark (get-buffer-process (current-buffer)))) ! ;; Initialize the index on the first use of this command ! ;; so that the first M-p gets index 0, and the first M-n gets ! ;; index -1. ! (if (null comint-input-ring-index) ! (setq comint-input-ring-index ! (if (> arg 0) -1 ! (if (< arg 0) 1 0)))) ! (setq comint-input-ring-index ! (mod (+ comint-input-ring-index arg) len)) ! (message "%d" (1+ comint-input-ring-index)) ! (insert (ring-ref comint-input-ring comint-input-ring-index)))))) (defun comint-next-input (arg) --- 573,755 ---- (defun comint-exec-1 (name buffer command switches) ! (let ((process-environment process-environment)) ! (setenv "TERMCAP" (format "emacs:co#%d:tc=unknown" (frame-width))) ! (setenv "TERM" "emacs") ! (setenv "EMACS" "t") (apply 'start-process name buffer command switches))) ! ! ;;; Input history processing in a buffer ! ;;; =========================================================================== ! ;;; Useful input history functions, courtesy of the Ergo group. ! ! ;;; Eleven commands: ! ;;; comint-dynamic-list-input-ring List history in help buffer. ! ;;; comint-previous-input Previous input... ! ;;; comint-previous-matching-input ...matching a string. ! ;;; comint-previous-matching-input-from-input ... matching the current input. ! ;;; comint-next-input Next input... ! ;;; comint-next-matching-input ...matching a string. ! ;;; comint-next-matching-input-from-input ... matching the current input. ! ;;; comint-backward-matching-input Backwards input... ! ;;; comint-forward-matching-input ...matching a string. ! ;;; comint-replace-by-expanded-history Expand history at point; ! ;;; replace with expanded history. ! ;;; comint-magic-space Expand history and insert space. ! ;;; ! ;;; Two functions: ! ;;; comint-read-input-ring Read into comint-input-ring... ! ;;; comint-write-input-ring Write to comint-input-ring-file-name. ! ! (defun comint-read-input-ring () ! "Sets the buffer's `comint-input-ring' from a history file. ! The name of the file is given by the variable `comint-input-ring-file-name'. ! The history ring is of size `comint-input-ring-size', regardless of file size. ! If `comint-input-ring-file-name' is nil this function does nothing. ! ! Useful within mode or mode hooks. ! ! The structure of the history file should be one input command per line, and ! most recent command last. ! See also `comint-input-ignoredups' and `comint-write-input-ring'." ! (cond ((null comint-input-ring-file-name) ! nil) ! ((not (file-readable-p comint-input-ring-file-name)) ! (message "Cannot read history file %s" comint-input-ring-file-name)) ! (t ! (let ((history-buf (get-file-buffer comint-input-ring-file-name)) ! (ring (make-ring comint-input-ring-size))) ! (save-excursion ! (set-buffer (or history-buf ! (find-file-noselect comint-input-ring-file-name))) ! ;; Save restriction in case file is already visited... ! ;; Watch for those date stamps in history files! ! (save-excursion ! (save-restriction ! (widen) ! (goto-char (point-min)) ! (while (re-search-forward "^\\s *\\([^#].*\\)\\s *$" nil t) ! (let ((history (buffer-substring (match-beginning 1) ! (match-end 1)))) ! (if (or (null comint-input-ignoredups) ! (ring-empty-p ring) ! (not (string-equal (ring-ref ring 0) history))) ! (ring-insert ring history))))) ! ;; Kill buffer unless already visited. ! (if (null history-buf) ! (kill-buffer nil)))) ! (setq comint-input-ring ring ! comint-input-ring-index nil))))) ! ! (defun comint-write-input-ring () ! "Writes the buffer's `comint-input-ring' to a history file. ! The name of the file is given by the variable `comint-input-ring-file-name'. ! The original contents of the file are lost if `comint-input-ring' is not empty. ! If `comint-input-ring-file-name' is nil this function does nothing. ! ! Useful within process sentinels. ! ! See also `comint-read-input-ring'." ! (cond ((or (null comint-input-ring-file-name) ! (null comint-input-ring) (ring-empty-p comint-input-ring)) ! nil) ! ((not (file-writable-p comint-input-ring-file-name)) ! (message "Cannot write history file %s" comint-input-ring-file-name)) ! (t ! (let* ((history-buf (get-buffer-create " *Temp Input History*")) ! (ring comint-input-ring) ! (file comint-input-ring-file-name) ! (index (ring-length ring))) ! ;; Write it all out into a buffer first. Much faster, but messier, ! ;; than writing it one line at a time. ! (save-excursion ! (set-buffer history-buf) ! (erase-buffer) ! (while (> index 0) ! (setq index (1- index)) ! (insert (ring-ref ring index) ?\n)) ! (write-region (buffer-string) nil file nil 'no-message) ! (kill-buffer nil)))))) ! (defun comint-dynamic-list-input-ring () ! "List in help buffer the buffer's input history." ! (interactive) ! (if (or (not (ring-p comint-input-ring)) ! (ring-empty-p comint-input-ring)) ! (message "No history") ! (let ((history nil) ! (history-buffer " *Input History*") ! (index (1- (ring-length comint-input-ring))) ! (conf (current-window-configuration))) ! ;; We have to build up a list ourselves from the ring vector. ! (while (>= index 0) ! (setq history (cons (ring-ref comint-input-ring index) history) ! index (1- index))) ! ;; Change "completion" to "history reference" ! ;; to make the display accurate. ! (with-output-to-temp-buffer history-buffer ! (display-completion-list history) ! (set-buffer history-buffer) ! (forward-line 3) ! (while (search-backward "completion" nil 'move) ! (replace-match "history reference"))) ! (sit-for 0) ! (message "Hit space to flush") ! (let ((ch (read-event))) ! (if (eq ch ?\ ) ! (set-window-configuration conf) ! (setq unread-command-events (list ch))))))) ! ! ! (defun comint-regexp-arg (prompt) ! ;; Return list of regexp and prefix arg using PROMPT. ! (let* ((minibuffer-history-sexp-flag nil) ! ;; Don't clobber this. ! (last-command last-command) ! (regexp (read-from-minibuffer prompt nil nil nil ! 'minibuffer-history-search-history))) ! (list (if (string-equal regexp "") ! (setcar minibuffer-history-search-history ! (nth 1 minibuffer-history-search-history)) ! regexp) ! (prefix-numeric-value current-prefix-arg)))) ! ! (defun comint-search-arg (arg) ! ;; First make sure there is a ring and that we are after the process mark ! (cond ((not (comint-after-pmark-p)) ! (error "Not at command line")) ! ((or (null comint-input-ring) ! (ring-empty-p comint-input-ring)) ! (error "Empty input ring")) ! ((zerop arg) ! ;; arg of zero resets search from beginning, and uses arg of 1 ! (setq comint-input-ring-index nil) ! 1) ! (t ! arg))) ! (defun comint-search-start (arg) ! ;; Index to start a directional search, starting at comint-input-ring-index ! (if comint-input-ring-index ! ;; If a search is running, offset by 1 in direction of arg ! (mod (+ comint-input-ring-index (if (> arg 0) 1 -1)) ! (ring-length comint-input-ring)) ! ;; For a new search, start from beginning or end, as appropriate ! (if (>= arg 0) ! 0 ; First elt for forward search ! (1- (ring-length comint-input-ring))))) ; Last elt for backward search ! ! (defun comint-previous-input-string (arg) ! "Return the string ARG places along the input ring. ! Moves relative to `comint-input-ring-index'." ! (ring-ref comint-input-ring (if comint-input-ring-index ! (mod (+ arg comint-input-ring-index) ! (ring-length comint-input-ring)) ! arg))) (defun comint-previous-input (arg) "Cycle backwards through input history." (interactive "*p") ! (comint-previous-matching-input "." arg)) (defun comint-next-input (arg) *************** *** 423,426 **** --- 758,794 ---- (comint-previous-input (- arg))) + (defun comint-previous-matching-input-string (regexp arg) + "Return the string matching REGEXP ARG places along the input ring. + Moves relative to `comint-input-ring-index'." + (let* ((pos (comint-previous-matching-input-string-position regexp arg))) + (if pos (ring-ref comint-input-ring pos)))) + + (defun comint-previous-matching-input-string-position (regexp arg &optional start) + "Return the index matching REGEXP ARG places along the input ring. + Moves relative to START, or `comint-input-ring-index'." + (if (or (not (ring-p comint-input-ring)) + (ring-empty-p comint-input-ring)) + (error "No history")) + (let* ((len (ring-length comint-input-ring)) + (motion (if (> arg 0) 1 -1)) + (n (mod (- (or start (comint-search-start arg)) motion) len)) + (tried-each-ring-item nil) + (prev nil)) + ;; Do the whole search as many times as the argument says. + (while (and (/= arg 0) (not tried-each-ring-item)) + ;; Step once. + (setq prev n + n (mod (+ n motion) len)) + ;; If we haven't reached a match, step some more. + (while (and (< n len) (not tried-each-ring-item) + (not (string-match regexp (ring-ref comint-input-ring n)))) + (setq n (mod (+ n motion) len) + ;; If we have gone all the way around in this search. + tried-each-ring-item (= n prev))) + (setq arg (if (> arg 0) (1- arg) (1+ arg)))) + ;; Now that we know which ring element to use, if we found it, return that. + (if (string-match regexp (ring-ref comint-input-ring n)) + n))) + (defun comint-previous-matching-input (regexp arg) "Search backwards through input history for match for REGEXP. *************** *** 428,466 **** With prefix argument N, search for Nth previous match. If N is negative, find the next or Nth next match." ! (interactive ! (let* ((minibuffer-history-sexp-flag nil) ! ;; Don't clobber this. ! (last-command last-command) ! (regexp (read-from-minibuffer "Previous input matching (regexp): " ! nil ! minibuffer-local-map ! nil ! 'minibuffer-history-search-history))) ! (list (if (string= regexp "") ! (setcar minibuffer-history-search-history ! (nth 1 minibuffer-history-search-history)) ! regexp) ! (prefix-numeric-value current-prefix-arg)))) ! (if (null comint-input-ring-index) ! (setq comint-input-ring-index -1)) ! (let* ((len (ring-length comint-input-ring)) ! (motion (if (> arg 0) 1 -1)) ! (n comint-input-ring-index)) ! ;; Do the whole search as many times as the argument says. ! (while (/= arg 0) ! (let ((prev n)) ! ;; Step once. ! (setq n (mod (+ n motion) len)) ! ;; If we haven't reached a match, step some more. ! (while (and (< n len) ! (not (string-match regexp (ring-ref comint-input-ring n)))) ! (setq n (mod (+ n motion) len)) ! ;; If we have gone all the way around in this search, error. ! (if (= n prev) ! (error "Not found")))) ! (setq arg (if (> arg 0) (1- arg) (1+ arg)))) ! ;; Now that we know which ring element to use, ! ;; substitute that for the current input. ! (comint-previous-input (- n comint-input-ring-index)))) (defun comint-next-matching-input (regexp arg) --- 796,811 ---- With prefix argument N, search for Nth previous match. If N is negative, find the next or Nth next match." ! (interactive (comint-regexp-arg "Previous input matching (regexp): ")) ! (setq arg (comint-search-arg arg)) ! (let ((pos (comint-previous-matching-input-string-position regexp arg))) ! ;; Has a match been found? ! (if (null pos) ! (error "Not found") ! (setq comint-input-ring-index pos) ! (message "History item: %d" (1+ pos)) ! (delete-region ! ;; Can't use kill-region as it sets this-command ! (process-mark (get-buffer-process (current-buffer))) (point)) ! (insert (ring-ref comint-input-ring pos))))) (defun comint-next-matching-input (regexp arg) *************** *** 469,594 **** With prefix argument N, search for Nth following match. If N is negative, find the previous or Nth previous match." ! (interactive ! (let ((minibuffer-history-sexp-flag nil) ! ;; Don't clobber this. ! (last-command last-command) ! (regexp (read-from-minibuffer "Previous input matching (regexp): " ! nil ! minibuffer-local-map ! nil ! 'minibuffer-history-search-history))) ! (list (if (string= regexp "") ! (setcar minibuffer-history-search-history ! (nth 1 minibuffer-history-search-history)) ! regexp) ! (prefix-numeric-value current-prefix-arg)))) (comint-previous-matching-input regexp (- arg))) - - ;;; These next three commands are alternatives to the input history commands - ;;; They search through the process buffer - ;;; text looking for occurrences of the prompt. Bound to M-P, M-N, and C-c R - ;;; (uppercase P, N, and R) for now. Try'em out. Go with what you like... - - ;;; comint-msearch-input-matching prompts for a string, not a regexp. - ;;; This could be considered to be the wrong thing. I decided to keep it - ;;; simple, and not make the user worry about regexps. This, of course, - ;;; limits functionality. - - ;;; These commands were deemed non-winning and have been commented out. - ;;; Feel free to re-enable them if you like. -Olin 3/91 - - ;(defun comint-psearch-input () - ; "Search forwards for next occurrence of prompt and skip to end of line. - ;\(prompt is anything matching regexp comint-prompt-regexp)" - ; (interactive) - ; (if (re-search-forward comint-prompt-regexp (point-max) t) - ; (end-of-line) - ; (error "No occurrence of prompt found"))) - ; - ;(defun comint-msearch-input () - ; "Search backwards for previous occurrence of prompt and skip to end of line. - ;Search starts from beginning of current line." - ; (interactive) - ; (let ((p (save-excursion - ; (beginning-of-line) - ; (cond ((re-search-backward comint-prompt-regexp (point-min) t) - ; (end-of-line) - ; (point)) - ; (t nil))))) - ; (if p (goto-char p) - ; (error "No occurrence of prompt found")))) - ; - ;(defun comint-msearch-input-matching (str) - ; "Search backwards for occurrence of prompt followed by STRING. - ;STRING is prompted for, and is NOT a regular expression." - ; (interactive (let ((s (read-from-minibuffer - ; (format "Command (default %s): " - ; comint-last-input-match)))) - ; (list (if (string= s "") comint-last-input-match s)))) - ;; (interactive "sCommand: ") - ; (setq comint-last-input-match str) ; update default - ; (let* ((r (concat comint-prompt-regexp (regexp-quote str))) - ; (p (save-excursion - ; (beginning-of-line) - ; (cond ((re-search-backward r (point-min) t) - ; (end-of-line) - ; (point)) - ; (t nil))))) - ; (if p (goto-char p) - ; (error "No match")))) ! ;;; ! ;;; Similar input -- contributed by ccm and highly winning. ;;; ! ;;; Reenter input, removing back to the last insert point if it exists. ;;; - ;;(defvar comint-last-similar-string "" - ;; "The string last used in a similar string search.") - ;;(defun comint-previous-similar-input (arg) - ;; "Fetch the previous (older) input that matches the string typed so far. - ;;Successive repetitions find successively older matching inputs. - ;;A prefix argument serves as a repeat count; a negative argument - ;;fetches following (more recent) inputs." - ;; (interactive "p") - ;; (if (not (comint-after-pmark-p)) - ;; (error "Not after process mark")) - ;; (if (null comint-input-ring-index) - ;; (setq comint-input-ring-index - ;; (if (> arg 0) -1 - ;; (if (< arg 0) 1 0)))) - ;; (if (not (or (eq last-command 'comint-previous-similar-input) - ;; (eq last-command 'comint-next-similar-input))) - ;; (setq comint-last-similar-string - ;; (buffer-substring - ;; (process-mark (get-buffer-process (current-buffer))) - ;; (point)))) - ;; (let* ((size (length comint-last-similar-string)) - ;; (len (ring-length comint-input-ring)) - ;; (n (+ comint-input-ring-index arg)) - ;; entry) - ;; (while (and (< n len) - ;; (or (< (length (setq entry (ring-ref comint-input-ring n))) size) - ;; (not (equal comint-last-similar-string - ;; (substring entry 0 size))))) - ;; (setq n (+ n arg))) - ;; (cond ((< n len) - ;; (setq comint-input-ring-index n) - ;; (if (or (eq last-command 'comint-previous-similar-input) - ;; (eq last-command 'comint-next-similar-input)) - ;; (delete-region (mark) (point)) ; repeat - ;; (push-mark (point))) ; 1st time - ;; (insert (substring entry size))) - ;; (t (error "Not found"))) - ;; (message "%d" (1+ comint-input-ring-index)))) - - ;;(defun comint-next-similar-input (arg) - ;; "Fetch the next (newer) input that matches the string typed so far. - ;;Successive repetitions find successively newer matching inputs. - ;;A prefix argument serves as a repeat count; a negative argument - ;;fetches previous (older) inputs." - ;; (interactive "p") - ;; (comint-previous-similar-input (- arg))) - (defun comint-send-input () "Send input to process. --- 814,1022 ---- With prefix argument N, search for Nth following match. If N is negative, find the previous or Nth previous match." ! (interactive (comint-regexp-arg "Next input matching (regexp): ")) (comint-previous-matching-input regexp (- arg))) ! (defun comint-previous-matching-input-from-input (arg) ! "Search backwards through input history for match for current input. ! \(Previous history elements are earlier commands.) ! With prefix argument N, search for Nth previous match. ! If N is negative, find the next or Nth next match." ! (interactive "p") ! (if (not (memq last-command '(comint-previous-matching-input-from-input ! comint-next-matching-input-from-input))) ! ;; Starting a new search ! (setq comint-matching-input-from-input-string ! (buffer-substring ! (process-mark (get-buffer-process (current-buffer))) ! (point)) ! comint-input-ring-index nil)) ! (comint-previous-matching-input ! (concat "^" (regexp-quote comint-matching-input-from-input-string)) ! arg)) ! ! (defun comint-next-matching-input-from-input (arg) ! "Search forwards through input history for match for current input. ! \(Previous history elements are earlier commands.) ! With prefix argument N, search for Nth previous match. ! If N is negative, find the next or Nth next match." ! (interactive "p") ! (comint-previous-matching-input-from-input (- arg))) ! ! ! (defun comint-replace-by-expanded-history () ! "Expand input command history references before point. ! This function depends on the buffer's idea of the input history, which may not ! match the command interpreter's idea, assuming it has one. ! ! Assumes history syntax is like typical Un*x shells'. However, since emacs ! cannot know the interpreter's idea of input line numbers, assuming it has one, ! it cannot expand absolute input line number references. ! ! See also `comint-magic-space'." ! (interactive) ! (save-excursion ! (let ((toend (- (save-excursion (end-of-line nil) (point)) (point))) ! (start (progn (comint-bol nil) (point)))) ! (while (re-search-forward ! "[!^]" (save-excursion (end-of-line nil) (- (point) toend)) t) ! ;; This seems a bit complex. We look for references such as !!, !-num, ! ;; !foo, !?foo, !{bar}, !?{bar}, ^oh, ^my^, ^god^it, ^never^ends^. ! ;; If that wasn't enough, the plings can be suffixed with argument ! ;; range specifiers. ! ;; Argument ranges are complex too, so we hive off the input line, ! ;; referenced with plings, with the range string to `comint-args'. ! (setq comint-input-ring-index nil) ! (goto-char (match-beginning 0)) ! (cond ((or (= (preceding-char) ?\\) ! (comint-within-quotes start (point))) ! ;; The history is quoted, or we're in quotes. ! (goto-char (match-end 0))) ! ((looking-at "![0-9]+\\($\\|[^-]\\)") ! ;; We cannot know the interpreter's idea of input line numbers. ! (goto-char (match-end 0)) ! (message "Absolute reference cannot be expanded")) ! ((looking-at "!-\\([0-9]+\\)\\(:?[0-9^$*-]+\\)?") ! ;; Just a number of args from `number' lines backward. ! (let ((number (1- (string-to-number ! (buffer-substring (match-beginning 1) ! (match-end 1)))))) ! (if (<= number (ring-length comint-input-ring)) ! (progn ! (replace-match ! (comint-args (comint-previous-input-string number) ! (match-beginning 2) (match-end 2)) t t) ! (setq comint-input-ring-index number) ! (message "History item: %d" (1+ number))) ! (goto-char (match-end 0)) ! (message "Relative reference exceeds input history size")))) ! ((or (looking-at "!!?:?\\([0-9^$*-]+\\)") (looking-at "!!")) ! ;; Just a number of args from the previous input line. ! (replace-match ! (comint-args (comint-previous-input-string 0) ! (match-beginning 1) (match-end 1)) t t)) ! ((looking-at ! "!\\??\\({\\(.+\\)}\\|\\(\\sw+\\)\\)\\(:?[0-9^$*-]+\\)?") ! ;; Most recent input starting with or containing (possibly ! ;; protected) string, maybe just a number of args. Phew. ! (let* ((mb1 (match-beginning 1)) (me1 (match-end 1)) ! (mb2 (match-beginning 2)) (me2 (match-end 2)) ! (exp (buffer-substring (or mb2 mb1) (or me2 me1))) ! (pref (if (save-match-data (looking-at "!\\?")) "" "^")) ! (pos (save-match-data ! (comint-previous-matching-input-string-position ! (concat pref (regexp-quote exp)) 1)))) ! (if (null pos) ! (progn (message "Not found") ! (goto-char (match-end 0)) ! (ding)) ! (setq comint-input-ring-index pos) ! (message "History item: %d" (1+ pos)) ! (replace-match ! (comint-args (ring-ref comint-input-ring pos) ! (match-beginning 4) (match-end 4)) ! t t)))) ! ((looking-at "\\^\\([^^]+\\)\\^?\\([^^]*\\)\\^?") ! ;; Quick substitution on the previous input line. ! (let ((old (buffer-substring (match-beginning 1) (match-end 1))) ! (new (buffer-substring (match-beginning 2) (match-end 2))) ! (pos nil)) ! (replace-match (comint-previous-input-string 0) t t) ! (setq pos (point)) ! (goto-char (match-beginning 0)) ! (if (search-forward old pos t) ! (replace-match new t t) ! (message "Not found") ! (ding)))) ! (t ! (goto-char (match-end 0)))))))) ! ! ! (defun comint-magic-space (arg) ! "Expand input history references before point and insert ARG spaces. ! A useful command to bind to SPC. See `comint-replace-by-expanded-history'." ! (interactive "p") ! (comint-replace-by-expanded-history) ! (self-insert-command arg)) ! ! (defun comint-within-quotes (beg end) ! "Return t if the number of quotes between BEG and END is odd. ! Quotes are single and double." ! (let ((countsq (comint-how-many-region "\\(^\\|[^\\\\]\\)\'" beg end)) ! (countdq (comint-how-many-region "\\(^\\|[^\\\\]\\)\"" beg end))) ! (or (= (mod countsq 2) 1) (= (mod countdq 2) 1)))) ! ! (defun comint-how-many-region (regexp beg end) ! "Return number of matches for REGEXP from BEG to END." ! (let ((count 0)) ! (save-excursion ! (save-match-data ! (goto-char beg) ! (while (re-search-forward regexp end t) ! (setq count (1+ count))))) ! count)) ! ! (defun comint-args (string begin end) ! ;; From STRING, return the args depending on the range specified in the text ! ;; from BEGIN to END. If BEGIN is nil, assume all args. Ignore leading `:'. ! ;; Range can be x-y, x-, -y, where x/y can be [0-9], *, ^, $. ! (save-match-data ! (if (null begin) ! (comint-arguments string 0 nil) ! (let* ((range (buffer-substring ! (if (eq (char-after begin) ?:) (1+ begin) begin) end)) ! (nth (cond ((string-match "^[*^]" range) 1) ! ((string-match "^-" range) 0) ! ((string-equal range "$") nil) ! (t (string-to-number range)))) ! (mth (cond ((string-match "[-*$]$" range) nil) ! ((string-match "-" range) ! (string-to-number (substring range (match-end 0)))) ! (t nth)))) ! (comint-arguments string nth mth))))) ! ! (defun comint-delim-arg (arg) ! ;; Return a list of arguments from ARG. If there's a quote in there, just ! ;; a list of the arg, otherwise try and break up using characters in ! ;; comint-delimiter-argument-list. Returned list is backwards. ! (if (or (null comint-delimiter-argument-list) ! (string-match "[\"\'\`]" arg)) ! (list arg) ! (let ((not-delim (format "[^%s]+" (mapconcat ! (function (lambda (d) (regexp-quote d))) ! comint-delimiter-argument-list ""))) ! (delim-str (mapconcat (function (lambda (d) ! (concat (regexp-quote d) "+"))) ! comint-delimiter-argument-list "\\|")) ! (args ()) (pos 0)) ! (while (or (eq pos (string-match not-delim arg pos)) ! (eq pos (string-match delim-str arg pos))) ! (setq pos (match-end 0) ! args (cons (substring arg (match-beginning 0) pos) args))) ! args))) ! ! (defun comint-arguments (string nth mth) ! "Return from STRING the NTH to MTH arguments. ! NTH and/or MTH can be nil, which means the last argument. ! Returned arguments are separated by single spaces. Arguments are assumed to be ! delimited by whitespace. Strings comprising characters in the variable ! `comint-delimiter-argument-list' are treated as delimiters and arguments. ! Argument 0 is the command name." ! (let ((arg "\\(\\S \\|\\(\"[^\"]*\"\\|\'[^\']*\'\\|\`[^\`]*\`\\)\\)+") ! (args ()) (pos 0) (str nil)) ! ;; We build a list of all the args. Unnecessary, but more efficient, when ! ;; ranges of args are required, than picking out one by one and recursing. ! (while (string-match arg string pos) ! (setq pos (match-end 0) ! str (substring string (match-beginning 0) pos) ! args (nconc (comint-delim-arg str) args))) ! (let ((n (or nth (1- (length args)))) ! (m (if mth (1- (- (length args) mth)) 0))) ! (mapconcat ! (function (lambda (a) a)) (nthcdr n (nreverse (nthcdr m args))) " ")))) ! ;;; ! ;;; Input processing stuff ;;; (defun comint-send-input () "Send input to process. *************** *** 601,608 **** since it is assumed the remote process will re-echo it). ! The value of variable `comint-input-sentinel' is called on the input ! before sending it. The input is entered into the input history ring, ! if the value of variable `comint-input-filter' returns non-nil when ! called on the input. If variable `comint-eol-on-send' is non-nil, then point is moved to the --- 1029,1037 ---- since it is assumed the remote process will re-echo it). ! Any history reference may be expanded depending on the value of the variable ! `comint-input-autoexpand'. The value of variable `comint-input-sentinel' is ! called on the input before sending it. The input is entered into the input ! history ring, if the value of variable `comint-input-filter' returns non-nil ! when called on the input. If variable `comint-eol-on-send' is non-nil, then point is moved to the *************** *** 616,620 **** comint-input-sentinel monitors input for \"cd\", \"pushd\", and \"popd\" commands. When it sees one, it cd's the buffer. ! comint-input-filter is the default: returns T if the input isn't all white space. --- 1045,1049 ---- comint-input-sentinel monitors input for \"cd\", \"pushd\", and \"popd\" commands. When it sees one, it cd's the buffer. ! comint-input-filter is the default: returns t if the input isn't all white space. *************** *** 622,626 **** comint-get-old-input snarfs the sexp ending at point. comint-input-sentinel does nothing. ! comint-input-filter returns NIL if the input matches input-filter-regexp, which matches (1) all whitespace (2) :a, :c, etc. --- 1051,1055 ---- comint-get-old-input snarfs the sexp ending at point. comint-input-sentinel does nothing. ! comint-input-filter returns nil if the input matches input-filter-regexp, which matches (1) all whitespace (2) :a, :c, etc. *************** *** 631,636 **** (if (not proc) (error "Current buffer has no process") (let* ((pmark (process-mark proc)) ! (pmark-val (marker-position pmark)) ! (input (if (>= (point) pmark-val) (progn (if comint-eol-on-send (end-of-line)) (buffer-substring pmark (point))) --- 1060,1064 ---- (if (not proc) (error "Current buffer has no process") (let* ((pmark (process-mark proc)) ! (intxt (if (>= (point) (marker-position pmark)) (progn (if comint-eol-on-send (end-of-line)) (buffer-substring pmark (point))) *************** *** 638,647 **** (goto-char pmark) (insert copy) ! copy)))) (if comint-process-echoes (delete-region pmark (point)) ! (insert ?\n)) ! (if (funcall comint-input-filter input) ! (ring-insert comint-input-ring input)) (funcall comint-input-sentinel input) (funcall comint-input-sender proc input) --- 1066,1096 ---- (goto-char pmark) (insert copy) ! copy))) ! (input (if (not (eq comint-input-autoexpand 'input)) ! ;; Just whatever's already there ! intxt ! ;; Expand and leave it visible in buffer ! (comint-replace-by-expanded-history) ! (buffer-substring pmark (point)))) ! (history (if (not (eq comint-input-autoexpand 'history)) ! (comint-arguments input 0 nil) ! ;; This is messy 'cos ultimately the original ! ;; functions used do insertion, rather than return ! ;; strings. We have to expand, then insert back. ! (comint-replace-by-expanded-history) ! (let ((copy (buffer-substring pmark (point)))) ! (delete-region pmark (point)) ! (insert input) ! (comint-arguments copy 0 nil))))) (if comint-process-echoes (delete-region pmark (point)) ! (insert ?\n)) ! (if (and (funcall comint-input-filter history) ! (or (null comint-input-ignoredups) ! (not (ring-p comint-input-ring)) ! (ring-empty-p comint-input-ring) ! (not (string-equal (ring-ref comint-input-ring 0) ! history)))) ! (ring-insert comint-input-ring history)) (funcall comint-input-sentinel input) (funcall comint-input-sender proc input) *************** *** 649,693 **** (set-marker comint-last-input-start pmark) (set-marker comint-last-input-end (point)) ! (set-marker (process-mark proc) (point)))))) ! ;; The sole purpose of using this filter for comint processes ;; is to keep comint-last-input-end from moving forward ;; when output is inserted. ! (defun comint-filter (process string) ! (let ((obuf (current-buffer)) ! opoint obeg oend) ! (set-buffer (process-buffer process)) ! (setq opoint (point)) ! (setq obeg (point-min)) ! (setq oend (point-max)) ! (let ((buffer-read-only nil) ! (nchars (length string))) ! (widen) ! (goto-char (process-mark process)) ! (if (<= (point) opoint) ! (setq opoint (+ opoint nchars))) ! ;; Insert after old_begv, but before old_zv. ! (if (< (point) obeg) ! (setq obeg (+ obeg nchars))) ! (if (<= (point) oend) ! (setq oend (+ oend nchars))) ! ! (insert-before-markers string) ! ;; Don't insert initial prompt outside the top of the window. ! (if (= (window-start (selected-window)) (point)) ! (set-window-start (selected-window) (- (point) (length string)))) ! ! (and comint-last-input-end ! (marker-buffer comint-last-input-end) ! (= (point) comint-last-input-end) ! (set-marker comint-last-input-end ! (- comint-last-input-end nchars))) ! (set-marker (process-mark process) (point) nil) ! (force-mode-line-update)) ! ! (narrow-to-region obeg oend) ! (goto-char opoint) ! (set-buffer obuf))) (defun comint-get-old-input-default () "Default for `comint-get-old-input'. --- 1098,1226 ---- (set-marker comint-last-input-start pmark) (set-marker comint-last-input-end (point)) ! (set-marker (process-mark proc) (point)) ! ;; A kludge to prevent the delay between insert and process output ! ;; affecting the display. A case for a comint-send-input-hook? ! (let ((functions comint-output-filter-functions)) ! (while functions ! (funcall (car functions) (concat input "\n")) ! (setq functions (cdr functions)))))))) ! ;; The purpose of using this filter for comint processes ;; is to keep comint-last-input-end from moving forward ;; when output is inserted. ! (defun comint-output-filter (process string) ! ;; First check for killed buffer ! (let ((oprocbuf (process-buffer process))) ! (if (and oprocbuf (buffer-name oprocbuf)) ! (let ((obuf (current-buffer)) ! (opoint nil) (obeg nil) (oend nil)) ! (set-buffer oprocbuf) ! (setq opoint (point)) ! (setq obeg (point-min)) ! (setq oend (point-max)) ! (let ((buffer-read-only nil) ! (nchars (length string)) ! (ostart nil)) ! (widen) ! (goto-char (process-mark process)) ! (setq ostart (point)) ! (if (<= (point) opoint) ! (setq opoint (+ opoint nchars))) ! ;; Insert after old_begv, but before old_zv. ! (if (< (point) obeg) ! (setq obeg (+ obeg nchars))) ! (if (<= (point) oend) ! (setq oend (+ oend nchars))) ! (insert-before-markers string) ! ;; Don't insert initial prompt outside the top of the window. ! (if (= (window-start (selected-window)) (point)) ! (set-window-start (selected-window) (- (point) (length string)))) ! (if (and comint-last-input-end ! (marker-buffer comint-last-input-end) ! (= (point) comint-last-input-end)) ! (set-marker comint-last-input-end (- comint-last-input-end nchars))) ! (set-marker comint-last-output-start ostart) ! (set-marker (process-mark process) (point)) ! (force-mode-line-update)) ! ! (narrow-to-region obeg oend) ! (goto-char opoint) ! (let ((functions comint-output-filter-functions)) ! (while functions ! (funcall (car functions) string) ! (setq functions (cdr functions)))) ! (set-buffer obuf))))) ! ! (defun comint-preinput-scroll-to-bottom () ! "Go to the end of buffer in all windows showing it. ! Movement occurs if point in the selected window is not after the process mark, ! and `this-command' is an insertion command. Insertion commands recognised ! are `self-insert-command', `comint-magic-space', `yank', `mouse-yank-at-click', ! and `hilit-yank'. ! Depends on the value of `comint-scroll-to-bottom-on-input'. ! ! This function should be a pre-command hook." ! (if (and comint-scroll-to-bottom-on-input ! (memq this-command '(self-insert-command comint-magic-space yank ! mouse-yank-at-click hilit-yank))) ! (let* ((selected (selected-window)) ! (current (current-buffer)) ! (process (get-buffer-process current)) ! (scroll comint-scroll-to-bottom-on-input)) ! (if (and process (< (point) (process-mark process)) ! scroll (not (window-minibuffer-p selected))) ! (walk-windows ! (function (lambda (window) ! (if (and (eq (window-buffer window) current) ! (or (eq scroll t) (eq scroll 'all) ! (and (eq scroll 'this) (eq selected window)))) ! (progn ! (select-window window) ! (goto-char (point-max)) ! (select-window selected))))) ! 'not-minibuf t))))) ! ! (defun comint-postoutput-scroll-to-bottom (string) ! "Go to the end of buffer in all windows showing it. ! Does not scroll if the current line is the last line in the buffer. ! Depends on the value of `comint-scroll-to-bottom-on-output' and ! `comint-scroll-show-maximum-output'. ! ! This function should be in the list `comint-output-filter-functions'." ! (let* ((selected (selected-window)) ! (current (current-buffer)) ! (process (get-buffer-process current)) ! (scroll comint-scroll-to-bottom-on-output)) ! (if process ! (walk-windows ! (function (lambda (window) ! (if (eq (window-buffer window) current) ! (progn ! (select-window window) ! (if (and (< (point) (process-mark process)) ! (or (eq scroll t) (eq scroll 'all) ! ;; Maybe user wants point to jump to the end. ! (and (eq scroll 'this) (eq selected window)) ! (and (eq scroll 'others) (not (eq selected window))) ! ;; If point was at the end, keep it at the end. ! (>= (point) ! (- (process-mark process) (length string))))) ! (goto-char (process-mark process))) ! ;; Optionally scroll so that the text ! ;; ends at the bottom of the window. ! (if (and comint-scroll-show-maximum-output ! (>= (point) (process-mark process))) ! (save-excursion ! (goto-char (point-max)) ! (recenter -1))) ! (select-window selected))))) ! nil t)))) + (defun comint-show-maximum-output () + "Put the end of the buffer at the bottom of the window." + (interactive) + (goto-char (point-max)) + (recenter -1)) + (defun comint-get-old-input-default () "Default for `comint-get-old-input'. *************** *** 701,704 **** --- 1234,1248 ---- (buffer-substring beg (point))))) + (defun comint-copy-old-input () + "Insert after prompt old input at point as new input to be edited. + Calls `comint-get-old-input' to get old input." + (interactive) + (let ((input (funcall comint-get-old-input)) + (process (get-buffer-process (current-buffer)))) + (if (not process) + (error "Current buffer has no process") + (goto-char (process-mark process)) + (insert input)))) + (defun comint-skip-prompt () "Skip past the text matching regexp `comint-prompt-regexp'. *************** *** 709,722 **** (goto-char (match-end 0))))) - (defun comint-after-pmark-p () ! "Is point after the process output marker?" ! ;; Since output could come into the buffer after we looked at the point ! ;; but before we looked at the process marker's value, we explicitly ! ;; serialise. This is just because I don't know whether or not emacs ! ;; services input during execution of lisp commands. ! (let ((proc-pos (marker-position ! (process-mark (get-buffer-process (current-buffer)))))) ! (<= proc-pos (point)))) (defun comint-simple-send (proc string) --- 1253,1260 ---- (goto-char (match-end 0))))) (defun comint-after-pmark-p () ! "Return t if point is after the process output marker." ! (let ((pmark (process-mark (get-buffer-process (current-buffer))))) ! (<= (marker-position pmark) (point)))) (defun comint-simple-send (proc string) *************** *** 729,734 **** (defun comint-bol (arg) "Goes to the beginning of line, then skips past the prompt, if any. ! If a prefix argument is given (\\[universal-argument]), then no prompt skip ! -- go straight to column 0. The prompt skip is done by skipping text matching the regular expression --- 1267,1271 ---- (defun comint-bol (arg) "Goes to the beginning of line, then skips past the prompt, if any. ! If prefix argument is given (\\[universal-argument]) the prompt is not skipped. The prompt skip is done by skipping text matching the regular expression *************** *** 799,803 **** Security bug: your string can still be temporarily recovered with \\[view-lossage]." - ; (interactive (list (comint-read-noecho "Enter non-echoed text"))) (interactive "P") ; Defeat snooping via C-x esc (let ((proc (get-buffer-process (current-buffer)))) --- 1336,1339 ---- *************** *** 827,830 **** --- 1363,1367 ---- (let ((next-i (+ i comint-input-chunk-size))) (accept-process-output) + (sit-for 0) (process-send-string proc (substring str i (min len next-i))) (setq i next-i))))) *************** *** 835,860 **** your process from hanging on long inputs. See `comint-send-string'." (comint-send-string proc (buffer-substring start end))) - ;;; Random input hackage (defun comint-kill-output () ! "Kill all output from interpreter since last input." (interactive) ! (let ((pmark (process-mark (get-buffer-process (current-buffer))))) (kill-region comint-last-input-end pmark) - (goto-char pmark) (insert "*** output flushed ***\n") (set-marker pmark (point)))) (defun comint-show-output () "Display start of this batch of interpreter output at top of window. ! Also put cursor there." (interactive) ! (goto-char comint-last-input-end) ! (backward-char) ! (beginning-of-line) ! (set-window-start (selected-window) (point)) ! (end-of-line)) (defun comint-interrupt-subjob () --- 1372,1402 ---- your process from hanging on long inputs. See `comint-send-string'." (comint-send-string proc (buffer-substring start end))) ;;; Random input hackage (defun comint-kill-output () ! "Kill all output from interpreter since last input. ! Does not delete the prompt." (interactive) ! (let ((pmark (progn (goto-char ! (process-mark (get-buffer-process (current-buffer)))) ! (beginning-of-line nil) ! (point-marker)))) (kill-region comint-last-input-end pmark) (insert "*** output flushed ***\n") + (comint-skip-prompt) (set-marker pmark (point)))) (defun comint-show-output () "Display start of this batch of interpreter output at top of window. ! Also put cursor there if the current position is not visible." (interactive) ! (let ((pos (point))) ! (goto-char comint-last-input-end) ! (beginning-of-line 0) ! (set-window-start (selected-window) (point)) ! (if (pos-visible-in-window-p pos) ! (goto-char pos) ! (comint-skip-prompt)))) (defun comint-interrupt-subjob () *************** *** 891,905 **** "Kill all text from last stuff output by interpreter to point." (interactive) ! (let* ((pmark (process-mark (get-buffer-process (current-buffer)))) ! (p-pos (marker-position pmark))) ! (if (> (point) p-pos) (kill-region pmark (point))))) (defun comint-delchar-or-maybe-eof (arg) ! "Delete ARG characters forward, or send an EOF to process if at end of buffer." (interactive "p") (if (eobp) (process-send-eof) ! (delete-char arg))) (defun comint-send-eof () --- 1433,1446 ---- "Kill all text from last stuff output by interpreter to point." (interactive) ! (let ((pmark (process-mark (get-buffer-process (current-buffer))))) ! (if (> (point) (marker-position pmark)) (kill-region pmark (point))))) (defun comint-delchar-or-maybe-eof (arg) ! "Delete ARG characters forward, or (if at eob) send an EOF to subprocess." (interactive "p") (if (eobp) (process-send-eof) ! (delete-char arg))) (defun comint-send-eof () *************** *** 908,929 **** (process-send-eof)) (defun comint-next-prompt (n) ! "\ ! Move to end of next prompt in the buffer (with prefix arg, Nth next). See `comint-prompt-regexp'." (interactive "p") ! (re-search-forward comint-prompt-regexp nil nil n)) ! (defun comint-prev-prompt (n) ! "\ ! Move to end of previous prompt in the buffer (with prefix arg, Nth previous). See `comint-prompt-regexp'." (interactive "p") ! (if (= (save-excursion (re-search-backward comint-prompt-regexp nil t) ! (match-end 0)) ! (point)) ! (setq n (1+ n))) ! (re-search-backward comint-prompt-regexp nil nil n) ! (goto-char (match-end 0))) ;;; Support for source-file processing commands. --- 1449,1492 ---- (process-send-eof)) + + (defun comint-backward-matching-input (regexp arg) + "Search backward through buffer for match for REGEXP. + Matches are searched for on lines that match `comint-prompt-regexp'. + With prefix argument N, search for Nth previous match. + If N is negative, find the next or Nth next match." + (interactive (comint-regexp-arg "Backward input matching (regexp): ")) + (let* ((re (concat comint-prompt-regexp ".*" regexp)) + (pos (save-excursion (end-of-line (if (> arg 0) 0 1)) + (if (re-search-backward re nil t arg) + (point))))) + (if (null pos) + (progn (message "Not found") + (ding)) + (goto-char pos) + (comint-bol nil)))) + + (defun comint-forward-matching-input (regexp arg) + "Search forward through buffer for match for REGEXP. + Matches are searched for on lines that match `comint-prompt-regexp'. + With prefix argument N, search for Nth following match. + If N is negative, find the previous or Nth previous match." + (interactive (comint-regexp-arg "Forward input matching (regexp): ")) + (comint-backward-matching-input regexp (- arg))) + + (defun comint-next-prompt (n) ! "Move to end of Nth next prompt in the buffer. See `comint-prompt-regexp'." (interactive "p") ! (let ((paragraph-start comint-prompt-regexp)) ! (end-of-line (if (> n 0) 1 0)) ! (forward-paragraph n) ! (comint-skip-prompt))) ! (defun comint-previous-prompt (n) ! "Move to end of Nth previous prompt in the buffer. See `comint-prompt-regexp'." (interactive "p") ! (comint-next-prompt (- n))) ;;; Support for source-file processing commands. *************** *** 1010,1015 **** (if (and buff (buffer-modified-p buff) ! (y-or-n-p (format "Save buffer %s first? " ! (buffer-name buff)))) ;; save BUFF. (let ((old-buffer (current-buffer))) --- 1573,1577 ---- (if (and buff (buffer-modified-p buff) ! (y-or-n-p (format "Save buffer %s first? " (buffer-name buff)))) ;; save BUFF. (let ((old-buffer (current-buffer))) *************** *** 1113,1233 **** (if (not (pos-visible-in-window-p proc-pt proc-win)) (let ((opoint (window-point proc-win))) ! (set-window-point proc-win proc-mark) (sit-for 0) (if (not (pos-visible-in-window-p opoint proc-win)) (push-mark opoint) ! (set-window-point proc-win opoint))))))) ! ;;; Filename completion in a buffer ;;; =========================================================================== ;;; Useful completion functions, courtesy of the Ergo group. ! ;;; Three commands: ! ;;; comint-dynamic-complete Complete filename at point. ! ;;; comint-dynamic-list-completions List completions in help buffer. ;;; comint-replace-by-expanded-filename Expand and complete filename at point; ;;; replace with expanded/completed name. ;;; These are not installed in the comint-mode keymap. But they are ;;; available for people who want them. Shell-mode installs them: ;;; (define-key shell-mode-map "\t" 'comint-dynamic-complete) ! ;;; (define-key shell-mode-map "\M-?" 'comint-dynamic-list-completions))) ;;; ;;; Commands like this are fine things to put in load hooks if you ;;; want them present in specific modes. ! (defun comint-match-partial-pathname () ! "Return the filename at point, or signal an error." (save-excursion ! (if (re-search-backward "[^~/A-Za-z0-9_.$#,=-]" nil 'move) (forward-char 1)) ;; Anchor the search forwards. ! (if (not (looking-at "[~/A-Za-z0-9_.$#,=-]")) (error "")) ! (re-search-forward "[~/A-Za-z0-9_.$#,=-]+") (substitute-in-file-name (buffer-substring (match-beginning 0) (match-end 0))))) ! (defun comint-replace-by-expanded-filename () ! "Expand the filename at point. ! Replace the filename with an expanded, canonicalised, and completed ! replacement. ! \"Expanded\" means environment variables (e.g., $HOME) and ~'s are ! replaced with the corresponding directories. \"Canonicalised\" means .. ! and \. are removed, and the filename is made absolute instead of relative. ! See functions `expand-file-name' and `substitute-in-file-name'. See also ! `comint-dynamic-complete'." ! (interactive) ! (let* ((pathname (comint-match-partial-pathname)) ! (pathdir (file-name-directory pathname)) ! (pathnondir (file-name-nondirectory pathname)) ! (completion (file-name-completion pathnondir ! (or pathdir default-directory)))) ! (cond ((null completion) ! (message "No completions of %s" pathname) ! (ding)) ! ((eql completion t) ! (message "Sole completion")) ! (t ; this means a string was returned. ! (delete-region (match-beginning 0) (match-end 0)) ! (insert (expand-file-name (concat pathdir completion))))))) (defun comint-dynamic-complete () "Dynamically complete the filename at point. ! This function is similar to `comint-replace-by-expanded-filename', except ! that it won't change parts of the filename already entered in the buffer; ! it just adds completion characters to the end of the filename." (interactive) ! (if (and (interactive-p) ! (eq last-command this-command)) ! ;; If you hit TAB twice in a row, you get a completion list. ! (comint-dynamic-list-completions) ! (let* ((pathname (comint-match-partial-pathname)) ! (pathdir (file-name-directory pathname)) ! (pathnondir (file-name-nondirectory pathname)) ! (completion (file-name-completion ! pathnondir ! ;; It is important to expand PATHDIR because ! ;; default-directory might be a handled name, and the ! ;; unexpanded PATHDIR won't necessarily match the ! ;; handler regexp. ! (if pathdir ! (expand-file-name pathdir) ! default-directory)))) ! (cond ((null completion) ! (message "No completions of %s" pathname) ! (ding)) ! ((eql completion t) ! (message "Sole completion")) ! (t ; this means a string was returned. ! (goto-char (match-end 0)) ! (insert (substring completion (length pathnondir)))))))) ! (defun comint-dynamic-list-completions () ! "List in help buffer all possible completions of the filename at point." (interactive) ! (let* ((pathname (comint-match-partial-pathname)) ! (pathdir (file-name-directory pathname)) ! (pathnondir (file-name-nondirectory pathname)) ! (completions ! (file-name-all-completions pathnondir ! (if pathdir ! (expand-file-name pathdir) ! default-directory)))) (cond ((null completions) ! (message "No completions of %s" pathname) ! (ding)) ! (t ! (let ((conf (current-window-configuration))) ! (with-output-to-temp-buffer "*Help*" ! (display-completion-list completions)) ! (sit-for 0) ! (message "Hit space to flush") ! (let ((ch (read-event))) ! (if (eq ch ?\ ) ! (set-window-configuration conf) ! (setq unread-command-events (list ch))))))))) ;;; Converting process modes to use comint mode --- 1675,1991 ---- (if (not (pos-visible-in-window-p proc-pt proc-win)) (let ((opoint (window-point proc-win))) ! (set-window-point proc-win proc-mark) ! (sit-for 0) (if (not (pos-visible-in-window-p opoint proc-win)) (push-mark opoint) ! (set-window-point proc-win opoint))))))) ! ;;; Filename/command/history completion in a buffer ;;; =========================================================================== ;;; Useful completion functions, courtesy of the Ergo group. ! ;;; Six functions: ! ;;; comint-dynamic-complete Complete or expand command, filename, ! ;;; history at point. ! ;;; comint-dynamic-complete-filename Complete filename at point. ! ;;; comint-dynamic-complete-variable Complete variable at point. ! ;;; comint-dynamic-list-filename-completions List completions in help buffer. ;;; comint-replace-by-expanded-filename Expand and complete filename at point; ;;; replace with expanded/completed name. + ;;; comint-dynamic-simple-complete Complete stub given candidates. + ;;; Four hooks (defined above): + ;;; comint-dynamic-complete-filename-command Complete file name at point. + ;;; comint-dynamic-complete-command-command Complete command at point. + ;;; comint-get-current-command Return command at point. + ;;; comint-after-partial-filename-command Return non-nil if after file. + ;;; These are not installed in the comint-mode keymap. But they are ;;; available for people who want them. Shell-mode installs them: ;;; (define-key shell-mode-map "\t" 'comint-dynamic-complete) ! ;;; (define-key shell-mode-map "\M-?" ! ;;; 'comint-dynamic-list-filename-completions))) ;;; ;;; Commands like this are fine things to put in load hooks if you ;;; want them present in specific modes. + (defvar comint-completion-autolist nil + "*If non-nil, automatically list possiblities on partial completion. + This mirrors the optional behavior of tcsh.") + + (defvar comint-completion-addsuffix t + "*If non-nil, add a `/' to completed directories, ` ' to file names. + This mirrors the optional behavior of tcsh.") + + (defvar comint-completion-recexact nil + "*If non-nil, use shortest completion if characters cannot be added. + This mirrors the optional behavior of tcsh. + + A non-nil value is useful if `comint-completion-autolist' is non-nil too.") ! (defvar comint-file-name-prefix "" ! "Prefix prepended to absolute file names taken from process input. ! This is used by comint's and shell's completion functions, and by shell's ! directory tracking functions.") ! ! ! (defun comint-directory (directory) ! ;; Return expanded DIRECTORY, with `comint-file-name-prefix' if absolute. ! (expand-file-name (if (file-name-absolute-p directory) ! (concat comint-file-name-prefix directory) ! directory))) ! ! ! (defun comint-match-partial-filename () ! "Return the filename at point, or signal an error. ! Environment variables are substituted." (save-excursion ! (if (re-search-backward "[^~/A-Za-z0-9_.$#,={}()-]" nil 'move) (forward-char 1)) ;; Anchor the search forwards. ! (if (not (looking-at "[~/A-Za-z0-9_.$#,={}()-]")) (error "")) ! (re-search-forward "[~/A-Za-z0-9_.$#,={}()-]+") (substitute-in-file-name (buffer-substring (match-beginning 0) (match-end 0))))) ! (defun comint-match-partial-variable () ! "Return the variable at point, or signal an error." ! (save-excursion ! (if (re-search-backward "[^A-Za-z0-9_${}]" nil 'move) ! (forward-char 1)) ! ;; Anchor the search forwards. ! (if (not (looking-at "\\$")) (error "")) ! (re-search-forward "\\${?[A-Za-z0-9_]+}?") ! (buffer-substring (match-beginning 0) (match-end 0)))) + (defun comint-after-partial-filename () + "Returns t if point is after a file name. + File names are assumed to contain `/'s or not be the first item in the input. + + See also `comint-bol'." + (let ((filename (comint-match-partial-filename))) + (or (save-match-data (string-match "/" filename)) + (not (eq (match-beginning 0) + (save-excursion (comint-bol nil) (point))))))) + + (defun comint-dynamic-complete () + "Dynamically complete/expand the command/filename/history at point. + If the text contains (a non-absolute line reference) `!' or `^' and + `comint-input-autoexpand' is non-nil, then an attempt is made to complete the + history. The value of the variable `comint-after-partial-filename-command' is + used to match file names. Otherwise, an attempt is made to complete the + command. + + See also the variables `comint-after-partial-filename-command', + `comint-dynamic-complete-filename-command', and + `comint-dynamic-complete-command-command', and functions + `comint-replace-by-expanded-history' and `comint-magic-space'." + (interactive) + (let ((previous-modified-tick (buffer-modified-tick))) + (if (and comint-input-autoexpand + (string-match "[!^]" (funcall comint-get-current-command))) + ;; Looks like there might be history references in the command. + (comint-replace-by-expanded-history)) + (if (= previous-modified-tick (buffer-modified-tick)) + ;; No references were expanded, so maybe they were none after all. + (cond ((funcall comint-after-partial-filename-command) + ;; It's a file name. + (funcall comint-dynamic-complete-filename-command)) + (t + ;; Assume it's a command. + (funcall comint-dynamic-complete-command-command)))))) + + + (defun comint-dynamic-complete-filename () "Dynamically complete the filename at point. ! This function is similar to `comint-replace-by-expanded-filename', except that ! it won't change parts of the filename already entered in the buffer; it just ! adds completion characters to the end of the filename. A completions listing ! may be shown in a help buffer if completion is ambiguous. ! ! Completion is dependent on the value of `comint-completion-addsuffix' and ! `comint-completion-recexact', and the timing of completions listing is ! dependent on the value of `comint-completion-autolist'." ! (interactive) ! (let* ((completion-ignore-case nil) ! (filename (comint-match-partial-filename)) ! (pathdir (file-name-directory filename)) ! (pathnondir (file-name-nondirectory filename)) ! (directory (if pathdir (comint-directory pathdir) default-directory)) ! (completion (file-name-completion pathnondir directory))) ! (cond ((null completion) ! (message "No completions of %s" filename) ! (ding)) ! ((eq completion t) ; Means already completed "file". ! (if comint-completion-addsuffix (insert " ")) ! (message "Sole completion")) ! ((string-equal completion "") ; Means completion on "directory/". ! (comint-dynamic-list-filename-completions)) ! (t ; Completion string returned. ! (let ((file (concat (file-name-as-directory directory) completion))) ! (goto-char (match-end 0)) ! (insert (substring (directory-file-name completion) ! (length pathnondir))) ! (cond ((symbolp (file-name-completion completion directory)) ! ;; We inserted a unique completion. ! (if comint-completion-addsuffix ! (insert (if (file-directory-p file) "/" " "))) ! (message "Completed")) ! ((and comint-completion-recexact comint-completion-addsuffix ! (string-equal pathnondir completion) ! (file-exists-p file)) ! ;; It's not unique, but user wants shortest match. ! (insert (if (file-directory-p file) "/" " ")) ! (message "Completed shortest")) ! ((or comint-completion-autolist ! (string-equal pathnondir completion)) ! ;; It's not unique, list possible completions. ! (comint-dynamic-list-filename-completions)) ! (t ! (message "Partially completed")))))))) ! ! ! (defun comint-replace-by-expanded-filename () ! "Dynamically expand and complete the filename at point. ! Replace the filename with an expanded, canonicalised and completed replacement. ! \"Expanded\" means environment variables (e.g., $HOME) and `~'s are replaced ! with the corresponding directories. \"Canonicalised\" means `..' and `.' are ! removed, and the filename is made absolute instead of relative. For expansion ! see `expand-file-name' and `substitute-in-file-name'. For completion see ! `comint-dynamic-complete-filename'." (interactive) ! (replace-match (expand-file-name (comint-match-partial-filename)) t t) ! (comint-dynamic-complete-filename)) ! ! ! (defun comint-dynamic-complete-variable () ! "Dynamically complete the environment variable at point. ! This function is similar to `comint-dynamic-complete-filename', except that it ! searches `process-environment' for completion candidates. Note that this may ! not be the same as the interpreter's idea of variable names. The main ! problem with this type of completion is that `process-environment' is the ! environment which Emacs started with. Emacs does not track changes to the ! environment made by the interpreter. Perhaps it would be more accurate if this ! function was called `comint-dynamic-complete-process-environment-variable'. ! See also `comint-dynamic-complete-filename'." (interactive) ! (let* ((completion-ignore-case nil) ! (variable (comint-match-partial-variable)) ! (varname (substring variable (string-match "[^$({]" variable))) ! (protection (cond ((string-match "{" variable) "}") ! ((string-match "(" variable) ")") ! (t ""))) ! (variables (mapcar (function (lambda (x) ! (list (substring x 0 (string-match "=" x))))) ! process-environment)) ! (var-directory-p ! (function (lambda (var) ! (file-directory-p ! (comint-directory (substitute-in-file-name (concat "$" var))))))) ! (completions (all-completions varname variables))) ! ;; Complete variable as if its value were a filename (which it might be). (cond ((null completions) ! (message "No completions of %s" varname) ! (ding)) ! ((= 1 (length completions)) ; Gotcha! ! (let ((completion (car completions))) ! (if (string-equal completion varname) ! (message "Sole completion") ! (insert (substring (directory-file-name completion) ! (length varname))) ! (message "Completed")) ! (insert protection) ! (if comint-completion-addsuffix ! (insert (if (funcall var-directory-p completion) "/" " "))))) ! (t ; There's no unique completion. ! (let ((completion (try-completion varname variables))) ! ;; Insert the longest substring. ! (insert (substring (directory-file-name completion) ! (length varname))) ! (cond ((and comint-completion-recexact comint-completion-addsuffix ! (string-equal varname completion) ! (member completion completions)) ! ;; It's not unique, but user wants shortest match. ! (insert protection ! (if (funcall var-directory-p completion) "/" " ")) ! (message "Completed shortest")) ! ((or comint-completion-autolist ! (string-equal varname completion)) ! ;; It's not unique, list possible completions. ! (comint-dynamic-list-completions completions)) ! (t ! (message "Partially completed")))))))) ! ! ! (defun comint-dynamic-simple-complete (stub candidates) ! "Dynamically complete STUB from CANDIDATES list. ! This function inserts completion characters at point by completing STUB from ! the strings in CANDIDATES. A completions listing may be shown in a help buffer ! if completion is ambiguous. ! ! See also `comint-dynamic-complete-filename'." ! (let* ((completion-ignore-case nil) ! (candidates (mapcar (function (lambda (x) (list x))) candidates)) ! (completions (all-completions stub candidates))) ! (cond ((null completions) ! (message "No completions of %s" stub) ! (ding)) ! ((= 1 (length completions)) ; Gotcha! ! (let ((completion (car completions))) ! (if (string-equal completion stub) ! (message "Sole completion") ! (insert (substring completion (length stub))) ! (message "Completed")) ! (if comint-completion-addsuffix (insert " ")))) ! (t ; There's no unique completion. ! (let ((completion (try-completion stub candidates))) ! ;; Insert the longest substring. ! (insert (substring completion (length stub))) ! (cond ((and comint-completion-recexact comint-completion-addsuffix ! (string-equal stub completion) ! (member completion completions)) ! ;; It's not unique, but user wants shortest match. ! (insert " ") ! (message "Completed shortest")) ! ((or comint-completion-autolist ! (string-equal stub completion)) ! ;; It's not unique, list possible completions. ! (comint-dynamic-list-completions completions)) ! (t ! (message "Partially completed")))))))) ! ! ! (defun comint-dynamic-list-filename-completions () ! "List in help buffer possible completions of the filename at point." ! (interactive) ! (let* ((completion-ignore-case nil) ! (filename (comint-match-partial-filename)) ! (pathdir (file-name-directory filename)) ! (pathnondir (file-name-nondirectory filename)) ! (directory (if pathdir (comint-directory pathdir) default-directory)) ! (completions (file-name-all-completions pathnondir directory))) ! (if completions ! (comint-dynamic-list-completions completions) ! (message "No completions of %s" filename) ! (ding)))) ! ! ! (defun comint-dynamic-list-completions (completions) ! "List in help buffer sorted COMPLETIONS. ! Typing SPC flushes the help buffer." ! (let ((conf (current-window-configuration))) ! (with-output-to-temp-buffer " *Completions*" ! (display-completion-list (sort completions 'string-lessp))) ! (sit-for 0) ! (message "Hit space to flush") ! (let ((ch (read-event))) ! (if (eq ch ?\ ) ! (set-window-configuration conf) ! (setq unread-command-events (list ch)))))) ;;; Converting process modes to use comint mode *************** *** 1284,1287 **** --- 2042,2054 ---- ;;; is typical: ;;; + ;;; (defvar shell-mode-map '()) + ;;; (cond ((not shell-mode-map) + ;;; (setq shell-mode-map (full-copy-sparse-keymap comint-mode-map)) + ;;; (define-key shell-mode-map "\C-c\C-f" 'shell-forward-command) + ;;; (define-key shell-mode-map "\C-c\C-b" 'shell-backward-command) + ;;; (define-key shell-mode-map "\t" 'comint-dynamic-complete) + ;;; (define-key shell-mode-map "\M-?" + ;;; 'comint-dynamic-list-filename-completions))) + ;;; ;;; (defun shell-mode () ;;; (interactive) *************** *** 1290,1298 **** ;;; (setq major-mode 'shell-mode) ;;; (setq mode-name "Shell") - ;;; (cond ((not shell-mode-map) - ;;; (setq shell-mode-map (full-copy-sparse-keymap comint-mode-map)) - ;;; (define-key shell-mode-map "\M-\t" 'comint-dynamic-complete) - ;;; (define-key shell-mode-map "\M-?" - ;;; 'comint-dynamic-list-completions))) ;;; (use-local-map shell-mode-map) ;;; (make-local-variable 'shell-directory-stack) --- 2057,2060 ---- *************** *** 1308,1438 **** ;;; of NIL, it barfs. Adjust your code accordingly... ;;; ;;; Do the user's customisation... - - (defvar comint-load-hook nil - "This hook is run when comint is loaded in. - This is a good place to put keybindings.") - - (run-hooks 'comint-load-hook) - - ;;; Change log: - ;;; 9/12/89 - ;;; - Souped up the filename expansion procedures. - ;;; Doc strings are much clearer and more detailed. - ;;; Fixed a bug where doing a filename completion when the point - ;;; was in the middle of the filename instead of at the end would lose. - ;;; - ;;; 2/17/90 - ;;; - Souped up the command history stuff so that text inserted - ;;; by comint-previous-input-matching is removed by following - ;;; command history recalls. comint-next/previous-input-matching - ;;; is now much more smoothly integrated w/the command history stuff. - ;;; - Added comint-eol-on-send flag and comint-input-sender hook. - ;;; Comint-input-sender based on code contributed by Jeff Peck - ;;; (peck@sun.com). - ;;; - ;;; 3/13/90 ccm@cmu.cs.edu - ;;; - Added comint-previous-similar-input for looking up similar inputs. - ;;; - Added comint-send-and-get-output to allow snarfing input from - ;;; buffer. - ;;; - Added the ability to pick up a source file by positioning over - ;;; a string in comint-get-source. - ;;; - Added add-hook to make it a little easier for the user to use - ;;; multiple hooks. - ;;; - ;;; 5/22/90 shivers - ;;; - Moved Chris' multiplexed ipc stuff to comint-ipc.el. - ;;; - Altered Chris' comint-get-source string feature. The string - ;;; is only offered as a default if it names an existing file. - ;;; - Changed comint-exec to directly crank up the process, instead - ;;; of calling the env program. This made background.el happy. - ;;; - Added new buffer-local var comint-ptyp. The problem is that - ;;; the signalling functions don't work as advertised. If you are - ;;; communicating via pipes, the CURRENT-GROUP arg is supposed to - ;;; be ignored, but, unfortunately it seems to be the case that you - ;;; must pass a NIL for this arg in the pipe case. COMINT-PTYP - ;;; is a flag that tells whether the process is communicating - ;;; via pipes or a pty. The comint signalling functions use it - ;;; to determine the necessary CURRENT-GROUP arg value. The bug - ;;; has been reported to the Gnu folks. - ;;; - comint-dynamic-complete flushes the help window if you hit space - ;;; after you execute it. - ;;; - Added functions comint-send-string, comint-send-region and var - ;;; comint-input-chunk-size. comint-send-string tries to prevent processes - ;;; from hanging when you send them long strings by breaking them into - ;;; chunks and allowing process output between chunks. I got the idea from - ;;; Eero Simoncelli's Common Lisp package. Note that using - ;;; comint-send-string means that the process buffer's contents can change - ;;; during a call! If you depend on process output only happening between - ;;; toplevel commands, this could be a problem. In such a case, use - ;;; process-send-string instead. If this is a problem for people, I'd like - ;;; to hear about it. - ;;; - Added comint-proc-query as a simple mechanism for commands that - ;;; want to query an inferior process and display its response. For a - ;;; typical use, see lisp-show-arglist in cmulisp.el. - ;;; - Added constant comint-version, which is now "2.01". - ;;; - ;;; 6/14/90 shivers - ;;; - Had comint-update-env defined twice. Removed extra copy. Also - ;;; renamed mem to be comint-mem, for modularity. The duplication - ;;; was reported by Michael Meissner. - ;;; 6/16/90 shivers - ;;; - Emacs has two different mechanisms for maintaining the process - ;;; environment, determined at compile time by the MAINTAIN-ENVIRONMENT - ;;; #define. One uses the process-environment global variable, and - ;;; one uses a getenv/setenv interface. comint-exec assumed the - ;;; process-environment interface; it has been generalised (with - ;;; comint-exec-1) to handle both cases. Pretty bogus. We could, - ;;; of course, skip all this and just use the etc/env program to - ;;; handle the environment tweaking, but that obscures process - ;;; queries that other modules (like background.el) depend on. etc/env - ;;; is also fairly bogus. This bug, and some of the fix code was - ;;; reported by Dan Pierson. - ;;; - ;;; 9/5/90 shivers - ;;; - Changed make-variable-buffer-local's to make-local-variable's. - ;;; This leaves non-comint-mode buffers alone. Stephane Payrard - ;;; reported the sloppy usage. - ;;; - You can now go from comint-previous-similar-input to - ;;; comint-previous-input with no problem. - ;;; - ;;; 12/21/90 shivers - ;;; - Added a condition-case to comint-get-source. Bogus strings - ;;; beginning with ~ were making the file-exists-p barf. - ;;; - Added "=" to the set of chars recognised by file completion - ;;; as constituting a filename. - ;;; - ;;; 1/90 shivers - ;;; These changes comprise release 2.02: - ;;; - Removed the kill-all-local-variables in comint-mode. This - ;;; made it impossible for client modes to set things before calling - ;;; comint-mode. (In particular, it messed up ilisp.el) In general, - ;;; the client mode should be responsible for a k-a-l-v's. - ;;; - Fixed comint-match-partial-pathname so that it works in - ;;; more cases: if the filename begins at the start-of-buffer; - ;;; if point is on the first char of the filename. Just a question - ;;; of getting the tricky bits right. - ;;; - Added a hook, comint-exec-hook that is run each time a process - ;;; is cranked up. Useful for things like process-kill-without-query. - ;;; - ;;; These two were pointed out by tale: - ;;; - Improved the doc string in comint-send-input a little bit. - ;;; - Tweaked make-comint to check process status with comint-check-proc - ;;; instead of equivalent inline code. - ;;; - ;;; - Prompt-search history commands have been commented out. I never - ;;; liked them; I don't think anyone used them. - ;;; - Made comint-exec-hook a local var, as it should have been. - ;;; (This way, for instance, you can have shell procs kill-w/o-query, - ;;; but let Scheme procs be default.) ;;; ! ;;; 7/91 Shivers ! ;;; - Souped up comint-read-noecho with an optional argument, STARS. ! ;;; Suggested by mjlx@EAGLE.CNSF.CORNELL.EDU. ! ;;; - Moved comint-previous-input-matching from C-c r to C-M-r. ! ;;; C-c bindings are reserved for the user. ! ;;; These bindings were done by Jim Blandy. ! ;;; These changes comprise version 2.03. (provide 'comint) --- 2070,2092 ---- ;;; of NIL, it barfs. Adjust your code accordingly... ;;; + ;;; Completion for comint-mode users + ;;; + ;;; For modes that use comint-mode, comint-after-partial-filename-command + ;;; should be set to a function that returns t if the stub before point is to + ;;; be treated as a filename. By default, if the stub contains a `/', or does + ;;; not follow the prompt, comint-dynamic-complete-filename-command is called. + ;;; Otherwise, comint-dynamic-complete-command-command is called. This should + ;;; also be set to a function that completes whatever the mode calls commands. + ;;; You could use comint-dynamic-simple-complete to do the bulk of the + ;;; completion job. ;;; Do the user's customisation... ;;; ! ;;; Isn't this what eval-after-load is for? ! ;;;(defvar comint-load-hook nil ! ;;; "This hook is run when comint is loaded in. ! ;;;This is a good place to put keybindings.") ! ;;; ! ;;;(run-hooks 'comint-load-hook) (provide 'comint) diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/compare-w.el emacs-19.20/lisp/compare-w.el *** emacs-19.19/lisp/compare-w.el Sun Aug 15 01:19:49 1993 --- emacs-19.20/lisp/compare-w.el Sun Nov 7 17:19:08 1993 *************** *** 135,151 **** ;; Don't try starting points before START, though. ;; Value is non-nil if whitespace is found. (defun compare-windows-skip-whitespace (start) (let ((end (point)) (opoint (point))) ! (while (and (looking-at compare-windows-whitespace) ! (<= end (match-end 0)) ! ;; This match goes past END, so advance END. ! (progn (setq end (match-end 0)) ! (> (point) start))) ;; keep going back until whitespace ;; doesn't extend to or past end (forward-char -1)) (goto-char end) ! (/= end opoint))) (provide 'compare-w) --- 135,161 ---- ;; Don't try starting points before START, though. ;; Value is non-nil if whitespace is found. + + ;; If there is whitespace before point, but none after, + ;; then return t, but don't advance point. (defun compare-windows-skip-whitespace (start) (let ((end (point)) + (beg (point)) (opoint (point))) ! (while (or (and (/= (point) start) ! ;; Consider at least the char before point, ! ;; unless it is also before START. ! (= (point) opoint)) ! (and (looking-at compare-windows-whitespace) ! (<= end (match-end 0)) ! ;; This match goes past END, so advance END. ! (progn (setq end (match-end 0)) ! (> (point) start)))) ;; keep going back until whitespace ;; doesn't extend to or past end (forward-char -1)) + (setq beg (point)) (goto-char end) ! (or (/= beg opoint) ! (/= end opoint)))) (provide 'compare-w) diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/compile.el emacs-19.20/lisp/compile.el *** emacs-19.19/lisp/compile.el Fri Aug 13 23:44:37 1993 --- emacs-19.20/lisp/compile.el Wed Sep 22 03:13:13 1993 *************** *** 314,318 **** (compilation-mode) (buffer-disable-undo (current-buffer)) ! (setq buffer-read-only t) (set (make-local-variable 'compilation-parse-errors-function) parser) (set (make-local-variable 'compilation-error-message) error-message) --- 314,318 ---- (compilation-mode) (buffer-disable-undo (current-buffer)) ! ;; (setq buffer-read-only t) ;;; Non-ergonomic. (set (make-local-variable 'compilation-parse-errors-function) parser) (set (make-local-variable 'compilation-error-message) error-message) *************** *** 615,619 **** (> compilation-parsing-end limit-search)) (or (not find-at-least) ! (> (length compilation-error-list) find-at-least))) ;; Since compilation-error-list is non-nil, it points to a specific ;; error the user wanted. So don't move it around. --- 615,619 ---- (> compilation-parsing-end limit-search)) (or (not find-at-least) ! (>= (length compilation-error-list) find-at-least))) ;; Since compilation-error-list is non-nil, it points to a specific ;; error the user wanted. So don't move it around. diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/cookie1.el emacs-19.20/lisp/cookie1.el *** emacs-19.19/lisp/cookie1.el Sun Aug 15 01:19:53 1993 --- emacs-19.20/lisp/cookie1.el Fri Sep 17 14:50:52 1993 *************** *** 92,98 **** ;;;###autoload (defun cookie-snarf (phrase-file startmsg endmsg) ! "Reads in the PHRASE-FILE, returns it as a vector of strings. Emit ! STARTMSG and ENDMSG before and after. Caches the result; second and ! subsequent calls on the same file won't go to disk." (let ((sym (intern-soft phrase-file cookie-cache))) (and sym (not (equal (symbol-function sym) --- 92,98 ---- ;;;###autoload (defun cookie-snarf (phrase-file startmsg endmsg) ! "Reads in the PHRASE-FILE, returns it as a vector of strings. ! Emit STARTMSG and ENDMSG before and after. Caches the result; second ! and subsequent calls on the same file won't go to disk." (let ((sym (intern-soft phrase-file cookie-cache))) (and sym (not (equal (symbol-function sym) *************** *** 120,123 **** --- 120,143 ---- (message endmsg) (set sym (apply 'vector result))))))) + + (defun read-cookie (prompt phrase-file startmsg endmsg &optional require-match) + "Prompt with PROMPT and read with completion among cookies in PHRASE-FILE. + STARTMSG and ENDMSG are passed along to `cookie-snarf'. + Optional fifth arg REQUIRE-MATCH non-nil forces a matching cookie." + ;; Make sure the cookies are in the cache. + (or (intern-soft phrase-file cookie-cache) + (cookie-snarf phrase-file startmsg endmsg)) + (completing-read prompt + (let ((sym (intern phrase-file cookie-cache))) + ;; We cache the alist form of the cookie in a property. + (or (get sym 'completion-alist) + (let* ((alist nil) + (vec (cookie-snarf phrase-file + startmsg endmsg)) + (i (length vec))) + (while (> (setq i (1- i)) 0) + (setq alist (cons (list (aref vec i)) alist))) + (put sym 'completion-alist alist)))) + nil require-match nil nil)) ; Thanks to Ian G Batten diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/desktop.el emacs-19.20/lisp/desktop.el *** emacs-19.19/lisp/desktop.el Sun Aug 15 01:20:07 1993 --- emacs-19.20/lisp/desktop.el Thu Oct 7 12:49:40 1993 *************** *** 4,8 **** ;; Author: Morten Welinder ! ;; Version: 2.01 ;; This file is part of GNU Emacs. --- 4,8 ---- ;; Author: Morten Welinder ! ;; Version: 2.02 ;; This file is part of GNU Emacs. *************** *** 24,85 **** ;;; Commentary: ! ; Save the Desktop, i.e., ! ; - some global variables ! ; - the list of buffers with associated files. For each buffer also ! ; - the major mode ! ; - the default directory ! ; - the point ! ; - the mark ! ; - buffer-read-only ! ; - truncate-lines ! ; - case-fold-search ! ; - case-replace ! ; - fill-column ! ! ; To use this, first put these three lines in the bottom of your .emacs ! ; file (the later the better): ! ; ! ; (load "desktop") ! ; (desktop-load-default) ! ; (desktop-read) ! ; ! ! ; Start Emacs in the root directory of your "project". The desktop saver ! ; is inactive by default. You activate it by M-X desktop-save RET. When ! ; you exit the next time the above data will be saved. This ensures that ! ; all the files you were editing will be reloaded the next time you start ! ; Emacs from the same directory and that points will be set where you ! ; left them. ! ; ! ; PLEASE NOTE: When the kill ring is saved as specified by the variable ! ; `desktop-globals-to-save' (by default it isn't). This may result in saving ! ; things you did not mean to keep. Use M-X desktop-clear RET. ! ; ! ; Thanks to hetrick@phys.uva.nl (Jim Hetrick) for useful ideas. ! ; --------------------------------------------------------------------------- ! ; HISTORY: ! ; ! ; Dec , 1992: Version 1.0 written; never released. ! ; Jan , 1993: Minor modes now saved: auto-fill-mode, overwrite-mode. ! ; Apr 26, 1993: Version 1.1 released. ! ; Apr 29, 1993: Now supports RMAIL, Info, and dired modes. ! ; Will now search home directory for desktop file. ! ; desktop-save asks for directory to save in. ! ; May 31, 1993: Version 1.3 ! ; Now works with Emacs 19. ! ; Jun 1, 1993: Minor bug fix. ! ; ! ; TODO: ! ; ! ; Save window configuration. ! ; Recognize more minor modes. ! ; Save mark rings. ! ; Start-up with buffer-menu??? ;;; Code: ! ; USER OPTIONS -- settings you might want to play with. ! ; ----------------------------------------------------------------------------- ! (defconst desktop-basefilename (if (equal system-type 'ms-dos) "emacs.dsk" ; Ms-Dos does not support multiple dots in file name --- 24,75 ---- ;;; Commentary: ! ;; Save the Desktop, i.e., ! ;; - some global variables ! ;; - the list of buffers with associated files. For each buffer also ! ;; - the major mode ! ;; - the default directory ! ;; - the point ! ;; - the mark & mark-active ! ;; - buffer-read-only ! ;; - truncate-lines ! ;; - case-fold-search ! ;; - case-replace ! ;; - fill-column ! ! ;; To use this, first put these three lines in the bottom of your .emacs ! ;; file (the later the better): ! ;; ! ;; (load "desktop") ! ;; (desktop-load-default) ! ;; (desktop-read) ! ;; ! ! ;; Start Emacs in the root directory of your "project". The desktop saver ! ;; is inactive by default. You activate it by M-x desktop-save RET. When ! ;; you exit the next time the above data will be saved. This ensures that ! ;; all the files you were editing will be reloaded the next time you start ! ;; Emacs from the same directory and that points will be set where you ! ;; left them. ! ;; ! ;; PLEASE NOTE: The kill ring can be saved as specified by the variable ! ;; `desktop-globals-to-save' (by default it isn't). This may result in saving ! ;; things you did not mean to keep. Use M-x desktop-clear RET. ! ;; ! ;; Thanks to hetrick@phys.uva.nl (Jim Hetrick) for useful ideas. ! ;; avk@rtsg.mot.com (Andrew V. Klein) for a dired tip. ! ;; chris@tecc.co.uk (Chris Boucher) for a mark tip. ! ;; --------------------------------------------------------------------------- ! ;; TODO: ! ;; ! ;; Save window configuration. ! ;; Recognize more minor modes. ! ;; Save mark rings. ! ;; Start-up with buffer-menu??? ;;; Code: ! ;; USER OPTIONS -- settings you might want to play with. ! ;; ---------------------------------------------------------------------------- ! (defconst desktop-basefilename (if (equal system-type 'ms-dos) "emacs.dsk" ; Ms-Dos does not support multiple dots in file name *************** *** 87,128 **** "File for Emacs desktop. A directory name will be prepended to this name.") ! (defvar desktop-missing-file-warning t "*If non-nil then issue warning if a file no longer exists. Otherwise simply ignore the file.") ! (defvar desktop-globals-to-save (list 'desktop-missing-file-warning ! ; 'kill-ring ; Feature: Also saves kill-ring-yank-pointer ! 'desktop-globals-to-save) ; Itself! "List of global variables to save when killing Emacs.") (defvar desktop-buffers-not-to-save ! "\\(\\.log\\|(ftp)\\)$" "Regexp identifying buffers that are to be excluded from saving.") (defvar desktop-buffer-handlers ! '(desktop-buffer-dired desktop-buffer-rmail desktop-buffer-info desktop-buffer-file) ! "*List of functions to call in order to create a buffer. ! The functions are called without parameters ! but may access the the major mode as `mam', ! the file name as `fn', the buffer name as `bn', the default directory as ! `dd'. If some function returns non-nil no further functions are called. If the function returns t then the buffer is considered created.") ! ; --------------------------------------------------------------------------- ! (defvar desktop-dirname nil "The directory in which the current desktop file resides.") (defconst desktop-header ! "; --------------------------------------------------------------------------- ! ; Desktop File for Emacs ! ; --------------------------------------------------------------------------- " "*Header to place in Desktop file.") ! ; --------------------------------------------------------------------------- ! (defconst postv18 (string-lessp "19" emacs-version) ! "t is Emacs version 19 or later.") (defun desktop-clear () "Empty the Desktop." --- 77,124 ---- "File for Emacs desktop. A directory name will be prepended to this name.") ! (defvar desktop-missing-file-warning t "*If non-nil then issue warning if a file no longer exists. Otherwise simply ignore the file.") ! (defvar desktop-globals-to-save (list 'desktop-missing-file-warning ! ;; Feature: saving kill-ring implies saving kill-ring-yank-pointer ! ;; 'kill-ring ! 'tags-file-name ! 'tags-table-list ! ;; 'desktop-globals-to-save ; Itself! ! ) "List of global variables to save when killing Emacs.") + ;; We skip .log files because they are normally temporary. + ;; (ftp) files because they require passwords and whatsnot. + ;; TAGS files to save time (tags-file-name is saved instead). (defvar desktop-buffers-not-to-save ! "\\(\\.log\\|(ftp)\\|^tags\\|^TAGS\\)$" "Regexp identifying buffers that are to be excluded from saving.") (defvar desktop-buffer-handlers ! '(desktop-buffer-dired desktop-buffer-rmail desktop-buffer-info desktop-buffer-file) ! "*List of functions to call in order to create a buffer. The functions are ! called without explicit parameters but may access the the major mode as `mam', ! the file name as `fn', the buffer name as `bn', the default directory as ! `dd'. If some function returns non-nil no further functions are called. If the function returns t then the buffer is considered created.") ! ;; ---------------------------------------------------------------------------- ! (defvar desktop-dirname nil "The directory in which the current desktop file resides.") (defconst desktop-header ! ";; -------------------------------------------------------------------------- ! ;; Desktop File for Emacs ! ;; -------------------------------------------------------------------------- " "*Header to place in Desktop file.") ! ;; ---------------------------------------------------------------------------- ! (defconst postv18 (string-lessp "19" emacs-version) ! "t if Emacs version 19 or later.") (defun desktop-clear () "Empty the Desktop." *************** *** 131,160 **** (setq kill-ring-yank-pointer nil) (mapcar (function kill-buffer) (buffer-list))) ! ; --------------------------------------------------------------------------- (if (not (boundp 'desktop-kill)) (if postv18 (add-hook 'kill-emacs-hook 'desktop-kill) (setq old-kill-emacs kill-emacs-hook) ! (setq kill-emacs-hook ! (function (lambda () (progn (desktop-kill) ! (run-hooks old-kill-emacs))))))) ! ; --------------------------------------------------------------------------- (defun desktop-kill () ! (if desktop-dirname (progn (desktop-save desktop-dirname)))) ! ! ;(defun kill-emacs (&optional query) ! ; "End this Emacs session. ! ;Prefix ARG or optional first ARG non-nil means exit with no questions asked, ! ;even if there are unsaved buffers. If Emacs is running non-interactively ! ;and ARG is an integer, then Emacs exits with ARG as its exit code. ! ; ! ;If the variable `desktop-dirname' is non-nil, ! ;the function desktop-save will be called first." ! ; (interactive "P") ! ; (if desktop-dirname (desktop-save desktop-dirname)) ! ; (original-kill-emacs query)) ! ; --------------------------------------------------------------------------- (defun desktop-outvar (VAR) "Output a setq statement for VAR to the desktop file." --- 127,150 ---- (setq kill-ring-yank-pointer nil) (mapcar (function kill-buffer) (buffer-list))) ! ;; ---------------------------------------------------------------------------- ! ;; This is a bit dirty for version 18 because that version of Emacs was not ! ;; toilet-trained considering hooks. (if (not (boundp 'desktop-kill)) (if postv18 (add-hook 'kill-emacs-hook 'desktop-kill) (setq old-kill-emacs kill-emacs-hook) ! (setq kill-emacs-hook ! (function (lambda () ! (progn (desktop-kill) ! (if (or (null old-kill-emacs) ! (symbolp old-kill-emacs)) ! (run-hooks old-kill-emacs) ! (funcall old-kill-emacs)))))))) ! ;; ---------------------------------------------------------------------------- (defun desktop-kill () ! (if desktop-dirname (progn (desktop-save desktop-dirname)))) ! ;; ---------------------------------------------------------------------------- (defun desktop-outvar (VAR) "Output a setq statement for VAR to the desktop file." *************** *** 166,197 **** (prin1 (symbol-value VAR) (current-buffer)) (insert ")\n")))) ! ; --------------------------------------------------------------------------- (defun desktop-save-buffer-p (filename bufname mode) "Return t if should record a particular buffer for next startup. ! FILENAME is the visited file name, BUFNAME is the buffer name, and MODE is the major mode." ! (or (and filename (not (string-match desktop-buffers-not-to-save bufname))) (and (null filename) (memq mode '(Info-mode dired-mode rmail-mode))))) ! ; --------------------------------------------------------------------------- (defun desktop-save (dirname) "Save the Desktop file. Parameter DIRNAME specifies where to save desktop." (interactive "DDirectory to save desktop file in: ") (save-excursion ! (let ((filename (expand-file-name (concat dirname desktop-basefilename))) ! (info (nreverse ! (mapcar (function (lambda (b) (set-buffer b) ! (list (buffer-file-name) (buffer-name) (list 'quote major-mode) (list 'quote ! (list overwrite-mode ! (not (null (if postv18 auto-fill-function --- 156,187 ---- (prin1 (symbol-value VAR) (current-buffer)) (insert ")\n")))) ! ;; ---------------------------------------------------------------------------- (defun desktop-save-buffer-p (filename bufname mode) "Return t if should record a particular buffer for next startup. ! FILENAME is the visited file name, BUFNAME is the buffer name, and MODE is the major mode." ! (or (and filename (not (string-match desktop-buffers-not-to-save bufname))) (and (null filename) (memq mode '(Info-mode dired-mode rmail-mode))))) ! ;; ---------------------------------------------------------------------------- (defun desktop-save (dirname) "Save the Desktop file. Parameter DIRNAME specifies where to save desktop." (interactive "DDirectory to save desktop file in: ") (save-excursion ! (let ((filename (expand-file-name (concat dirname desktop-basefilename))) ! (info (nreverse ! (mapcar (function (lambda (b) (set-buffer b) ! (list (buffer-file-name) (buffer-name) (list 'quote major-mode) (list 'quote ! (list overwrite-mode ! (not (null (if postv18 auto-fill-function *************** *** 199,203 **** (point) (if postv18 ! (mark t) (mark)) buffer-read-only --- 189,193 ---- (point) (if postv18 ! (list 'quote (mark t) mark-active) (mark)) buffer-read-only *************** *** 206,210 **** case-fold-search case-replace ! (list 'quote (cond ((equal major-mode 'Info-mode) --- 196,200 ---- case-fold-search case-replace ! (list 'quote (cond ((equal major-mode 'Info-mode) *************** *** 212,216 **** Info-current-node)) ((equal major-mode 'dired-mode) ! (list default-directory)) )) ))) --- 202,211 ---- Info-current-node)) ((equal major-mode 'dired-mode) ! (if postv18 ! (nreverse ! (mapcar ! (function car) ! dired-subdir-alist)) ! (list default-directory))) )) ))) *************** *** 220,244 **** (erase-buffer) ! (insert desktop-header ! "; Created " (current-time-string) "\n" ! "; Emacs version " emacs-version "\n\n" ! "; Global section:\n") (mapcar (function desktop-outvar) desktop-globals-to-save) (if (memq 'kill-ring desktop-globals-to-save) ! (insert "(setq kill-ring-yank-pointer (nthcdr " ! (int-to-string (- (length kill-ring) (length kill-ring-yank-pointer))) " kill-ring))\n")) ! (insert "\n; Buffer section:\n") ! (mapcar (function (lambda (l) ! (if (desktop-save-buffer-p ! (car l) (nth 1 l) (nth 1 (nth 2 l))) (progn (insert "(desktop-buffer") ! (mapcar (function (lambda (e) (insert "\n ") --- 215,239 ---- (erase-buffer) ! (insert desktop-header ! ";; Created " (current-time-string) "\n" ! ";; Emacs version " emacs-version "\n\n" ! ";; Global section:\n") (mapcar (function desktop-outvar) desktop-globals-to-save) (if (memq 'kill-ring desktop-globals-to-save) ! (insert "(setq kill-ring-yank-pointer (nthcdr " ! (int-to-string (- (length kill-ring) (length kill-ring-yank-pointer))) " kill-ring))\n")) ! (insert "\n;; Buffer section:\n") ! (mapcar (function (lambda (l) ! (if (desktop-save-buffer-p ! (car l) (nth 1 l) (nth 1 (nth 2 l))) (progn (insert "(desktop-buffer") ! (mapcar (function (lambda (e) (insert "\n ") *************** *** 251,255 **** (write-region (point-min) (point-max) filename nil 'nomessage))) (setq desktop-dirname dirname)) ! ; --------------------------------------------------------------------------- (defun desktop-remove () "Delete the Desktop file and inactivate the desktop system." --- 246,250 ---- (write-region (point-min) (point-max) filename nil 'nomessage))) (setq desktop-dirname dirname)) ! ;; ---------------------------------------------------------------------------- (defun desktop-remove () "Delete the Desktop file and inactivate the desktop system." *************** *** 259,263 **** (if (file-exists-p filename) (delete-file filename)) (setq desktop-dirname nil)))) ! ; --------------------------------------------------------------------------- (defun desktop-read () "Read the Desktop file and the files it specifies." --- 254,258 ---- (if (file-exists-p filename) (delete-file filename)) (setq desktop-dirname nil)))) ! ;; ---------------------------------------------------------------------------- (defun desktop-read () "Read the Desktop file and the files it specifies." *************** *** 274,288 **** (message "Desktop loaded.")) (desktop-clear)))) ! ; --------------------------------------------------------------------------- (defun desktop-load-default () ! "Load the `default' start-up library manually. ! Also inhibit further loading of it. ! Call this from your `.emacs' file ! provide correct modes for autoloaded files." ! (if (not inhibit-default-init) (progn (load "default" t t) (setq inhibit-default-init t)))) ! ; --------------------------------------------------------------------------- (defun desktop-buffer-info () "Load an info file." (if (equal 'Info-mode mam) --- 269,285 ---- (message "Desktop loaded.")) (desktop-clear)))) ! ;; ---------------------------------------------------------------------------- (defun desktop-load-default () ! "Load the `default' start-up library manually. Also inhibit further loading ! of it. Call this from your `.emacs' file to provide correct modes for ! autoloaded files." ! (if (not inhibit-default-init) ; safety check (progn (load "default" t t) (setq inhibit-default-init t)))) ! ;; ---------------------------------------------------------------------------- ! ;; Note: the following functions use the dynamic variable binding in Lisp. ! ;; The byte compiler may therefore complain of undeclared variables. ! ;; (defun desktop-buffer-info () "Load an info file." (if (equal 'Info-mode mam) *************** *** 291,314 **** (Info-find-node (nth 0 misc) (nth 1 misc)) t))) ! ; --------------------------------------------------------------------------- (defun desktop-buffer-rmail () "Load a RMAIL file." (if (equal 'rmail-mode mam) (progn (rmail-input fn) t))) ! ; --------------------------------------------------------------------------- (defun desktop-buffer-dired () "Load a directory using dired." (if (equal 'dired-mode mam) ! (progn (dired (nth 0 misc)) t))) ! ; --------------------------------------------------------------------------- (defun desktop-buffer-file () "Load a file." (if fn (if (or (file-exists-p fn) (and desktop-missing-file-warning ! (y-or-n-p (format ! "File \"%s\" no longer exists. Re-create? " fn)))) (progn (find-file fn) t) 'ignored))) ! ; --------------------------------------------------------------------------- ! ;;Create a buffer, load its file, set is mode, ...; called from Desktop file ;; only. (defun desktop-buffer (fn bn mam mim pt mk ro tl fc cfs cr misc) --- 288,314 ---- (Info-find-node (nth 0 misc) (nth 1 misc)) t))) ! ;; ---------------------------------------------------------------------------- (defun desktop-buffer-rmail () "Load a RMAIL file." (if (equal 'rmail-mode mam) (progn (rmail-input fn) t))) ! ;; ---------------------------------------------------------------------------- (defun desktop-buffer-dired () "Load a directory using dired." (if (equal 'dired-mode mam) ! (progn ! (dired (car misc)) ! (mapcar (function dired-maybe-insert-subdir) (cdr misc)) ! t))) ! ;; ---------------------------------------------------------------------------- (defun desktop-buffer-file () "Load a file." (if fn (if (or (file-exists-p fn) (and desktop-missing-file-warning ! (y-or-n-p (format ! "File \"%s\" no longer exists. Re-create? " fn)))) (progn (find-file fn) t) 'ignored))) ! ;; ---------------------------------------------------------------------------- ! ;; Create a buffer, load its file, set is mode, ...; called from Desktop file ;; only. (defun desktop-buffer (fn bn mam mim pt mk ro tl fc cfs cr misc) *************** *** 331,336 **** (overwrite-mode 0)) (goto-char pt) ! (set-mark mk) ! (setq buffer-read-only ro) (setq truncate-lines tl) (setq fill-column fc) --- 331,341 ---- (overwrite-mode 0)) (goto-char pt) ! (if (consp mk) ! (progn ! (set-mark (car mk)) ! (setq mark-active (car (cdr mk)))) ! (set-mark mk)) ! ;; Never override file system if the file really is read-only marked. ! (if ro (setq buffer-read-only ro)) (setq truncate-lines tl) (setq fill-column fc) *************** *** 338,344 **** (setq case-replace cr) )))) ! ; --------------------------------------------------------------------------- ! (provide 'desktop) ;; desktop.el ends here. --- 343,349 ---- (setq case-replace cr) )))) ! ;; ---------------------------------------------------------------------------- (provide 'desktop) ;; desktop.el ends here. + diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/diary.el emacs-19.20/lisp/diary.el *** emacs-19.19/lisp/diary.el Sun Aug 15 01:20:14 1993 --- emacs-19.20/lisp/diary.el Wed Oct 20 01:45:59 1993 *************** *** 105,110 **** t) ! (defvar diary-syntax-table ! (standard-syntax-table) "The syntax table used when parsing dates in the diary file. It is the standard syntax table used in Fundamental mode, but with the --- 105,109 ---- t) ! (defvar diary-syntax-table (copy-syntax-table (standard-syntax-table)) "The syntax table used when parsing dates in the diary file. It is the standard syntax table used in Fundamental mode, but with the *************** *** 1169,1178 **** of the parameters should be changed to DAY, MONTH, YEAR.) - %%(diary-sunrise-sunset) - Diary entries giving the local times of Sabbath candle - lighting will be made every day. Note that since there is - no text, it makes sense only if the fancy diary display is - used. Floating point required. - %%(diary-rosh-hodesh) Diary entries will be made on the dates of Rosh Hodesh on --- 1168,1171 ---- *************** *** 1541,1545 **** (append diary-entries-list (list (list date string)))))) ! (defconst hebrew-calendar-parashiot-names ["Bereshith" "Noah" "Lech L'cha" "Vayera" "Hayei Sarah" "Toledoth" "Vayetze" "Vayishlah" "Vayeshev" "Mikketz" "Vayiggash" "Vayhi" --- 1534,1538 ---- (append diary-entries-list (list (list date string)))))) ! (defvar hebrew-calendar-parashiot-names ["Bereshith" "Noah" "Lech L'cha" "Vayera" "Hayei Sarah" "Toledoth" "Vayetze" "Vayishlah" "Vayeshev" "Mikketz" "Vayiggash" "Vayhi" diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/diff.el emacs-19.20/lisp/diff.el *** emacs-19.19/lisp/diff.el Sun Aug 15 01:20:15 1993 --- emacs-19.20/lisp/diff.el Sat Sep 18 21:57:35 1993 *************** *** 160,164 **** (defun diff (old new &optional switches) "Find and display the differences between OLD and NEW files. ! Interactively the current buffer's file name is the default for for NEW and a backup file for NEW is the default for OLD. With prefix arg, prompt for diff switches." --- 160,164 ---- (defun diff (old new &optional switches) "Find and display the differences between OLD and NEW files. ! Interactively the current buffer's file name is the default for NEW and a backup file for NEW is the default for OLD. With prefix arg, prompt for diff switches." diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/dired.el emacs-19.20/lisp/dired.el *** emacs-19.19/lisp/dired.el Sun Aug 15 01:20:17 1993 --- emacs-19.20/lisp/dired.el Mon Oct 25 02:13:14 1993 *************** *** 929,933 **** (setq major-mode 'dired-mode mode-name "Dired" ! case-fold-search nil buffer-read-only t selective-display t ; for subdirectory hiding --- 929,933 ---- (setq major-mode 'dired-mode mode-name "Dired" ! ;; case-fold-search nil buffer-read-only t selective-display t ; for subdirectory hiding *************** *** 1326,1341 **** (dired-clear-alist) (save-excursion ! (let ((count 0)) (goto-char (point-min)) (setq dired-subdir-alist nil) (while (re-search-forward dired-subdir-regexp nil t) (setq count (1+ count)) ! (dired-alist-add-1 (buffer-substring (match-beginning 1) ! (match-end 1)) ! ;; Put subdir boundary between lines: ! (save-excursion ! (goto-char (match-beginning 0)) ! (beginning-of-line) ! (point-marker)))) (if (> count 1) (message "Buffer includes %d directories" count)) --- 1326,1348 ---- (dired-clear-alist) (save-excursion ! (let ((count 0) ! (buffer-read-only nil) ! new-dir-name) (goto-char (point-min)) (setq dired-subdir-alist nil) (while (re-search-forward dired-subdir-regexp nil t) + (save-excursion + (goto-char (match-beginning 1)) + (setq new-dir-name + (expand-file-name (buffer-substring (point) (match-end 1)))) + (delete-region (point) (match-end 1)) + (insert new-dir-name)) (setq count (1+ count)) ! (dired-alist-add-1 new-dir-name ! ;; Place a sub directory boundary between lines. ! (save-excursion ! (goto-char (match-beginning 0)) ! (beginning-of-line) ! (point-marker)))) (if (> count 1) (message "Buffer includes %d directories" count)) *************** *** 2289,2295 **** (load "dired-vms")) - (run-hooks 'dired-load-hook) ; for your customizations - (provide 'dired) ;;; dired.el ends here --- 2296,2302 ---- (load "dired-vms")) (provide 'dired) + + (run-hooks 'dired-load-hook) ; for your customizations ;;; dired.el ends here diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/disass.el emacs-19.20/lisp/disass.el *** emacs-19.19/lisp/disass.el Sun Aug 15 01:20:18 1993 --- emacs-19.20/lisp/disass.el Thu Sep 23 16:37:14 1993 *************** *** 87,90 **** --- 87,92 ---- (setq macro t obj (cdr obj))) + (if (and (listp obj) (eq (car obj) 'byte-code)) + (setq obj (list 'lambda nil obj))) (if (and (listp obj) (not (eq (car obj) 'lambda))) (error "not a function")) diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/disp-table.el emacs-19.20/lisp/disp-table.el *** emacs-19.19/lisp/disp-table.el Sun Aug 15 01:20:19 1993 --- emacs-19.20/lisp/disp-table.el Mon Nov 8 10:06:45 1993 *************** *** 39,58 **** (prin1 (aref dt 260)) (princ "\nCharacter display glyph sequences:\n") ! (let ((vector (make-vector 256 nil)) ! (i 0)) ! (while (< i 256) ! (aset vector i (aref dt i)) ! (setq i (1+ i))) ! (describe-vector vector)) (print-help-return-message))) ;;;###autoload (defun describe-current-display-table () ! "Describe the display table in use in the selected window and buffer." ! (interactive) ! (describe-display-table ! (or (window-display-table (selected-window)) ! buffer-display-table ! standard-display-table))) ;;;###autoload --- 39,63 ---- (prin1 (aref dt 260)) (princ "\nCharacter display glyph sequences:\n") ! (save-excursion ! (set-buffer standard-output) ! (let ((vector (make-vector 256 nil)) ! (i 0)) ! (while (< i 256) ! (aset vector i (aref dt i)) ! (setq i (1+ i))) ! (describe-vector vector))) (print-help-return-message))) ;;;###autoload (defun describe-current-display-table () ! "Describe the display table in use in the selected window and buffer." ! (interactive) ! (let ((disptab ! (or (window-display-table (selected-window)) ! buffer-display-table ! standard-display-table))) ! (if disptab ! (describe-display-table disptab) ! (message "No display table")))) ;;;###autoload diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/dunnet.el emacs-19.20/lisp/dunnet.el *** emacs-19.19/lisp/dunnet.el Sun Aug 15 01:20:26 1993 --- emacs-19.20/lisp/dunnet.el Tue Sep 7 13:01:59 1993 *************** *** 3136,3140 **** (dun-save-val "dun-room-silents") (dun-save-val "dun-inventory") ! (dun-save-val "dun-endgame-question") (dun-save-val "dun-endgame") (dun-save-val "dun-cdroom") --- 3136,3140 ---- (dun-save-val "dun-room-silents") (dun-save-val "dun-inventory") ! (dun-save-val "dun-endgame-questions") (dun-save-val "dun-endgame") (dun-save-val "dun-cdroom") diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/edebug.el emacs-19.20/lisp/edebug.el *** emacs-19.19/lisp/edebug.el Sun Aug 15 01:20:33 1993 --- emacs-19.20/lisp/edebug.el Sat Sep 18 21:57:51 1993 *************** *** 1166,1169 **** --- 1166,1173 ---- (setq edebug-mode edebug-initial-mode)) (let* ((edebug-entered t) + (pre-command-hook (if (memq edebug-func pre-command-hook) + nil pre-command-hook)) + (post-command-hook (if (memq edebug-func post-command-hook) + nil post-command-hook)) (edebug-data (get edebug-func 'edebug)) ;; pull out parts of the edebug-data diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/edmacro.el emacs-19.20/lisp/edmacro.el *** emacs-19.19/lisp/edmacro.el Sun Aug 15 01:20:34 1993 --- emacs-19.20/lisp/edmacro.el Mon Sep 20 23:43:44 1993 *************** *** 1,9 **** ;;; edmacro.el --- keyboard macro editor ! ;; Copyright (C) 1990 Free Software Foundation, Inc. ! ;; Author: Dave Gillespie ! ;; Maintainer: FSF ! ;; Version: 1.02 ;; Keywords: abbrev --- 1,9 ---- ;;; edmacro.el --- keyboard macro editor ! ;; Copyright (C) 1993 Free Software Foundation, Inc. ! ;; Author: Dave Gillespie ! ;; Maintainer: Dave Gillespie ! ;; Version: 2.01 ;; Keywords: abbrev *************** *** 26,653 **** ;;; Commentary: ! ;; To use, type `M-x edit-last-kbd-macro' to edit the most recently ! ;; defined keyboard macro. If you have used `M-x name-last-kbd-macro' ! ;; to give a keyboard macro a name, type `M-x edit-kbd-macro' to edit ! ;; the macro by name. When you are done editing, type `C-c C-c' to ! ;; record your changes back into the original keyboard macro. ;;; Code: ;;; The user-level commands for editing macros. ;;;###autoload ! (defun edit-last-kbd-macro (&optional prefix buffer hook) "Edit the most recently defined keyboard macro." (interactive "P") ! (edmacro-edit-macro last-kbd-macro ! (function (lambda (x arg) (setq last-kbd-macro x))) ! prefix buffer hook)) ;;;###autoload ! (defun edit-kbd-macro (cmd &optional prefix buffer hook in-hook out-hook) ! "Edit a keyboard macro which has been given a name by `name-last-kbd-macro'. ! \(See also `edit-last-kbd-macro'.)" ! (interactive "CCommand name: \nP") ! (and cmd ! (edmacro-edit-macro (if in-hook ! (funcall in-hook cmd) ! (symbol-function cmd)) ! (or out-hook ! (list 'lambda '(x arg) ! (list 'fset ! (list 'quote cmd) ! 'x))) ! prefix buffer hook cmd))) ;;;###autoload ! (defun read-kbd-macro (start end) "Read the region as a keyboard macro definition. The region is interpreted as spelled-out keystrokes, e.g., \"M-x abc RET\". The resulting macro is installed as the \"current\" keyboard macro. ! Symbols: RET, SPC, TAB, DEL, LFD, NUL; C-key; M-key. (Must be uppercase.) ! REM marks the rest of a line as a comment. ! Whitespace is ignored; other characters are copied into the macro." (interactive "r") ! (setq last-kbd-macro (edmacro-parse-keys (buffer-substring start end))) ! (if (and (string-match "\\`\C-x(" last-kbd-macro) ! (string-match "\C-x)\\'" last-kbd-macro)) ! (setq last-kbd-macro (substring last-kbd-macro 2 -2)))) ! ! ;;; Formatting a keyboard macro as human-readable text. ! (defun edmacro-print-macro (macro-str local-map) ! (let ((save-map (current-local-map)) ! (print-escape-newlines t) ! key-symbol key-str key-last prefix-arg this-prefix) ! (unwind-protect ! (progn ! (use-local-map local-map) ! (while (edmacro-peek-char) ! (edmacro-read-key) ! (setq this-prefix prefix-arg) ! (or (memq key-symbol '(digit-argument ! negative-argument ! universal-argument)) ! (null prefix-arg) ! (progn ! (cond ((consp prefix-arg) ! (insert (format "prefix-arg (%d)\n" ! (car prefix-arg)))) ! ((eq prefix-arg '-) ! (insert "prefix-arg -\n")) ! ((numberp prefix-arg) ! (insert (format "prefix-arg %d\n" prefix-arg)))) ! (setq prefix-arg nil))) ! (cond ((null key-symbol) ! (insert "type \"") ! (edmacro-insert-string macro-str) ! (insert "\"\n") ! (setq macro-str "")) ! ((eq key-symbol 'digit-argument) ! (edmacro-prefix-arg key-last nil prefix-arg)) ! ((eq key-symbol 'negative-argument) ! (edmacro-prefix-arg ?- nil prefix-arg)) ! ((eq key-symbol 'universal-argument) ! (let* ((c-u 4) (argstartchar key-last) ! (char (edmacro-read-char))) ! (while (= char argstartchar) ! (setq c-u (* 4 c-u) ! char (edmacro-read-char))) ! (edmacro-prefix-arg char c-u nil))) ! ((eq key-symbol 'self-insert-command) ! (insert "insert ") ! (if (and (>= key-last 32) (<= key-last 126)) ! (let ((str "")) ! (while (or (and (eq key-symbol ! 'self-insert-command) ! (< (length str) 60) ! (>= key-last 32) ! (<= key-last 126)) ! (and (memq key-symbol ! '(backward-delete-char ! delete-backward-char ! backward-delete-char-untabify)) ! (> (length str) 0))) ! (if (eq key-symbol 'self-insert-command) ! (setq str (concat str ! (char-to-string key-last))) ! (setq str (substring str 0 -1))) ! (edmacro-read-key)) ! (insert "\"" str "\"\n") ! (edmacro-unread-chars key-str)) ! (insert "\"") ! (edmacro-insert-string (char-to-string key-last)) ! (insert "\"\n"))) ! ((and (eq key-symbol 'quoted-insert) ! (edmacro-peek-char)) ! (insert "quoted-insert\n") ! (let ((ch (edmacro-read-char)) ! ch2) ! (if (and (>= ch ?0) (<= ch ?7)) ! (progn ! (setq ch (- ch ?0) ! ch2 (edmacro-read-char)) ! (if ch2 ! (if (and (>= ch2 ?0) (<= ch2 ?7)) ! (progn ! (setq ch (+ (* ch 8) (- ch2 ?0)) ! ch2 (edmacro-read-char)) ! (if ch2 ! (if (and (>= ch2 ?0) (<= ch2 ?7)) ! (setq ch (+ (* ch 8) (- ch2 ?0))) ! (edmacro-unread-chars ch2)))) ! (edmacro-unread-chars ch2))))) ! (if (or (and (>= ch ?0) (<= ch ?7)) ! (< ch 32) (> ch 126)) ! (insert (format "type \"\\%03o\"\n" ch)) ! (insert "type \"" (char-to-string ch) "\"\n")))) ! ((memq key-symbol '(isearch-forward ! isearch-backward ! isearch-forward-regexp ! isearch-backward-regexp)) ! (insert (symbol-name key-symbol) "\n") ! (edmacro-isearch-argument)) ! ((eq key-symbol 'execute-extended-command) ! (edmacro-read-argument obarray 'commandp)) ! (t ! (let ((cust (get key-symbol 'edmacro-print))) ! (if cust ! (funcall cust) ! (insert (symbol-name key-symbol)) ! (indent-to 30) ! (insert " # ") ! (edmacro-insert-string key-str) ! (insert "\n") ! (let ((int (edmacro-get-interactive key-symbol))) ! (if (string-match "\\`\\*" int) ! (setq int (substring int 1))) ! (while (> (length int) 0) ! (cond ((= (aref int 0) ?a) ! (edmacro-read-argument ! obarray nil)) ! ((memq (aref int 0) '(?b ?B ?D ?f ?F ?n ! ?s ?S ?x ?X)) ! (edmacro-read-argument)) ! ((and (= (aref int 0) ?c) ! (edmacro-peek-char)) ! (insert "type \"") ! (edmacro-insert-string ! (char-to-string ! (edmacro-read-char))) ! (insert "\"\n")) ! ((= (aref int 0) ?C) ! (edmacro-read-argument ! obarray 'commandp)) ! ((= (aref int 0) ?k) ! (edmacro-read-key) ! (if key-symbol ! (progn ! (insert "type \"") ! (edmacro-insert-string key-str) ! (insert "\"\n")) ! (edmacro-unread-chars key-str))) ! ((= (aref int 0) ?N) ! (or this-prefix ! (edmacro-read-argument))) ! ((= (aref int 0) ?v) ! (edmacro-read-argument ! obarray 'user-variable-p))) ! (let ((nl (string-match "\n" int))) ! (setq int (if nl ! (substring int (1+ nl)) ! ""))))))))))) ! (use-local-map save-map)))) ! ! (defun edmacro-prefix-arg (char c-u value) ! (let ((sign 1)) ! (if (and (numberp value) (< value 0)) ! (setq sign -1 value (- value))) ! (if (eq value '-) ! (setq sign -1 value nil)) ! (while (and char (= ?- char)) ! (setq sign (- sign) c-u nil) ! (setq char (edmacro-read-char))) ! (while (and char (>= char ?0) (<= char ?9)) ! (setq value (+ (* (if (numberp value) value 0) 10) (- char ?0)) c-u nil) ! (setq char (edmacro-read-char))) ! (setq prefix-arg ! (cond (c-u (list c-u)) ! ((numberp value) (* value sign)) ! ((= sign -1) '-))) ! (edmacro-unread-chars char))) ! ! (defun edmacro-insert-string (str) ! (let ((i 0) j ch) ! (while (< i (length str)) ! (if (and (> (setq ch (aref str i)) 127) ! (< ch 160)) ! (progn ! (setq ch (- ch 128)) ! (insert "\\M-"))) ! (if (< ch 32) ! (cond ((= ch 8) (insret "\\b")) ! ((= ch 9) (insert "\\t")) ! ((= ch 10) (insert "\\n")) ! ((= ch 13) (insert "\\r")) ! ((= ch 27) (insert "\\e")) ! (t (insert "\\C-" (char-to-string (downcase (+ ch 64)))))) ! (if (< ch 127) ! (if (or (= ch 34) (= ch 92)) ! (insert "\\" (char-to-string ch)) ! (setq j i) ! (while (and (< (setq i (1+ i)) (length str)) ! (>= (setq ch (aref str i)) 32) ! (/= ch 34) (/= ch 92) ! (< ch 127))) ! (insert (substring str j i)) ! (setq i (1- i))) ! (if (memq ch '(127 255)) ! (insert (format "\\%03o" ch)) ! (insert "\\M-" (char-to-string (- ch 128)))))) ! (setq i (1+ i))))) ! ! (defun edmacro-lookup-key (map) ! (let ((loc (and map (lookup-key map macro-str))) ! (glob (lookup-key (current-global-map) macro-str)) ! (loc-str macro-str) ! (glob-str macro-str)) ! (and (integerp loc) ! (setq loc-str (substring macro-str 0 loc) ! loc (lookup-key map loc-str))) ! (and (consp loc) ! (setq loc nil)) ! (or loc ! (setq loc-str "")) ! (and (integerp glob) ! (setq glob-str (substring macro-str 0 glob) ! glob (lookup-key (current-global-map) glob-str))) ! (and (consp glob) ! (setq glob nil)) ! (or glob ! (setq glob-str "")) ! (if (> (length glob-str) (length loc-str)) ! (setq key-symbol glob ! key-str glob-str) ! (setq key-symbol loc ! key-str loc-str)) ! (setq key-last (and (> (length key-str) 0) ! (logand (aref key-str (1- (length key-str))) 127))) ! key-symbol)) ! ! (defun edmacro-read-argument (&optional obarray pred) ;; currently ignored ! (let ((str "") ! (min-bsp 0) ! (exec (eq key-symbol 'execute-extended-command)) ! str-base) ! (while (progn ! (edmacro-lookup-key (current-global-map)) ! (or (and (eq key-symbol 'self-insert-command) ! (< (length str) 60)) ! (memq key-symbol ! '(backward-delete-char ! delete-backward-char ! backward-delete-char-untabify)) ! (eq key-last 9))) ! (setq macro-str (substring macro-str (length key-str))) ! (or (and (eq key-last 9) ! obarray ! (let ((comp (try-completion str obarray pred))) ! (and (stringp comp) ! (> (length comp) (length str)) ! (setq str comp)))) ! (if (or (eq key-symbol 'self-insert-command) ! (and (or (eq key-last 9) ! (<= (length str) min-bsp)) ! (setq min-bsp (+ (length str) (length key-str))))) ! (setq str (concat str key-str)) ! (setq str (substring str 0 -1))))) ! (setq str-base str ! str (concat str key-str) ! macro-str (substring macro-str (length key-str))) ! (if exec ! (let ((comp (try-completion str-base obarray pred))) ! (if (if (stringp comp) ! (and (commandp (intern comp)) ! (setq str-base comp)) ! (commandp (intern str-base))) ! (insert str-base "\n") ! (insert "execute-extended-command\n") ! (insert "type \"") ! (edmacro-insert-string str) ! (insert "\"\n"))) ! (if (> (length str) 0) ! (progn ! (insert "type \"") ! (edmacro-insert-string str) ! (insert "\"\n")))))) ! ! (defun edmacro-isearch-argument () ! (let ((str "") ! (min-bsp 0) ! ch) ! (while (and (setq ch (edmacro-read-char)) ! (or (<= ch 127) (not search-exit-option)) ! (not (eq ch search-exit-char)) ! (or (eq ch search-repeat-char) ! (eq ch search-reverse-char) ! (eq ch search-delete-char) ! (eq ch search-yank-word-char) ! (eq ch search-yank-line-char) ! (eq ch search-quote-char) ! (eq ch ?\r) ! (eq ch ?\t) ! (not search-exit-option) ! (and (/= ch 127) (>= ch 32)))) ! (if (and (eq ch search-quote-char) ! (edmacro-peek-char)) ! (setq str (concat str (char-to-string ch) ! (char-to-string (edmacro-read-char))) ! min-bsp (length str)) ! (if (or (and (< ch 127) (>= ch 32)) ! (eq ch search-yank-word-char) ! (eq ch search-yank-line-char) ! (and (or (not (eq ch search-delete-char)) ! (<= (length str) min-bsp)) ! (setq min-bsp (1+ (length str))))) ! (setq str (concat str (char-to-string ch))) ! (setq str (substring str 0 -1))))) ! (if (eq ch search-exit-char) ! (if (= (length str) 0) ;; non-incremental search ! (progn ! (setq str (concat str (char-to-string ch))) ! (and (eq (edmacro-peek-char) ?\C-w) ! (progn ! (setq str (concat str "\C-w")) ! (edmacro-read-char))) ! (if (> (length str) 0) ! (progn ! (insert "type \"") ! (edmacro-insert-string str) ! (insert "\"\n"))) ! (edmacro-read-argument) ! (setq str ""))) ! (edmacro-unread-chars ch)) ! (if (> (length str) 0) ! (progn ! (insert "type \"") ! (edmacro-insert-string str) ! (insert "\\e\"\n"))))) ! ! ;;; Get the next keystroke-sequence from the input stream. ! ;;; Sets key-symbol, key-str, and key-last as a side effect. ! (defun edmacro-read-key () ! (edmacro-lookup-key (current-local-map)) ! (and key-symbol ! (setq macro-str (substring macro-str (length key-str))))) ! ! (defun edmacro-peek-char () ! (and (> (length macro-str) 0) ! (aref macro-str 0))) ! ! (defun edmacro-read-char () ! (and (> (length macro-str) 0) ! (prog1 ! (aref macro-str 0) ! (setq macro-str (substring macro-str 1))))) ! ! (defun edmacro-unread-chars (chars) ! (and (integerp chars) ! (setq chars (char-to-string chars))) ! (and chars ! (setq macro-str (concat chars macro-str)))) ! ! (defun edmacro-dump (mac) ! (set-mark-command nil) ! (insert "\n\n") ! (edmacro-print-macro mac (current-local-map))) ! ! ;;; Parse a string of spelled-out keystrokes, as produced by key-description. ! ! (defun edmacro-parse-keys (str) ! (let ((pos 0) ! (mac "") ! part) ! (while (and (< pos (length str)) ! (string-match "[^ \t\n]+" str pos)) ! (setq pos (match-end 0) ! part (substring str (match-beginning 0) (match-end 0)) ! mac (concat mac ! (if (and (> (length part) 2) ! (= (aref part 1) ?-) ! (= (aref part 0) ?M)) ! (progn ! (setq part (substring part 2)) ! "\e") ! (if (and (> (length part) 4) ! (= (aref part 0) ?C) ! (= (aref part 1) ?-) ! (= (aref part 2) ?M) ! (= (aref part 3) ?-)) ! (progn ! (setq part (concat "C-" (substring part 4))) ! "\e") ! "")) ! (or (cdr (assoc part '( ( "NUL" . "\0" ) ! ( "RET" . "\r" ) ! ( "LFD" . "\n" ) ! ( "TAB" . "\t" ) ! ( "ESC" . "\e" ) ! ( "SPC" . " " ) ! ( "DEL" . "\177" ) ! ( "C-?" . "\177" ) ! ( "C-2" . "\0" ) ! ( "C-SPC" . "\0") ))) ! (and (equal part "REM") ! (setq pos (or (string-match "\n" str pos) ! (length str))) ! "") ! (and (= (length part) 3) ! (= (aref part 0) ?C) ! (= (aref part 1) ?-) ! (char-to-string (logand (aref part 2) 31))) ! part)))) ! mac)) ! ;;; Parse a keyboard macro description in edmacro-print-macro's format. - (defun edmacro-read-macro (&optional map) - (or map (setq map (current-local-map))) - (let ((macro-str "")) - (while (not (progn - (skip-chars-forward " \t\n") - (eobp))) - (cond ((looking-at "#")) ;; comment - ((looking-at "prefix-arg[ \t]*-[ \t]*\n") - (edmacro-append-chars "\C-u-")) - ((looking-at "prefix-arg[ \t]*\\(-?[0-9]+\\)[ \t]*\n") - (edmacro-append-chars (concat "\C-u" (edmacro-match-string 1)))) - ((looking-at "prefix-arg[ \t]*(\\([0-9]+\\))[ \t]*\n") - (let ((val (string-to-int (edmacro-match-string 1)))) - (while (> val 1) - (or (= (% val 4) 0) - (error "Bad prefix argument value")) - (edmacro-append-chars "\C-u") - (setq val (/ val 4))))) - ((looking-at "prefix-arg") - (error "Bad prefix argument syntax")) - ((looking-at "insert ") - (forward-char 7) - (edmacro-append-chars (read (current-buffer))) - (if (< (current-column) 7) - (forward-line -1))) - ((looking-at "type ") - (forward-char 5) - (edmacro-append-chars (read (current-buffer))) - (if (< (current-column) 5) - (forward-line -1))) - ((looking-at "keys \\(.*\\)\n") - (goto-char (1- (match-end 0))) - (edmacro-append-chars (edmacro-parse-keys - (buffer-substring (match-beginning 1) - (match-end 1))))) - ((looking-at "\\([-a-zA-z0-9_]+\\)[ \t]*\\(.*\\)\n") - (let* ((func (intern (edmacro-match-string 1))) - (arg (edmacro-match-string 2)) - (cust (get func 'edmacro-read))) - (if cust - (funcall cust arg) - (or (commandp func) - (error "Not an Emacs command")) - (or (equal arg "") - (string-match "\\`#" arg) - (error "Unexpected argument to command")) - (let ((keys - (or (where-is-internal func map t) - (where-is-internal func (current-global-map) t)))) - (if keys - (edmacro-append-chars keys) - (edmacro-append-chars (concat "\ex" - (symbol-name func) - "\n"))))))) - (t (error "Syntax error"))) - (forward-line 1)) - macro-str)) - - (defun edmacro-append-chars (chars) - (setq macro-str (concat macro-str chars))) - - (defun edmacro-match-string (n) - (if (match-beginning n) - (buffer-substring (match-beginning n) (match-end n)) - "")) - - (defun edmacro-get-interactive (func) - (if (symbolp func) - (let ((cust (get func 'edmacro-interactive))) - (if cust - cust - (edmacro-get-interactive (symbol-function func)))) - (or (and (eq (car-safe func) 'lambda) - (let ((int (if (consp (nth 2 func)) - (nth 2 func) - (nth 3 func)))) - (and (eq (car-safe int) 'interactive) - (stringp (nth 1 int)) - (nth 1 int)))) - ""))) - - (put 'search-forward 'edmacro-interactive "s") - (put 'search-backward 'edmacro-interactive "s") - (put 'word-search-forward 'edmacro-interactive "s") - (put 'word-search-backward 'edmacro-interactive "s") - (put 're-search-forward 'edmacro-interactive "s") - (put 're-search-backward 'edmacro-interactive "s") - (put 'switch-to-buffer 'edmacro-interactive "B") - (put 'kill-buffer 'edmacro-interactive "B") - (put 'rename-buffer 'edmacro-interactive "B\nB") - (put 'goto-char 'edmacro-interactive "N") - (put 'global-set-key 'edmacro-interactive "k\nC") - (put 'global-unset-key 'edmacro-interactive "k") - (put 'local-set-key 'edmacro-interactive "k\nC") - (put 'local-unset-key 'edmacro-interactive "k") - - ;;; Think about kbd-macro-query - - ;;; Edit a keyboard macro in another buffer. - ;;; (Prefix argument is currently ignored.) - - (defun edmacro-edit-macro (mac repl &optional prefix buffer hook arg) - (or (stringp mac) - (error "Not a keyboard macro")) - (let ((oldbuf (current-buffer)) - (local (current-local-map)) - (buf (get-buffer-create (or buffer "*Edit Macro*")))) - (set-buffer buf) - (kill-all-local-variables) - (use-local-map edmacro-mode-map) - (setq buffer-read-only nil - major-mode 'edmacro-mode - mode-name "Edit Macro") - (set (make-local-variable 'edmacro-original-buffer) oldbuf) - (set (make-local-variable 'edmacro-replace-function) repl) - (set (make-local-variable 'edmacro-replace-argument) arg) - (set (make-local-variable 'edmacro-finish-hook) hook) - (erase-buffer) - (insert "# Keyboard Macro Editor. Press C-c C-c to finish; press C-x k RET to cancel.\n") - (insert "# Original keys: " (key-description mac) "\n\n") - (message "Formatting keyboard macro...") - (edmacro-print-macro mac local) - (switch-to-buffer buf) - (goto-char (point-min)) - (forward-line 3) - (recenter '(4)) - (set-buffer-modified-p nil) - (message "Formatting keyboard macro...done") - (run-hooks 'edmacro-format-hook))) - (defun edmacro-finish-edit () (interactive) ! (or (and (boundp 'edmacro-original-buffer) ! (boundp 'edmacro-replace-function) ! (boundp 'edmacro-replace-argument) ! (boundp 'edmacro-finish-hook) ! (eq major-mode 'edmacro-mode)) ! (error "This command is valid only in buffers created by `edit-kbd-macro'.")) ! (let ((buf (current-buffer)) ! (str (buffer-string)) ! (func edmacro-replace-function) ! (arg edmacro-replace-argument) ! (hook edmacro-finish-hook)) ! (goto-char (point-min)) ! (run-hooks 'edmacro-compile-hook) ! (and (buffer-modified-p) ! func ! (progn ! (message "Compiling keyboard macro...") ! (let ((mac (edmacro-read-macro ! (and (buffer-name edmacro-original-buffer) ! (save-excursion ! (set-buffer edmacro-original-buffer) ! (current-local-map)))))) ! (and (buffer-name edmacro-original-buffer) ! (switch-to-buffer edmacro-original-buffer)) ! (funcall func mac arg)) ! (message "Compiling keyboard macro...done"))) ! (kill-buffer buf) ! (if hook ! (funcall hook arg)))) (defun edmacro-mode () ! "\\Keyboard Macro Editing mode. Press \\[edmacro-finish-edit] to save and exit. To abort the edit, just kill this buffer with \\[kill-buffer] RET. ! The keyboard macro is represented as a series of M-x style command names. ! Keystrokes which do not correspond to simple M-x commands are written as ! \"type\" commands. When you press \\[edmacro-finish-edit], edmacro converts each command ! back into a suitable keystroke sequence; \"type\" commands are converted ! directly back into keystrokes." (interactive) ! (error "This mode can be enabled only by `edit-kbd-macro' or `edit-last-kbd-macro'.")) (put 'edmacro-mode 'mode-class 'special) ! (if (boundp 'edmacro-mode-map) () ! (setq edmacro-mode-map (make-sparse-keymap)) ! (define-key edmacro-mode-map "\C-c\C-c" 'edmacro-finish-edit)) ;;; edmacro.el ends here --- 26,694 ---- ;;; Commentary: ! ;;; Usage: ! ;; ! ;; The `C-x C-k' (`edit-kbd-macro') command edits a keyboard macro ! ;; in a special buffer. It prompts you to type a key sequence, ! ;; which should be one of: ! ;; ! ;; * RET or `C-x e' (call-last-kbd-macro), to edit the most ! ;; recently defined keyboard macro. ! ;; ! ;; * `M-x' followed by a command name, to edit a named command ! ;; whose definition is a keyboard macro. ! ;; ! ;; * `C-h l' (view-lossage), to edit the 100 most recent keystrokes ! ;; and install them as the "current" macro. ! ;; ! ;; * any key sequence whose definition is a keyboard macro. ! ;; ! ;; This file includes a version of `insert-kbd-macro' that uses the ! ;; more readable format defined by these routines. ! ;; ! ;; Also, the `read-kbd-macro' command parses the region as ! ;; a keyboard macro, and installs it as the "current" macro. ! ;; This and `format-kbd-macro' can also be called directly as ! ;; Lisp functions. ! ! ;; Type `C-h m', or see the documentation for `edmacro-mode' below, ! ;; for information about the format of written keyboard macros. ! ! ;; `edit-kbd-macro' formats the macro with one command per line, ! ;; including the command names as comments on the right. If the ! ;; formatter gets confused about which keymap was used for the ! ;; characters, the command-name comments will be wrong but that ! ;; won't hurt anything. ! ! ;; With a prefix argument, `edit-kbd-macro' will format the ! ;; macro in a more concise way that omits the comments. ! ! ;; This package requires GNU Emacs 19 or later, and daveg's CL ! ;; package 2.02 or later. (CL 2.02 comes standard starting with ! ;; Emacs 19.18.) This package does not work with Emacs 18 or ! ;; Lucid Emacs. ;;; Code: + (require 'cl) + ;;; The user-level commands for editing macros. + ;;;###autoload (define-key ctl-x-map "\C-k" 'edit-kbd-macro) + (define-key ctl-x-map "\C-k" 'edit-kbd-macro) + + ;;;###autoload + (defvar edmacro-eight-bits nil + "*Non-nil if edit-kbd-macro should leave 8-bit characters intact. + Default nil means to write characters above \\177 in octal notation.") + + (defvar edmacro-mode-map nil) + (unless edmacro-mode-map + (setq edmacro-mode-map (make-sparse-keymap)) + (define-key edmacro-mode-map "\C-c\C-c" 'edmacro-finish-edit) + (define-key edmacro-mode-map "\C-c\C-q" 'edmacro-insert-key)) + ;;;###autoload ! (defun edit-kbd-macro (keys &optional prefix finish-hook store-hook) ! "Edit a keyboard macro. ! At the prompt, type any key sequence which is bound to a keyboard macro. ! Or, type `C-x e' or RET to edit the last keyboard macro, `C-h l' to edit ! the last 100 keystrokes as a keyboard macro, or `M-x' to edit a macro by ! its command name. ! With a prefix argument, format the macro in a more concise way." ! (interactive "kKeyboard macro to edit (C-x e, M-x, C-h l, or keys): \nP") ! (when keys ! (let ((cmd (if (arrayp keys) (key-binding keys) keys)) ! (mac nil)) ! (cond (store-hook ! (setq mac keys) ! (setq cmd nil)) ! ((or (eq cmd 'call-last-kbd-macro) ! (member keys '("\r" [return]))) ! (or last-kbd-macro ! (y-or-n-p "No keyboard macro defined. Create one? ") ! (keyboard-quit)) ! (setq mac (or last-kbd-macro "")) ! (setq cmd 'last-kbd-macro)) ! ((eq cmd 'execute-extended-command) ! (setq cmd (read-command "Name of keyboard macro to edit: ")) ! (setq mac (symbol-function cmd))) ! ((eq cmd 'view-lossage) ! (setq mac (recent-keys)) ! (setq cmd 'last-kbd-macro)) ! ((symbolp cmd) ! (setq mac (symbol-function cmd))) ! (t ! (setq mac cmd) ! (setq cmd nil))) ! (unless (arrayp mac) ! (error "Not a keyboard macro: %s" cmd)) ! (message "Formatting keyboard macro...") ! (let* ((oldbuf (current-buffer)) ! (mmac (edmacro-fix-menu-commands mac)) ! (fmt (edmacro-format-keys mmac 1)) ! (fmtv (edmacro-format-keys mmac (not prefix))) ! (buf (get-buffer-create "*Edit Macro*"))) ! (message "Formatting keyboard macro...done") ! (switch-to-buffer buf) ! (kill-all-local-variables) ! (use-local-map edmacro-mode-map) ! (setq buffer-read-only nil) ! (setq major-mode 'edmacro-mode) ! (setq mode-name "Edit Macro") ! (set (make-local-variable 'edmacro-original-buffer) oldbuf) ! (set (make-local-variable 'edmacro-finish-hook) finish-hook) ! (set (make-local-variable 'edmacro-store-hook) store-hook) ! (erase-buffer) ! (insert ";; Keyboard Macro Editor. Press C-c C-c to finish; " ! "press C-x k RET to cancel.\n") ! (insert ";; Original keys: " fmt "\n") ! (unless store-hook ! (insert "\nCommand: " (if cmd (symbol-name cmd) "none") "\n") ! (let ((keys (where-is-internal (or cmd mac) nil))) ! (if keys ! (while keys ! (insert "Key: " (edmacro-format-keys (pop keys) 1) "\n")) ! (insert "Key: none\n")))) ! (insert "\nMacro:\n\n") ! (save-excursion ! (insert fmtv "\n")) ! (recenter '(4)) ! (when (eq mac mmac) ! (set-buffer-modified-p nil)) ! (run-hooks 'edmacro-format-hook))))) ! ! ;;; The next two commands are provided for convenience and backward ! ;;; compatibility. ! ! ;;;###autoload ! (defun edit-last-kbd-macro (&optional prefix) "Edit the most recently defined keyboard macro." (interactive "P") ! (edit-kbd-macro 'call-last-kbd-macro prefix)) ;;;###autoload ! (defun edit-named-kbd-macro (&optional prefix) ! "Edit a keyboard macro which has been given a name by `name-last-kbd-macro'." ! (interactive "P") ! (edit-kbd-macro 'execute-extended-command prefix)) ;;;###autoload ! (defun read-kbd-macro (start &optional end) "Read the region as a keyboard macro definition. The region is interpreted as spelled-out keystrokes, e.g., \"M-x abc RET\". + See documentation for `edmacro-mode' for details. + Leading/trailing \"C-x (\" and \"C-x )\" in the text are allowed and ignored. The resulting macro is installed as the \"current\" keyboard macro. ! In Lisp, may also be called with a single STRING argument in which case ! the result is returned rather than being installed as the current macro. ! The result will be a string if possible, otherwise an event vector. ! Second argument NEED-VECTOR means to return an event vector always." (interactive "r") ! (if (stringp start) ! (edmacro-parse-keys start end) ! (setq last-kbd-macro (edmacro-parse-keys (buffer-substring start end))))) ! ;;;###autoload ! (defun format-kbd-macro (&optional macro verbose) ! "Return the keyboard macro MACRO as a human-readable string. ! This string is suitable for passing to `read-kbd-macro'. ! Second argument VERBOSE means to put one command per line with comments. ! If VERBOSE is `1', put everything on one line. If VERBOSE is omitted ! or nil, use a compact 80-column format." ! (and macro (symbolp macro) (setq macro (symbol-function macro))) ! (edmacro-format-keys (or macro last-kbd-macro) verbose)) ! ;;; Commands for *Edit Macro* buffer. (defun edmacro-finish-edit () (interactive) ! (unless (eq major-mode 'edmacro-mode) ! (error ! "This command is valid only in buffers created by `edit-kbd-macro'")) ! (run-hooks 'edmacro-finish-hook) ! (let ((cmd nil) (keys nil) (no-keys nil) ! (top (point-min))) ! (goto-char top) ! (let ((case-fold-search nil)) ! (while (cond ((looking-at "[ \t]*\\($\\|;;\\|REM[ \t\n]\\)") ! t) ! ((looking-at "Command:[ \t]*\\([^ \t\n]*\\)[ \t]*$") ! (when edmacro-store-hook ! (error "\"Command\" line not allowed in this context")) ! (let ((str (buffer-substring (match-beginning 1) ! (match-end 1)))) ! (unless (equal str "") ! (setq cmd (and (not (equalp str "none")) ! (intern str))) ! (and (fboundp cmd) (not (arrayp (symbol-function cmd))) ! (not (y-or-n-p ! (format "Command %s is already defined; %s" ! cmd "proceed? "))) ! (keyboard-quit)))) ! t) ! ((looking-at "Key:\\(.*\\)$") ! (when edmacro-store-hook ! (error "\"Key\" line not allowed in this context")) ! (let ((key (edmacro-parse-keys ! (buffer-substring (match-beginning 1) ! (match-end 1))))) ! (unless (equal key "") ! (if (equalp key "none") ! (setq no-keys t) ! (push key keys) ! (let ((b (key-binding key))) ! (and b (commandp b) (not (arrayp b)) ! (or (not (fboundp b)) ! (not (arrayp (symbol-function b)))) ! (not (y-or-n-p ! (format "Key %s is already defined; %s" ! (edmacro-format-keys key 1) ! "proceed? "))) ! (keyboard-quit)))))) ! t) ! ((looking-at "Macro:[ \t\n]*") ! (goto-char (match-end 0)) ! nil) ! ((eobp) nil) ! (t (error "Expected a `Macro:' line"))) ! (forward-line 1)) ! (setq top (point))) ! (let* ((buf (current-buffer)) ! (str (buffer-substring top (point-max))) ! (modp (buffer-modified-p)) ! (obuf edmacro-original-buffer) ! (store-hook edmacro-store-hook) ! (finish-hook edmacro-finish-hook)) ! (unless (or cmd keys store-hook (equal str "")) ! (error "No command name or keys specified")) ! (when modp ! (when (buffer-name obuf) ! (set-buffer obuf)) ! (message "Compiling keyboard macro...") ! (let ((mac (edmacro-parse-keys str))) ! (message "Compiling keyboard macro...done") ! (if store-hook ! (funcall store-hook mac) ! (when (eq cmd 'last-kbd-macro) ! (setq last-kbd-macro (and (> (length mac) 0) mac)) ! (setq cmd nil)) ! (when cmd ! (if (= (length mac) 0) ! (fmakunbound cmd) ! (fset cmd mac))) ! (if no-keys ! (when cmd ! (loop for key in (where-is-internal cmd nil) do ! (global-unset-key key))) ! (when keys ! (if (= (length mac) 0) ! (loop for key in keys do (global-unset-key key)) ! (loop for key in keys do ! (global-set-key key (or cmd mac))))))))) ! (kill-buffer buf) ! (when (buffer-name obuf) ! (switch-to-buffer obuf)) ! (when finish-hook ! (funcall finish-hook))))) ! ! (defun edmacro-insert-key (key) ! "Insert the written name of a key in the buffer." ! (interactive "kKey to insert: ") ! (if (bolp) ! (insert (edmacro-format-keys key t) "\n") ! (insert (edmacro-format-keys key) " "))) (defun edmacro-mode () ! "\\Keyboard Macro Editing mode. Press ! \\[edmacro-finish-edit] to save and exit. To abort the edit, just kill this buffer with \\[kill-buffer] RET. ! Press \\[edmacro-insert-key] to insert the name of any key by typing the key. ! ! The editing buffer contains a \"Command:\" line and any number of ! \"Key:\" lines at the top. These are followed by a \"Macro:\" line ! and the macro itself as spelled-out keystrokes: `C-x C-f foo RET'. ! ! The \"Command:\" line specifies the command name to which the macro ! is bound, or \"none\" for no command name. Write \"last-kbd-macro\" ! to refer to the current keyboard macro (as used by \\[call-last-kbd-macro]). ! ! The \"Key:\" lines specify key sequences to which the macro is bound, ! or \"none\" for no key bindings. ! ! You can edit these lines to change the places where the new macro ! is stored. ! ! ! Format of keyboard macros during editing: ! ! Text is divided into \"words\" separated by whitespace. Except for ! the words described below, the characters of each word go directly ! as characters of the macro. The whitespace that separates words ! is ignored. Whitespace in the macro must be written explicitly, ! as in \"foo SPC bar RET\". ! ! * The special words RET, SPC, TAB, DEL, LFD, ESC, and NUL represent ! special control characters. The words must be written in uppercase. ! ! * A word in angle brackets, e.g., , , or , represents ! a function key. (Note that in the standard configuration, the ! function key and the control key RET are synonymous.) ! You can use angle brackets on the words RET, SPC, etc., but they ! are not required there. ! ! * Keys can be written by their ASCII code, using a backslash followed ! by up to six octal digits. This is the only way to represent keys ! with codes above \\377. ! ! * One or more prefixes M- (meta), C- (control), S- (shift), A- (alt), ! H- (hyper), and s- (super) may precede a character or key notation. ! For function keys, the prefixes may go inside or outside of the ! brackets: C- = . The prefixes may be written in ! any order: M-C-x = C-M-x. ! ! Prefixes are not allowed on multi-key words, e.g., C-abc, except ! that the Meta prefix is allowed on a sequence of digits and optional ! minus sign: M--123 = M-- M-1 M-2 M-3. ! ! * The `^' notation for control characters also works: ^M = C-m. ! ! * Double angle brackets enclose command names: <> is ! shorthand for M-x next-line RET. ! ! * Finally, REM or ;; causes the rest of the line to be ignored as a ! comment. ! ! Any word may be prefixed by a multiplier in the form of a decimal ! number and `*': 3* = , and ! 10*foo = foofoofoofoofoofoofoofoofoofoo. ! ! Multiple text keys can normally be strung together to form a word, ! but you may need to add whitespace if the word would look like one ! of the above notations: `; ; ;' is a keyboard macro with three ! semicolons, but `;;;' is a comment. Likewise, `\\ 1 2 3' is four ! keys but `\\123' is a single key written in octal, and `< right >' ! is seven keys but `' is a single function key. When in ! doubt, use whitespace." (interactive) ! (error "This mode can be enabled only by `edit-kbd-macro'")) (put 'edmacro-mode 'mode-class 'special) + + ;;; Formatting a keyboard macro as human-readable text. ! (defun edmacro-format-keys (macro &optional verbose) ! (setq macro (edmacro-fix-menu-commands macro)) ! (let* ((maps (append (current-minor-mode-maps) ! (list (current-local-map) (current-global-map)))) ! (pkeys '(end-macro ?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9 ?- ?\C-u ! ?\M-- ?\M-0 ?\M-1 ?\M-2 ?\M-3 ?\M-4 ?\M-5 ?\M-6 ! ?\M-7 ?\M-8 ?\M-9)) ! (mdigs (nthcdr 13 pkeys)) ! (maxkey (if edmacro-eight-bits 255 127)) ! (case-fold-search nil) ! (res-words '("NUL" "TAB" "LFD" "RET" "ESC" "SPC" "DEL" "REM")) ! (rest-mac (vconcat macro [end-macro])) ! (res "") ! (len 0) ! (one-line (eq verbose 1))) ! (if one-line (setq verbose nil)) ! (when (stringp macro) ! (loop for i below (length macro) do ! (when (>= (aref rest-mac i) 128) ! (incf (aref rest-mac i) (- (lsh 1 23) 128))))) ! (while (not (eq (aref rest-mac 0) 'end-macro)) ! (let* ((prefix ! (or (and (integerp (aref rest-mac 0)) ! (memq (aref rest-mac 0) mdigs) ! (memq (key-binding (subseq rest-mac 0 1)) ! '(digit-argument negative-argument)) ! (let ((i 1)) ! (while (memq (aref rest-mac i) (cdr mdigs)) ! (incf i)) ! (and (not (memq (aref rest-mac i) pkeys)) ! (prog1 (concat "M-" (subseq rest-mac 0 i) " ") ! (callf subseq rest-mac i))))) ! (and (eq (aref rest-mac 0) ?\C-u) ! (eq (key-binding [?\C-u]) 'universal-argument) ! (let ((i 1)) ! (while (eq (aref rest-mac i) ?\C-u) ! (incf i)) ! (and (not (memq (aref rest-mac i) pkeys)) ! (prog1 (loop repeat i concat "C-u ") ! (callf subseq rest-mac i))))) ! (and (eq (aref rest-mac 0) ?\C-u) ! (eq (key-binding [?\C-u]) 'universal-argument) ! (let ((i 1)) ! (when (eq (aref rest-mac i) ?-) ! (incf i)) ! (while (memq (aref rest-mac i) ! '(?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9)) ! (incf i)) ! (and (not (memq (aref rest-mac i) pkeys)) ! (prog1 (concat "C-u " (subseq rest-mac 1 i) " ") ! (callf subseq rest-mac i))))))) ! (bind-len (apply 'max 1 ! (loop for map in maps ! for b = (lookup-key map rest-mac) ! when b collect b))) ! (key (subseq rest-mac 0 bind-len)) ! (fkey nil) tlen tkey ! (bind (or (loop for map in maps for b = (lookup-key map key) ! thereis (and (not (integerp b)) b)) ! (and (setq fkey (lookup-key function-key-map rest-mac)) ! (setq tlen fkey tkey (subseq rest-mac 0 tlen) ! fkey (lookup-key function-key-map tkey)) ! (loop for map in maps ! for b = (lookup-key map fkey) ! when (and (not (integerp b)) b) ! do (setq bind-len tlen key tkey) ! and return b ! finally do (setq fkey nil))))) ! (first (aref key 0)) ! (text (loop for i from bind-len below (length rest-mac) ! for ch = (aref rest-mac i) ! while (and (integerp ch) ! (> ch 32) (< ch maxkey) (/= ch 92) ! (eq (key-binding (char-to-string ch)) ! 'self-insert-command) ! (or (> i (- (length rest-mac) 2)) ! (not (eq ch (aref rest-mac (+ i 1)))) ! (not (eq ch (aref rest-mac (+ i 2)))))) ! finally return i)) ! desc) ! (if (stringp bind) (setq bind nil)) ! (cond ((and (eq bind 'self-insert-command) (not prefix) ! (> text 1) (integerp first) ! (> first 32) (<= first maxkey) (/= first 92) ! (progn ! (if (> text 30) (setq text 30)) ! (setq desc (concat (subseq rest-mac 0 text))) ! (when (string-match "^[ACHMsS]-." desc) ! (setq text 2) ! (callf substring desc 0 2)) ! (not (string-match ! "^;;\\|^<.*>$\\|^\\\\[0-9]+$\\|^[0-9]+\\*." ! desc)))) ! (when (or (string-match "^\\^.$" desc) ! (member desc res-words)) ! (setq desc (mapconcat 'char-to-string desc " "))) ! (when verbose ! (setq bind (format "%s * %d" bind text))) ! (setq bind-len text)) ! ((and (eq bind 'execute-extended-command) ! (> text bind-len) ! (memq (aref rest-mac text) '(return 13)) ! (progn ! (setq desc (concat (subseq rest-mac bind-len text))) ! (commandp (intern-soft desc)))) ! (if (commandp (intern-soft desc)) (setq bind desc)) ! (setq desc (format "<<%s>>" desc)) ! (setq bind-len (1+ text))) ! (t ! (setq desc (mapconcat ! (function ! (lambda (ch) ! (cond ! ((integerp ch) ! (concat ! (loop for pf across "ACHMsS" ! for bit in '(18 22 20 23 19 21) ! when (/= (logand ch (lsh 1 bit)) 0) ! concat (format "%c-" pf)) ! (let ((ch2 (logand ch (1- (lsh 1 18))))) ! (cond ((<= ch2 32) ! (case ch2 ! (0 "NUL") (9 "TAB") (10 "LFD") ! (13 "RET") (27 "ESC") (32 "SPC") ! (t ! (format "C-%c" ! (+ (if (<= ch2 26) 96 64) ! ch2))))) ! ((= ch2 127) "DEL") ! ((<= ch2 maxkey) (char-to-string ch2)) ! (t (format "\\%o" ch2)))))) ! ((symbolp ch) ! (format "<%s>" ch)) ! (t ! (error "Unrecognized item in macro: %s" ch))))) ! (or fkey key) " ")))) ! (if prefix (setq desc (concat prefix desc))) ! (unless (string-match " " desc) ! (let ((times 1) (pos bind-len)) ! (while (not (mismatch rest-mac rest-mac ! :end1 bind-len :start2 pos ! :end2 (+ bind-len pos))) ! (incf times) ! (incf pos bind-len)) ! (when (> times 1) ! (setq desc (format "%d*%s" times desc)) ! (setq bind-len (* bind-len times))))) ! (setq rest-mac (subseq rest-mac bind-len)) ! (if verbose ! (progn ! (unless (equal res "") (callf concat res "\n")) ! (callf concat res desc) ! (when (and bind (or (stringp bind) (symbolp bind))) ! (callf concat res ! (make-string (max (- 3 (/ (length desc) 8)) 1) 9) ! ";; " (if (stringp bind) bind (symbol-name bind)))) ! (setq len 0)) ! (if (and (> (+ len (length desc) 2) 72) (not one-line)) ! (progn ! (callf concat res "\n ") ! (setq len 1)) ! (unless (equal res "") ! (callf concat res " ") ! (incf len))) ! (callf concat res desc) ! (incf len (length desc))))) ! res)) ! ! (defun edmacro-fix-menu-commands (macro) ! (when (vectorp macro) ! (let ((i 0) ev) ! (while (< i (length macro)) ! (when (consp (setq ev (aref macro i))) ! (cond ((equal (cadadr ev) '(menu-bar)) ! (setq macro (vconcat (subseq macro 0 i) ! (vector 'menu-bar (car ev)) ! (subseq macro (1+ i)))) ! (incf i)) ! ;; It would be nice to do pop-up menus, too, but not enough ! ;; info is recorded in macros to make this possible. ! (t ! (error "Macros with mouse clicks are not %s" ! "supported by this command")))) ! (incf i)))) ! macro) ! ! ;;; Parsing a human-readable keyboard macro. ! ! (defun edmacro-parse-keys (string &optional need-vector) ! (let ((case-fold-search nil) ! (pos 0) ! (res [])) ! (while (and (< pos (length string)) ! (string-match "[^ \t\n\f]+" string pos)) ! (let ((word (substring string (match-beginning 0) (match-end 0))) ! (key nil) ! (times 1)) ! (setq pos (match-end 0)) ! (when (string-match "\\([0-9]+\\)\\*." word) ! (setq times (string-to-int (substring word 0 (match-end 1)))) ! (setq word (substring word (1+ (match-end 1))))) ! (cond ((string-match "^<<.+>>$" word) ! (setq key (vconcat (if (eq (key-binding [?\M-x]) ! 'execute-extended-command) ! [?\M-x] ! (or (car (where-is-internal ! 'execute-extended-command)) ! [?\M-x])) ! (substring word 2 -2) "\r"))) ! ((and (string-match "^\\(\\([ACHMsS]-\\)*\\)<\\(.+\\)>$" word) ! (progn ! (setq word (concat (substring word (match-beginning 1) ! (match-end 1)) ! (substring word (match-beginning 3) ! (match-end 3)))) ! (not (string-match ! "\\<\\(NUL\\|RET\\|LFD\\|ESC\\|SPC\\|DEL\\)$" ! word)))) ! (setq key (list (intern word)))) ! ((or (equal word "REM") (string-match "^;;" word)) ! (setq pos (string-match "$" string pos))) ! (t ! (let ((orig-word word) (prefix 0) (bits 0)) ! (while (string-match "^[ACHMsS]-." word) ! (incf bits (lsh 1 (cdr (assq (aref word 0) ! '((?A . 18) (?C . 22) ! (?H . 20) (?M . 23) ! (?s . 19) (?S . 21)))))) ! (incf prefix 2) ! (callf substring word 2)) ! (when (string-match "^\\^.$" word) ! (incf bits (lsh 1 22)) ! (incf prefix) ! (callf substring word 1)) ! (let ((found (assoc word '(("NUL" . "\0") ("RET" . "\r") ! ("LFD" . "\n") ("TAB" . "\t") ! ("ESC" . "\e") ("SPC" . " ") ! ("DEL" . "\177"))))) ! (when found (setq word (cdr found)))) ! (when (string-match "^\\\\[0-7]+$" word) ! (loop for ch across word ! for n = 0 then (+ (* n 8) ch -48) ! finally do (setq word (vector n)))) ! (cond ((= bits 0) ! (setq key word)) ! ((and (= bits (lsh 1 23)) (stringp word) ! (string-match "^-?[0-9]+$" word)) ! (setq key (loop for x across word collect (+ x bits)))) ! ((/= (length word) 1) ! (error "%s must prefix a single character, not %s" ! (substring orig-word 0 prefix) word)) ! ((and (/= (logand bits (lsh 1 22)) 0) (stringp word) ! (string-match "[@-_.a-z?]" word)) ! (setq key (list (+ bits (- (lsh 1 22)) ! (if (equal word "?") 127 ! (logand (aref word 0) 31)))))) ! (t ! (setq key (list (+ bits (aref word 0))))))))) ! (when key ! (loop repeat times do (callf vconcat res key))))) ! (when (and (>= (length res) 4) ! (eq (aref res 0) ?\C-x) ! (eq (aref res 1) ?\() ! (eq (aref res (- (length res) 2)) ?\C-x) ! (eq (aref res (- (length res) 1)) ?\))) ! (setq res (subseq res 2 -2))) ! (if (and (not need-vector) ! (loop for ch across res ! always (and (integerp ch) ! (let ((ch2 (logand ch (lognot (lsh 1 23))))) ! (and (>= ch2 0) (<= ch2 127)))))) ! (concat (loop for ch across res ! collect (if (= (logand ch (lsh 1 23)) 0) ! ch (+ ch 128)))) ! res))) ! ! ;;; The following probably ought to go in macros.el: ! ! ;;;###autoload ! (defun insert-kbd-macro (macroname &optional keys) ! "Insert in buffer the definition of kbd macro NAME, as Lisp code. ! Optional second arg KEYS means also record the keys it is on ! \(this is the prefix argument, when calling interactively). ! ! This Lisp code will, when executed, define the kbd macro with the same ! definition it has now. If you say to record the keys, the Lisp code ! will also rebind those keys to the macro. Only global key bindings ! are recorded since executing this Lisp code always makes global ! bindings. ! ! To save a kbd macro, visit a file of Lisp code such as your `~/.emacs', ! use this command, and then save the file." ! (interactive "CInsert kbd macro (name): \nP") ! (let (definition) ! (if (string= (symbol-name macroname) "") ! (progn ! (setq definition (format-kbd-macro)) ! (insert "(setq last-kbd-macro")) ! (setq definition (format-kbd-macro macroname)) ! (insert (format "(defalias '%s" macroname))) ! (if (> (length definition) 50) ! (insert " (read-kbd-macro\n") ! (insert "\n (read-kbd-macro ")) ! (prin1 definition (current-buffer)) ! (insert "))\n") ! (if keys ! (let ((keys (where-is-internal macroname nil))) ! (while keys ! (insert (format "(global-set-key %S '%s)\n" (car keys) macroname)) ! (setq keys (cdr keys))))))) ! ! (provide 'edmacro) ;;; edmacro.el ends here + diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/etags.el emacs-19.20/lisp/etags.el *** emacs-19.19/lisp/etags.el Sun Aug 15 01:20:42 1993 --- emacs-19.20/lisp/etags.el Tue Nov 9 02:12:20 1993 *************** *** 387,392 **** ;; First check only tables already in buffers. (save-excursion (tags-table-including buffer-file-name ! tags-table-list ! t)) ;; Since that didn't find any, now do the ;; expensive version: reading new files. --- 387,392 ---- ;; First check only tables already in buffers. (save-excursion (tags-table-including buffer-file-name ! tags-table-list ! t)) ;; Since that didn't find any, now do the ;; expensive version: reading new files. *************** *** 993,997 **** (point)))) (terpri) ! (forward-line 1)))) (defun etags-tags-apropos (string) --- 993,998 ---- (point)))) (terpri) ! (forward-line 1)) ! t)) (defun etags-tags-apropos (string) *************** *** 1071,1078 **** ;; point should be just after a string that matches TAG. (defun tag-exact-match-p (tag) ! (and (looking-at "\\Sw.*\177") (looking-at "\\S_.*\177") ;not a symbol char ! (save-excursion ! (backward-char (1+ (length tag))) ! (and (looking-at "\\Sw") (looking-at "\\S_"))))) ;; t if point is at a tag line that matches TAG as a word. --- 1072,1083 ---- ;; point should be just after a string that matches TAG. (defun tag-exact-match-p (tag) ! ;; The match is really exact if there is an explicit tag name. ! (or (looking-at (concat "[^\177]*\177" (regexp-quote tag) "\001")) ! ;; We also call it "exact" if it is surrounded by symbol boundaries. ! ;; This is needed because etags does not always generate explicit names. ! (and (looking-at "\\Sw.*\177") (looking-at "\\S_.*\177") ! (save-excursion ! (backward-char (1+ (length tag))) ! (and (looking-at "\\Sw") (looking-at "\\S_")))))) ;; t if point is at a tag line that matches TAG as a word. *************** *** 1098,1103 **** (defun next-file (&optional initialize novisit) "Select next file among files in current tags table. ! Non-nil first argument (prefix arg, if interactive) ! initializes to the beginning of the list of files in the tags table. Non-nil second argument NOVISIT means use a temporary buffer --- 1103,1110 ---- (defun next-file (&optional initialize novisit) "Select next file among files in current tags table. ! ! A first argument of t (prefix arg, if interactive) initializes to the ! beginning of the list of files in the tags table. If the argument is ! neither nil nor t, it is evalled to initialize the list of files. Non-nil second argument NOVISIT means use a temporary buffer *************** *** 1107,1115 **** if the file was newly read in, the value is the filename." (interactive "P") ! (and initialize ! (save-excursion ! ;; Visit the tags table buffer to get its list of files. ! (visit-tags-table-buffer) ! (setq next-file-list (tags-table-files)))) (or next-file-list (save-excursion --- 1114,1129 ---- if the file was newly read in, the value is the filename." (interactive "P") ! (cond ((not initialize) ! ;; Not the first run. ! ) ! ((eq initialize t) ! ;; Initialize the list from the tags table. ! (save-excursion ! ;; Visit the tags table buffer to get its list of files. ! (visit-tags-table-buffer) ! (setq next-file-list (tags-table-files)))) ! (t ! ;; Initialize the list by evalling the argument. ! (setq next-file-list (eval initialize)))) (or next-file-list (save-excursion *************** *** 1149,1153 **** (defun tags-loop-continue (&optional first-time) "Continue last \\[tags-search] or \\[tags-query-replace] command. ! Used noninteractively with non-nil argument to begin such a command. Two variables control the processing we do on each file: the value of `tags-loop-scan' is a form to be executed on each file --- 1163,1168 ---- (defun tags-loop-continue (&optional first-time) "Continue last \\[tags-search] or \\[tags-query-replace] command. ! Used noninteractively with non-nil argument to begin such a command (the ! argument is passed to `next-file', which see). Two variables control the processing we do on each file: the value of `tags-loop-scan' is a form to be executed on each file *************** *** 1195,1199 **** ;;;###autoload ! (defun tags-search (regexp) "Search through all files listed in tags table for match for REGEXP. Stops when a match is found. --- 1210,1214 ---- ;;;###autoload ! (defun tags-search (regexp &optional file-list-form) "Search through all files listed in tags table for match for REGEXP. Stops when a match is found. *************** *** 1210,1217 **** (list 're-search-forward regexp nil t) tags-loop-operate nil) ! (tags-loop-continue t))) ;;;###autoload ! (defun tags-query-replace (from to &optional delimited) "Query-replace-regexp FROM with TO through all files listed in tags table. Third arg DELIMITED (prefix arg) means replace only word-delimited matches. --- 1225,1232 ---- (list 're-search-forward regexp nil t) tags-loop-operate nil) ! (tags-loop-continue (or file-list-form t)))) ;;;###autoload ! (defun tags-query-replace (from to &optional delimited file-list-form) "Query-replace-regexp FROM with TO through all files listed in tags table. Third arg DELIMITED (prefix arg) means replace only word-delimited matches. *************** *** 1229,1241 **** '(goto-char (match-beginning 0)))) tags-loop-operate (list 'perform-replace from to t t delimited)) ! (tags-loop-continue t)) ;;;###autoload (defun list-tags (file) "Display list of tags in file FILE. ! FILE should not contain a directory specification ! unless it has one in the tags table." ! (interactive (list (completing-read "List tags in file: " nil ! 'tags-table-files t nil))) (with-output-to-temp-buffer "*Tags List*" (princ "Tags in file ") --- 1244,1260 ---- '(goto-char (match-beginning 0)))) tags-loop-operate (list 'perform-replace from to t t delimited)) ! (tags-loop-continue (or file-list-form t))) ;;;###autoload (defun list-tags (file) "Display list of tags in file FILE. ! FILE should not contain a directory specification." ! (interactive (list (completing-read "List tags in file: " ! (save-excursion ! (visit-tags-table-buffer) ! (mapcar 'list ! (mapcar 'file-name-nondirectory ! (tags-table-files)))) ! nil t nil))) (with-output-to-temp-buffer "*Tags List*" (princ "Tags in file ") *************** *** 1246,1253 **** (gotany nil)) (while (visit-tags-table-buffer (not first-time)) (if (funcall list-tags-function file) (setq gotany t))) (or gotany ! (error "File %s not in current tags tables")))))) ;;;###autoload --- 1265,1273 ---- (gotany nil)) (while (visit-tags-table-buffer (not first-time)) + (setq first-time nil) (if (funcall list-tags-function file) (setq gotany t))) (or gotany ! (error "File %s not in current tags tables" file)))))) ;;;###autoload diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/files.el emacs-19.20/lisp/files.el *** emacs-19.19/lisp/files.el Sun Aug 15 01:46:41 1993 --- emacs-19.20/lisp/files.el Wed Nov 10 15:40:04 1993 *************** *** 40,43 **** --- 40,46 ---- *Every* FROM string should start with `^'. + Do not use `~' in the TO strings. + They should be ordinary absolute directory names. + Use this feature when you have directories which you normally refer to via absolute symbolic links. Make TO the name of the link, and FROM *************** *** 183,188 **** functions are called.") - ;;; In case someone does make it local. - (put 'write-file-hooks 'permanent-local t) (defvar write-file-hooks nil "List of functions to be called before writing out a buffer to a file. --- 186,189 ---- *************** *** 193,202 **** See also `write-contents-hooks'. Don't make this variable buffer-local; instead, use `local-write-file-hooks'.") - (put 'local-write-file-hooks 'permanent-local t) (defvar local-write-file-hooks nil "Just like `write-file-hooks', except intended for per-buffer use. The functions in this list are called before the ones in `write-file-hooks'.") (defvar write-contents-hooks nil --- 194,206 ---- See also `write-contents-hooks'. Don't make this variable buffer-local; instead, use `local-write-file-hooks'.") + ;;; However, in case someone does make it local... + (put 'write-file-hooks 'permanent-local t) (defvar local-write-file-hooks nil "Just like `write-file-hooks', except intended for per-buffer use. The functions in this list are called before the ones in `write-file-hooks'.") + (make-variable-buffer-local 'local-write-file-hooks) + (put 'local-write-file-hooks 'permanent-local t) (defvar write-contents-hooks nil *************** *** 327,331 **** both at the level of the file and at the level of the directories containing it, until no links are left at any level." ! (if (string= filename "~") (progn (setq filename (expand-file-name filename)) --- 331,337 ---- both at the level of the file and at the level of the directories containing it, until no links are left at any level." ! (if (or (string= filename "~") ! (and (string= (substring filename 0 1) "~") ! (string-match "~[^/]*" filename))) (progn (setq filename (expand-file-name filename)) *************** *** 508,512 **** (defvar abbreviated-home-dir nil ! "The the user's homedir abbreviated according to `directory-abbrev-list'.") (defun abbreviate-file-name (filename) --- 514,518 ---- (defvar abbreviated-home-dir nil ! "The user's homedir abbreviated according to `directory-abbrev-list'.") (defun abbreviate-file-name (filename) *************** *** 833,907 **** -*- mode tag." ;; Look for -*-MODENAME-*- or -*- ... mode: MODENAME; ... -*- ! (let (beg end mode) (save-excursion (goto-char (point-min)) (skip-chars-forward " \t\n") ! (if (and enable-local-variables ! ;; Don't look for -*- if this file name matches any ! ;; of the regexps in inhibit-local-variables-regexps. ! (let ((temp inhibit-local-variables-regexps)) ! (while (and temp ! (not (string-match (car temp) ! buffer-file-name))) ! (setq temp (cdr temp))) ! (not temp)) ! (search-forward "-*-" (save-excursion ! ;; If the file begins with "#!" ! ;; (exec interpreter magic), look ! ;; for mode frobs in the first two ! ;; lines. You cannot necessarily ! ;; put them in the first line of ! ;; such a file without screwing up ! ;; the interpreter invocation. ! (end-of-line (and (looking-at "^#!") 2)) ! (point)) t) ! (progn ! (skip-chars-forward " \t") ! (setq beg (point)) ! (search-forward "-*-" ! (save-excursion (end-of-line) (point)) ! t)) ! (progn ! (forward-char -3) ! (skip-chars-backward " \t") ! (setq end (point)) ! (goto-char beg) ! (if (search-forward ":" end t) ! (progn ! (goto-char beg) ! (if (let ((case-fold-search t)) ! (search-forward "mode:" end t)) ! (progn ! (skip-chars-forward " \t") ! (setq beg (point)) ! (if (search-forward ";" end t) ! (forward-char -1) ! (goto-char end)) ! (skip-chars-backward " \t") ! (setq mode (buffer-substring beg (point)))))) ! (setq mode (buffer-substring beg end))))) ! (setq mode (intern (concat (downcase mode) "-mode"))) ! (if buffer-file-name ! (let ((alist auto-mode-alist) ! (name buffer-file-name)) ! (let ((case-fold-search (eq system-type 'vax-vms))) ! ;; Remove backup-suffixes from file name. ! (setq name (file-name-sans-versions name)) ! ;; Find first matching alist entry. ! (while (and (not mode) alist) ! (if (string-match (car (car alist)) name) ! (setq mode (cdr (car alist)))) ! (setq alist (cdr alist)))))))) ! (if mode (funcall mode)))) (defun hack-local-variables-prop-line () ;; Set local variables specified in the -*- line. ! ;; Returns t if mode was set. (save-excursion (goto-char (point-min)) (skip-chars-forward " \t\n\r") (let ((result '()) ! (end (save-excursion (end-of-line) (point))) ! mode-p) ;; Parse the -*- line into the `result' alist. (cond ((not (search-forward "-*-" end t)) --- 839,915 ---- -*- mode tag." ;; Look for -*-MODENAME-*- or -*- ... mode: MODENAME; ... -*- ! (let (beg end done) (save-excursion (goto-char (point-min)) (skip-chars-forward " \t\n") ! (and enable-local-variables ! ;; Don't look for -*- if this file name matches any ! ;; of the regexps in inhibit-local-variables-regexps. ! (let ((temp inhibit-local-variables-regexps)) ! (while (and temp ! (not (string-match (car temp) ! buffer-file-name))) ! (setq temp (cdr temp))) ! (not temp)) ! (search-forward "-*-" (save-excursion ! ;; If the file begins with "#!" ! ;; (exec interpreter magic), look ! ;; for mode frobs in the first two ! ;; lines. You cannot necessarily ! ;; put them in the first line of ! ;; such a file without screwing up ! ;; the interpreter invocation. ! (end-of-line (and (looking-at "^#!") 2)) ! (point)) t) ! (progn ! (skip-chars-forward " \t") ! (setq beg (point)) ! (search-forward "-*-" ! (save-excursion (end-of-line) (point)) ! t)) ! (progn ! (forward-char -3) ! (skip-chars-backward " \t") ! (setq end (point)) ! (goto-char beg) ! (if (save-excursion (search-forward ":" end t)) ! ;; Find all specifications for the `mode:' variable ! ;; and execute hem left to right. ! (while (let ((case-fold-search t)) ! (search-forward "mode:" end t)) ! (skip-chars-forward " \t") ! (setq beg (point)) ! (if (search-forward ";" end t) ! (forward-char -1) ! (goto-char end)) ! (skip-chars-backward " \t") ! (funcall (intern (concat (downcase (buffer-substring beg (point))) "-mode")))) ! ;; Simple -*-MODE-*- case. ! (funcall (intern (concat (downcase (buffer-substring beg end)) "-mode")))) ! (setq done t))) ! ;; If we didn't find a mode from a -*- line, try using the file name. ! (if (and (not done) buffer-file-name) ! (let ((alist auto-mode-alist) ! (name buffer-file-name) ! mode) ! (let ((case-fold-search (eq system-type 'vax-vms))) ! ;; Remove backup-suffixes from file name. ! (setq name (file-name-sans-versions name)) ! ;; Find first matching alist entry. ! (while (and (not mode) alist) ! (if (string-match (car (car alist)) name) ! (setq mode (cdr (car alist)))) ! (setq alist (cdr alist)))) ! (if mode (funcall mode))))))) (defun hack-local-variables-prop-line () ;; Set local variables specified in the -*- line. ! ;; Ignore any specification for `mode:'; ! ;; set-auto-mode should already have handled that. (save-excursion (goto-char (point-min)) (skip-chars-forward " \t\n\r") (let ((result '()) ! (end (save-excursion (end-of-line) (point)))) ;; Parse the -*- line into the `result' alist. (cond ((not (search-forward "-*-" end t)) *************** *** 935,945 **** (skip-chars-forward " \t;"))) (setq result (nreverse result)))) - - ;; Mode is magic. - (let (mode) - (while (setq mode (assq 'mode result)) - (setq mode-p t result (delq mode result)) - (funcall (intern (concat (downcase (symbol-name (cdr mode))) - "-mode"))))) (if (and result --- 943,946 ---- *************** *** 953,960 **** (let ((key (car (car result))) (val (cdr (car result)))) ! ;; 'mode has already been removed from this list. ! (hack-one-local-variable key val)) ! (setq result (cdr result)))) ! mode-p))) (defun hack-local-variables () --- 954,960 ---- (let ((key (car (car result))) (val (cdr (car result)))) ! (or (eq key 'mode) ! (hack-one-local-variable key val))) ! (setq result (cdr result))))))) (defun hack-local-variables () *************** *** 975,979 **** (set-window-start (selected-window) (point))) (y-or-n-p (format "Set local variables as specified at end of %s? " ! (file-name-nondirectory buffer-file-name)))))))) (let ((continue t) prefix prefixlen suffix beg --- 975,983 ---- (set-window-start (selected-window) (point))) (y-or-n-p (format "Set local variables as specified at end of %s? " ! (if buffer-file-name ! (file-name-nondirectory ! buffer-file-name) ! (concat "buffer " ! (buffer-name)))))))))) (let ((continue t) prefix prefixlen suffix beg *************** *** 1297,1313 **** (let* ((base-versions (concat (file-name-nondirectory fn) ".~")) (bv-length (length base-versions)) ! (possibilities (file-name-all-completions ! base-versions ! (file-name-directory fn))) ! (versions (sort (mapcar ! (function backup-extract-version) ! possibilities) ! '<)) ! (high-water-mark (apply 'max 0 versions)) ! (deserve-versions-p ! (or version-control ! (> high-water-mark 0))) ! (number-to-delete (- (length versions) ! kept-old-versions kept-new-versions -1))) (if (not deserve-versions-p) (list (make-backup-file-name fn)) --- 1301,1324 ---- (let* ((base-versions (concat (file-name-nondirectory fn) ".~")) (bv-length (length base-versions)) ! possibilities ! (versions nil) ! (high-water-mark 0) ! (deserve-versions-p nil) ! (number-to-delete 0)) ! (condition-case () ! (setq possibilities (file-name-all-completions ! base-versions ! (file-name-directory fn)) ! versions (sort (mapcar ! (function backup-extract-version) ! possibilities) ! '<) ! high-water-mark (apply 'max 0 versions) ! deserve-versions-p (or version-control ! (> high-water-mark 0)) ! number-to-delete (- (length versions) ! kept-old-versions kept-new-versions -1)) ! (file-error ! (setq possibilities nil))) (if (not deserve-versions-p) (list (make-backup-file-name fn)) diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/font-lock.el emacs-19.20/lisp/font-lock.el *** emacs-19.19/lisp/font-lock.el Sun Aug 15 01:20:54 1993 --- emacs-19.20/lisp/font-lock.el Tue Oct 26 16:44:00 1993 *************** *** 88,98 **** If this is a list, then elements may be of the forms: ! \"string\" ; a regexp to highlight in the ; `font-lock-keyword-face'. ! (\"string\" . integer) ; match N of the regexp will be highlighted ! (\"string\" . face-name) ; use the named face ! (\"string\" integer face-name) ; both of the above ! (\"string\" integer face-name t) ; this allows highlighting to overlap ! ; with already-highlighted regions. These regular expressions should not match text which spans lines. --- 88,102 ---- If this is a list, then elements may be of the forms: ! \"string\" ; A regexp to highlight in the ; `font-lock-keyword-face'. ! (\"string\" . N) ; Highlight subexpression N of the regexp. ! (\"string\" . face-name) ; Use the named face ! (\"string\" N face-name) ; Both of the above ! (\"string\" N face-name t) ; This allows highlighting to override ! ; already-highlighted regions. ! (\"string\" N face-name keep) ; This allows highlighting to occur ! ; even if some parts of what STRING matches ! ; are already highlighted--but does not alter ! ; the existing highlighting of those parts. These regular expressions should not match text which spans lines. *************** *** 262,267 **** (defsubst font-lock-any-properties-p (start end) ! (or (get-text-property start 'font-lock) ! (let ((next (next-single-property-change start 'font-lock))) (and next (< next end))))) --- 266,271 ---- (defsubst font-lock-any-properties-p (start end) ! (or (get-text-property start 'face) ! (let ((next (next-single-property-change start 'face))) (and next (< next end))))) *************** *** 300,304 **** ;; don't fontify this keyword if we're already in some other context. (or (if allow-overlap-p nil (font-lock-any-properties-p s e)) ! (progn (put-text-property s e 'face face)))) (if loudly (message "Fontifying %s... (regexps...%s)" --- 304,319 ---- ;; don't fontify this keyword if we're already in some other context. (or (if allow-overlap-p nil (font-lock-any-properties-p s e)) ! (if (not (memq allow-overlap-p '(t nil))) ! (save-excursion ! (goto-char s) ! (save-restriction ! (narrow-to-region s e) ! (while (not (eobp)) ! (let ((next (next-single-property-change (point) 'face))) ! (if (> next (point-max)) ! (setq next (point-max))) ! (if (not (get-text-property (point) 'face)) ! (put-text-property (point) next 'face face)) ! (goto-char next))))) (put-text-property s e 'face face)))) (if loudly (message "Fontifying %s... (regexps...%s)" *************** *** 376,380 **** (if font-lock-verbose (message "Fontifying %s..." (buffer-name))) ;; Turn it on to run hooks and get the right font-lock-keywords. ! (or was-on (font-lock-mode 1)) (font-lock-unfontify-region (point-min) (point-max)) (if font-lock-verbose (message "Fontifying %s... (syntactically...)" --- 391,395 ---- (if font-lock-verbose (message "Fontifying %s..." (buffer-name))) ;; Turn it on to run hooks and get the right font-lock-keywords. ! (or was-on (font-lock-set-defaults)) (font-lock-unfontify-region (point-min) (point-max)) (if font-lock-verbose (message "Fontifying %s... (syntactically...)" *************** *** 386,390 **** (buffer-name))) (font-lock-hack-keywords (point-min) (point-max) font-lock-verbose)) - (or was-on (font-lock-mode 0)) ; turn it off if it was off. (set (make-local-variable 'font-lock-fontified) t) (if font-lock-verbose (message "Fontifying %s... done." (buffer-name))) --- 401,404 ---- *************** *** 395,399 **** (defun font-lock-set-defaults () ! "sets font-lock-keywords to something appropriate for this mode." (setq font-lock-keywords (cond ((eq major-mode 'lisp-mode) lisp-font-lock-keywords) --- 409,413 ---- (defun font-lock-set-defaults () ! "Set `font-lock-keywords' to something appropriate for this mode." (setq font-lock-keywords (cond ((eq major-mode 'lisp-mode) lisp-font-lock-keywords) *************** *** 478,482 **** ;; ;; fontify other preprocessor lines. ! '("^#[ \t]*\\(if\\|ifn?def\\)[ \t]+\\([^\n]+\\)" 2 font-lock-function-name-face t) ;; --- 492,500 ---- ;; ;; fontify other preprocessor lines. ! '("^#[ \t]*\\(if\\)[ \t]+\\([^\n]+\\)" ! 2 font-lock-function-name-face keep) ! '("^#[ \t]*\\(endif\\|else\\)[ \t]+\\([^\n]+\\)" ! 2 font-lock-function-name-face keep) ! '("^#[ \t]*\\(ifn?def\\)[ \t]+\\([^ \t\n]+\\)" 2 font-lock-function-name-face t) ;; diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/forms.el emacs-19.20/lisp/forms.el *** emacs-19.19/lisp/forms.el Sun Aug 15 01:20:58 1993 --- emacs-19.20/lisp/forms.el Wed Nov 10 21:50:25 1993 *************** *** 2,7 **** ;;; Copyright (C) 1991, 1993 Free Software Foundation, Inc. ! ;; Author: Johan Vromans ! ;; Version: 2.0 ;; This file is part of GNU Emacs. --- 2,7 ---- ;;; Copyright (C) 1991, 1993 Free Software Foundation, Inc. ! ;; Author: Johan Vromans ! ;; Version: $Revision: 2.3 $ ;; This file is part of GNU Emacs. *************** *** 27,32 **** ;;; === Naming conventions ;;; ! ;;; The names of all variables and functions start with 'form-'. ! ;;; Names which start with 'form--' are intended for internal use, and ;;; should *NOT* be used from the outside. ;;; --- 27,32 ---- ;;; === Naming conventions ;;; ! ;;; The names of all variables and functions start with 'forms-'. ! ;;; Names which start with 'forms--' are intended for internal use, and ;;; should *NOT* be used from the outside. ;;; *************** *** 114,143 **** ;;; back to the separator character. ;;; ! ;;; forms-forms-scroll [bool, default t] ;;; Non-nil means: rebind locally the commands that ;;; perform `scroll-up' or `scroll-down' to use ;;; `forms-next-field' resp. `forms-prev-field'. ;;; ! ;;; forms-forms-jump [bool, default t] ;;; Non-nil means: rebind locally the commands that ;;; perform `beginning-of-buffer' or `end-of-buffer' ;;; to perform `forms-first-field' resp. `forms-last-field'. ;;; ! ;;; forms-new-record-filter [symbol, no default] ! ;;; If defined: this should be the name of a ;;; function that is called when a new ;;; record is created. It can be used to fill in ;;; the new record with default fields, for example. - ;;; Instead of the name of the function, it may - ;;; be the function itself. ;;; ! ;;; forms-modified-record-filter [symbol, no default] ! ;;; If defined: this should be the name of a ;;; function that is called when a record has ;;; been modified. It is called after the fields ;;; are parsed. It can be used to register ;;; modification dates, for example. - ;;; Instead of the name of the function, it may - ;;; be the function itself. ;;; ;;; forms-use-text-properties [bool, see text for default] --- 114,139 ---- ;;; back to the separator character. ;;; ! ;;; forms-forms-scroll [bool, default nil] ;;; Non-nil means: rebind locally the commands that ;;; perform `scroll-up' or `scroll-down' to use ;;; `forms-next-field' resp. `forms-prev-field'. ;;; ! ;;; forms-forms-jump [bool, default nil] ;;; Non-nil means: rebind locally the commands that ;;; perform `beginning-of-buffer' or `end-of-buffer' ;;; to perform `forms-first-field' resp. `forms-last-field'. ;;; ! ;;; forms-new-record-filter [symbol, default nil] ! ;;; If not nil: this should be the name of a ;;; function that is called when a new ;;; record is created. It can be used to fill in ;;; the new record with default fields, for example. ;;; ! ;;; forms-modified-record-filter [symbol, default nil] ! ;;; If not nil: this should be the name of a ;;; function that is called when a record has ;;; been modified. It is called after the fields ;;; are parsed. It can be used to register ;;; modification dates, for example. ;;; ;;; forms-use-text-properties [bool, see text for default] *************** *** 207,236 **** ;;; needed. ;;; ! ;;; Commands and keymaps: ;;; ! ;;; A local keymap `forms-mode-map' is used in the forms buffer. ! ;;; If the forms is in view mode, this keymap is used so all forms mode ! ;;; functions are accessible. ! ;;; If the forms is in edit mode, this map can be accessed with C-c prefix. ! ;;; ! ;;; Default bindings: ! ;;; ! ;;; \C-c forms-mode-map ! ;;; TAB forms-next-field ! ;;; SPC forms-next-record ! ;;; < forms-first-record ! ;;; > forms-last-record ! ;;; ? describe-mode ! ;;; d forms-delete-record ! ;;; e forms-edit-mode ! ;;; i forms-insert-record ! ;;; j forms-jump-record ! ;;; n forms-next-record ! ;;; p forms-prev-record ! ;;; q forms-exit ! ;;; s forms-search ! ;;; v forms-view-mode ! ;;; x forms-exit-no-save ! ;;; DEL forms-prev-record ;;; ;;; For convenience, TAB is always bound to `forms-next-field', so you --- 203,249 ---- ;;; needed. ;;; ! ;;; The forms buffer can be in on eof two modes: edit mode or view ! ;;; mode. View mode is a read-only mode, you cannot modify the ! ;;; contents of the buffer. ;;; ! ;;; Edit mode commands: ! ;;; ! ;;; TAB forms-next-field ! ;;; \C-c TAB forms-next-field ! ;;; \C-c < forms-first-record ! ;;; \C-c > forms-last-record ! ;;; \C-c ? describe-mode ! ;;; \C-c \C-k forms-delete-record ! ;;; \C-c \C-q forms-toggle-read-only ! ;;; \C-c \C-o forms-insert-record ! ;;; \C-c \C-l forms-jump-record ! ;;; \C-c \C-n forms-next-record ! ;;; \C-c \C-p forms-prev-record ! ;;; \C-c \C-s forms-search ! ;;; \C-c \C-x forms-exit ! ;;; ! ;;; Read-only mode commands: ! ;;; ! ;;; SPC forms-next-record ! ;;; DEL forms-prev-record ! ;;; ? describe-mode ! ;;; \C-q forms-toggle-read-only ! ;;; l forms-jump-record ! ;;; n forms-next-record ! ;;; p forms-prev-record ! ;;; s forms-search ! ;;; x forms-exit ! ;;; ! ;;; Of course, it is also possible to use the \C-c prefix to obtain the ! ;;; same command keys as in edit mode. ! ;;; ! ;;; The following bindings are available, independent of the mode: ! ;;; ! ;;; [next] forms-next-record ! ;;; [prior] forms-prev-record ! ;;; [begin] forms-first-record ! ;;; [end] forms-last-record ! ;;; [S-TAB] forms-prev-field ! ;;; [backtab] forms-prev-field ;;; ;;; For convenience, TAB is always bound to `forms-next-field', so you *************** *** 239,243 **** ;;; As mentioned above (see `forms-forms-scroll' and `forms-forms-jump') ;;; the bindings of standard functions `scroll-up', `scroll-down', ! ;;; `beginning-of-buffer' and `end-of-buffer' are locally replaced with ;;; forms mode functions next/prev record and first/last ;;; record. --- 252,256 ---- ;;; As mentioned above (see `forms-forms-scroll' and `forms-forms-jump') ;;; the bindings of standard functions `scroll-up', `scroll-down', ! ;;; `beginning-of-buffer' and `end-of-buffer' can be locally replaced with ;;; forms mode functions next/prev record and first/last ;;; record. *************** *** 254,259 **** (provide 'forms-mode) ;;; for compatibility ! (defconst forms-version "2.0" ! "Version of forms-mode implementation.") (defvar forms-mode-hooks nil --- 267,274 ---- (provide 'forms-mode) ;;; for compatibility ! (defconst forms-version (substring "$Revision: 2.3 $" 11 -2) ! "The version number of forms-mode (as string). The complete RCS id is: ! ! $Id: forms.el,v 2.3 1993/10/21 00:43:51 rms Exp $") (defvar forms-mode-hooks nil *************** *** 283,291 **** "If not nil: use this character to separate multi-line fields (default C-k).") ! (defvar forms-forms-scroll t "*Non-nil means replace scroll-up/down commands in Forms mode. The replacement commands performs forms-next/prev-record.") ! (defvar forms-forms-jump t "*Non-nil means redefine beginning/end-of-buffer in Forms mode. The replacement commands performs forms-first/last-record.") --- 298,306 ---- "If not nil: use this character to separate multi-line fields (default C-k).") ! (defvar forms-forms-scroll nil "*Non-nil means replace scroll-up/down commands in Forms mode. The replacement commands performs forms-next/prev-record.") ! (defvar forms-forms-jump nil "*Non-nil means redefine beginning/end-of-buffer in Forms mode. The replacement commands performs forms-first/last-record.") *************** *** 323,328 **** "Number of the record currently on the screen.") ! (defvar forms-mode-map nil ; yes - this one is global "Keymap for form buffer.") (defvar forms--markers nil --- 338,347 ---- "Number of the record currently on the screen.") ! (defvar forms-mode-map nil "Keymap for form buffer.") + (defvar forms-mode-ro-map nil + "Keymap for form buffer in view mode.") + (defvar forms-mode-edit-map nil + "Keymap for form buffer in edit mode.") (defvar forms--markers nil *************** *** 348,357 **** (make-variable-buffer-local 'forms--mode-setup) - (defvar forms--new-record-filter nil - "Set if a new record filter has been defined.") - - (defvar forms--modified-record-filter nil - "Set if a modified record filter has been defined.") - (defvar forms--dynamic-text nil "Array that holds dynamic texts to insert between fields.") --- 367,370 ---- *************** *** 370,377 **** "Major mode to visit files in a field-structured manner using a form. ! Commands (prefix with C-c if not in read-only mode): ! \\{forms-mode-map}" ! ! (interactive) ; no - 'primary' is not prefix arg ;; This is not a simple major mode, as usual. Therefore, forms-mode --- 383,402 ---- "Major mode to visit files in a field-structured manner using a form. ! Commands: Equivalent keys in read-only mode: ! TAB forms-next-field TAB ! \\C-c TAB forms-next-field ! \\C-c < forms-first-record < ! \\C-c > forms-last-record > ! \\C-c ? describe-mode ? ! \\C-c \\C-k forms-delete-record ! \\C-c \\C-q forms-toggle-read-only q ! \\C-c \\C-o forms-insert-record ! \\C-c \\C-l forms-jump-record l ! \\C-c \\C-n forms-next-record n ! \\C-c \\C-p forms-prev-record p ! \\C-c \\C-s forms-search s ! \\C-c \\C-x forms-exit x ! " ! (interactive) ;; This is not a simple major mode, as usual. Therefore, forms-mode *************** *** 404,413 **** (make-local-variable 'forms-forms-jump) (make-local-variable 'forms-use-text-properties) ! (make-local-variable 'forms--new-record-filter) ! (make-local-variable 'forms--modified-record-filter) ;; Make sure no filters exist. ! (fmakunbound 'forms-new-record-filter) ! (fmakunbound 'forms-modified-record-filter) ;; If running Emacs 19 under X, setup faces to show read-only and --- 429,438 ---- (make-local-variable 'forms-forms-jump) (make-local-variable 'forms-use-text-properties) ! (make-local-variable 'forms-new-record-filter) ! (make-local-variable 'forms-modified-record-filter) ;; Make sure no filters exist. ! (setq forms-new-record-filter nil) ! (setq forms-modified-record-filter nil) ;; If running Emacs 19 under X, setup faces to show read-only and *************** *** 424,440 **** ;; check if the mandatory variables make sense. (or forms-file ! (error "'forms-file' has not been set")) (or forms-number-of-fields ! (error "'forms-number-of-fields' has not been set")) ! (or (> forms-number-of-fields 0) ! (error "'forms-number-of-fields' must be > 0") ! (or (stringp forms-field-sep)) ! (error "'forms-field-sep' is not a string")) (if forms-multi-line (if (and (stringp forms-multi-line) (eq (length forms-multi-line) 1)) (if (string= forms-multi-line forms-field-sep) ! (error "'forms-multi-line' is equal to 'forms-field-sep'")) ! (error "'forms-multi-line' must be nil or a one-character string"))) (or (fboundp 'set-text-properties) (setq forms-use-text-properties nil)) --- 449,472 ---- ;; check if the mandatory variables make sense. (or forms-file ! (error (concat "Forms control file error: " ! "'forms-file' has not been set"))) (or forms-number-of-fields ! (error (concat "Forms control file error: " ! "'forms-number-of-fields' has not been set"))) ! (or (and (numberp forms-number-of-fields) ! (> forms-number-of-fields 0)) ! (error (concat "Forms control file error: " ! "'forms-number-of-fields' must be a number > 0"))) ! (or (stringp forms-field-sep) ! (error (concat "Forms control file error: " ! "'forms-field-sep' is not a string"))) (if forms-multi-line (if (and (stringp forms-multi-line) (eq (length forms-multi-line) 1)) (if (string= forms-multi-line forms-field-sep) ! (error (concat "Forms control file error: " ! "'forms-multi-line' is equal to 'forms-field-sep'"))) ! (error (concat "Forms control file error: " ! "'forms-multi-line' must be nil or a one-character string")))) (or (fboundp 'set-text-properties) (setq forms-use-text-properties nil)) *************** *** 457,476 **** ;; Check if record filters are defined. ! (setq forms--new-record-filter ! (cond ! ((fboundp 'forms-new-record-filter) ! (symbol-function 'forms-new-record-filter)) ! ((and (boundp 'forms-new-record-filter) ! (fboundp forms-new-record-filter)) ! forms-new-record-filter))) ! (fmakunbound 'forms-new-record-filter) ! (setq forms--modified-record-filter ! (cond ! ((fboundp 'forms-modified-record-filter) ! (symbol-function 'forms-modified-record-filter)) ! ((and (boundp 'forms-modified-record-filter) ! (fboundp forms-modified-record-filter)) ! forms-modified-record-filter))) ! (fmakunbound 'forms-modified-record-filter) ;; The filters acces the contents of the forms using `forms-fields'. --- 489,501 ---- ;; Check if record filters are defined. ! (if (and forms-new-record-filter ! (not (fboundp forms-new-record-filter))) ! (error (concat "Forms control file error: " ! "'forms-new-record-filter' is not a function"))) ! ! (if (and forms-modified-record-filter ! (not (fboundp forms-modified-record-filter))) ! (error (concat "Forms control file error: " ! "'forms-modified-record-filter' is not a function"))) ;; The filters acces the contents of the forms using `forms-fields'. *************** *** 510,522 **** (make-local-variable 'forms--search-regexp) ! ;; A bug in the current Emacs release prevents a keymap ! ;; which is buffer-local from being used by 'describe-mode'. ! ;; Hence we'll leave it global. ! ;;(make-local-variable 'forms-mode-map) (if forms-mode-map ; already defined nil ;;(message "forms: building keymap...") ! (setq forms-mode-map (make-keymap)) ! (forms--mode-commands forms-mode-map) ;;(message "forms: building keymap... done.") ) --- 535,546 ---- (make-local-variable 'forms--search-regexp) ! ; The keymaps are global, so multiple forms mode buffers can share them. ! ;(make-local-variable 'forms-mode-map) ! ;(make-local-variable 'forms-mode-ro-map) ! ;(make-local-variable 'forms-mode-edit-map) (if forms-mode-map ; already defined nil ;;(message "forms: building keymap...") ! (forms--mode-commands) ;;(message "forms: building keymap... done.") ) *************** *** 545,554 **** (setq major-mode 'forms-mode) (setq mode-name "Forms") ! (make-local-variable 'minor-mode-alist) ; needed? ! ;;(message "forms: proceeding setup (minor mode)...") ! (forms--set-minor-mode) ;;(message "forms: proceeding setup (keymaps)...") (forms--set-keymaps) - (make-local-variable 'local-write-file-hooks) ;;(message "forms: proceeding setup (commands)...") (forms--change-commands) --- 569,581 ---- (setq major-mode 'forms-mode) (setq mode-name "Forms") ! ! ;; Since we aren't really implementing a minor mode, we hack the modeline ! ;; directly to get the text " View " into forms-read-only form buffers. For ! ;; that reason, this variable must be buffer only. ! (make-local-variable 'minor-mode-alist) ! (setq minor-mode-alist (list (list 'forms-read-only " View"))) ! ;;(message "forms: proceeding setup (keymaps)...") (forms--set-keymaps) ;;(message "forms: proceeding setup (commands)...") (forms--change-commands) *************** *** 557,564 **** (set-buffer-modified-p nil) - ;; We have our own revert function - use it - (make-local-variable 'revert-buffer-function) - (setq revert-buffer-function 'forms-revert-buffer) - ;; setup the first (or current) record to show (if (< forms--current-record 1) --- 584,587 ---- *************** *** 591,598 **** ;; Verify that `forms-format-list' is not nil. (or forms-format-list ! (error "'forms-format-list' has not been set")) ;; It must be a list. (or (listp forms-format-list) ! (error "'forms-format-list' is not a list")) ;; Assume every field is painted once. --- 614,623 ---- ;; Verify that `forms-format-list' is not nil. (or forms-format-list ! (error (concat "Forms control file error: " ! "'forms-format-list' has not been set"))) ;; It must be a list. (or (listp forms-format-list) ! (error (concat "Forms control file error: " ! "'forms-format-list' is not a list"))) ;; Assume every field is painted once. *************** *** 634,640 **** (if (or (<= el 0) (> el forms-number-of-fields)) ! (error ! "Forms error: field number %d out of range 1..%d" ! el forms-number-of-fields)) ;; Store forms order. --- 659,665 ---- (if (or (<= el 0) (> el forms-number-of-fields)) ! (error (concat "Forms format error: " ! "field number %d out of range 1..%d") ! el forms-number-of-fields)) ;; Store forms order. *************** *** 644,653 **** (setq field-num (1+ field-num)) - ;; Make sure the field is preceded by something. (if prev-item (setq forms-format-list ! (append forms-format-list (list prev-item) nil)) ! (setq forms-format-list ! (append forms-format-list (list "\n") nil))) (setq prev-item el)) --- 669,675 ---- (setq field-num (1+ field-num)) (if prev-item (setq forms-format-list ! (append forms-format-list (list prev-item) nil))) (setq prev-item el)) *************** *** 657,663 **** ;; Validate. (or (fboundp (car-safe el)) ! (error ! "Forms error: not a function: %s" ! (prin1-to-string (car-safe el)))) ;; Shift. --- 679,685 ---- ;; Validate. (or (fboundp (car-safe el)) ! (error (concat "Forms format error: " ! "not a function " ! (prin1-to-string (car-safe el))))) ;; Shift. *************** *** 669,674 **** ;; else (t ! (error "Forms error: invalid element %s" ! (prin1-to-string el)))) ;; Advance to next element of the list. --- 691,697 ---- ;; else (t ! (error (concat "Forms format error: " ! "invalid element " ! (prin1-to-string el))))) ;; Advance to next element of the list. *************** *** 681,685 **** (append forms-format-list (list prev-item) nil)) ;; Append a newline if the last item is a field. ! ;; This prevents pasrsing problems. ;; Also it makes it possible to insert an empty last field. (if (numberp prev-item) --- 704,708 ---- (append forms-format-list (list prev-item) nil)) ;; Append a newline if the last item is a field. ! ;; This prevents parsing problems. ;; Also it makes it possible to insert an empty last field. (if (numberp prev-item) *************** *** 692,763 **** ;; Special treatment for read-only segments. ;; ! ;; If text is inserted after a read-only segment, it inherits the ;; read-only properties. This is not what we want. ! ;; The modification hook of the last character of the read-only segment ! ;; temporarily switches its properties to read-write, so the new ;; text gets the right properties. ! ;; The post-command-hook is used to restore the original properties. ! ;; ! ;; A character category `forms-electric' is used for the characters ! ;; that get the modification hook set. Using a category, it is ! ;; possible to globally enable/disable the modification hook. This is ! ;; necessary, since modifying a hook or setting text properties are ! ;; considered modifications and would trigger the hooks while building ! ;; the forms. ! (defvar forms--ro-modification-start nil "Record start of modification command.") ! (defvar forms--ro-properties nil "Original properties of the character being overridden.") ! (defun forms--romh (begin end) ! "`modification-hook' function for forms-electric characters." ! ! ;; Note start location. ! (or forms--ro-modification-start ! (setq forms--ro-modification-start (point))) ! ! ;; Fetch current properties. ! (setq forms--ro-properties ! (text-properties-at (1- forms--ro-modification-start))) ! ! ;; Disarm modification hook. ! (setplist 'forms--electric nil) ! ! ;; Replace them. ! (let ((inhibit-read-only t)) ! (set-text-properties ! (1- forms--ro-modification-start) forms--ro-modification-start ! (list 'face forms--rw-face))) ! ;; Re-arm electric. ! (setplist 'forms--electric '(modification-hooks (forms--romh))) ! ;; Enable `post-command-hook' to restore the properties. ! (setq post-command-hook ! (append (list 'forms--romh-post-command-hook) post-command-hook))) ! (defun forms--romh-post-command-hook () ! "`post-command-hook' function for forms--electric characters." ;; Disable `post-command-hook'. (setq post-command-hook ! (delq 'forms--romh-post-command-hook post-command-hook)) - ;; Disarm modification hook. - (setplist 'forms--electric nil) - ;; Restore properties. ! (if forms--ro-modification-start (let ((inhibit-read-only t)) (set-text-properties ! (1- forms--ro-modification-start) forms--ro-modification-start ! forms--ro-properties))) ! ! ;; Re-arm electric. ! (setplist 'forms--electric '(modification-hooks (forms--romh))) ;; Cleanup. ! (setq forms--ro-modification-start nil)) (defvar forms--marker) --- 715,778 ---- ;; Special treatment for read-only segments. ;; ! ;; If text is inserted between two read-only segments, it inherits the ;; read-only properties. This is not what we want. ! ;; To solve this, read-only segments get the `insert-in-front-hooks' ! ;; property set with a function that temporarily switches the properties ! ;; of the first character of the segment to read-write, so the new ;; text gets the right properties. ! ;; The `post-command-hook' is used to restore the original properties. ! (defvar forms--iif-start nil "Record start of modification command.") ! (defvar forms--iif-properties nil "Original properties of the character being overridden.") ! (defun forms--iif-hook (begin end) ! "`insert-in-front-hooks' function for read-only segments." ! ;; Note start location. By making it a marker that points one ! ;; character beyond the actual location, it is guaranteed to move ! ;; correctly if text is inserted. ! (or forms--iif-start ! (setq forms--iif-start (copy-marker (1+ (point))))) ! ! ;; Check if there is special treatment required. ! (if (or (<= forms--iif-start 2) ! (get-text-property (- forms--iif-start 2) ! 'read-only)) ! (progn ! ;; Fetch current properties. ! (setq forms--iif-properties ! (text-properties-at (1- forms--iif-start))) ! ! ;; Replace them. ! (let ((inhibit-read-only t)) ! (set-text-properties ! (1- forms--iif-start) forms--iif-start ! (list 'face forms--rw-face 'front-sticky '(face)))) ! ! ;; Enable `post-command-hook' to restore the properties. ! (setq post-command-hook ! (append (list 'forms--iif-post-command-hook) post-command-hook))) ! ;; No action needed. Clear marker. ! (setq forms--iif-start nil))) ! (defun forms--iif-post-command-hook () ! "`post-command-hook' function for read-only segments." ;; Disable `post-command-hook'. (setq post-command-hook ! (delq 'forms--iif-hook-post-command-hook post-command-hook)) ;; Restore properties. ! (if forms--iif-start (let ((inhibit-read-only t)) (set-text-properties ! (1- forms--iif-start) forms--iif-start ! forms--iif-properties))) ;; Cleanup. ! (setq forms--iif-start nil)) (defvar forms--marker) *************** *** 779,789 **** (` (lambda (arg) (let ((inhibit-read-only t)) - (setplist 'forms--electric nil) (,@ (apply 'append (mapcar 'forms--make-format-elt-using-text-properties ! forms-format-list)))) ! (setplist 'forms--electric ! '(modification-hooks (forms--romh))) ! (setq forms--ro-modification-start nil))) (` (lambda (arg) (,@ (apply 'append --- 794,809 ---- (` (lambda (arg) (let ((inhibit-read-only t)) (,@ (apply 'append (mapcar 'forms--make-format-elt-using-text-properties ! forms-format-list))) ! ;; Prevent insertion before the first text. ! (,@ (if (numberp (car forms-format-list)) ! nil ! '((add-text-properties (point-min) (1+ (point-min)) ! '(front-sticky (read-only)))))) ! ;; Prevent insertion after the last text. ! (remove-text-properties (1- (point)) (point) ! '(rear-nonsticky))) ! (setq forms--iif-start nil))) (` (lambda (arg) (,@ (apply 'append *************** *** 804,816 **** ;; (lambda (arg) ;; (let ((inhibit-read-only t)) - ;; (setplist 'forms--electric nil) ;; ! ;; ;; a string, e.g. "text: " ;; (set-text-properties ;; (point) ;; (progn (insert "text: ") (point)) ! ;; (list 'face forms--ro-face 'read-only 1)) ;; ! ;; ;; a field, e.g. 6 ;; (let ((here (point))) ;; (aset forms--markers 0 (point-marker)) --- 824,838 ---- ;; (lambda (arg) ;; (let ((inhibit-read-only t)) ;; ! ;; ;; A string, e.g. "text: ". ;; (set-text-properties ;; (point) ;; (progn (insert "text: ") (point)) ! ;; (list 'face forms--ro-face ! ;; 'read-only 1 ! ;; 'insert-in-front-hooks 'forms--iif-hook ! ;; 'rear-nonsticky '(read-only face insert-in-front-hooks))) ;; ! ;; ;; A field, e.g. 6. ;; (let ((here (point))) ;; (aset forms--markers 0 (point-marker)) *************** *** 819,836 **** ;; (set-text-properties ;; here (point) ! ;; (list 'face forms--rw-face))) ! ;; (if (get-text-property (1- here) 'read-only) ! ;; (put-text-property ! ;; (1- here) here ! ;; 'category 'forms--electric))) ;; ! ;; ;; another string, e.g. "\nmore text: " ;; (set-text-properties ;; (point) ;; (progn (insert "\nmore text: ") (point)) ;; (list 'face forms--ro-face ! ;; 'read-only 2)) ;; ! ;; ;; a function, e.g. (tocol 40) ;; (set-text-properties ;; (point) --- 841,857 ---- ;; (set-text-properties ;; here (point) ! ;; (list 'face forms--rw-face ! ;; 'front-sticky '(face)))) ;; ! ;; ;; Another string, e.g. "\nmore text: ". ;; (set-text-properties ;; (point) ;; (progn (insert "\nmore text: ") (point)) ;; (list 'face forms--ro-face ! ;; 'read-only 2 ! ;; 'insert-in-front-hooks 'forms--iif-hook ! ;; 'rear-nonsticky '(read-only face insert-in-front-hooks))) ;; ! ;; ;; A function, e.g. (tocol 40). ;; (set-text-properties ;; (point) *************** *** 839,848 **** ;; (point)) ;; (list 'face forms--ro-face ! ;; 'read-only 2)) ;; ;; ;; wrap up ! ;; (setplist 'forms--electric ! ;; '(modification-hooks (forms--romh))) ! ;; (setq forms--ro-modification-start nil) ;; )) --- 860,876 ---- ;; (point)) ;; (list 'face forms--ro-face ! ;; 'read-only 2 ! ;; 'insert-in-front-hooks 'forms--iif-hook ! ;; 'rear-nonsticky '(read-only face insert-in-front-hooks))) ! ;; ! ;; ;; Prevent insertion before the first text. ! ;; (add-text-properties (point-min) (1+ (point-min)) ! ;; '(front-sticky (read-only)))))) ! ;; ;; Prevent insertion after the last text. ! ;; (remove-text-properties (1- (point)) (point) ! ;; '(rear-nonsticky))) ;; ;; ;; wrap up ! ;; (setq forms--iif-start nil) ;; )) *************** *** 856,860 **** (point)) (list 'face forms--ro-face ; read-only appearance ! 'read-only (,@ (list (1+ forms--marker)))))))) ((numberp el) (` ((let ((here (point))) --- 884,891 ---- (point)) (list 'face forms--ro-face ; read-only appearance ! 'read-only (,@ (list (1+ forms--marker))) ! 'insert-in-front-hooks '(forms--iif-hook) ! 'rear-nonsticky '(face read-only insert-in-front-hooks)))))) ! ((numberp el) (` ((let ((here (point))) *************** *** 867,875 **** (set-text-properties here (point) ! (list 'face forms--rw-face))) ! (if (get-text-property (1- here) 'read-only) ! (put-text-property ! (1- here) here ! 'category 'forms--electric)))))) ((listp el) --- 898,903 ---- (set-text-properties here (point) ! (list 'face forms--rw-face ! 'front-sticky '(face)))))))) ((listp el) *************** *** 883,888 **** (point)) (list 'face forms--ro-face ! 'read-only ! (,@ (list (1+ forms--marker)))))))) ;; end of cond --- 911,917 ---- (point)) (list 'face forms--ro-face ! 'read-only (,@ (list (1+ forms--marker))) ! 'insert-in-front-hooks '(forms--iif-hook) ! 'rear-nonsticky '(read-only face insert-in-front-hooks)))))) ;; end of cond *************** *** 1047,1089 **** )) - (defun forms--set-minor-mode () - (setq minor-mode-alist - (if forms-read-only - " View" - nil))) - (defun forms--set-keymaps () "Set the keymaps used in this mode." ! (if forms-read-only ! (use-local-map forms-mode-map) ! (use-local-map (make-sparse-keymap)) ! (define-key (current-local-map) "\C-c" forms-mode-map) ! (define-key (current-local-map) "\t" 'forms-next-field))) ! ! (defun forms--mode-commands (map) ! "Fill map with all Forms mode commands." ! ! (define-key map "\t" 'forms-next-field) ! (define-key map " " 'forms-next-record) ! (define-key map "d" 'forms-delete-record) ! (define-key map "e" 'forms-edit-mode) ! (define-key map "i" 'forms-insert-record) ! (define-key map "j" 'forms-jump-record) ! (define-key map "n" 'forms-next-record) ! (define-key map "p" 'forms-prev-record) ! (define-key map "q" 'forms-exit) ! (define-key map "s" 'forms-search) ! (define-key map "v" 'forms-view-mode) ! (define-key map "x" 'forms-exit-no-save) ! (define-key map "<" 'forms-first-record) ! (define-key map ">" 'forms-last-record) ! (define-key map "?" 'describe-mode) ! (define-key map "\177" 'forms-prev-record) ! ;(define-key map "\C-c" map) ! ;(define-key map "\e" 'ESC-prefix) ! ;(define-key map "\C-x" ctl-x-map) ! ;(define-key map "\C-u" 'universal-argument) ! ;(define-key map "\C-h" help-map) ) --- 1076,1138 ---- )) (defun forms--set-keymaps () "Set the keymaps used in this mode." ! (use-local-map (if forms-read-only ! forms-mode-ro-map ! forms-mode-edit-map))) ! ! (defun forms--mode-commands () ! "Fill the Forms mode keymaps." ! ! ;; `forms-mode-map' is always accessible via \C-c prefix. ! (setq forms-mode-map (make-keymap)) ! (define-key forms-mode-map "\t" 'forms-next-field) ! (define-key forms-mode-map "\C-k" 'forms-delete-record) ! (define-key forms-mode-map "\C-q" 'forms-toggle-read-only) ! (define-key forms-mode-map "\C-o" 'forms-insert-record) ! (define-key forms-mode-map "\C-l" 'forms-jump-record) ! (define-key forms-mode-map "\C-n" 'forms-next-record) ! (define-key forms-mode-map "\C-p" 'forms-prev-record) ! (define-key forms-mode-map "\C-s" 'forms-search) ! (define-key forms-mode-map "\C-x" 'forms-exit) ! (define-key forms-mode-map "<" 'forms-first-record) ! (define-key forms-mode-map ">" 'forms-last-record) ! (define-key forms-mode-map "?" 'describe-mode) ! (define-key forms-mode-map "\C-?" 'forms-prev-record) ! ! ;; `forms-mode-ro-map' replaces the local map when in read-only mode. ! (setq forms-mode-ro-map (make-keymap)) ! (suppress-keymap forms-mode-ro-map) ! (define-key forms-mode-ro-map "\C-c" forms-mode-map) ! (define-key forms-mode-ro-map "\t" 'forms-next-field) ! (define-key forms-mode-ro-map "q" 'forms-toggle-read-only) ! (define-key forms-mode-ro-map "l" 'forms-jump-record) ! (define-key forms-mode-ro-map "n" 'forms-next-record) ! (define-key forms-mode-ro-map "p" 'forms-prev-record) ! (define-key forms-mode-ro-map "s" 'forms-search) ! (define-key forms-mode-ro-map "x" 'forms-exit) ! (define-key forms-mode-ro-map "<" 'forms-first-record) ! (define-key forms-mode-ro-map ">" 'forms-last-record) ! (define-key forms-mode-ro-map "?" 'describe-mode) ! (define-key forms-mode-ro-map " " 'forms-next-record) ! (forms--mode-commands1 forms-mode-ro-map) ! ! ;; This is the normal, local map. ! (setq forms-mode-edit-map (make-keymap)) ! (define-key forms-mode-edit-map "\t" 'forms-next-field) ! (define-key forms-mode-edit-map "\C-c" forms-mode-map) ! (forms--mode-commands1 forms-mode-edit-map) ! ) ! ! (defun forms--mode-commands1 (map) ! "Helper routine to define keys." ! (define-key map [TAB] 'forms-next-field) ! (define-key map [S-tab] 'forms-prev-field) ! (define-key map [next] 'forms-next-record) ! (define-key map [prior] 'forms-prev-record) ! (define-key map [begin] 'forms-first-record) ! (define-key map [last] 'forms-last-record) ! (define-key map [backtab] 'forms-prev-field) ) *************** *** 1116,1119 **** --- 1165,1169 ---- ;; ;; save-buffer -> forms--save-buffer + (make-local-variable 'local-write-file-hooks) (add-hook 'local-write-file-hooks (function *************** *** 1123,1142 **** (set-buffer forms--file-buffer) (save-buffer)) ! t)))) (defun forms--help () "Initial help for Forms mode." ;; We should use ! ;;(message (substitute-command-keys (concat ! ;;"\\[forms-next-record]:next" ! ;;" \\[forms-prev-record]:prev" ! ;;" \\[forms-first-record]:first" ! ;;" \\[forms-last-record]:last" ! ;;" \\[describe-mode]:help" ! ;;" \\[forms-exit]:exit"))) ! ;; but it's too slow .... ! (if forms-read-only ! (message "SPC:next DEL:prev <:first >:last ?:help q:exit") ! (message "C-c n:next C-c p:prev C-c <:first C-c >:last C-c ?:help C-c q:exit"))) (defun forms--trans (subj arg rep) --- 1173,1197 ---- (set-buffer forms--file-buffer) (save-buffer)) ! t))) ! ;; We have our own revert function - use it ! (make-local-variable 'revert-buffer-function) ! (setq revert-buffer-function 'forms-revert-buffer) ! ! t) (defun forms--help () "Initial help for Forms mode." ;; We should use ! (message (substitute-command-keys (concat ! "\\[forms-next-record]:next" ! " \\[forms-prev-record]:prev" ! " \\[forms-first-record]:first" ! " \\[forms-last-record]:last" ! " \\[describe-mode]:help")))) ! ; but it's too slow .... ! ; (if forms-read-only ! ; (message "SPC:next DEL:prev <:first >:last ?:help q:exit") ! ; (message "C-c n:next C-c p:prev C-c <:first C-c >:last C-c ?:help C-c q:exit")) ! ; ) (defun forms--trans (subj arg rep) *************** *** 1208,1212 **** (if forms-use-text-properties (let ((inhibit-read-only t)) - (setplist 'forms--electric nil) (set-text-properties (point-min) (point-max) nil))) (erase-buffer) --- 1263,1266 ---- *************** *** 1216,1220 **** nil (beep) ! (message "Record has %d fields instead of %d." (length forms--the-record-list) forms-number-of-fields) (if (< (length forms--the-record-list) forms-number-of-fields) --- 1270,1274 ---- nil (beep) ! (message "Warning: this record has %d fields instead of %d" (length forms--the-record-list) forms-number-of-fields) (if (< (length forms--the-record-list) forms-number-of-fields) *************** *** 1255,1263 **** (funcall forms--parser)) ! (if forms--modified-record-filter ;; As a service to the user, we add a zeroth element so she ;; can use the same indices as in the forms definition. (let ((the-fields (vconcat [nil] forms--recordv))) ! (setq the-fields (funcall forms--modified-record-filter the-fields)) (cdr (append the-fields nil))) --- 1309,1317 ---- (funcall forms--parser)) ! (if forms-modified-record-filter ;; As a service to the user, we add a zeroth element so she ;; can use the same indices as in the forms definition. (let ((the-fields (vconcat [nil] forms--recordv))) ! (setq the-fields (funcall forms-modified-record-filter the-fields)) (cdr (append the-fields nil))) *************** *** 1292,1300 **** (save-excursion (set-buffer forms--file-buffer) ! ;; Insert something before kill-line is called. See kill-line ! ;; doc. Bugfix provided by Ignatios Souvatzis. ! (insert "*") ! (beginning-of-line) ! (kill-line nil) (insert the-record) (beginning-of-line)))))) --- 1346,1353 ---- (save-excursion (set-buffer forms--file-buffer) ! ;; Use delete-region instead of kill-region, to avoid ! ;; adding junk to the kill-ring. ! (delete-region (save-excursion (beginning-of-line) (point)) ! (save-excursion (end-of-line) (point))) (insert the-record) (beginning-of-line)))))) *************** *** 1392,1396 **** (setq forms--current-record cur) (beep) ! (message "Stuck at record %d." cur)))))) (defun forms-first-record () --- 1445,1449 ---- (setq forms--current-record cur) (beep) ! (message "Stuck at record %d" cur)))))) (defun forms-first-record () *************** *** 1412,1443 **** (beep) (setq forms--total-records numrec) ! (message "Number of records reset to %d." forms--total-records))) (forms-jump-record forms--total-records)) ;;; Other commands ! (defun forms-view-mode () ! "Visit buffer read-only." ! (interactive) ! (if forms-read-only ! nil ! (forms--checkmod) ; sync ! (setq forms-read-only t) ! (forms-mode))) ! (defun forms-edit-mode () ! "Make form suitable for editing, if possible." ! (interactive) ! (let ((ro forms-read-only)) ! (if (save-excursion ! (set-buffer forms--file-buffer) ! buffer-read-only) ! (progn ! (setq forms-read-only t) ! (message "No write access to \"%s\"" forms-file) ! (beep)) ! (setq forms-read-only nil)) ! (if (equal ro forms-read-only) nil (forms-mode)))) --- 1465,1505 ---- (beep) (setq forms--total-records numrec) ! (message "Warning: number of records changed to %d" forms--total-records))) (forms-jump-record forms--total-records)) ;;; Other commands ! (defun forms-toggle-read-only (arg) ! "Toggles read-only mode of a forms mode buffer. ! With an argument, enables read-only mode if the argument is positive. ! Otherwise enables edit mode if the visited file is writeable." ! (interactive "P") ! ! (if (if arg ! ;; Negative arg means switch it off. ! (<= (prefix-numeric-value arg) 0) ! ;; No arg means toggle. ! forms-read-only) ! ! ;; Enable edit mode, if possible. ! (let ((ro forms-read-only)) ! (if (save-excursion ! (set-buffer forms--file-buffer) ! buffer-read-only) ! (progn ! (setq forms-read-only t) ! (message "No write access to \"%s\"" forms-file) ! (beep)) ! (setq forms-read-only nil)) ! (if (equal ro forms-read-only) ! nil ! (forms-mode))) ! ! ;; Enable view mode. ! (if forms-read-only nil + (forms--checkmod) ; sync + (setq forms-read-only t) (forms-mode)))) *************** *** 1453,1472 **** "Create a new record before the current one. With ARG: store the record after the current one. ! If a function `forms-new-record-filter' is defined, or ! `forms-new-record-filter' contains the name of a function, it is called to fill (some of) the fields with default values." - ; The above doc is not true, but for documentary purposes only (interactive "P") (let ((ln (if arg (1+ forms--current-record) forms--current-record)) the-list the-record) (forms--checkmod) ! (if forms--new-record-filter ;; As a service to the user, we add a zeroth element so she ;; can use the same indices as in the forms definition. (let ((the-fields (make-vector (1+ forms-number-of-fields) ""))) ! (setq the-fields (funcall forms--new-record-filter the-fields)) (setq the-list (cdr (append the-fields nil)))) (setq the-list (make-list forms-number-of-fields ""))) --- 1515,1535 ---- "Create a new record before the current one. With ARG: store the record after the current one. ! If `forms-new-record-filter' contains the name of a function, it is called to fill (some of) the fields with default values." (interactive "P") + (if forms-read-only + (error "")) + (let ((ln (if arg (1+ forms--current-record) forms--current-record)) the-list the-record) (forms--checkmod) ! (if forms-new-record-filter ;; As a service to the user, we add a zeroth element so she ;; can use the same indices as in the forms definition. (let ((the-fields (make-vector (1+ forms-number-of-fields) ""))) ! (setq the-fields (funcall forms-new-record-filter the-fields)) (setq the-list (cdr (append the-fields nil)))) (setq the-list (make-list forms-number-of-fields ""))) *************** *** 1493,1496 **** --- 1556,1563 ---- "Deletes a record. With a prefix argument: don't ask." (interactive "P") + + (if forms-read-only + (error "")) + (forms--checkmod) (if (or arg *************** *** 1500,1504 **** (set-buffer forms--file-buffer) (goto-line ln) ! (kill-line 1)) (setq forms--total-records (1- forms--total-records)) (if (> forms--current-record forms--total-records) --- 1567,1574 ---- (set-buffer forms--file-buffer) (goto-line ln) ! ;; Use delete-region instead of kill-region, to avoid ! ;; adding junk to the kill-ring. ! (delete-region (save-excursion (beginning-of-line) (point)) ! (save-excursion (end-of-line) (1+ (point))))) (setq forms--total-records (1- forms--total-records)) (if (> forms--current-record forms--total-records) *************** *** 1574,1577 **** --- 1644,1672 ---- (goto-char (aref forms--markers 0))))) + (defun forms-prev-field (arg) + "Jump to ARG-th previous field." + (interactive "p") + + (let ((i (length forms--markers)) + (here (point)) + there + (cnt 0)) + + (if (zerop arg) + (setq cnt 1) + (setq cnt (+ cnt arg))) + + (if (catch 'done + (while (> i 0) + (setq i ( 1- i)) + (if (or (null (setq there (aref forms--markers i))) + (>= there here)) + nil + (if (<= (setq cnt (1- cnt)) 0) + (progn + (goto-char there) + (throw 'done t)))))) + nil + (goto-char (aref forms--markers (1- (length forms--markers))))))) ;;; ;;; Special service diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/frame.el emacs-19.20/lisp/frame.el *** emacs-19.19/lisp/frame.el Sat Aug 14 05:22:15 1993 --- emacs-19.20/lisp/frame.el Mon Nov 8 08:13:30 1993 *************** *** 320,324 **** additional frame parameters that Emacs recognizes for X window frames." (interactive) ! (funcall frame-creation-function parameters)) (defun filtered-frame-list (predicate) --- 320,328 ---- additional frame parameters that Emacs recognizes for X window frames." (interactive) ! (let ((nframe)) ! (run-hooks 'before-make-frame-hook) ! (setq nframe (funcall frame-creation-function parameters)) ! (run-hooks 'after-make-frame-hook) ! nframe)) (defun filtered-frame-list (predicate) *************** *** 372,376 **** (setq arg (1+ arg))) (raise-frame frame) ! (select-frame frame))) ;;;; Frame configurations --- 376,382 ---- (setq arg (1+ arg))) (raise-frame frame) ! (select-frame frame) ! (set-mouse-position (selected-frame) (1- (frame-width)) 0) ! (unfocus-frame))) ;;;; Frame configurations *************** *** 392,399 **** (frame-list)))) ! (defun set-frame-configuration (configuration) "Restore the frames to the state described by CONFIGURATION. Each frame listed in CONFIGURATION has its position, size, window ! configuration, and other parameters set as specified in CONFIGURATION." (or (frame-configuration-p configuration) (signal 'wrong-type-argument --- 398,408 ---- (frame-list)))) ! (defun set-frame-configuration (configuration &optional nodelete) "Restore the frames to the state described by CONFIGURATION. Each frame listed in CONFIGURATION has its position, size, window ! configuration, and other parameters set as specified in CONFIGURATION. ! Ordinarily, this function deletes all existing frames not ! listed in CONFIGURATION. But if optional second argument NODELETE ! is given and non-nil, the unwanted frames are iconified instead." (or (frame-configuration-p configuration) (signal 'wrong-type-argument *************** *** 417,421 **** (setq frames-to-delete (cons frame frames-to-delete)))))) (frame-list)) ! (mapcar 'delete-frame frames-to-delete))) (defun frame-configuration-p (object) --- 426,436 ---- (setq frames-to-delete (cons frame frames-to-delete)))))) (frame-list)) ! (if nodelete ! ;; Note: making frames invisible here was tried ! ;; but led to some strange behavior--each time the frame ! ;; was made visible again, the window manager asked afresh ! ;; for where to put it. ! (mapcar 'iconify-frame frames-to-delete) ! (mapcar 'delete-frame frames-to-delete)))) (defun frame-configuration-p (object) diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/gud.el emacs-19.20/lisp/gud.el *** emacs-19.19/lisp/gud.el Sun Aug 15 01:21:15 1993 --- emacs-19.20/lisp/gud.el Fri Oct 1 22:26:26 1993 *************** *** 3,6 **** --- 3,7 ---- ;; Author: Eric S. Raymond + ;; Maintainer: FSF ;; Version: 1.3 ;; Keywords: unix, tools *************** *** 66,70 **** (defun gud-find-file (f) (error "GUD not properly entered.")) ! ;; ====================================================================== ;; command definition --- 67,71 ---- (defun gud-find-file (f) (error "GUD not properly entered.")) ! ;; ====================================================================== ;; command definition *************** *** 147,151 **** ;; by the car of gud-tag-frame. This may be a file name, a tag name, or ;; something else. ! ;; ====================================================================== ;; gdb functions --- 148,152 ---- ;; by the car of gud-tag-frame. This may be a file name, a tag name, or ;; something else. ! ;; ====================================================================== ;; gdb functions *************** *** 248,252 **** ) ! ;; ====================================================================== ;; sdb functions --- 249,253 ---- ) ! ;; ====================================================================== ;; sdb functions *************** *** 327,331 **** (run-hooks 'sdb-mode-hook) ) ! ;; ====================================================================== ;; dbx functions --- 328,332 ---- (run-hooks 'sdb-mode-hook) ) ! ;; ====================================================================== ;; dbx functions *************** *** 389,393 **** (run-hooks 'dbx-mode-hook) ) ! ;; ====================================================================== ;; xdb (HP PARISC debugger) functions --- 390,394 ---- (run-hooks 'dbx-mode-hook) ) ! ;; ====================================================================== ;; xdb (HP PARISC debugger) functions *************** *** 490,493 **** --- 491,592 ---- (setq gud-xdb-accumulation "") (run-hooks 'xdb-mode-hook)) + + ;; ====================================================================== + ;; perldb functions + + ;;; History of argument lists passed to perldb. + (defvar gud-perldb-history nil) + + (defun gud-perldb-massage-args (file args) + (cons "-d" (cons file (cons "-emacs" args)))) + + ;; There's no guarantee that Emacs will hand the filter the entire + ;; marker at once; it could be broken up across several strings. We + ;; might even receive a big chunk with several markers in it. If we + ;; receive a chunk of text which looks like it might contain the + ;; beginning of a marker, we save it here between calls to the + ;; filter. + (defvar gud-perldb-marker-acc "") + + (defun gud-perldb-marker-filter (string) + (save-match-data + (setq gud-perldb-marker-acc (concat gud-perldb-marker-acc string)) + (let ((output "")) + + ;; Process all the complete markers in this chunk. + (while (string-match "^\032\032\\([^:\n]*\\):\\([0-9]*\\):.*\n" + gud-perldb-marker-acc) + (setq + + ;; Extract the frame position from the marker. + gud-last-frame + (cons (substring gud-perldb-marker-acc (match-beginning 1) (match-end 1)) + (string-to-int (substring gud-perldb-marker-acc + (match-beginning 2) + (match-end 2)))) + + ;; Append any text before the marker to the output we're going + ;; to return - we don't include the marker in this text. + output (concat output + (substring gud-perldb-marker-acc 0 (match-beginning 0))) + + ;; Set the accumulator to the remaining text. + gud-perldb-marker-acc (substring gud-perldb-marker-acc (match-end 0)))) + + ;; Does the remaining text look like it might end with the + ;; beginning of another marker? If it does, then keep it in + ;; gud-perldb-marker-acc until we receive the rest of it. Since we + ;; know the full marker regexp above failed, it's pretty simple to + ;; test for marker starts. + (if (string-match "^\032.*\\'" gud-perldb-marker-acc) + (progn + ;; Everything before the potential marker start can be output. + (setq output (concat output (substring gud-perldb-marker-acc + 0 (match-beginning 0)))) + + ;; Everything after, we save, to combine with later input. + (setq gud-perldb-marker-acc + (substring gud-perldb-marker-acc (match-beginning 0)))) + + (setq output (concat output gud-perldb-marker-acc) + gud-perldb-marker-acc "")) + + output))) + + (defun gud-perldb-find-file (f) + (find-file-noselect f)) + + ;;;###autoload + (defun perldb (command-line) + "Run perldb on program FILE in buffer *gud-FILE*. + The directory containing FILE becomes the initial working directory + and source-file directory for your debugger." + (interactive + (list (read-from-minibuffer "Run perldb (like this): " + (if (consp gud-perldb-history) + (car gud-perldb-history) + "perl ") + nil nil + '(gud-perldb-history . 1)))) + (gud-overload-functions '((gud-massage-args . gud-perldb-massage-args) + (gud-marker-filter . gud-perldb-marker-filter) + (gud-find-file . gud-perldb-find-file) + )) + + (gud-common-init command-line) + + (gud-def gud-break "b %l" "\C-b" "Set breakpoint at current line.") + (gud-def gud-remove "d %l" "\C-d" "Remove breakpoint at current line") + (gud-def gud-step "s" "\C-s" "Step one source line with display.") + (gud-def gud-next "n" "\C-n" "Step one line (skip functions).") + (gud-def gud-cont "c" "\C-r" "Continue with display.") + ; (gud-def gud-finish "finish" "\C-f" "Finish executing current function.") + ; (gud-def gud-up "up %p" "<" "Up N stack frames (numeric arg).") + ; (gud-def gud-down "down %p" ">" "Down N stack frames (numeric arg).") + (gud-def gud-print "%e" "\C-p" "Evaluate perl expression at point.") + + (setq comint-prompt-regexp "^ DB<[0-9]+> ") + (run-hooks 'perldb-mode-hook) + ) ;; *************** *** 495,498 **** --- 594,598 ---- ;; + ;;; When we send a command to the debugger via gud-call, it's annoying ;;; to see the command and the new prompt inserted into the debugger's diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/hexl.el emacs-19.20/lisp/hexl.el *** emacs-19.19/lisp/hexl.el Sun Aug 15 01:21:28 1993 --- emacs-19.20/lisp/hexl.el Wed Nov 10 15:43:03 1993 *************** *** 168,173 **** (make-local-variable 'write-contents-hooks) ! (setq write-contents-hooks ! (cons 'hexl-save-buffer write-contents-hooks)) (let ((modified (buffer-modified-p)) --- 168,172 ---- (make-local-variable 'write-contents-hooks) ! (add-hook 'write-contents-hooks 'hexl-save-buffer) (let ((modified (buffer-modified-p)) *************** *** 234,237 **** --- 233,237 ---- (setq buffer-read-only nil) (dehexlify-buffer) + (remove-hook 'write-contents-hook 'hexl-save-buffer) (set-buffer-modified-p modified) (setq buffer-read-only read-only) diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/hilit19.el emacs-19.20/lisp/hilit19.el *** emacs-19.19/lisp/hilit19.el Sun Aug 15 01:21:35 1993 --- emacs-19.20/lisp/hilit19.el Tue Sep 21 03:25:06 1993 *************** *** 1,3 **** ! ;; hilit19.el (Release 2.7) -- customizable highlighting for Emacs19. ;; Copyright (c) 1993 Free Software Foundation, Inc. ;; --- 1,3 ---- ! ;; hilit19.el (Release 2.19) -- customizable highlighting for Emacs19. ;; Copyright (c) 1993 Free Software Foundation, Inc. ;; *************** *** 40,49 **** ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ! ;; hilit19.el,v 2.7 1993/07/30 02:43:01 stig Release ;; ;; LCD Archive Entry: ;; hilit19|Jonathan Stigelman|Stig@netcom.com| ;; Comprehensive (and comparatively fast) regex-based highlighting for Emacs 19| ! ;; 1993/07/30 02:43:01|Release 2.7|~/packages/hilit19.el.Z| ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; --- 40,49 ---- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ! ;; hilit19.el,v 2.19 1993/09/08 18:44:10 stig Release ;; ;; LCD Archive Entry: ;; hilit19|Jonathan Stigelman|Stig@netcom.com| ;; Comprehensive (and comparatively fast) regex-based highlighting for Emacs 19| ! ;; 1993/09/08 18:44:10|Release 2.19|~/packages/hilit19.el.Z| ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; *************** *** 98,107 **** ;; ;; Emacs cannot properly find bold and italic fonts unless you specify a ! ;; verbose X11 font name. Here's a good font menu: ;; ;; (setq ;; x-fixed-font-alist ;; '("Font Menu" ! ;; ("Fonts" ;; ("6x12" "-misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-*-1") ;; ("6x13" "-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-*-1") --- 98,109 ---- ;; ;; Emacs cannot properly find bold and italic fonts unless you specify a ! ;; verbose X11 font name. If you specify a font for emacs in your ! ;; .Xdefaults, it *MUST* be specified using the long form of the font name. ! ;; Here's a good font menu: ;; ;; (setq ;; x-fixed-font-alist ;; '("Font Menu" ! ;; ("Misc" ;; ("6x12" "-misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-*-1") ;; ("6x13" "-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-*-1") *************** *** 134,146 **** ;; font size can have bold & italic properties. ;; - ;; * When identifiers such as remove_switch_entry, ar highlighted in C/C++, - ;; imbedded keywords--"switch" in this case--are highlighted. I don't - ;; personally see this problem because I modify the syntax for C/C++ so that - ;; ?_ is a word character "w". This also means that forward-word skips over - ;; entire variables. This will be fixed when I generalize the highlighting - ;; patterns. - ;; ;; * unbalanced, unescaped double quote characters can confuse hilit19. ! ;; This will be fixed, so don't bug me about it. ;; ;; * ALTHOUGH HILIT19 IS FASTER THAN FONT-LOCK-MODE... --- 136,141 ---- ;; font size can have bold & italic properties. ;; ;; * unbalanced, unescaped double quote characters can confuse hilit19. ! ;; This will be fixed someday, so don't bug me about it. ;; ;; * ALTHOUGH HILIT19 IS FASTER THAN FONT-LOCK-MODE... *************** *** 171,174 **** --- 166,171 ---- ;; dana@thumper.bellcore.com (Dana A. Chee), working on the multi-frame bug ;; derway@ndc.com (Don Erway), for breaking it... + ;; moss_r@summer.chem.su.oz.au (Richard Moss), first pass at add-pattern + ;; Olivier Lecarme , Pascal & Icon patterns ;; ;; With suggestions and minor regex patches from numerous others... *************** *** 177,180 **** --- 174,252 ---- ;; ;; hilit19.el,v + ;; Revision 2.19 1993/09/08 18:44:10 stig + ;; installed patch for elusive bug in hilit-rehighlight-region that caused + ;; hilit-unhighlight-region to hang in an infinite loop. + ;; + ;; Revision 2.18 1993/08/27 03:51:00 stig + ;; minor mods to lisp-mode and c/c++ mode patterns + ;; + ;; Revision 2.17 1993/08/25 02:19:17 stig + ;; work-around for bug in next-overlay-change that caused dired and jargon-mode + ;; to hang in an endless loop. Perhaps other modes were doing this too. + ;; + ;; Revision 2.16 1993/08/22 19:46:00 stig + ;; bug fix for next-overlay-change and accompanying change to + ;; hilit-unhighlight-region + ;; + ;; Revision 2.15 1993/08/20 12:16:22 stig + ;; minor change to fortran patterns + ;; + ;; Revision 2.14 1993/08/17 14:12:10 stig + ;; added default face mapping for 'formula' which is needed for new latex + ;; patterns. + ;; + ;; twiddled the calendar-mode patterns a bit. + ;; + ;; Revision 2.13 1993/08/16 04:33:54 stig + ;; hilit-set-mode-patterns was screwing up two part patterns. it doesn't now. + ;; + ;; Revision 2.12 1993/08/16 00:16:41 stig + ;; changed references to default-bold-italic to just bold-italic because the + ;; font for that face is maintained by emacs. + ;; + ;; the pattern matcher now starts it's searches from the end of the most + ;; recently highlighted region (which is not necessarily the end of the most + ;; recently matched regex). + ;; + ;; multiple errors in pattern matcher now just give an error instead of lots of + ;; annoying messages and dings. + ;; + ;; no longer use vm-summary-mode-hooks. + ;; + ;; some code moved from hilit-highlight-region to hilit-set-mode-patterns. + ;; This will affect you if you pass your patterns directly to + ;; hilit-highlight-region....use a pseudo-mode instead. + ;; + ;; pattern changes to C/C++, latex, texinfo, fortran, nroff, etc. + ;; + ;; Revision 2.11 1993/08/13 12:12:37 stig + ;; removed some crufty commented-out code + ;; + ;; diverged lisp-mode and emacs-lisp-mode...also added lisp keywords. + ;; + ;; Revision 2.10 1993/08/13 09:47:06 stig + ;; added calendar-mode, icon-mode and pascal-mode patterns + ;; + ;; commented out hilit-toggle-highlight because I want to phase it out entirely + ;; + ;; Revision 2.9 1993/08/13 08:44:22 stig + ;; added optional case-fold argument to hilit-set-mode-patterns, this case-fold + ;; parameter is now stored in hilit-patterns-alist. + ;; + ;; Revision 2.8 1993/08/12 22:05:03 stig + ;; fixed some typos in documentation + ;; + ;; twiddled some of the color defaults for dark backgrounds + ;; + ;; always get 'mono color defaults if (not (x-display-color-p)) + ;; + ;; added hilit-rehighlight-buffer-quietly to dired-after-readin-hook + ;; + ;; fixed bug in hilit-string-find that mishandled strings of the form: "\\" + ;; + ;; NEW FUNCTION: hilit-add-mode-pattern... kinda like add-hook for patterns + ;; + ;; fixed minor pattern bugs for latex-mode and emacs-lisp-mode + ;; ;; Revision 2.7 1993/07/30 02:43:01 stig ;; added const to the list of modifiers for C/C++ types *************** *** 256,260 **** automatic highlighting by the find-file hook.") ! (defvar hilit-auto-highlight-maxout 57000 "* auto-highlight is disabled in buffers larger than this") --- 328,332 ---- automatic highlighting by the find-file hook.") ! (defvar hilit-auto-highlight-maxout 60000 ; hilit19 keeps getting bigger... "* auto-highlight is disabled in buffers larger than this") *************** *** 309,317 **** "alist of major-mode values and default highlighting patterns ! A hilighting pattern is a list of the form (start end face), where ! start is a regex, end is a regex (or nil if it's not needed) and face is the name of an entry in hilit-face-translation-table, the name of a face, or nil (which disables the pattern). See the hilit-lookup-face-create documentation for valid face names.") --- 381,392 ---- "alist of major-mode values and default highlighting patterns ! A highlighting pattern is a list of the form (start end face), where ! start is a regex, end is either a regex or a match number for start, and face is the name of an entry in hilit-face-translation-table, the name of a face, or nil (which disables the pattern). + Each entry in the alist is of the form: + (mode . (case-fold pattern [pattern ...])) + See the hilit-lookup-face-create documentation for valid face names.") *************** *** 322,325 **** --- 397,402 ---- your init file.") + (eval-when-compile (setq byte-optimize t)) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Use this to report bugs: *************** *** 327,331 **** (eval-when-compile (require 'reporter)) ; no compilation gripes ! (defun hilit-submit-feeback () "Submit feedback on hilit19 to the author: Stig@netcom.com" (interactive) --- 404,408 ---- (eval-when-compile (require 'reporter)) ; no compilation gripes ! (defun hilit-submit-feedback () "Submit feedback on hilit19 to the author: Stig@netcom.com" (interactive) *************** *** 334,338 **** (reporter-submit-bug-report "Jonathan Stigelman " ! "hilit19.el (Release 2.7)" (and (y-or-n-p "Do you need to include a dump hilit variables? ") (append --- 411,415 ---- (reporter-submit-bug-report "Jonathan Stigelman " ! "hilit19.el (Release 2.19)" (and (y-or-n-p "Do you need to include a dump hilit variables? ") (append *************** *** 362,374 **** " [ ] a _MASSIVE_THANK_YOU_ for writing hilit19.el\n" " [ ] An invitation to attend the next Hackers Conference\n" - " [ ] my DONATION to your vacation fund (prototype digital cash)\n" " [ ] You're a RIGHTEOUS HACKER, what are your rates?\n" " [ ] I've used the force and read the source, but I'M CONFUSED\n" ! " [ ] a PATCH (diff -cw oldversion newversion) to fix a problem\n" ! " [ ] a REPRODUCABLE BUG that I do not believe to be an EMACS bug\n" " - I *swear* that it's not already mentioned in the KNOWN BUGS\n" ! " - Also, I have checked netcom.com:/pub/stig/src/hilit19.el.gz\n" " for a newer release that fixes the problem.\n" ! " [ ] ADVICE -- or an unfulfilled desire that I suspect you share\n" "\n" "Hey Stig, I *know* you're busy but...\n")))) --- 439,451 ---- " [ ] a _MASSIVE_THANK_YOU_ for writing hilit19.el\n" " [ ] An invitation to attend the next Hackers Conference\n" " [ ] You're a RIGHTEOUS HACKER, what are your rates?\n" " [ ] I've used the force and read the source, but I'M CONFUSED\n" ! " [ ] a PATCH. (output of 'diff -uw old.el new.el' or 'diff -cw')\n" ! " [ ] a SERIOUS AND REPRODUCABLE BUG that is not an EMACS bug\n" " - I *swear* that it's not already mentioned in the KNOWN BUGS\n" ! " - I HAVE CHECKED netcom.com:/pub/stig/src/Beta/hilit19.el.gz\n" " for a newer release that fixes the problem.\n" ! " >> I HAVE ALSO CHECKED netcom.com:/pub/stig/src/Beta/hl319.el.gz\n" ! " This is the alpha version...what will become hilit19 (Beta 3.0).\n" "\n" "Hey Stig, I *know* you're busy but...\n")))) *************** *** 383,393 **** ;; used for C/C++ and elisp and perl (comment firebrick-italic moccasin italic) ! (include purple Plum1 default-bold-italic) (define ForestGreen-bold green bold) ! (defun blue-bold cyan-bold default-bold-italic) (decl RoyalBlue cyan bold) (type nil yellow nil) ! (keyword RoyalBlue cyan default-bold-italic) ! (label red-bold orange-underlined underline) (string grey40 orange underline) --- 460,470 ---- ;; used for C/C++ and elisp and perl (comment firebrick-italic moccasin italic) ! (include purple Plum1 bold-italic) (define ForestGreen-bold green bold) ! (defun blue-bold cyan-bold bold-italic) (decl RoyalBlue cyan bold) (type nil yellow nil) ! (keyword RoyalBlue cyan bold-italic) ! (label red-underline orange-underlined underline) (string grey40 orange underline) *************** *** 399,417 **** ;; and anotherone for LaTeX (crossref DarkGoldenrod Goldenrod underline) ;; compilation buffers ! (active-error default/pink-bold default/DeepPink-bold bold-underline) ! (error red-bold yellow bold) ! (warning blue-italic green italic) ;; Makefiles (some faces borrowed from C/C++ too) ! (rule blue-bold-underline cyan-underline bold-underline) ;; VM, GNUS and Text mode (msg-subject blue-bold yellow bold) ! (msg-from purple-bold SeaGreen bold) (msg-header firebrick-bold cyan italic) ! (msg-separator black/tan-bold lightblue nil) ! (msg-quote ForestGreen green italic) (summary-seen grey40 white nil) --- 476,495 ---- ;; and anotherone for LaTeX (crossref DarkGoldenrod Goldenrod underline) + (formula Goldenrod DarkGoldenrod underline) ;; compilation buffers ! (active-error default/pink-bold default/DeepPink-bold default-underline) ! (error red-bold yellow bold) ! (warning blue-italic green italic) ;; Makefiles (some faces borrowed from C/C++ too) ! (rule blue-bold-underline cyan-underline default-bold-underline) ;; VM, GNUS and Text mode (msg-subject blue-bold yellow bold) ! (msg-from purple-bold green bold) (msg-header firebrick-bold cyan italic) ! (msg-separator black/tan-bold black/lightblue nil) ! (msg-quote ForestGreen pink italic) (summary-seen grey40 white nil) *************** *** 420,430 **** (summary-deleted firebrick white italic) (summary-unread RoyalBlue yellow bold) ! (summary-new blue-bold yellow-bold default-bold-italic) ! (summary-current default/skyblue-bold green/LightGrey-bold reverse-default) (gnus-group-unsubscribed grey50 white nil) ! (gnus-group-empty nil yellow nil) (gnus-group-full ForestGreen green italic) ! (gnus-group-overflowing firebrick orange default-bold-italic) ;; dired mode --- 498,508 ---- (summary-deleted firebrick white italic) (summary-unread RoyalBlue yellow bold) ! (summary-new blue-bold yellow-bold bold-italic) ! (summary-current default/skyblue-bold green/dimgrey-bold reverse-default) (gnus-group-unsubscribed grey50 white nil) ! (gnus-group-empty nil nil nil) (gnus-group-full ForestGreen green italic) ! (gnus-group-overflowing firebrick red bold-italic) ;; dired mode *************** *** 432,436 **** (dired-link firebrick-italic green italic) (dired-ignored ForestGreen moccasin nil) ! (dired-deleted red-bold-italic orange default-bold-italic) (dired-marked purple Plum1 nil) --- 510,514 ---- (dired-link firebrick-italic green italic) (dired-ignored ForestGreen moccasin nil) ! (dired-deleted red-bold-italic orange bold-italic) (dired-marked purple Plum1 nil) *************** *** 440,448 **** (jargon-keyword firebrick-underline yellow underline) ) ! "alist of default faces (face . (light-default dark-default mono-default))") (defconst hilit-face-translation-table ! (let ((index (or (cdr (assq hilit-background-mode ! '((light . 1) (dark . 2)))) 3))) (mapcar (function (lambda (x) (cons (car x) (nth index x)))) --- 518,533 ---- (jargon-keyword firebrick-underline yellow underline) ) ! "alist of default faces (face . (light-default dark-default mono-default)) ! ! There is no way for the user to modify this table such that it will have any ! effect upon the translations used by hilit19. Instead, use the function ! hilit-translate AFTER hilit19 has been loaded. + See also the documentation for hilit-lookup-face-create.") + (defconst hilit-face-translation-table ! (let ((index (or (and (x-display-color-p) ! (cdr (assq hilit-background-mode ! '((light . 1) (dark . 2))))) 3))) (mapcar (function (lambda (x) (cons (car x) (nth index x)))) *************** *** 584,592 **** (interactive "r") (or quietly hilit-quietly (message "Unhighlighting")) ! (while (< start end) ! (mapcar (function (lambda (ovr) ! (and (overlay-get ovr 'hilit) (delete-overlay ovr)))) ! (overlays-at start)) ! (setq start (next-overlay-change start))) (or quietly hilit-quietly (message "Done unhighlighting"))) --- 669,678 ---- (interactive "r") (or quietly hilit-quietly (message "Unhighlighting")) ! (let ((lstart 0)) ! (while (and start (> start lstart) (< start end)) ! (mapcar (function (lambda (ovr) ! (and (overlay-get ovr 'hilit) (delete-overlay ovr)))) ! (overlays-at start)) ! (setq lstart start start (next-overlay-change start)))) (or quietly hilit-quietly (message "Done unhighlighting"))) *************** *** 626,635 **** (setq patterns (cdr (assq patterns hilit-patterns-alist))))) ;; txt prop: (setq patterns (reverse patterns)) ! (let ((prio (length patterns)) ! (case-fold-search nil) ;; txt prop: (buffer-read-only nil) ;; txt prop: (bm (buffer-modified-p)) ! p pstart pend face mstart) ;; txt prop: (unwind-protect (save-excursion (save-restriction --- 712,722 ---- (setq patterns (cdr (assq patterns hilit-patterns-alist))))) ;; txt prop: (setq patterns (reverse patterns)) ! (let ((case-fold-search (car patterns)) ! (prio (1- (length patterns))) ;; txt prop: (buffer-read-only nil) ;; txt prop: (bm (buffer-modified-p)) ! p pstart pend face mstart (puke-count 0)) ;; txt prop: (unwind-protect + (setq patterns (cdr patterns)) ; remove case-fold from head of pattern (save-excursion (save-restriction *************** *** 644,650 **** (or quietly hilit-quietly (message "highlighting %d: %s%s" prio pstart ! (if pend (concat " ... " pend) ""))) (goto-char (point-min)) ! (condition-case nil (cond ((symbolp pstart) --- 731,737 ---- (or quietly hilit-quietly (message "highlighting %d: %s%s" prio pstart ! (if (stringp pend) (concat " ... " pend) ""))) (goto-char (point-min)) ! (condition-case msg (cond ((symbolp pstart) *************** *** 662,677 **** face prio) (forward-char 1)))) ! (t ! (or (numberp pend) (setq pend 0)) ;; inner loop -- just one regex to match whole pattern (while (re-search-forward pstart nil t nil) (hilit-region-set-face (match-beginning pend) ! (match-end pend) face prio)))) ! (error (message "Unbalanced delimiters? Barfed on '%s'" ! pstart) ! (ding) (sit-for 4)))) (setq prio (1- prio) patterns (cdr patterns))) ! )) (or quietly hilit-quietly (message "")) ; "Done highlighting" ;; txt prop: (set-buffer-modified-p bm)) ; unwind protection --- 749,766 ---- face prio) (forward-char 1)))) ! ((numberp pend) ;; inner loop -- just one regex to match whole pattern (while (re-search-forward pstart nil t nil) + (goto-char (match-end pend)) (hilit-region-set-face (match-beginning pend) ! (match-end pend) face prio))) ! (t (error "malformed pattern"))) ! (error (if (> (setq puke-count (1+ puke-count)) 1) ! (error msg) ! (message "Error: '%s'" msg) ! (ding) (sit-for 4))))) (setq prio (1- prio) patterns (cdr patterns))) ! )) (or quietly hilit-quietly (message "")) ; "Done highlighting" ;; txt prop: (set-buffer-modified-p bm)) ; unwind protection *************** *** 681,688 **** "Re-highlights the region, optionally in a QUIET way" (interactive "r") ! (setq start (apply 'min start (mapcar 'overlay-start (overlays-at start))) ! end (apply 'max end (mapcar 'overlay-end (overlays-at end)))) ! (hilit-unhighlight-region start end quietly) ! (hilit-highlight-region start end nil quietly)) (defun hilit-rehighlight-buffer (&optional quietly) --- 770,779 ---- "Re-highlights the region, optionally in a QUIET way" (interactive "r") ! (save-restriction ! (widen) ! (setq start (apply 'min start (mapcar 'overlay-start (overlays-at start))) ! end (apply 'max end (mapcar 'overlay-end (overlays-at end)))) ! (hilit-unhighlight-region start end quietly) ! (hilit-highlight-region start end nil quietly))) (defun hilit-rehighlight-buffer (&optional quietly) *************** *** 709,722 **** (defalias 'hilit-highlight-buffer 'hilit-rehighlight-buffer) ! (defun hilit-toggle-highlight (arg) ! "Locally toggle highlighting. With arg, forces highlighting off." ! (interactive "P") ! ;; FIXME -- this loses numeric information in hilit-auto-rehighlight ! (setq hilit-auto-rehighlight ! (and (not arg) (not hilit-auto-rehighlight))) ! (if hilit-auto-rehighlight ! (hilit-rehighlight-buffer) ! (hilit-unhighlight-region (point-min) (point-max))) ! (message "Rehighlighting is set to %s" hilit-auto-rehighlight)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; --- 800,816 ---- (defalias 'hilit-highlight-buffer 'hilit-rehighlight-buffer) ! ;; Well, I want to remove this function...there's one sure way to find out if ! ;; anyone uses it or not...and that's to comment it out. ! ;; ! ;; (defun hilit-toggle-highlight (arg) ! ;; "Locally toggle highlighting. With arg, forces highlighting off." ! ;; (interactive "P") ! ;; ;; FIXME -- this loses numeric information in hilit-auto-rehighlight ! ;; (setq hilit-auto-rehighlight ! ;; (and (not arg) (not hilit-auto-rehighlight))) ! ;; (if hilit-auto-rehighlight ! ;; (hilit-rehighlight-buffer) ! ;; (hilit-unhighlight-region (point-min) (point-max))) ! ;; (message "Rehighlighting is set to %s" hilit-auto-rehighlight)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; *************** *** 755,770 **** (hilit-rehighlight-region st en quietly)))) - ;; (defun hilit-rehighlight-yank-region () - ;; "Rehighlights from the beginning of the line where the region starts to - ;; the end of the line where the region ends. This could flake out on - ;; multi-line highlights (like C comments and lisp strings.)" - ;; (if hilit-auto-rehighlight - ;; (hilit-rehighlight-region - ;; (save-excursion (goto-char (region-beginning)) - ;; (beginning-of-line) (point)) - ;; (save-excursion (goto-char (region-end)) - ;; (end-of-line) (point)) - ;; t))) - (defun hilit-recenter (arg) "Recenter, then rehighlight according to hilit-auto-rehighlight. If called --- 849,852 ---- *************** *** 777,788 **** (hilit-repaint-command (consp arg))) - ;; (defun hilit-redraw-display (arg) - ;; "Rehighlights according to the value of hilit-auto-rehighlight, a prefix - ;; arg forces a rehighlight of the whole buffer. Otherwise just like - ;; redraw-display." - ;; (interactive "P") - ;; (hilit-redraw-internal arg) - ;; (redraw-display)) - (defun hilit-yank (arg) "Yank with rehighlighting" --- 859,862 ---- *************** *** 899,908 **** (add-hook hook 'hilit-rehighlight-buffer-quietly))) '( - compilation-parse-hook - - Info-select-hook ; FIXME -- phase this out later Info-selection-hook ! vm-summary-mode-hooks vm-summary-pointer-hook vm-preview-message-hook --- 973,979 ---- (add-hook hook 'hilit-rehighlight-buffer-quietly))) '( Info-selection-hook ! ;; runs too early vm-summary-mode-hooks vm-summary-pointer-hook vm-preview-message-hook *************** *** 916,922 **** mail-setup-hook mh-show-mode-hook )) ! ;; rehilight only the visible part of the summary buffer for speed. (add-hook 'gnus-mark-article-hook (function --- 987,995 ---- mail-setup-hook mh-show-mode-hook + + dired-after-readin-hook )) ! ;; rehighlight only visible part of summary buffer for speed. (add-hook 'gnus-mark-article-hook (function *************** *** 957,963 **** (set alist (cons (cons key val) (eval alist)))))) ! (defun hilit-set-mode-patterns (modelist patterns &optional parse-fn) "Sets the default highlighting patterns for MODE to PATTERNS. ! See the variable hilit-mode-enable-list." (or (consp modelist) (setq modelist (list modelist))) (let (ok (flip (eq (car hilit-mode-enable-list) 'not))) --- 1030,1047 ---- (set alist (cons (cons key val) (eval alist)))))) ! (defun hilit-set-mode-patterns (modelist patterns ! &optional parse-fn case-fold) "Sets the default highlighting patterns for MODE to PATTERNS. ! See the variable hilit-mode-enable-list. ! ! Takes optional arguments PARSE-FN and CASE-FOLD." ! ;; change pattern ! (mapcar (function (lambda (p) ! (and (stringp (car p)) ! (null (nth 1 p)) ! (setcar (cdr p) 0)))) ! patterns) ! (setq patterns (cons case-fold patterns)) ! (or (consp modelist) (setq modelist (list modelist))) (let (ok (flip (eq (car hilit-mode-enable-list) 'not))) *************** *** 968,1025 **** (and flip (setq ok (not ok))) (and ok ! (progn ! (and parse-fn ! (hilit-associate 'hilit-parser-alist m parse-fn)) ! (hilit-associate 'hilit-patterns-alist m patterns))))) modelist))) (defun hilit-string-find (qchar) "looks for a string and returns (start . end) or NIL. The argument QCHAR is the character that would precede a character constant double quote. ! Finds [^QCHAR]\" ... [^\\]\"" (let (st en) (while (and (search-forward "\"" nil t) (eq qchar (char-after (1- (setq st (match-beginning 0))))))) (while (and (search-forward "\"" nil t) ! (eq ?\\ (char-after (- (setq en (point)) 2))))) (and en (cons st en)))) ! (hilit-set-mode-patterns ! '(c-mode c++-c-mode elec-c-mode) ! '(("/\\*" "\\*/" comment) ! ; ("\"" "[^\\]\"" string) ! (hilit-string-find ?' string) ! ;; declaration ! ("^#[ \t]*\\(undef\\|define\\).*$" nil define) ! ("^#.*$" nil include) ! ;; function decls are expected to have types on the previous line ! ("^\\(\\w\\|[$_]\\)+\\s *\\(\\(\\w\\|[$_]\\)+\\s *((\\|(\\)[^)]*)+" nil defun) ! ("^\\(typedef\\|struct\\|union\\|enum\\).*$" nil decl) ! ;; datatype -- black magic regular expression ! ("[ \n\t({]\\(\\(const\\|register\\|volatile\\|unsigned\\|extern\\|static\\)\\s +\\)*\\(\\(\\w\\|[$_]\\)+_t\\|float\\|double\\|void\\|char\\|short\\|int\\|long\\|FILE\\|\\(\\(struct\\|union\\|enum\\)\\([ \t]+\\(\\w\\|[$_]\\)*\\)\\)\\)\\(\\s +\\*+)?\\|[ \n\t;()]\\)" nil type) ! ;; key words ! ("[^_]\\<\\(return\\|goto\\|if\\|else\\|case\\|default\\|switch\\|break\\|continue\\|while\\|do\\|for\\)\\>[^_]" 1 keyword) ! )) ! (hilit-set-mode-patterns ! 'c++-mode ! '(("/\\*" "\\*/" comment) ! ("//.*$" nil comment) ! ("^/.*$" nil comment) ! ; ("\"" "[^\\]\"" string) ! (hilit-string-find ?' string) ! ;; declaration ! ("^#[ \t]*\\(undef\\|define\\).*$" nil define) ! ("^#.*$" nil include) ! ;; function decls are expected to have types on the previous line ! ("^\\(\\(\\w\\|[$_]\\)+::\\)?\\(\\w\\|[$_]\\)+\\s *\\(\\(\\w\\|[$_]\\)+\\s *((\\|(\\)[^)]*)+" nil defun) ! ("^\\(\\(\\w\\|[$_]\\)+[ \t]*::[ \t]*\\)?\\(\\(\\w\\|[$_]\\)+\\|operator.*\\)\\s *\\(\\(\\w\\|[$_]\\)+\\s *((\\|(\\)[^)]*)+" nil defun) ! ("^\\(template\\|typedef\\|struct\\|union\\|class\\|enum\\|public\\|private\\|protected\\).*$" nil decl) ! ;; datatype -- black magic regular expression ! ("[ \n\t({]\\(\\(const\\|register\\|volatile\\|unsigned\\|extern\\|static\\)\\s +\\)*\\(\\(\\w\\|[$_]\\)+_t\\|float\\|double\\|void\\|char\\|short\\|int\\|long\\|FILE\\|\\(\\(struct\\|union\\|enum\\|class\\)\\([ \t]+\\(\\w\\|[$_]\\)*\\)\\)\\)\\(\\s +\\*+)?\\|[ \n\t;()]\\)" nil type) ! ;; key words ! ("[^_]\\<\\(return\\|goto\\|if\\|else\\|case\\|default\\|switch\\|break\\|continue\\|while\\|do\\|for\\|public\\|protected\\|private\\|delete\\|new\\)\\>[^_]" ! 1 keyword))) (hilit-set-mode-patterns 'perl-mode --- 1052,1146 ---- (and flip (setq ok (not ok))) (and ok ! (progn ! (and parse-fn ! (hilit-associate 'hilit-parser-alist m parse-fn)) ! (hilit-associate 'hilit-patterns-alist m patterns))))) modelist))) + (defun hilit-add-pattern (pstart pend face &optional mode first) + "Highlight pstart with face for the current major-mode. + Optionally, place the new pattern first in the pattern list" + (interactive "sPattern start regex: \nsPattern end regex (default none): \nxFace: ") + + (and (equal pstart "") (error "Must specify starting regex")) + (cond ((equal pend "") (setq pend 0)) + ((string-match "^[0-9]+$" pend) (setq pend (string-to-int pend)))) + (or mode (setq mode major-mode)) + (let ((old-patterns (cdr (assq mode hilit-patterns-alist))) + (new-pat (list pstart pend face))) + (cond ((not old-patterns) + (hilit-set-mode-patterns mode (list new-pat))) + (first + (setcdr old-patterns (cons new-pat (cdr old-patterns)))) + (t + (nconc old-patterns (list new-pat))))) + (and (interactive-p) (hilit-rehighlight-buffer))) + (defun hilit-string-find (qchar) "looks for a string and returns (start . end) or NIL. The argument QCHAR is the character that would precede a character constant double quote. ! Finds strings delimited by double quotes. The first double quote may not be ! preceded by QCHAR and the closing double quote may not be preceded by an odd ! number of backslashes." (let (st en) (while (and (search-forward "\"" nil t) (eq qchar (char-after (1- (setq st (match-beginning 0))))))) (while (and (search-forward "\"" nil t) ! (save-excursion ! (setq en (point)) ! (forward-char -1) ! (skip-chars-backward "\\\\") ! (forward-char 1) ! (not (zerop (% (- en (point)) 2)))))) (and en (cons st en)))) ! ;; return types on same line... ! ;; ("^[a-zA-z].*\\(\\w\\|[$_]\\)+\\s *\\(\\(\\w\\|[$_]\\)+\\s *((\\|(\\)[^)]*)+" nil defun) ! ;; On another note, a working pattern for grabbing function definitions for C is ! ;; ! ;; ("^[a-zA-Z_]+.*[;{]$" nil ForestGreen) ; global defns ( start at col 1 ) ! ;; ("^[a-zA-Z_]+.*(" ")" defun) ! ;; ; defuns assumed to start at col 1, not with # or { ! ;; ! ;; this will make external declarations/definitions green, and function ! ;; definitions the defun face. Hmmm - seems to work for me anyway. + (let ((comments '(("/\\*" "\\*/" comment))) + (c++-comments '(("//.*$" nil comment) + ("^/.*$" nil comment))) + (strings '((hilit-string-find ?' string))) + (preprocessor '(("^#[ \t]*\\(undef\\|define\\).*$" "[^\\]$" define) + ("^#.*$" nil include)))) + + (hilit-set-mode-patterns + '(c-mode c++-c-mode elec-c-mode) + (append + comments strings preprocessor + '( + ;; function decls are expected to have types on the previous line + ("^\\(\\w\\|[$_]\\)+\\s *\\(\\(\\w\\|[$_]\\)+\\s *((\\|(\\)[^)]*)+" nil defun) + ("^\\(typedef\\|struct\\|union\\|enum\\).*$" nil decl) + ;; datatype -- black magic regular expression + ("[ \n\t({]\\(\\(const\\|register\\|volatile\\|unsigned\\|extern\\|static\\)\\s +\\)*\\(\\(\\w\\|[$_]\\)+_t\\|float\\|double\\|void\\|char\\|short\\|int\\|long\\|FILE\\|\\(\\(struct\\|union\\|enum\\)\\([ \t]+\\(\\w\\|[$_]\\)*\\)\\)\\)\\(\\s +\\*+)?\\|[ \n\t;()]\\)" nil type) + ;; key words + ("[^_]\\<\\(return\\|goto\\|if\\|else\\|case\\|default\\|switch\\|break\\|continue\\|while\\|do\\|for\\)\\>[^_]" 1 keyword) + ))) + + (hilit-set-mode-patterns + 'c++-mode + (append + comments c++-comments strings preprocessor + '( + ;; function decls are expected to have types on the previous line + ("^\\(\\(\\w\\|[$_]\\)+::\\)?\\(\\w\\|[$_]\\)+\\s *\\(\\(\\w\\|[$_]\\)+\\s *((\\|(\\)[^)]*)+" nil defun) + ("^\\(\\(\\w\\|[$_]\\)+[ \t]*::[ \t]*\\)?\\(\\(\\w\\|[$_]\\)+\\|operator.*\\)\\s *\\(\\(\\w\\|[$_]\\)+\\s *((\\|(\\)[^)]*)+" nil defun) + ("^\\(template\\|typedef\\|struct\\|union\\|class\\|enum\\|public\\|private\\|protected\\).*$" nil decl) + ;; datatype -- black magic regular expression + ("[ \n\t({]\\(\\(const\\|register\\|volatile\\|unsigned\\|extern\\|static\\)\\s +\\)*\\(\\(\\w\\|[$_]\\)+_t\\|float\\|double\\|void\\|char\\|short\\|int\\|long\\|FILE\\|\\(\\(struct\\|union\\|enum\\|class\\)\\([ \t]+\\(\\w\\|[$_]\\)*\\)\\)\\)\\(\\s +\\*+)?\\|[ \n\t;()]\\)" nil type) + ;; key words + ("[^_]\\<\\(return\\|goto\\|if\\|else\\|case\\|default\\|switch\\|break\\|continue\\|while\\|do\\|for\\|public\\|protected\\|private\\|delete\\|new\\)\\>[^_]" + 1 keyword))))) + (hilit-set-mode-patterns 'perl-mode *************** *** 1064,1070 **** 'fortran-mode '(("^[*Cc].*$" nil comment) ! ("[ \t]\\(call\\|program\\|subroutine\\|function\\|stop\\|return\\|end\\|include\\)[ \t\n]" nil include) ("\\(^[ \t]*[0-9]+\\|[ \t]continue[ \t\n]\\|format\\)" nil define) ("[ \t]\\(do\\|do[ \t]*[0-9]+\\|go[ \t]*to[ \t]*[0-9]+\\|end[ \t]*do\\|if\\|else[ \t]*if\\|then\\|else\\|end[ \t]*if\\)[ \t\n(]" nil define) ("[ \t]\\(parameter[\t\n ]*([^)]*)\\|data\\|save\\|common[ \t\n]*/[^/]*/\\)" nil decl) --- 1185,1192 ---- 'fortran-mode '(("^[*Cc].*$" nil comment) ! ("'[^'\n]*'" nil string) ("\\(^[ \t]*[0-9]+\\|[ \t]continue[ \t\n]\\|format\\)" nil define) ("[ \t]\\(do\\|do[ \t]*[0-9]+\\|go[ \t]*to[ \t]*[0-9]+\\|end[ \t]*do\\|if\\|else[ \t]*if\\|then\\|else\\|end[ \t]*if\\)[ \t\n(]" nil define) + ("[ \t]\\(call\\|program\\|subroutine\\|function\\|stop\\|return\\|end\\|include\\)[ \t\n]" nil include) ("[ \t]\\(parameter[\t\n ]*([^)]*)\\|data\\|save\\|common[ \t\n]*/[^/]*/\\)" nil decl) *************** *** 1072,1077 **** ("implicit[ \t]*none" nil decl) ("\\([ \t]\\|implicit[ \t]*\\)\\(dimension\\|integer\\|real\\|double[ \t]*precision\\|character\\|logical\\|complex\\|double[ \t]*complex\\)\\([*][0-9]*\\|[ \t\n]\\)" nil keyword) ! ("'[^'\n]*'" nil string) ! )) (hilit-set-mode-patterns --- 1194,1199 ---- ("implicit[ \t]*none" nil decl) ("\\([ \t]\\|implicit[ \t]*\\)\\(dimension\\|integer\\|real\\|double[ \t]*precision\\|character\\|logical\\|complex\\|double[ \t]*complex\\)\\([*][0-9]*\\|[ \t\n]\\)" nil keyword) ! ) ! nil 'case-insensitive) (hilit-set-mode-patterns *************** *** 1081,1085 **** ("^[ \t]*PROCEDURE[ \t]+\\w+[^ \t(;]*" nil defun) ("\\<\\(RECORD\\|ARRAY\\|OF\\|POINTER\\|TO\\|BEGIN\\|END\\|FOR\\|IF\\|THEN\\|ELSE\\|ELSIF\\|CASE\\|WHILE\\|DO\\|MODULE\\|FROM\\|RETURN\\|IMPORT\\|EXPORT\\|VAR\\|LOOP\\|UNTIL\\|\\DEFINITION\\|IMPLEMENTATION\\|AND\\|OR\\|NOT\\|CONST\\|TYPE\\|QUALIFIED\\)\\>" nil keyword) ! )) (hilit-set-mode-patterns 'prolog-mode --- 1203,1208 ---- ("^[ \t]*PROCEDURE[ \t]+\\w+[^ \t(;]*" nil defun) ("\\<\\(RECORD\\|ARRAY\\|OF\\|POINTER\\|TO\\|BEGIN\\|END\\|FOR\\|IF\\|THEN\\|ELSE\\|ELSIF\\|CASE\\|WHILE\\|DO\\|MODULE\\|FROM\\|RETURN\\|IMPORT\\|EXPORT\\|VAR\\|LOOP\\|UNTIL\\|\\DEFINITION\\|IMPLEMENTATION\\|AND\\|OR\\|NOT\\|CONST\\|TYPE\\|QUALIFIED\\)\\>" nil keyword) ! ) ! nil 'case-insensitive) (hilit-set-mode-patterns 'prolog-mode *************** *** 1116,1120 **** ;; various declarations/definitions ("\\\\\\(setlength\\|settowidth\\|addtolength\\|setcounter\\|addtocounter\\)" nil define) ! ("\\\\\\(\\|title\\|author\\|date\\|thanks\\){" "}" define) ("\\\\documentstyle\\(\\[.*\\]\\)?{" "}" decl) --- 1239,1243 ---- ;; various declarations/definitions ("\\\\\\(setlength\\|settowidth\\|addtolength\\|setcounter\\|addtocounter\\)" nil define) ! ("\\\\\\(title\\|author\\|date\\|thanks\\){" "}" define) ("\\\\documentstyle\\(\\[.*\\]\\)?{" "}" decl) *************** *** 1129,1136 **** ;; label-like things ! ("\\\\item\\[" "\\]" label) ! ("\\\\item\\b" nil label) ! ("\\\\caption\\(\\[.*\\]\\)?{" "}" label) ;; things that bring in external files ("\\\\\\(include\\|input\\|bibliography\\){" "}" include) --- 1252,1263 ---- ;; label-like things ! ("\\\\item\\(\\[[^]]*\\]\\)?" nil label) ! ("\\\\caption\\(\\[[^]]*\\]\\)?{" "}" label) + ;; formulas + ("\\\\(" "\\\\)" formula) ; \( \) + ("\\\\\\[" "\\\\\\]" formula) ; \[ \] + ("[^$]\\($\\($[^$]*\\$\\|[^$]*\\)\\$\\)" 1 formula) ; '$...$' or '$$...$$' + ;; things that bring in external files ("\\\\\\(include\\|input\\|bibliography\\){" "}" include) *************** *** 1216,1230 **** (hilit-set-mode-patterns ! '(emacs-lisp-mode lisp-mode) '( (";.*" nil comment) ! ;;; ("^;.*$" nil comment) ! ;;; ("\\s ;+[ ;].*$" nil comment) (hilit-string-find ?\\ string) ! ("^\\s *(def\\(un\\|macro\\|advice\\|subst\\)\\s " "\\()\\|nil\\)" defun) ("^\\s *(defvar\\s +\\S +" nil decl) ("^\\s *(defconst\\s +\\S +" nil define) ("^\\s *(\\(provide\\|require\\|\\(auto\\)?load\\).*$" nil include) )) --- 1343,1388 ---- + ;;; this will match only comments w/ an even (zero is even) number of quotes... + ;;; which is still inadequate because it matches comments in multi-line strings + ;;; how anal do you want to get about never highlighting comments in strings? + ;;; I could twiddle with this forever and still it wouldn't be perfect. + ;;; (";\\([^\"\n]*\"[^\"\n]*\"\\)*[^\"\n]*$" nil comment) + (hilit-set-mode-patterns ! '(emacs-lisp-mode lisp-interaction-mode) '( (";.*" nil comment) ! ! ;;; This almost works...but I think I'll stick with the parser function ! ;;;("[^?]\\(\"\\(\"\\||\\([^\"]+\\|[\\]\\([\\][\\]\\)*\"\\)*\"\\)\\)" 1 string) (hilit-string-find ?\\ string) ! ! ("^\\s *(def\\(un\\|macro\\|advice\\|alias\\|subst\\)[ \t\n]" ! "\\()\\|nil\\)" defun) ("^\\s *(defvar\\s +\\S +" nil decl) ("^\\s *(defconst\\s +\\S +" nil define) ("^\\s *(\\(provide\\|require\\|\\(auto\\)?load\\).*$" nil include) + ("\\s *\\&\\(rest\\|optional\\)\\s *" nil keyword) + ("(\\(let\\*?\\|cond\\|if\\|or\\|and\\|map\\(car\\|concat\\)\\|prog[n1*]?\\|while\\|lambda\\|function\\|set\\([qf]\\|car\\|cdr\\)?\\|nconc\\|eval-when-compile\\|condition-case\\|unwind-protect\\|catch\\|throw\\|error\\)[ \t\n]" 1 keyword) + )) + + (hilit-set-mode-patterns + '(lisp-mode ilisp-mode) + '( + (";.*" nil comment) + ("#|" "|#" comment) + ;;; This almost works...but I think I'll stick with the parser function + ;;;("[^?]\\(\"\\(\"\\||\\([^\"]+\\|[\\]\\([\\][\\]\\)*\"\\)*\"\\)\\)" 1 string) + (hilit-string-find ?\\ string) + + ;; this is waaaaaaaay too slow + ;; ("^\\s *(def\\(un\\|macro\\|advice\\|alias\\|method\\|subst\\)\\s \\S +[ \t\n]+\\(nil\\|(\\(([^()]*)\\|[^()]+\\)*)\\)" nil defun) + ("^\\s *(def\\(un\\|macro\\|advice\\|subst\\|method\\)\\s " "\\()\\|nil\\)" defun) + + ("^\\s *(\\(def\\(var\\|type\\|parameter\\)\\|declare\\)\\s +\\S +" nil decl) + ("^\\s *(def\\(const\\(ant\\)?\\|class\\|struct\\)\\s \\S +[ \t\n]+\\((\\(([^()]*)\\|[^()]+\\)*)\\)?" nil define) + ("^\\s *(\\(provide\\|require\\|\\(auto\\)?load\\).*$" nil include) + ("[ \t]\\&\\(key\\|rest\\|optional\\|aux\\)\\s *" nil keyword) + ("(\\(let\\*?\\|locally\\|cond\\|if\\*?\\|or\\|and\\|map\\(car\\|c[ao]n\\)?\\|prog[nv1*]?\\|while\\|when\\|unless\\|do\\(\\*\\|list\\|times\\)\\|lambda\\|function\\|values\\|set\\([qf]\\|car\\|cdr\\)?\\|rplac[ad]\\|nconc\\|block\\|go\\|return\\(-from\\)?\\|[ec]?\\(type\\)?case\\|multiple-value-\\(bind\\|setq\\|list\\|call\\|prog1\\)\\|unwind-protect\\|handler-case\\|catch\\|throw\\|eval-when\\(-compile\\)?\\)[ \t\n]" 1 keyword) )) *************** *** 1238,1242 **** ("^[ \t\n]*\\\\def[\\\\@]\\(\\w+\\)" nil defun) ("\\\\\\(begin\\|end\\){\\([A-Za-z0-9\\*]+\\)}" nil defun) ! ; ("[^\\\\]\\$\\([^$]*\\)\\$" nil string) ("\\$\\([^$]*\\)\\$" nil string) )) --- 1396,1400 ---- ("^[ \t\n]*\\\\def[\\\\@]\\(\\w+\\)" nil defun) ("\\\\\\(begin\\|end\\){\\([A-Za-z0-9\\*]+\\)}" nil defun) ! ;; ("[^\\\\]\\$\\([^$]*\\)\\$" nil string) ("\\$\\([^$]*\\)\\$" nil string) )) *************** *** 1253,1259 **** ;; ("^[^\\.].*\"[^\\\"]*\\(\\\\\\(.\\)[^\\\"]*\\)*\"" nil string) ("\"" "[^\\]\"" string) ! ("^\\.[A-Za-z12\\\\].*$" nil define) ("\\([\\\][^ ]*\\)" nil keyword) ! ("^\\.[a-zA-Z].*$" nil keyword))) (hilit-set-mode-patterns --- 1411,1418 ---- ;; ("^[^\\.].*\"[^\\\"]*\\(\\\\\\(.\\)[^\\\"]*\\)*\"" nil string) ("\"" "[^\\]\"" string) ! ("^\\.[A-Z12\\\\].*$" nil define) ("\\([\\\][^ ]*\\)" nil keyword) ! ("^\\.[A-Z].*$" nil keyword)) ! nil 'case-insensitive) (hilit-set-mode-patterns *************** *** 1261,1266 **** '(("^\\(@c\\|@comment\\)\\>.*$" nil comment) ("@\\(emph\\|strong\\|b\\|i\\){[^}]+}" nil comment) ! ; seems broken ! ; ("\\$[^$]*\\$" nil string) ("@\\(file\\|kbd\\|key\\){[^}]+}" nil string) ("^\\*.*$" nil defun) --- 1420,1425 ---- '(("^\\(@c\\|@comment\\)\\>.*$" nil comment) ("@\\(emph\\|strong\\|b\\|i\\){[^}]+}" nil comment) ! ;; seems broken ! ;; ("\\$[^$]*\\$" nil string) ("@\\(file\\|kbd\\|key\\){[^}]+}" nil string) ("^\\*.*$" nil defun) *************** *** 1298,1302 **** --- 1457,1528 ---- nil jargon-keyword))) ; lisp manual + (hilit-set-mode-patterns + 'calendar-mode + '(("[A-Z][a-z]+ [0-9]+" nil define) ; month and year + ("S M Tu W Th F S" nil label) ; week days + ("[0-9]+\\*" nil defun) ; holidays + ("[0-9]+\\+" nil comment) ; diary days + )) + + (hilit-set-mode-patterns + 'pascal-mode + '(("(\\*" "\\*)" comment) + ("{" "}" comment) + ;; Doesn't work when there are strings in comments.... + ;; ("'[^']*'" nil string) + ("^#.*$" nil include) + ("^[ \t]*\\(procedure\\|function\\)[ \t]+\\w+[^ \t(;]*" nil defun) + ("\\<\\(program\\|begin\\|end\\)\\>" nil defun) + ("\\<\\(external\\|forward\\)\\>" nil include) + ("\\<\\(label\\|const\\|type\\|var\\)\\>" nil define) + ("\\<\\(record\\|array\\|file\\)\\>" nil type) + ("\\<\\(of\\|to\\|for\\|if\\|then\\|else\\|case\\|while\\|do\\|until\\|and\\|or\\|not\\|with\\|repeat\\)\\>" nil keyword) + ) + nil 'case-insensitive) + + (hilit-set-mode-patterns + 'icon-mode + '(("#.*$" nil comment) + ("\"[^\\\"]*\\(\\\\.[^\\\"]*\\)*\"" nil string) + ;; charsets: these do not work because of a conflict with strings + ;; ("'[^\\']*\\(\\\\.[^\\']*\\)*'" nil string) + ("^[ \t]*procedure[ \t]+\\w+[ \t]*(" ")" defun) + ("^[ \t]*record.*(" ")" include) + ("^[ \t]*\\(global\\|link\\)[ \t\n]+[A-Za-z_0-9]+\\([ \t\n]*,[ \t\n]*[A-Za-z_0-9]+\\)*" nil include) + ("^[ \t]*\\(local\\|static\\)[ \t\n]+[A-Za-z_0-9]+\\([ \t\n]*,[ \t\n]*[A-Za-z_0-9]+\\)*" nil decl) + ("\\<\\(initial\\|end\\)\\>" nil glob-struct) + ("\\<\\(while\\|until\\|return\\|every\\|if\\|then\\|else\\|to\\|case\\|of\\|suspend\\|create\\|do\\|repeat\\|break\\)\\>" nil keyword) + )) + + ;; as you can see, I had two similar problems for Pascal and Icon. In + ;; Pascal, strings are delimited with ' and an embedded quote is doubled, + ;; thus string syntax would be extremely simple. However, if a string + ;; occurs within a comment, the following text is considered a string. + ;; + ;; In Icon, strings are similar to C ones, but there are also charsets, + ;; delimited with simple quotes. I could not manage to use both regexps at + ;; the same time. + + ;; The problem I have with my patterns for Icon is that this language has a + ;; string similar constant to the C one (but a string can be cut on several + ;; lines, if terminated by a dash and continued with initial blanks, like + ;; this: + ;; "This is a somewhat long - + ;; string, written on three - + ;; succesive lines" + ;; in order to insert a double quote in a string, you have to escape it + ;; with a \), bu also a character set constant (named a charset), which + ;; uses single quotes instead of double ones. It would seem intuitive to + ;; highlight both constants in the same way. + + (provide 'hilit19) ;;; hilit19 ends here. + + + ;; __________________________________________________________________________ + ;; Stig@netcom.com netcom.com:/pub/stig/00-PGP-KEY + ;; It's hard to be cutting-edge at your own pace... 32 DF B9 19 AE 28 D1 7A + ;; Bullet-proof code cannot stand up to teflon bugs. A3 9D 0B 1A 33 13 4D 7F + diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/holidays.el emacs-19.20/lisp/holidays.el *** emacs-19.19/lisp/holidays.el Sun Aug 15 01:21:37 1993 --- emacs-19.20/lisp/holidays.el Wed Oct 20 01:46:11 1993 *************** *** 390,394 **** "Rogation Sunday") (list (calendar-gregorian-from-absolute (+ abs-easter 39)) ! "Ascension Sunday") (list (calendar-gregorian-from-absolute (+ abs-easter 49)) "Pentecost (Whitsunday)") --- 390,394 ---- "Rogation Sunday") (list (calendar-gregorian-from-absolute (+ abs-easter 39)) ! "Ascension Day") (list (calendar-gregorian-from-absolute (+ abs-easter 49)) "Pentecost (Whitsunday)") diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/info.el emacs-19.20/lisp/info.el *** emacs-19.19/lisp/info.el Sun Aug 15 01:21:46 1993 --- emacs-19.20/lisp/info.el Wed Nov 10 15:45:17 1993 *************** *** 845,850 **** (or (search-forward "\n* menu:" nil t) (error "No menu in this node")) ! (or (re-search-forward (concat "\n* " menu-item ":") nil t) ! (re-search-forward (concat "\n* " menu-item) nil t) (error "No such item in menu")) (beginning-of-line) --- 845,850 ---- (or (search-forward "\n* menu:" nil t) (error "No menu in this node")) ! (or (re-search-forward (concat "\n\\* " menu-item ":") nil t) ! (re-search-forward (concat "\n\\* " menu-item) nil t) (error "No such item in menu")) (beginning-of-line) diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/isearch.el emacs-19.20/lisp/isearch.el *** emacs-19.19/lisp/isearch.el Fri Aug 13 02:32:53 1993 --- emacs-19.20/lisp/isearch.el Sun Oct 24 00:05:35 1993 *************** *** 5,12 **** ;; Author: Daniel LaLiberte ! ;; |$Date: 1993/08/13 06:32:49 $|$Revision: 1.49 $ ! ;; This file is not yet part of GNU Emacs, but it is based almost ! ;; entirely on isearch.el which is part of GNU Emacs. ;; GNU Emacs is distributed in the hope that it will be useful, --- 5,11 ---- ;; Author: Daniel LaLiberte ! ;; |$Date: 1993/10/24 04:05:22 $|$Revision: 1.52 $ ! ;; This file is part of GNU Emacs. ;; GNU Emacs is distributed in the hope that it will be useful, *************** *** 30,45 **** ;; Instructions - ;; Searching with isearch-mode.el should work just like isearch.el, - ;; except it is done in a temporary minor mode that terminates when - ;; you finish searching. - - ;; To use isearch-mode instead of the standard isearch.el, add the - ;; following to your .emacs file. The standard key bindings to - ;; isearch-forward, etc, will then use isearch-mode instead of - ;; isearch. - - ;; (defalias 'isearch 'isearch-mode) - ;; (autoload 'isearch-mode "isearch-mode") - ;; For programmed use of isearch-mode, e.g. calling (isearch-forward), ;; isearch-mode behaves modally and does not return until the search --- 29,32 ---- *************** *** 47,59 **** ;; gnus does it wrong: (call-interactively 'isearch-forward). - ;; If any package you use invokes isearching non-interactively to get - ;; the modal behavior described above, you must use the redefinitions - ;; of isearch-forward, etc. found in this file instead of those in - ;; loaddefs.el. The simplest way to ensure this is to just load - ;; isearch-mode explicitly in your .emacs instead of using the above - ;; defalias and autoload. - - ;; (load "isearch-mode") - ;; The key bindings active within isearch-mode are defined below in ;; `isearch-mode-map' which is given bindings close to the default --- 34,37 ---- *************** *** 256,259 **** --- 234,240 ---- (define-key map "\C-w" 'isearch-yank-word) (define-key map "\C-y" 'isearch-yank-line) + (define-key map [mouse-2] 'isearch-yank-kill) + ;; This overrides the default binding for t. + (define-key map [down-mouse-2] 'nil) ;; Bind the ASCII-equivalent "function keys" explicitly *************** *** 289,292 **** --- 270,274 ---- (define-key map "\M-n" 'isearch-ring-advance) (define-key map "\M-p" 'isearch-ring-retreat) + (define-key map "\M-y" 'isearch-yank-kill) (define-key map "\M-\t" 'isearch-complete) *************** *** 877,892 **** (defun isearch-yank (chunk) ;; Helper for isearch-yank-word and isearch-yank-line ! (let ((string (save-excursion ! (and (not isearch-forward) isearch-other-end ! (goto-char isearch-other-end)) ! (buffer-substring ! (point) ! (save-excursion ! (cond ! ((eq chunk 'word) ! (forward-word 1)) ! ((eq chunk 'line) ! (end-of-line))) ! (point)))))) ;; Downcase the string if not supposed to case-fold yanked strings. (if (and isearch-case-fold-search --- 859,879 ---- (defun isearch-yank (chunk) ;; Helper for isearch-yank-word and isearch-yank-line ! ;; CHUNK should be word, line or kill. ! (let ((string (cond ! ((eq chunk 'kill) ! (current-kill 0)) ! (t ! (save-excursion ! (and (not isearch-forward) isearch-other-end ! (goto-char isearch-other-end)) ! (buffer-substring ! (point) ! (save-excursion ! (cond ! ((eq chunk 'word) ! (forward-word 1)) ! ((eq chunk 'line) ! (end-of-line))) ! (point)))))))) ;; Downcase the string if not supposed to case-fold yanked strings. (if (and isearch-case-fold-search *************** *** 903,906 **** --- 890,897 ---- (isearch-search-and-update)) + (defun isearch-yank-kill () + "Pull string from kill ring into search string." + (interactive) + (isearch-yank 'kill)) (defun isearch-yank-word () diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/iso-acc.el emacs-19.20/lisp/iso-acc.el *** emacs-19.19/lisp/iso-acc.el --- emacs-19.20/lisp/iso-acc.el Sun Nov 7 16:23:09 1993 *************** *** 0 **** --- 1,223 ---- + ;;; iso-acc.el -- minor mode providing electric accent keys + ;;; Copyright (C) 1993 Free Software Foundation, Inc. + + ;; Author: Johan Vromans + ;; Version: 1.7 + ;; Maintainer: FSF + ;; Keywords: i18n + + ;; This file is part of GNU Emacs. + + ;; GNU Emacs is free software; you can redistribute it and/or modify + ;; it under the terms of the GNU General Public License as published by + ;; the Free Software Foundation; either version 2, or (at your option) + ;; any later version. + + ;; GNU Emacs is distributed in the hope that it will be useful, + ;; but WITHOUT ANY WARRANTY; without even the implied warranty of + ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ;; GNU General Public License for more details. + + ;; You should have received a copy of the GNU General Public License + ;; along with GNU Emacs; see the file COPYING. If not, write to + ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + + ;;; Commentary: + + ;; Function `iso-accents-mode' activates a minor mode + ;; (`iso-accents-minor-mode') in which typewriter "dead keys" are + ;; emulated. The purpose of this emulation is to provide a simple + ;; means for inserting accented characters according to the ISO-8859-1 + ;; character set. + ;; + ;; In `iso-accents-minor-mode', pseudo accent characters are used to + ;; introduce accented keys. The pseudo-accent characterss are: + ;; + ;; ' (minute) -> grave accent + ;; ` (backtick) -> acute accent + ;; " (second) -> diaeresis + ;; ^ (caret) -> circumflex + ;; ~ (tilde) -> tilde over the character + ;; / (slash) -> slash through the character. + ;; + ;; The action taken depends on the key that follows the pseudo accent. + ;; In general: + ;; + ;; pseudo-accent + appropriate letter -> accented letter + ;; pseudo-accent + space -> pseudo-accent + ;; pseudo-accent + pseudo-accent -> accent (if available) + ;; pseudo-accent + other -> pseudo-accent + other + ;; + ;; If the pseudo-accent is followed by anything else than a + ;; self-insert-command, the dead-key code is terminated, the + ;; pseudo-accent inserted 'as is' and the bell is rung to signal this. + ;; + ;; Function `iso-accents-mode' can be used to enable the iso accents + ;; minor mode, or disable it. + + ;;; Code: + + (provide 'iso-acc) + + (defvar iso-accents-list + '(((?' ?A) ?\301) + ((?' ?E) ?\311) + ((?' ?I) ?\315) + ((?' ?O) ?\323) + ((?' ?U) ?\332) + ((?' ?Y) ?\335) + ((?' ?a) ?\341) + ((?' ?e) ?\351) + ((?' ?i) ?\355) + ((?' ?o) ?\363) + ((?' ?u) ?\372) + ((?' ?Y) ?\375) + ((?' ?') ?\264) + ((?' ? ) ?') + ((?` ?A) ?\300) + ((?` ?E) ?\310) + ((?` ?I) ?\314) + ((?` ?O) ?\322) + ((?` ?U) ?\331) + ((?` ?a) ?\340) + ((?` ?e) ?\350) + ((?` ?i) ?\354) + ((?` ?o) ?\362) + ((?` ?u) ?\371) + ((?` ? ) ?`) + ((?` ?`) ?`) ; no special code? + ((?^ ?A) ?\302) + ((?^ ?E) ?\312) + ((?^ ?I) ?\316) + ((?^ ?O) ?\324) + ((?^ ?U) ?\333) + ((?^ ?a) ?\342) + ((?^ ?e) ?\352) + ((?^ ?i) ?\356) + ((?^ ?o) ?\364) + ((?^ ?u) ?\373) + ((?^ ? ) ?^) + ((?^ ?^) ?^) ; no special code? + ((?\" ?A) ?\304) + ((?\" ?E) ?\313) + ((?\" ?I) ?\317) + ((?\" ?O) ?\326) + ((?\" ?U) ?\334) + ((?\" ?a) ?\344) + ((?\" ?e) ?\353) + ((?\" ?i) ?\357) + ((?\" ?o) ?\366) + ((?\" ?u) ?\374) + ((?\" ?y) ?\377) + ((?\" ? ) ?\") + ((?\" ?\") ?\250) + ((?\~ ?A) ?\303) + ((?\~ ?C) ?\307) + ((?\~ ?D) ?\320) + ((?\~ ?N) ?\321) + ((?\~ ?O) ?\325) + ((?\~ ?a) ?\343) + ((?\~ ?c) ?\307) + ((?\~ ?d) ?\360) + ((?\~ ?n) ?\361) + ((?\~ ?o) ?\365) + ((?\~ ?>) ?\273) + ((?\~ ?<) ?\253) + ((?\/ ?O) ?\330) + ((?\/ ?o) ?\370) + ) + "Association list for ISO accent combinations.") + + (defvar iso-accents-minor-mode nil + "*Non-nil enables ISO Accents mode. + Setting this variable makes it local to the current buffer. + See `iso-accents-mode'.") + (make-variable-buffer-local 'iso-accents-minor-mode) + + (defun iso-accents-accent-key (prompt) + "Modify the following character by adding an accent to it." + ;; Pick up the accent character. + (if iso-accents-minor-mode + (iso-accents-compose prompt) + (char-to-string last-input-char))) + + (defun iso-accents-compose-key (prompt) + "Modify the following character by adding an accent to it." + ;; Pick up the accent character. + (let ((combined (iso-accents-compose prompt))) + (if unread-command-events + (let ((unread unread-command-events)) + (setq unread-command-events nil) + (error "Characters %s and %s cannot be composed" + (single-key-description (aref combined 0)) + (single-key-description (car unread))))) + combined)) + + (defun iso-accents-compose (prompt) + (let* ((first-char last-input-char) + ;; Wait for the second key and look up the combination. + (second-char (if (or prompt + (not (eq (key-binding "a") + 'self-insert-command))) + (progn + (message "%s%c" + (or prompt "Compose with ") + first-char) + (read-event)) + (insert first-char) + (prog1 (read-event) + (delete-region (1- (point)) (point))))) + (entry (assoc (list first-char second-char) iso-accents-list))) + (if entry + ;; Found it: delete the first character and insert the combination. + (concat (list (nth 1 entry))) + ;; Otherwise, advance and schedule the second key for execution. + (setq unread-command-events (list second-char)) + (vector first-char)))) + + (or key-translation-map (setq key-translation-map (make-sparse-keymap))) + ;; For sequences starting with an accent character, + ;; use a function that tests iso-accents-minor-mode. + (define-key key-translation-map "'" 'iso-accents-accent-key) + (define-key key-translation-map "`" 'iso-accents-accent-key) + (define-key key-translation-map "^" 'iso-accents-accent-key) + (define-key key-translation-map "\"" 'iso-accents-accent-key) + (define-key key-translation-map "~" 'iso-accents-accent-key) + (define-key key-translation-map "/" 'iso-accents-accent-key) + + ;; It is a matter of taste if you want the minor mode indicated + ;; in the mode line... + ;; If so, uncomment the next four lines. + ;; (or (assq 'iso-accents-minor-mode minor-mode-map-alist) + ;; (setq minor-mode-alist + ;; (append minor-mode-alist + ;; '((iso-accents-minor-mode " ISO-Acc"))))) + + ;;;###autoload + (defun iso-accents-mode (&optional arg) + "Toggle ISO Accents mode, in which accents modify the following letter. + This permits easy insertion of accented characters according to ISO-8859-1. + When Iso-accents mode is enabled, accent character keys + \(`, ', \", ^, / and ~) do not self-insert; instead, they modify the following + letter key so that it inserts an ISO accented letter. + + Special combinations: ~c gives a c with cedilla, + ~d gives a d with dash. + ~< and ~> give guillemets. + + With an argument, a positive argument enables ISO-accents mode, + and a negative argument disables it." + + (interactive "P") + + (if (if arg + ;; Negative arg means switch it off. + (<= (prefix-numeric-value arg) 0) + ;; No arg means toggle. + iso-accents-minor-mode) + (setq iso-accents-minor-mode nil) + + ;; Enable electric accents. + (setq iso-accents-minor-mode t))) + + ;;; iso-acc.el ends here diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/iso-transl.el emacs-19.20/lisp/iso-transl.el *** emacs-19.19/lisp/iso-transl.el --- emacs-19.20/lisp/iso-transl.el Sun Nov 7 05:24:20 1993 *************** *** 0 **** --- 1,147 ---- + ;;; iso-transl.el --- keyboard input definitions for ISO 8859/1. + + ;; Copyright (C) 1987, 1993 Free Software Foundation, Inc. + + ;; Author: Howard Gayle + ;; Maintainer: FSF + ;; Keywords: i18n + + ;; This file is part of GNU Emacs. + + ;; GNU Emacs is free software; you can redistribute it and/or modify + ;; it under the terms of the GNU General Public License as published by + ;; the Free Software Foundation; either version 2, or (at your option) + ;; any later version. + + ;; GNU Emacs is distributed in the hope that it will be useful, + ;; but WITHOUT ANY WARRANTY; without even the implied warranty of + ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ;; GNU General Public License for more details. + + ;; You should have received a copy of the GNU General Public License + ;; along with GNU Emacs; see the file COPYING. If not, write to + ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + + ;;; Code: + + (let ((map (make-sparse-keymap))) + (define-key map " " [160]) + (define-key map "!" [161]) + (define-key map "\"" (make-sparse-keymap)) + (define-key map "\"\"" [168]) + (define-key map "\"A" [196]) + (define-key map "\"E" [203]) + (define-key map "\"I" [207]) + (define-key map "\"O" [214]) + (define-key map "\"U" [220]) + (define-key map "\"a" [228]) + (define-key map "\"e" [235]) + (define-key map "\"i" [239]) + (define-key map "\"o" [246]) + (define-key map "\"u" [252]) + (define-key map "\"y" [255]) + (define-key map "'" (make-sparse-keymap)) + (define-key map "''" [180]) + (define-key map "'A" [193]) + (define-key map "'E" [201]) + (define-key map "'I" [205]) + (define-key map "'O" [211]) + (define-key map "'U" [218]) + (define-key map "'Y" [221]) + (define-key map "'a" [225]) + (define-key map "'e" [233]) + (define-key map "'i" [237]) + (define-key map "'o" [243]) + (define-key map "'u" [250]) + (define-key map "'y" [253]) + (define-key map "$" [164]) + (define-key map "+" [177]) + (define-key map "," (make-sparse-keymap)) + (define-key map ",," [184]) + (define-key map ",C" [199]) + (define-key map ",c" [231]) + (define-key map "-" [173]) + (define-key map "." [183]) + (define-key map "/" (make-sparse-keymap)) + (define-key map "//" [247]) + (define-key map "/O" [216]) + (define-key map "/o" [248]) + (define-key map "1" (make-sparse-keymap)) + (define-key map "1/" (make-sparse-keymap)) + (define-key map "1/2" [189]) + (define-key map "1/4" [188]) + (define-key map "3" (make-sparse-keymap)) + (define-key map "3/" (make-sparse-keymap)) + (define-key map "3/4" [190]) + (define-key map "<" [171]) + (define-key map "=" [175]) + (define-key map ">" [187]) + (define-key map "?" [191]) + (define-key map "A" (make-sparse-keymap)) + (define-key map "AA" [197]) + (define-key map "AE" [198]) + (define-key map "C" [169]) + (define-key map "D" [208]) + (define-key map "L" [163]) + (define-key map "P" [182]) + (define-key map "R" [174]) + (define-key map "S" [167]) + (define-key map "T" [222]) + (define-key map "Y" [165]) + (define-key map "^" (make-sparse-keymap)) + (define-key map "^1" [185]) + (define-key map "^2" [178]) + (define-key map "^3" [179]) + (define-key map "^A" [194]) + (define-key map "^E" [202]) + (define-key map "^I" [206]) + (define-key map "^O" [212]) + (define-key map "^U" [219]) + (define-key map "^a" [226]) + (define-key map "^e" [234]) + (define-key map "^i" [238]) + (define-key map "^o" [244]) + (define-key map "^u" [251]) + (define-key map "_" (make-sparse-keymap)) + (define-key map "_a" [170]) + (define-key map "_o" [186]) + (define-key map "`" (make-sparse-keymap)) + (define-key map "`A" [192]) + (define-key map "`E" [200]) + (define-key map "`I" [204]) + (define-key map "`O" [210]) + (define-key map "`U" [217]) + (define-key map "`a" [224]) + (define-key map "`e" [232]) + (define-key map "`i" [236]) + (define-key map "`o" [242]) + (define-key map "`u" [249]) + (define-key map "a" (make-sparse-keymap)) + (define-key map "aa" [229]) + (define-key map "ae" [230]) + (define-key map "c" [162]) + (define-key map "d" [240]) + (define-key map "o" [176]) + (define-key map "s" [223]) + (define-key map "t" [254]) + (define-key map "u" [181]) + (define-key map "x" [215]) + (define-key map "|" [166]) + (define-key map "~" (make-sparse-keymap)) + (define-key map "~A" [195]) + (define-key map "~N" [209]) + (define-key map "~O" [213]) + (define-key map "~a" [227]) + (define-key map "~n" [241]) + (define-key map "~o" [245]) + (define-key map "~~" [172]) + (or key-translation-map + (setq key-translation-map (make-sparse-keymap))) + (define-key key-translation-map "\C-x8" map) + (define-key isearch-mode-map "\C-x" nil) + (define-key isearch-mode-map [?\C-x t] 'isearch-other-control-char) + (define-key isearch-mode-map "\C-x8" nil)) + + (provide 'iso-transl) + + ;;; iso-transl.el ends here diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/ispell.el emacs-19.20/lisp/ispell.el *** emacs-19.19/lisp/ispell.el Sun Aug 15 01:21:52 1993 --- emacs-19.20/lisp/ispell.el Mon Nov 8 08:25:00 1993 *************** *** 46,49 **** --- 46,52 ---- and need not be mentioned here.") + (defvar ispell-look-command "look" + "*Command for running look.") + ;Each marker in this list points to the start of a word that ;ispell thought was bad last time it did the :file command. *************** *** 217,220 **** --- 220,229 ---- (defalias 'ispell-menu-map ispell-menu-map) + (define-key ispell-menu-map [ispell-complete-word-interior-frag] + '("Complete Interior Fragment" . ispell-complete-word-interior-frag)) + + (define-key ispell-menu-map [ispell-complete-word] + '("Complete Word" . ispell-complete-word)) + (define-key ispell-menu-map [reload-ispell] '("Reload Dictionary" . reload-ispell)) *************** *** 223,226 **** --- 232,238 ---- '("Continue Check" . ispell-next)) + (define-key ispell-menu-map [ispell-message] + '("Check Message" . ispell-message)) + (define-key ispell-menu-map [ispell-region] '("Check Region" . ispell-region)) *************** *** 271,275 **** (unwind-protect (progn ! (cond ((null filename) (setq filename (make-temp-name "/usr/tmp/ispell")) (setq delete-temp t) --- 283,288 ---- (unwind-protect (progn ! (cond ((or (null filename) ! (find-file-name-handler buffer-file-name)) (setq filename (make-temp-name "/usr/tmp/ispell")) (setq delete-temp t) *************** *** 302,306 **** (cond ((not (markerp (car ispell-bad-words))) (setq ispell-bad-words nil) ! (message "No misspellings.")) (t (message "Ispell parsing done.") --- 315,320 ---- (cond ((not (markerp (car ispell-bad-words))) (setq ispell-bad-words nil) ! (message "No misspellings.") ! t) (t (message "Ispell parsing done.") *************** *** 311,346 **** (defun ispell-next () ! "Resume command loop for most recent Ispell command." (interactive) (setq ispell-window-configuration nil) ! (unwind-protect ! (catch 'quit ! ;; There used to be a save-excursion here, ! ;; but that was annoying: it's better if point doesn't move ! ;; when you type q. ! (let (next) ! (while (markerp (setq next (car ispell-bad-words))) ! (switch-to-buffer (marker-buffer next)) ! (push-mark) ! (ispell-point next "at saved position.") ! (setq ispell-bad-words (cdr ispell-bad-words)) ! (set-marker next nil)))) ! (if ispell-window-configuration ! (set-window-configuration ispell-window-configuration)) ! (cond ((null ispell-bad-words) ! (error "Ispell has not yet been run.")) ! ((markerp (car ispell-bad-words)) ! (message (substitute-command-keys ! "Type \\[ispell-next] to continue."))) ! ((eq (car ispell-bad-words) nil) ! (setq ispell-bad-words nil) ! (message "No more misspellings (but checker was interrupted.)")) ! ((eq (car ispell-bad-words) t) ! (setq ispell-bad-words nil) ! (message "Ispell done.")) ! (t ! (setq ispell-bad-words nil) ! (message "Bad ispell internal list")))) ! (ispell-dump)) ;;;###autoload --- 325,363 ---- (defun ispell-next () ! "Resume command loop for most recent Ispell command. ! Return value is t unless exit is due to typing `q'." (interactive) (setq ispell-window-configuration nil) ! (prog1 ! (unwind-protect ! (catch 'ispell-quit ! ;; There used to be a save-excursion here, ! ;; but that was annoying: it's better if point doesn't move ! ;; when you type q. ! (let (next) ! (while (markerp (setq next (car ispell-bad-words))) ! (switch-to-buffer (marker-buffer next)) ! (push-mark) ! (ispell-point next "at saved position.") ! (setq ispell-bad-words (cdr ispell-bad-words)) ! (set-marker next nil))) ! t) ! (if ispell-window-configuration ! (set-window-configuration ispell-window-configuration)) ! (cond ((null ispell-bad-words) ! (error "Ispell has not yet been run.")) ! ((markerp (car ispell-bad-words)) ! (message (substitute-command-keys ! "Type \\[ispell-next] to continue."))) ! ((eq (car ispell-bad-words) nil) ! (setq ispell-bad-words nil) ! (message "No more misspellings (but checker was interrupted.)")) ! ((eq (car ispell-bad-words) t) ! (setq ispell-bad-words nil) ! (message "Ispell done.")) ! (t ! (setq ispell-bad-words nil) ! (message "Bad ispell internal list")))) ! (ispell-dump))) ;;;###autoload *************** *** 353,357 **** (ispell-next) (condition-case err ! (catch 'quit (save-window-excursion (ispell-point (point) "at point.")) --- 370,374 ---- (ispell-next) (condition-case err ! (catch 'ispell-quit (save-window-excursion (ispell-point (point) "at point.")) *************** *** 532,536 **** (setq flag nil)) ((= c ?q) ! (throw 'quit nil)) ((= c ? ) (setq flag nil)) --- 549,555 ---- (setq flag nil)) ((= c ?q) ! (throw 'ispell-quit nil)) ! ((= c (nth 3 (current-input-mode))) ! (keyboard-quit)) ((= c ? ) (setq flag nil)) *************** *** 569,574 **** (delete-region (point-min) (point-max)) (if ispell-have-new-look ! (call-process "look" nil buf nil "-r" regex) ! (call-process "look" nil buf nil regex)) (goto-char (point-min)) (forward-line 10) --- 588,593 ---- (delete-region (point-min) (point-max)) (if ispell-have-new-look ! (call-process ispell-look-command nil buf nil "-r" regex) ! (call-process ispell-look-command nil buf nil regex)) (goto-char (point-min)) (forward-line 10) *************** *** 604,607 **** --- 623,1005 ---- (kill-emacs 1)) (write-region (point-min) (point-max) "ispell.info")) + + ;;;; ispell-complete-word + + ;;; Brief Description: + ;;; Complete word fragment at point using dictionary and replace with full + ;;; word. Expansion done in current buffer like lisp-complete-symbol. + ;;; Completion of interior word fragments possible with prefix argument. + + ;;; Known Problem: + ;;; Does not use private dictionary because GNU `look' does not use it. It + ;;; would be nice if GNU `look' took standard input; this would allow gzip'ed + ;;; dictionaries to be used. GNU `look' also has a bug, see + ;;; `ispell-gnu-look-still-broken-p'. + + ;;; Motivation: + ;;; The `l', "regular expression look up", keymap option of ispell-word + ;;; (ispell-do-look) can only be run after finding a misspelled word. So + ;;; ispell-do-look can not be used to look for words starting with `cat' to + ;;; find `catechetical' since `cat' is a correctly spelled word. Furthermore, + ;;; ispell-do-look does not return the entire list returned by `look'. + ;;; + ;;; ispell-complete-word allows you to get a completion list from the system + ;;; dictionary and expand a word fragment at the current position in a buffer. + ;;; These examples assume ispell-complete-word is bound to M-TAB as it is in + ;;; text-mode; the `Complete Word' and `Complete Interior Fragment' entries of + ;;; the "Spell" submenu under the "Edit" menu may also be used instead of + ;;; M-TAB and C-u M-TAB, respectively. + ;;; + ;;; EXAMPLE 1: The word `Saskatchewan' needs to be spelled. The user may + ;;; type `Sas' and hit M-TAB and a completion list will be built using the + ;;; shell command `look' and displayed in the *Completions* buffer: + ;;; + ;;; Possible completions are: + ;;; sash sashay + ;;; sashayed sashed + ;;; sashes sashimi + ;;; Saskatchewan Saskatoon + ;;; sass sassafras + ;;; sassier sassing + ;;; sasswood sassy + ;;; + ;;; By viewing this list the user will hopefully be motivated to insert the + ;;; letter `k' after the `sas'. When M-TAB is hit again the word `Saskat' + ;;; will be inserted in place of `sas' (note case) since this is a unique + ;;; substring completion. The narrowed completion list can be viewed with + ;;; another M-TAB + ;;; + ;;; Possible completions are: + ;;; Saskatchewan Saskatoon + ;;; + ;;; Inserting the letter `c' and hitting M-TAB will narrow the completion + ;;; possibilities to just `Saskatchewan' and this will be inserted in the + ;;; buffer. At any point the user may click the mouse on a completion to + ;;; select it. + ;;; + ;;; EXAMPLE 2: The user has typed `Sasaquane' and M-$ (ispell-word) gives no + ;;; "near-misses" in which case you back up to `Sas' and hit M-TAB and find + ;;; the correct word as above. The `Sas' will be replaced by `Saskatchewan' + ;;; and the remaining word fragment `aquane' can be deleted. + ;;; + ;;; EXAMPLE 3: If a version of `look' is used that supports regular + ;;; expressions, then `ispell-have-new-look' should be t (its default) and + ;;; interior word fragments may also be used for the search. The word + ;;; `pneumonia' needs to be spelled. The user can only remember the + ;;; interior fragment `mon' in which case `C-u M-TAB' on `mon' gives a list + ;;; of all words containing the interior word fragment `mon'. Typing `p' + ;;; and M-TAB will narrow this list to all the words starting with `p' and + ;;; containing `mon' from which `pneumonia' can be found as above. + + ;;; The user-defined variables are: + ;;; + ;;; ispell-look-command + ;;; ispell-look-dictionary + ;;; ispell-gnu-look-still-broken-p + + ;;; Algorithm (some similarity to lisp-complete-symbol): + ;;; + ;;; * call-process on command ispell-look-command (default: "look") to find + ;;; words in ispell-look-dictionary matching `string' (or `regexp' if + ;;; ispell-have-new-look is t). Parse output and store results in + ;;; ispell-lookup-completions-alist. + ;;; + ;;; * Build completion list using try-completion and `string' + ;;; + ;;; * Replace `string' in buffer with matched common substring completion. + ;;; + ;;; * Display completion list only if there is no matched common substring. + ;;; + ;;; * Rebuild ispell-lookup-completions-alist, on a next call, only when + ;;; beginning of word fragment has changed. + ;;; + ;;; * Interior fragments searches are performed similarly with the exception + ;;; that the entire fragment at point is initially removed from the buffer, + ;;; the STRING passed to try-completion and all-completions is just "" and + ;;; not the interior fragment; this allows all completions containing the + ;;; interior fragment to be shown. The location in the buffer is stored to + ;;; decide whether future completion narrowing of the current list should be + ;;; done or if a new list should be built. See interior fragment example + ;;; above. + ;;; + ;;; * Robust searches are done using a `look' with -r (regular expression) + ;;; switch if ispell-have-new-look is t. + + ;;;; User-defined variables. + + (defvar ispell-look-dictionary nil + "*If non-nil then spelling dictionary as string for `ispell-complete-word'. + Overrides default dictionary file such as \"/usr/dict/words\" or GNU look's + \"${prefix}/lib/ispell/ispell.words\"") + + (defvar ispell-gnu-look-still-broken-p nil + "*t if GNU look -r can give different results with and without trialing `.*'. + Example: `look -dfr \"^ya\" foo' returns nothing, while `look -dfr \"^ya.*\" foo' + returns `yacc', where `foo' is a dictionary file containing the three lines + + y + y's + yacc + + Both commands should return `yacc'. If `ispell-complete-word' erroneously + states that no completions exist for a string, then setting this variable to t + will help find those completions.") + + ;;;; Internal variables. + + ;;; Possible completions for last word fragment. + (defvar ispell-lookup-completions-alist nil) + + ;;; Last word fragment processed by `ispell-complete-word'. + (defvar ispell-lookup-last-word nil) + + ;;; Buffer local variables. + + ;;; Value of interior-frag in last call to `ispell-complete-word'. + (defvar ispell-lookup-last-interior-p nil) + (make-variable-buffer-local 'ispell-lookup-last-interior-p) + (put 'ispell-lookup-last-interior-p 'permanent-local t) + + ;;; Buffer position in last call to `ispell-complete-word'. + (defvar ispell-lookup-last-bow nil) + (make-variable-buffer-local 'ispell-lookup-last-bow) + (put 'ispell-lookup-last-bow 'permanent-local t) + + ;;;; Interactive functions. + ;;;###autoload + (defun ispell-complete-word (&optional interior-frag) + "Complete word using letters at point to word beginning using `look'. + With optional argument INTERIOR-FRAG, word fragment at point is assumed to be + an interior word fragment in which case `ispell-have-new-look' should be t. + See also `ispell-look-dictionary' and `ispell-gnu-look-still-broken-p'." + + (interactive "P") + + ;; `look' must support regexp expressions in order to perform an interior + ;; fragment search. + (if (and interior-frag (not ispell-have-new-look)) + (error (concat "Sorry `ispell-have-new-look' is nil. " + "You also will need GNU Ispell's `look'."))) + + (let* ((completion-ignore-case t) + + ;; Get location of beginning of word fragment. + (bow (save-excursion (skip-chars-backward "a-zA-Z'") (point))) + + ;; Get the string to look up. + (string (buffer-substring bow (point))) + + ;; Get regexp for which we search and, if necessary, an interior word + ;; fragment. + (regexp (if interior-frag + (concat "^.*" string ".*") + ;; If possible use fast binary search: no trailing `.*'. + (concat "^" string + (if ispell-gnu-look-still-broken-p ".*")))) + + ;; We want all completions for case of interior fragments so set + ;; prefix to an empty string. + (prefix (if interior-frag "" string)) + + ;; Are we continuing from a previous interior fragment search? + ;; Check last value of interior-word and if the point has moved. + (continuing-an-interior-frag-p + (and ispell-lookup-last-interior-p + (equal ispell-lookup-last-bow bow))) + + ;; Are we starting a unique word fragment search? Always t for + ;; interior word fragment search. + (new-unique-string-p + (or interior-frag (null ispell-lookup-last-word) + (let ((case-fold-search t)) + ;; Can we locate last word fragment as a substring of current + ;; word fragment? If the last word fragment is larger than + ;; the current string then we will have to rebuild the list + ;; later. + (not (string-match + (concat "^" ispell-lookup-last-word) string))))) + + completion) + + ;; Check for perfect completion already. That is, maybe the user has hit + ;; M-x ispell-complete-word one too many times? + (if (string-equal string "") + (if (string-equal (concat ispell-lookup-last-word " ") + (buffer-substring + (save-excursion (forward-word -1) (point)) (point))) + (error "Perfect match...still. Please move on.") + (error "No word fragment at point."))) + + ;; Create list of words from system dictionary starting with `string' if + ;; new string and not continuing from a previous interior fragment search. + (if (and (not continuing-an-interior-frag-p) new-unique-string-p) + (setq ispell-lookup-completions-alist + (ispell-lookup-build-list string regexp))) + + ;; Check for a completion of `string' in the list and store `string' and + ;; other variables for the next call. + (setq completion (try-completion prefix ispell-lookup-completions-alist) + ispell-lookup-last-word string + ispell-lookup-last-interior-p interior-frag + ispell-lookup-last-bow bow) + + ;; Test the completion status. + (cond + + ;; * Guess is a perfect match. + ((eq completion t) + (insert " ") + (message "Perfect match.")) + + ;; * No possibilities. + ((null completion) + (message "Can't find completion for \"%s\"" string) + (beep)) + + ;; * Replace string fragment with matched common substring completion. + ((and (not (string-equal completion "")) + ;; Fold case so a completion list is built when `string' and common + ;; substring differ only in case. + (let ((case-fold-search t)) + (not (string-match (concat "^" completion "$") string)))) + (search-backward string bow) + (replace-match completion nil t) ; FIXEDCASE doesn't work? or LITERAL? + (message "Proposed unique substring. Repeat for completions list.")) + + ;; * String is a common substring completion already. Make list. + (t + (message "Making completion list...") + (if (string-equal completion "") (delete-region bow (point))) + (let ((list (all-completions prefix ispell-lookup-completions-alist))) + (with-output-to-temp-buffer " *Completions*" + (display-completion-list list))) + (message "Making completion list...done"))))) + + ;;;###autoload + (defun ispell-complete-word-interior-frag () + "Runs `ispell-complete-word' with a non-nil INTERIOR-FRAG. + A completion list is built for word fragment at point which is assumed to be + an interior word fragment. `ispell-have-new-look' should be t." + (interactive) + (ispell-complete-word t)) + + ;;;; Internal Function. + + ;;; Build list of words using ispell-look-command from dictionary + ;;; ispell-look-dictionary (if this is a non-nil string). Look for words + ;;; starting with STRING if ispell-have-new-look is nil or look for REGEXP if + ;;; ispell-have-new-look is t. Returns result as an alist suitable for use by + ;;; try-completion, all-completions, and completing-read. + (defun ispell-lookup-build-list (string regexp) + (save-excursion + (message "Building list...") + (set-buffer (get-buffer-create " *ispell look*")) + (erase-buffer) + + (if (stringp ispell-look-dictionary) + (if ispell-have-new-look + (call-process ispell-look-command nil t nil "-fr" regexp + ispell-look-dictionary) + (call-process ispell-look-command nil t nil "-f" string + ispell-look-dictionary)) + (if ispell-have-new-look + (call-process ispell-look-command nil t nil "-fr" regexp) + (call-process ispell-look-command nil t nil "-f" string))) + + ;; Build list for try-completion and all-completions by storing each line + ;; of output starting from bottom of buffer and deleting upwards. + (let (list) + (goto-char (point-min)) + (while (not (= (point-min) (point-max))) + (end-of-line) + (setq list (cons (buffer-substring (point-min) (point)) list)) + (forward-line) + (delete-region (point-min) (point))) + + ;; Clean. + (erase-buffer) + (message "Building list...done") + + ;; Make the list into an alist and return. + (mapcar 'list (nreverse list))))) + + ;; Return regexp-quote of STRING if STRING is non-empty. + ;; Otherwise return an unmatchable regexp. + (defun ispell-non-empty-string (string) + (if (or (not string) (string-equal string "")) + "\\'\\`" ; An unmatchable string if string is null. + (regexp-quote string))) + + (defvar ispell-message-cite-regexp "^ \\|^\t" + "*Regular expression to match lines cited from one message into another.") + + ;;;###autoload + (defun ispell-message () + "Check the spelling of a mail message or news post. + Don't check spelling of message headers or included messages. + + To spell-check whenever a message is sent, include this line in .emacs: + (setq news-inews-hook (setq mail-send-hook 'ispell-message)) + + Or you can bind the function to C-c i in gnus or mail with: + (setq mail-mode-hook (setq news-reply-mode-hook + (function (lambda () (local-set-key \"\\C-ci\" 'ispell-message)))))" + (interactive) + (save-excursion + (let (non-internal-message + (old-case-fold-search case-fold-search) + (case-fold-search nil)) + (goto-char (point-min)) + ;; Don't spell-check the headers. + (if (search-forward mail-header-separator nil t) + ;; Move to first body line. + (forward-line 1) + (while (and (looking-at "[a-zA-Z-]+:\\|\t\\| ") + (not (eobp))) + (forward-line 1)) + (setq non-internal-message t) + ) + (let ((cite-regexp ;Prefix of inserted text + (cond + ((featurep 'supercite) ; sc 3.0 + (concat "\\(" (sc-cite-regexp) "\\)" "\\|" + (ispell-non-empty-string sc-reference-tag-string))) + ((featurep 'sc) ; sc 2.3 + (concat "\\(" sc-cite-regexp "\\)" "\\|" + (ispell-non-empty-string sc-reference-tag-string))) + (non-internal-message ; Assume nn sent us this message. + (concat "In [a-zA-Z.]+ you write:" "\\|" + "In <[^,;&+=]+> [^,;&+=]+ writes:" "\\|" + " *> *")) + ((equal major-mode 'news-reply-mode) ;Gnus + (concat "In article <" "\\|" + (if mail-yank-prefix + (ispell-non-empty-string mail-yank-prefix) + ispell-message-cite-regexp))) + ((boundp 'vm-included-text-prefix) ; VM mail message + (concat "[^,;&+=]+ writes:" "\\|" + (ispell-non-empty-string vm-included-text-prefix) + )) + ((boundp 'mh-ins-buf-prefix) ; mh mail message + (ispell-non-empty-string mh-ins-buf-prefix)) + (mail-yank-prefix ; vanilla mail message. + (ispell-non-empty-string mail-yank-prefix)) + (t ispell-message-cite-regexp))) + (continue t)) + + (while (and (not (eobp)) continue) + ;; Skip across text cited from other messages. + (while (and (looking-at (concat "^[ \t]*$\\|" cite-regexp)) + (not (eobp))) + (forward-line 1)) + (if (not (eobp)) + ;; Check the next batch of lines that *aren't* cited. + (let ((start (point))) + (if (re-search-forward + (concat "^\\(" cite-regexp "\\)") nil 'end) + (beginning-of-line)) + (let ((case-fold-search old-case-fold-search)) + (save-excursion + (setq continue (ispell-region (- start 1) (point)))))))))))) (provide 'ispell) diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/loaddefs.el emacs-19.20/lisp/loaddefs.el *** emacs-19.19/lisp/loaddefs.el Wed Aug 11 14:23:18 1993 --- emacs-19.20/lisp/loaddefs.el Tue Nov 9 18:57:23 1993 *************** *** 229,232 **** --- 229,237 ---- ;; (error "That function key is not bound to anything.")) + ;; Apparently some terminals have a labeled help key. + (define-key function-key-map [help] "\C-h") + (define-key global-map [menu] 'execute-extended-command) + (define-key global-map [find] 'search-forward) + ;; natural bindings for terminal keycaps --- defined in X keysym order (define-key global-map [home] 'beginning-of-buffer) *************** *** 371,374 **** --- 376,380 ---- (define-key ctl-x-map "rg" 'insert-register) (define-key ctl-x-map "rr" 'copy-rectangle-to-register) + (define-key ctl-x-map "rc" 'clear-rectangle) (define-key ctl-x-map "rk" 'kill-rectangle) (define-key ctl-x-map "ry" 'yank-rectangle) *************** *** 985,988 **** --- 991,1154 ---- ;;;*** + + ;;;### (autoloads (list-bookmarks bookmark-load bookmark-save bookmark-write bookmark-delete bookmark-insert bookmark-rename bookmark-locate bookmark-relocate bookmark-jump bookmark-set) "bookmark" "bookmark.el" (11468 39303)) + ;;; Generated autoloads from bookmark.el + + (if (symbolp (key-binding "r")) nil (progn (define-key ctl-x-map "rb" (quote bookmark-jump)) (define-key ctl-x-map "rm" (quote bookmark-set)) (define-key ctl-x-map "rl" (quote list-bookmarks)))) + + (defvar bookmark-map nil "\ + Keymap containing bindings to bookmark functions. + It is not bound to any key by default: to bind it + so that you have a bookmark prefix, just use `global-set-key' and bind a + key of your choice to `bookmark-map'. All interactive bookmark + functions have a binding in this keymap.") + + (define-prefix-command (quote bookmark-map)) + + (define-key bookmark-map "x" (quote bookmark-set)) + + (define-key bookmark-map "m" (quote bookmark-set)) + + (define-key bookmark-map "j" (quote bookmark-jump)) + + (define-key bookmark-map "g" (quote bookmark-jump)) + + (define-key bookmark-map "i" (quote bookmark-insert)) + + (define-key bookmark-map "e" (quote edit-bookmarks)) + + (define-key bookmark-map "f" (quote bookmark-locate)) + + (define-key bookmark-map "r" (quote bookmark-rename)) + + (define-key bookmark-map "d" (quote bookmark-delete)) + + (define-key bookmark-map "l" (quote bookmark-load)) + + (define-key bookmark-map "w" (quote bookmark-write)) + + (define-key bookmark-map "s" (quote bookmark-save)) + + (add-hook (quote kill-emacs-hook) (function (lambda nil (and (featurep (quote bookmark)) bookmark-alist (bookmark-time-to-save-p t) (bookmark-save))))) + + (autoload (quote bookmark-set) "bookmark" "\ + Set a bookmark named NAME inside a file. + With prefix arg, will not overwrite a bookmark that has the same name + as NAME if such a bookmark already exists, but instead will \"push\" + the new bookmark onto the bookmark alist. Thus the most recently set + bookmark with name NAME would be the one in effect at any given time, + but the others are still there, should you decide to delete the most + recent one. + + To yank words from the text of the buffer and use them as part of the + bookmark name, type C-w while setting a bookmark. Successive C-w's + yank successive words. + + Typing C-v inserts the name of the current file being visited. Typing + C-u inserts the name of the last bookmark used in the buffer (as an + aid in using a single bookmark name to track your progress through a + large file). If no bookmark was used, then C-u behaves like C-v and + inserts the name of the file being visited. + + Use \\[bookmark-delete] to remove bookmarks (you give it a name, + and it removes only the first instance of a bookmark with that name from + the list of bookmarks.)" t nil) + + (autoload (quote bookmark-jump) "bookmark" "\ + Jump to bookmark BOOKMARK (a point in some file). + You may have a problem using this function if the value of variable + `bookmark-alist' is nil. If that happens, you need to load in some + bookmarks. See help on function `bookmark-load' for more about + this. + + If the file pointed to by BOOKMARK no longer exists, you will be asked + if you wish to give the bookmark a new location, and bookmark-jump + will then jump to the new location, as well as recording it in place + of the old one in the permanent bookmark record." t nil) + + (autoload (quote bookmark-relocate) "bookmark" "\ + Relocate BOOKMARK -- prompts for a filename, and makes an already + existing bookmark point to that file, instead of the one it used to + point at. Useful when a file has been renamed after a bookmark was + set in it." t nil) + + (autoload (quote bookmark-locate) "bookmark" "\ + Insert the name of the file associated with BOOKMARK. + Optional second arg NO-INSERTION means merely return the filename as a + string." t nil) + + (autoload (quote bookmark-rename) "bookmark" "\ + Change the name of OLD-BOOKMARK to NEWNAME. + If called from keyboard, prompts for OLD-BOOKMARK and NEWNAME. + If called from menubar, OLD-BOOKMARK is selected from a menu, and + prompts for NEWNAME. + If called from Lisp, prompts for NEWNAME if only OLD-BOOKMARK was + passed as an argument. If called with two strings, then no prompting + is done. You must pass at least OLD-BOOKMARK when calling from Lisp. + + While you are entering the new name, consecutive C-w's insert + consectutive words from the text of the buffer into the new bookmark + name, and C-v inserts the name of the file." t nil) + + (autoload (quote bookmark-insert) "bookmark" "\ + Insert the text of the file pointed to by bookmark BOOKMARK. + You may have a problem using this function if the value of variable + `bookmark-alist' is nil. If that happens, you need to load in some + bookmarks. See help on function `bookmark-load' for more about + this." t nil) + + (autoload (quote bookmark-delete) "bookmark" "\ + Delete the bookmark named NAME from the bookmark list. + Removes only the first instance of a bookmark with that name. If + there are one or more other bookmarks with the same name, they will + not be deleted. Defaults to the \"current\" bookmark (that is, the + one most recently used in this file, if any)." t nil) + + (autoload (quote bookmark-write) "bookmark" "\ + Write bookmarks to a file (for which the user will be prompted + interactively). Don't use this in Lisp programs; use bookmark-save + instead." t nil) + + (autoload (quote bookmark-save) "bookmark" "\ + Save currently defined bookmarks. + Saves by default in the file defined by the variable + `bookmark-file'. With a prefix arg, save it in file FILE. + + If you are calling this from Lisp, the two arguments are PREFIX-ARG + and FILE, and if you just want it to write to the default file, then + pass no arguments. Or pass in nil and FILE, and it will save in FILE + instead. If you pass in one argument, and it is non-nil, then the + user will be interactively queried for a file to save in. + + When you want to load in the bookmarks from a file, use + `bookmark-load', \\[bookmark-load]. That function will prompt you + for a file, defaulting to the file defined by variable + `bookmark-file'." t nil) + + (autoload (quote bookmark-load) "bookmark" "\ + Load bookmarks from FILE (which must be in bookmark format). + Appends loaded bookmarks to the front of the list of bookmarks. If + optional second argument REVERT is non-nil, existing bookmarks are + destroyed. Optional third arg NO-MSG means don't display any messages + while loading. + + If you load a file that doesn't contain a proper bookmark alist, you + will corrupt Emacs's bookmark list. Generally, you should only load + in files that were created with the bookmark functions in the first + place. Your own personal bookmark file, `~/.emacs-bkmrks', is + maintained automatically by Emacs; you shouldn't need to load it + explicitly." t nil) + + (defalias (quote edit-bookmarks) (quote list-bookmarks)) + + (autoload (quote list-bookmarks) "bookmark" "\ + Display a list of existing bookmarks. + The list is displayed in a buffer named `*Bookmark List*'. + The leftmost column displays a D if the bookmark is flagged for + deletion, or > if it is flagged for displaying." t nil) + (autoload 'menu-bar-bookmark-map "bookmark" nil t 'keymap) + + ;;;*** + ;;;### (autoloads (batch-byte-compile display-call-tree byte-compile compile-defun byte-compile-file byte-recompile-directory) "bytecomp" "bytecomp.el" (11367 8231)) ;;; Generated autoloads from bytecomp.el *************** *** 2497,2501 **** ;;;*** ! ;;;### (autoloads (complete-tag select-tags-table tags-apropos list-tags tags-query-replace tags-search tags-loop-continue next-file find-tag-regexp find-tag-other-frame find-tag-other-window find-tag find-tag-noselect tags-table-files visit-tags-table) "etags" "etags.el" (11364 43321)) ;;; Generated autoloads from etags.el --- 2663,2667 ---- ;;;*** ! ;;;### (autoloads (complete-tag select-tags-table tags-apropos list-tags tags-query-replace tags-search tags-loop-continue next-file find-tag-regexp find-tag-other-frame find-tag-other-window find-tag find-tag-noselect tags-table-files visit-tags-table) "etags" "etags.el" (11394 10144)) ;;; Generated autoloads from etags.el *************** *** 2621,2626 **** (autoload (quote next-file) "etags" "\ Select next file among files in current tags table. ! Non-nil first argument (prefix arg, if interactive) ! initializes to the beginning of the list of files in the tags table. Non-nil second argument NOVISIT means use a temporary buffer --- 2787,2794 ---- (autoload (quote next-file) "etags" "\ Select next file among files in current tags table. ! ! A first argument of t (prefix arg, if interactive) initializes to the ! beginning of the list of files in the tags table. If the argument is ! neither nil nor t, it is evalled to initialize the list of files. Non-nil second argument NOVISIT means use a temporary buffer *************** *** 2632,2636 **** (autoload (quote tags-loop-continue) "etags" "\ Continue last \\[tags-search] or \\[tags-query-replace] command. ! Used noninteractively with non-nil argument to begin such a command. Two variables control the processing we do on each file: the value of `tags-loop-scan' is a form to be executed on each file --- 2800,2805 ---- (autoload (quote tags-loop-continue) "etags" "\ Continue last \\[tags-search] or \\[tags-query-replace] command. ! Used noninteractively with non-nil argument to begin such a command (the ! argument is passed to `next-file', which see). Two variables control the processing we do on each file: the value of `tags-loop-scan' is a form to be executed on each file *************** *** 3217,3221 **** ;;;*** ! ;;;### (autoloads (ispell-region ispell-word ispell) "ispell" "ispell.el" (11344 51605)) ;;; Generated autoloads from ispell.el --- 3386,3405 ---- ;;;*** ! ;;;### (autoloads (iso-accents-mode) "iso-acc" "iso-acc.el" (11467 25993)) ! ;;; Generated autoloads from iso-acc.el ! ! (autoload (quote iso-accents-mode) "iso-acc" "\ ! Toggle a minor mode in which accents modify the following letter. ! This permits easy insertion of accented characters according to ISO-8859-1. ! When Iso-accents mode is enabled, accent character keys ! (', \", ^ and ~) do not self-insert; instead, they modify the following ! letter key so that it inserts an ISO accented letter. ! ! With an argument, a positive argument enables ISO-accents mode, ! and a negative argument disables it." t nil) ! ! ;;;*** ! ! ;;;### (autoloads (ispell-message ispell-complete-word-interior-frag ispell-complete-word ispell-region ispell-word ispell) "ispell" "ispell.el" (11485 39692)) ;;; Generated autoloads from ispell.el *************** *** 3251,3254 **** --- 3435,3460 ---- Check the spelling for all of the words in the region." t nil) + (autoload (quote ispell-complete-word) "ispell" "\ + Complete word using letters at point to word beginning using `look'. + With optional argument INTERIOR-FRAG, word fragment at point is assumed to be + an interior word fragment in which case `ispell-have-new-look' should be t. + See also `ispell-look-dictionary' and `ispell-gnu-look-still-broken-p'." t nil) + + (autoload (quote ispell-complete-word-interior-frag) "ispell" "\ + Runs `ispell-complete-word' with a non-nil INTERIOR-FRAG. + A completion list is built for word fragment at point which is assumed to be + an interior word fragment. `ispell-have-new-look' should be t." t nil) + + (autoload (quote ispell-message) "ispell" "\ + Check the spelling of a mail message or news post. + Don't check spelling of message headers or included messages. + + To spell-check whenever a message is sent, include this line in .emacs: + (setq news-inews-hook (setq mail-send-hook 'ispell-message)) + + Or you can bind the function to C-c i in gnus or mail with: + (setq mail-mode-hook (setq news-reply-mode-hook + (function (lambda () (local-set-key \"\\C-ci\" 'ispell-message)))))" t nil) + ;;;*** *************** *** 3565,3569 **** ;;;*** ! ;;;### (autoloads (map-y-or-n-p) "map-ynp" "map-ynp.el" (11342 16097)) ;;; Generated autoloads from map-ynp.el --- 3771,3775 ---- ;;;*** ! ;;;### (autoloads (map-y-or-n-p) "map-ynp" "map-ynp.el" (11449 65482)) ;;; Generated autoloads from map-ynp.el *************** *** 3602,3605 **** --- 3808,3814 ---- nil, the prompt is repeated for the same object. + Final optional argument NO-CURSOR-IN-ECHO-AREA non-nil says not to set + `cursor-in-echo-area' while prompting. + This function uses `query-replace-map' to define the standard responses, but not all of the responses which `query-replace' understands *************** *** 4836,4839 **** --- 5045,5068 ---- ;;;*** + ;;;### (autoloads (texinfo-format-region texinfo-format-buffer) "texinfmt" "texinfmt.el" (11462 52384)) + ;;; Generated autoloads from texinfmt.el + + (autoload (quote texinfo-format-buffer) "texinfmt" "\ + Process the current buffer as texinfo code, into an Info file. + The Info file output is generated in a buffer visiting the Info file + names specified in the @setfilename command. + + Non-nil argument (prefix, if interactive) means don't make tag table + and don't split the file if large. You can use Info-tagify and + Info-split to do these manually." t nil) + + (autoload (quote texinfo-format-region) "texinfmt" "\ + Convert the current region of the Texinfo file to Info format. + This lets you see what that part of the file will look like in Info. + The command is bound to \\[texinfo-format-region]. The text that is + converted to Info is stored in a temporary buffer." t nil) + + ;;;*** + ;;;### (autoloads (texinfo-mode) "texinfo" "texinfo.el" (11367 23334)) ;;; Generated autoloads from texinfo.el *************** *** 4908,4911 **** --- 5137,5186 ---- ;;;*** + ;;;### (autoloads (texinfo-sequential-node-update texinfo-every-node-update texinfo-update-node) "texnfo-upd" "texnfo-upd.el" (11488 11824)) + ;;; Generated autoloads from texnfo-upd.el + + (autoload (quote texinfo-update-node) "texnfo-upd" "\ + Without any prefix argument, update the node in which point is located. + Non-nil argument (prefix, if interactive) means update the nodes in the + marked region. + + The functions for creating or updating nodes and menus, and their + keybindings, are: + + texinfo-update-node (&optional region-p) \\[texinfo-update-node] + texinfo-every-node-update () \\[texinfo-every-node-update] + texinfo-sequential-node-update (&optional region-p) + + texinfo-make-menu (&optional region-p) \\[texinfo-make-menu] + texinfo-all-menus-update () \\[texinfo-all-menus-update] + texinfo-master-menu () + + texinfo-indent-menu-description (column &optional region-p) + + The `texinfo-column-for-description' variable specifies the column to + which menu descriptions are indented. Its default value is 32." t nil) + + (autoload (quote texinfo-every-node-update) "texnfo-upd" "\ + Update every node in a Texinfo file." t nil) + + (autoload (quote texinfo-sequential-node-update) "texnfo-upd" "\ + Update one node (or many) in a Texinfo file with sequential pointers. + + This function causes the `Next' or `Previous' pointer to point to the + immediately preceding or following node, even if it is at a higher or + lower hierarchical level in the document. Continually pressing `n' or + `p' takes you straight through the file. + + Without any prefix argument, update the node in which point is located. + Non-nil argument (prefix, if interactive) means update the nodes in the + marked region. + + This command makes it awkward to navigate among sections and + subsections; it should be used only for those documents that are meant + to be read like a novel rather than a reference, and for which the + Info `g*' command is inadequate." t nil) + + ;;;*** + ;;;### (autoloads (display-time) "time" "time.el" (11322 20891)) ;;; Generated autoloads from time.el *************** *** 5426,5429 **** --- 5701,5815 ---- (autoload (quote vip-mode) "vip" "\ Turn on VIP emulation of VI." t nil) + + ;;;*** + + ;;;### (autoloads (wordstar-mode) "ws-mode" "ws-mode.el" (11486 24343)) + ;;; Generated autoloads from ws-mode.el + + (autoload (quote wordstar-mode) "ws-mode" "\ + Major mode with WordStar-like key bindings. + + BUGS: + - Help menus with WordStar commands (C-j just calls help-for-help) + are not implemented + - Options for search and replace + - Show markers (C-k h) is somewhat strange + - Search and replace (C-q a) is only available in forward direction + + No key bindings beginning with ESC are installed, they will work + Emacs-like. + + The key bindings are: + + C-a backward-word + C-b fill-paragraph + C-c scroll-up-line + C-d forward-char + C-e previous-line + C-f forward-word + C-g delete-char + C-h backward-char + C-i indent-for-tab-command + C-j help-for-help + C-k ordstar-C-k-map + C-l ws-repeat-search + C-n open-line + C-p quoted-insert + C-r scroll-down-line + C-s backward-char + C-t kill-word + C-u keyboard-quit + C-v overwrite-mode + C-w scroll-down + C-x next-line + C-y kill-complete-line + C-z scroll-up + + C-k 0 ws-set-marker-0 + C-k 1 ws-set-marker-1 + C-k 2 ws-set-marker-2 + C-k 3 ws-set-marker-3 + C-k 4 ws-set-marker-4 + C-k 5 ws-set-marker-5 + C-k 6 ws-set-marker-6 + C-k 7 ws-set-marker-7 + C-k 8 ws-set-marker-8 + C-k 9 ws-set-marker-9 + C-k b ws-begin-block + C-k c ws-copy-block + C-k d save-buffers-kill-emacs + C-k f find-file + C-k h ws-show-markers + C-k i ws-indent-block + C-k k ws-end-block + C-k p ws-print-block + C-k q kill-emacs + C-k r insert-file + C-k s save-some-buffers + C-k t ws-mark-word + C-k u ws-exdent-block + C-k C-u keyboard-quit + C-k v ws-move-block + C-k w ws-write-block + C-k x kill-emacs + C-k y ws-delete-block + + C-o c center-line + C-o b switch-to-buffer + C-o j justify-current-line + C-o k kill-buffer + C-o l list-buffers + C-o m auto-fill-mode + C-o r set-fill-column + C-o C-u keyboard-quit + C-o wd delete-other-windows + C-o wh split-window-horizontally + C-o wo other-window + C-o wv split-window-vertically + + C-q 0 ws-find-marker-0 + C-q 1 ws-find-marker-1 + C-q 2 ws-find-marker-2 + C-q 3 ws-find-marker-3 + C-q 4 ws-find-marker-4 + C-q 5 ws-find-marker-5 + C-q 6 ws-find-marker-6 + C-q 7 ws-find-marker-7 + C-q 8 ws-find-marker-8 + C-q 9 ws-find-marker-9 + C-q a ws-query-replace + C-q b ws-to-block-begin + C-q c end-of-buffer + C-q d end-of-line + C-q f ws-search + C-q k ws-to-block-end + C-q l ws-undo + C-q p ws-last-cursorp + C-q r beginning-of-buffer + C-q C-u keyboard-quit + C-q w ws-last-error + C-q y ws-kill-eol + C-q DEL ws-kill-bol + " t nil) ;;;*** diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/lucid.el emacs-19.20/lisp/lucid.el *** emacs-19.19/lisp/lucid.el Sun Aug 15 01:22:10 1993 --- emacs-19.20/lisp/lucid.el Wed Nov 10 15:26:28 1993 *************** *** 53,68 **** (setcdr tail new-parent)))) - (defun remove-hook (hook-var function) - "Remove a function from a hook, if it is present. - First argument HOOK-VAR (a symbol) is the name of a hook, second - argument FUNCTION is the function to remove (compared with `eq')." - (if (boundp 'hook-var) - (let ((old (symbol-value hook-var))) - ;; If the hook value is a single function, turn it into a list. - (if (or (not (listp old)) (eq (car old) 'lambda)) - (set hook-var (list old))) - ;; Now delete FUNCTION. - (set hook-var (delq function (symbol-value hook-var)))))) - (defun remprop (symbol prop) (let ((plist (symbol-plist symbol))) --- 53,56 ---- diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/mailabbrev.el emacs-19.20/lisp/mailabbrev.el *** emacs-19.19/lisp/mailabbrev.el Sun Aug 15 01:22:15 1993 --- emacs-19.20/lisp/mailabbrev.el Fri Oct 1 18:40:11 1993 *************** *** 203,207 **** (build-mail-abbrevs (substitute-in-file-name ! (buffer-substring (match-beginning 1) (match-end 1)) t))) (re-search-forward "[ \t]+\\([^ \t\n]+\\)") (let* ((name (buffer-substring --- 203,207 ---- (build-mail-abbrevs (substitute-in-file-name ! (buffer-substring (match-beginning 1) (match-end 1))))) (re-search-forward "[ \t]+\\([^ \t\n]+\\)") (let* ((name (buffer-substring diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/man.el emacs-19.20/lisp/man.el *** emacs-19.19/lisp/man.el Sun Aug 15 01:22:22 1993 --- emacs-19.20/lisp/man.el Thu Nov 11 02:16:53 1993 *************** *** 81,84 **** --- 81,85 ---- This variable may have one of the following values: + newframe -- put the manpage in its own frame (see `Man-frame-parameters') bully -- make the manpage the current buffer and only window aggressive -- make the manpage the current buffer in the other window *************** *** 90,93 **** --- 91,97 ---- Any other value of `Man-notify' is equivalent to `meek'.") + (defvar Man-frame-parameters nil + "*Frame parameter list for creating a new frame for a manual page.") + (defvar Man-reuse-okay-p t "*Reuse a manpage buffer if possible. *************** *** 146,150 **** "-e '/^Printed [0-9].*[0-9]$/d'" "-e '/^[ \\t]*X Version 1[01].*Release [0-9]/d'" ! "-e '/^Sun Microsystems.*Last change:/d'" "-e '/^Sun Release [0-9].*[0-9]$/d'" "-e '/^\\n$/D'" --- 150,154 ---- "-e '/^Printed [0-9].*[0-9]$/d'" "-e '/^[ \\t]*X Version 1[01].*Release [0-9]/d'" ! "-e '/^[A-za-z].*Last change:/d'" "-e '/^Sun Release [0-9].*[0-9]$/d'" "-e '/^\\n$/D'" *************** *** 185,189 **** "*Hooks for Man mode.") ! (defvar Man-section-regexp "[0-9][a-zA-Z+]*" "*Regular expression describing a manpage section within parentheses.") --- 189,193 ---- "*Hooks for Man mode.") ! (defvar Man-section-regexp "[0-9][a-zA-Z+]*\\|[LNln]" "*Regular expression describing a manpage section within parentheses.") *************** *** 417,422 **** (setq man-args (Man-translate-references man-args)) ! (if Man-downcase-section-letters-p ! (setq man-args (Man-downcase man-args))) (Man-getpage-in-background man-args (consp arg)) )) --- 421,427 ---- (setq man-args (Man-translate-references man-args)) ! ;; This is apparently already done correctly via Man-translate-references. ! ;; (if Man-downcase-section-letters-p ! ;; (setq man-args (Man-downcase man-args))) (Man-getpage-in-background man-args (consp arg)) )) *************** *** 449,452 **** --- 454,460 ---- See the variable `Man-notify' for the different notification behaviors." (cond + ((eq Man-notify 'newframe) + (set-buffer man-buffer) + (new-frame Man-frame-parameters)) ((eq Man-notify 'bully) (pop-to-buffer man-buffer) diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/map-ynp.el emacs-19.20/lisp/map-ynp.el *** emacs-19.19/lisp/map-ynp.el Sun Aug 15 01:22:25 1993 --- emacs-19.20/lisp/map-ynp.el Wed Nov 10 23:40:47 1993 *************** *** 1,5 **** ;;; map-ynp.el --- General-purpose boolean question-asker. ! ;;; Copyright (C) 1991, 1992 Free Software Foundation, Inc. ;; Author: Roland McGrath --- 1,5 ---- ;;; map-ynp.el --- General-purpose boolean question-asker. ! ;;; Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. ;; Author: Roland McGrath *************** *** 34,38 **** ;;;###autoload ! (defun map-y-or-n-p (prompter actor list &optional help action-alist) "Ask a series of boolean questions. Takes args PROMPTER ACTOR LIST, and optional args HELP and ACTION-ALIST. --- 34,39 ---- ;;;###autoload ! (defun map-y-or-n-p (prompter actor list &optional help action-alist ! no-cursor-in-echo-area) "Ask a series of boolean questions. Takes args PROMPTER ACTOR LIST, and optional args HELP and ACTION-ALIST. *************** *** 68,71 **** --- 69,75 ---- nil, the prompt is repeated for the same object. + Final optional argument NO-CURSOR-IN-ECHO-AREA non-nil says not to set + `cursor-in-echo-area' while prompting. + This function uses `query-replace-map' to define the standard responses, but not all of the responses which `query-replace' understands *************** *** 115,127 **** (setq quit-flag nil) ;; Prompt the user about this object. ! (let ((cursor-in-echo-area t)) (message "%s(y, n, !, ., q, %sor %s) " prompt user-keys ! (key-description (char-to-string help-char))) (setq char (read-event))) ;; Show the answer to the question. (message "%s(y, n, !, ., q, %sor %s) %s" prompt user-keys ! (key-description (char-to-string help-char)) (single-key-description char)) (setq def (lookup-key map (vector char))) --- 119,131 ---- (setq quit-flag nil) ;; Prompt the user about this object. ! (let ((cursor-in-echo-area (not no-cursor-in-echo-area))) (message "%s(y, n, !, ., q, %sor %s) " prompt user-keys ! (key-description (vector help-char))) (setq char (read-event))) ;; Show the answer to the question. (message "%s(y, n, !, ., q, %sor %s) %s" prompt user-keys ! (key-description (vector help-char)) (single-key-description char)) (setq def (lookup-key map (vector char))) *************** *** 202,206 **** ;; Random char. (message "Type %s for help." ! (key-description (char-to-string help-char))) (beep) (sit-for 1) --- 206,210 ---- ;; Random char. (message "Type %s for help." ! (key-description (vector help-char))) (beep) (sit-for 1) diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/menu-bar.el emacs-19.20/lisp/menu-bar.el *** emacs-19.19/lisp/menu-bar.el Sat Aug 14 06:31:28 1993 --- emacs-19.20/lisp/menu-bar.el Tue Nov 9 02:28:34 1993 *************** *** 24,28 **** ;;; Code: ! (define-key global-map [menu-bar] (make-sparse-keymap "menu-bar")) (defvar menu-bar-help-menu (make-sparse-keymap "Help")) ;; Put Help item last. --- 24,31 ---- ;;; Code: ! ;; Don't clobber an existing menu-bar keymap, to preserve any menu-bar key ! ;; definitions made in loaddefs.el. ! (or (lookup-key global-map [menu-bar]) ! (define-key global-map [menu-bar] (make-sparse-keymap "menu-bar"))) (defvar menu-bar-help-menu (make-sparse-keymap "Help")) ;; Put Help item last. *************** *** 39,42 **** --- 42,47 ---- '("Kill Buffer" . kill-this-buffer)) (define-key menu-bar-file-menu [delete-frame] '("Delete Frame" . delete-frame)) + (define-key menu-bar-file-menu [bookmark] + '("Bookmarks..." . menu-bar-bookmark-map)) (define-key menu-bar-file-menu [print-buffer] '("Print Buffer" . print-buffer)) (define-key menu-bar-file-menu [revert-buffer] *************** *** 49,56 **** (define-key menu-bar-file-menu [new-frame] '("New Frame" . new-frame)) - (define-key menu-bar-edit-menu [spell] '("Spell..." . ispell-menu-map)) (define-key menu-bar-edit-menu [fill] '("Fill" . fill-region)) (define-key menu-bar-edit-menu [clear] '("Clear" . delete-region)) (define-key menu-bar-edit-menu [choose-next-paste] '("Choose Next Paste" . mouse-menu-choose-yank)) --- 54,68 ---- (define-key menu-bar-file-menu [new-frame] '("New Frame" . new-frame)) (define-key menu-bar-edit-menu [spell] '("Spell..." . ispell-menu-map)) (define-key menu-bar-edit-menu [fill] '("Fill" . fill-region)) (define-key menu-bar-edit-menu [clear] '("Clear" . delete-region)) + (define-key menu-bar-edit-menu [re-search-back] + '("Regexp Search Backwards" . re-search-backward)) + (define-key menu-bar-edit-menu [search-back] + '("Search Backwards" . search-backward)) + (define-key menu-bar-edit-menu [re-search-fwd] + '("Regexp Search" . re-search-forward)) + (define-key menu-bar-edit-menu [search-fwd] + '("Search" . search-forward)) (define-key menu-bar-edit-menu [choose-next-paste] '("Choose Next Paste" . mouse-menu-choose-yank)) *************** *** 107,111 **** '(or revert-buffer-function revert-buffer-insert-file-contents-function (and (buffer-file-name) ! (not (verify-visited-file-modtime (current-buffer)))))) ;; Permit deleting frame if it would leave a visible or iconified frame. (put 'delete-frame 'menu-enable --- 119,124 ---- '(or revert-buffer-function revert-buffer-insert-file-contents-function (and (buffer-file-name) ! (or (buffer-modified-p) ! (not (verify-visited-file-modtime (current-buffer))))))) ;; Permit deleting frame if it would leave a visible or iconified frame. (put 'delete-frame 'menu-enable diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/mouse-sel.el emacs-19.20/lisp/mouse-sel.el *** emacs-19.19/lisp/mouse-sel.el --- emacs-19.20/lisp/mouse-sel.el Mon Nov 8 09:27:17 1993 *************** *** 0 **** --- 1,437 ---- + ;;; mouse-sel.el --- Multi-click selection support for Emacs 19 + + ;; Copyright (C) 1993 Free Software Foundation, Inc. + + ;; Author: Mike Williams + ;; Keywords: mouse + ;; Version: $Revision: 1.1 $ + + ;; This file is part of GNU Emacs. + + ;; GNU Emacs is free software; you can redistribute it and/or modify + ;; it under the terms of the GNU General Public License as published by + ;; the Free Software Foundation; either version 2, or (at your option) + ;; any later version. + + ;; GNU Emacs is distributed in the hope that it will be useful, + ;; but WITHOUT ANY WARRANTY; without even the implied warranty of + ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ;; GNU General Public License for more details. + + ;;; Commentary: + ;; + ;; This module provides multi-click mouse support for GNU Emacs versions + ;; 19.18 and later. I've tried to make it behave more like standard X + ;; clients (eg. xterm) than the default Emacs 19 mouse selection handlers. + ;; Basically: + ;; + ;; * Clicking mouse-1 starts (cancels) selection, dragging extends it. + ;; + ;; * Clicking or dragging mouse-3 extends the selection as well. + ;; + ;; * Double-clicking on word constituents selects words. + ;; Double-clicking on symbol constituents selects symbols. + ;; Double-clicking on quotes or parentheses selects sexps. + ;; Double-clicking on whitespace selects whitespace. + ;; Triple-clicking selects lines. + ;; + ;; * Selecting sets the region & X primary selection, but does NOT affect + ;; the kill-ring. Because the mouse handlers set the primary selection + ;; directly, mouse-sel sets the variables interprogram-cut-function + ;; and interprogram-paste-function to nil. + ;; + ;; * Clicking mouse-2 pastes contents of primary selection. + ;; + ;; * Pressing mouse-2 while selecting or extending copies selected text + ;; to the kill ring. Pressing mouse-1 or mouse-3 kills it. + ;; + ;; This module requires my thingatpt.el module, version 1.14 or later, which + ;; it uses to find the bounds of words, lines, sexps, etc. + ;; + ;; Thanks to KevinB@bartley.demon.co.uk for his useful input. + ;; + ;; You may also want to use one or more of following: + ;; + ;; ;; Enable region highlight + ;; (transient-mark-mode 1) + ;; + ;; ;; But only in the selected window + ;; (setq highlight-nonselected-windows nil) + ;; + ;; ;; Enable pending-delete + ;; (delete-selection-mode 1) + ;; + ;;--- Customisation ------------------------------------------------------- + ;; + ;; * You can control the way mouse-sel binds it's keys by setting the value + ;; of mouse-sel-default-bindings before loading mouse-sel. + ;; + ;; (a) If mouse-sel-default-bindings = t (the default) + ;; + ;; Mouse sets and pastes selection + ;; mouse-1 mouse-select + ;; mouse-2 mouse-insert-selection + ;; mouse-3 mouse-extend + ;; + ;; Selection/kill-ring interaction is disabled + ;; interprogram-cut-function = nil + ;; interprogram-paste-function = nil + ;; + ;; (b) If mouse-sel-default-bindings = 'interprogram-cut-paste + ;; + ;; Mouse sets selection, and pastes from kill-ring + ;; mouse-1 mouse-select + ;; mouse-2 mouse-yank-at-click + ;; mouse-3 mouse-extend + ;; + ;; Selection/kill-ring interaction is retained + ;; interprogram-cut-function = x-select-text + ;; interprogram-paste-function = x-cut-buffer-or-selection-value + ;; + ;; What you lose is the ability to select some text in + ;; delete-selection-mode and yank over the top of it. + ;; + ;; (c) If mouse-sel-default-bindings = nil, no bindings are made. + ;; + ;; * I like to leave point at the end of the region nearest to where the + ;; mouse was, even though this makes region highlighting mis-leading (the + ;; cursor makes it look like one extra character is selected). You can + ;; disable this behaviour with: + ;; + ;; (setq mouse-sel-leave-point-near-mouse nil) + ;; + ;; * Normally, the selection highlight will be removed when the mouse is + ;; lifted. You can tell mouse-sel to retain the selection highlight + ;; (useful if you don't use transient-mark-mode) with: + ;; + ;; (setq mouse-sel-retain-highlight t) + ;; + ;; * By default, mouse-select cycles the click count after 3 clicks. That + ;; is, clicking mouse-1 four times has the same effect as clicking it + ;; once, clicking five times has the same effect as clicking twice, etc. + ;; Disable this behaviour with: + ;; + ;; (setq mouse-sel-cycle-clicks nil) + ;; + ;; * The variables mouse-sel-{set,get,check}-selection-function control how + ;; the selection is handled. Under X Windows, these variables default so + ;; that the X primary selection is used. Under other windowing systems, + ;; alternate functions are used, which simply store the selection value + ;; in a variable. + ;; + ;;--- Hints --------------------------------------------------------------- + ;; + ;; * You can change the selection highlight face by altering the properties + ;; of mouse-drag-overlay, eg. + ;; + ;; (overlay-put mouse-drag-overlay 'face 'bold) + ;; + ;; * Pasting from the primary selection under emacs 19.19 is SLOW (there's + ;; a two second delay). The following code will cause mouse-sel to use + ;; the cut buffer rather than the primary selection. However, be aware + ;; that cut buffers are OBSOLETE, and some X applications may not support + ;; them. + ;; + ;; (setq mouse-sel-set-selection-function 'x-select-text + ;; mouse-sel-get-selection-function 'x-get-cut-buffer) + ;; + ;;--- Warnings ------------------------------------------------------------ + ;; + ;; * When selecting sexps, the selection extends by sexps at the same + ;; nesting level. This also means the selection cannot be extended out + ;; of the enclosing nesting level. This is INTENTIONAL. + + ;;; Code: + + (provide 'mouse-sel) + + (require 'mouse) + (require 'thingatpt) + + ;;=== Version ============================================================= + + (defconst mouse-sel-version (substring "$Revision: 1.1 $" 11 -2) + "The revision number of mouse-sel (as string). The complete RCS id is: + + $Id: mouse-sel.el,v 1.1 1993/11/08 14:27:16 rms Exp $") + + ;;=== User Variables ====================================================== + + (defvar mouse-sel-leave-point-near-mouse t + "*Leave point near last mouse position. + If non-nil, \\[mouse-select] and \\[mouse-extend] will leave point at the end + of the region nearest to where the mouse last was. + If nil, point will always be placed at the beginning of the region.") + + (defvar mouse-sel-retain-highlight nil + "*Retain highlight on mouse-drag-overlay. + If non-nil, regions selected using \\[mouse-select] and \\[mouse-extend] will + remain highlighted. + If nil, highlighting will be turned off when the mouse is lifted.") + + (defvar mouse-sel-cycle-clicks t + "*If non-nil, \\[mouse-select] cycles the click-counts after 3 clicks. + Ie. 4 clicks = 1 click, 5 clicks = 2 clicks, etc.") + + (defvar mouse-sel-default-bindings t + "Set to nil before loading mouse-sel to prevent default mouse bindings.") + + ;;=== Selection =========================================================== + + (defvar mouse-sel-selection-type nil "Type of current selection") + (make-variable-buffer-local 'mouse-sel-selection-type) + + (defvar mouse-sel-selection "" + "This variable is used to store the selection value when mouse-sel is + used on windowing systems other than X Windows.") + + (defvar mouse-sel-set-selection-function + (if (eq window-system 'x) + (function (lambda (s) (x-set-selection 'PRIMARY s))) + (function (lambda (s) (setq mouse-sel-selection s)))) + "Function to call to set selection. + Called with one argument, the text to select.") + + (defvar mouse-sel-get-selection-function + (if (eq window-system 'x) + 'x-get-selection + (function (lambda () mouse-sel-selection))) + "Function to call to get the selection. + Called with no argument, it should return the selected text.") + + (defvar mouse-sel-check-selection-function + (if (eq window-system 'x) + 'x-selection-owner-p + nil) + "Function to check whether emacs still owns the selection. + Called with no arguments.") + + (defun mouse-sel-determine-selection-type (NCLICKS) + "Determine what `thing' \\[mouse-select] and \\[mouse-extend] should + select by. The first argument is NCLICKS, is the number of consecutive + mouse clicks at the same position." + (let* ((next-char (char-after (point))) + (char-syntax (if next-char (char-syntax next-char))) + (nclicks (if mouse-sel-cycle-clicks (1+ (% (1- NCLICKS) 3)) NCLICKS))) + (cond + ((= nclicks 1) nil) + ((>= nclicks 3) 'line) + ((memq char-syntax '(?\( ?\) ?\" ?')) 'sexp) + ((memq next-char '(? ?\t ?\n)) 'whitespace) + ((eq char-syntax ?_) 'symbol) + ((eq char-syntax ?w) 'word)))) + + (defun mouse-select (EVENT) + "Set region/selection using the mouse. + + On click, point & mark are set to click position, and mark is disabled. + Dragging extends region/selection. + + Double-clicking on word constituents selects words. + Double-clicking on symbol constituents selects symbols. + Double-clicking on quotes or parentheses selects sexps. + Double-clicking on whitespace selects whitespace. + Triple-clicking selects lines. + + Clicking mouse-2 while selecting copies the region to the kill-ring. + Clicking mouse-1 or mouse-3 kills the region. + + This should be bound to a down-mouse event." + (interactive "e") + (mouse-set-point EVENT) + (setq mouse-sel-selection-type + (mouse-sel-determine-selection-type (event-click-count EVENT))) + (let ((object-bounds (bounds-of-thing-at-point mouse-sel-selection-type))) + (if object-bounds + (progn + (setq mark-active t) + (goto-char (car object-bounds)) + (set-mark (cdr object-bounds))) + (deactivate-mark))) + (mouse-extend)) + + (defun mouse-extend (&optional EVENT) + "Extend region/selection using the mouse. + + See documentation for mouse-select for more details. + + This should be bound to a down-mouse event." + (interactive "e") + (if EVENT (select-window (posn-window (event-end EVENT)))) + (let* ((min (if mark-active (region-beginning) (point))) + (max (if mark-active (region-end) (point))) + (orig-window (selected-window)) + (orig-window-frame (window-frame orig-window)) + (top (nth 1 (window-edges orig-window))) + (bottom (nth 3 (window-edges orig-window))) + (orig-cursor-type + (cdr (assoc 'cursor-type (frame-parameters (selected-frame))))) + direction + event) + + ;; Inhibit normal region highlight + (setq mark-active nil) + + ;; Highlight region (forcing re-highlight) + (move-overlay mouse-drag-overlay min max (current-buffer)) + (overlay-put mouse-drag-overlay 'face + (overlay-get mouse-drag-overlay 'face)) + + ;; Bar cursor + (modify-frame-parameters (selected-frame) '((cursor-type . bar))) + + ;; Handle dragging + (unwind-protect + (progn + (track-mouse + + (while (if EVENT ; Use initial event + (prog1 + (setq event EVENT) + (setq EVENT nil)) + (setq event (read-event)) + (and (consp event) + (memq (car event) '(mouse-movement switch-frame)))) + + (let ((end (event-end event))) + + (cond + + ;; Ignore any movement outside the frame + ((eq (car-safe event) 'switch-frame) nil) + ((and (posn-window end) + (not (eq (window-frame (posn-window end)) + (window-frame orig-window)))) nil) + + ;; Different window, same frame + ((not (eq (posn-window end) orig-window)) + (let ((end-row (cdr (cdr (mouse-position))))) + (cond + ((and end-row (not (bobp)) (< end-row top)) + (mouse-scroll-subr (- end-row top) + mouse-drag-overlay max)) + ((and end-row (not (eobp)) (>= end-row bottom)) + (mouse-scroll-subr (1+ (- end-row bottom)) + mouse-drag-overlay min)) + ))) + + ;; On the mode line + ((eq (posn-point end) 'mode-line) + (mouse-scroll-subr 1 mouse-drag-overlay min)) + + ;; In original window + (t (goto-char (posn-point end))) + + ) + + ;; Determine direction of drag + (cond + ((and (not direction) (not (eq min max))) + (setq direction (if (< (point) (/ (+ min max) 2)) -1 1))) + ((and (not (eq direction -1)) (<= (point) min)) + (setq direction -1)) + ((and (not (eq direction 1)) (>= (point) max)) + (setq direction 1))) + + (if (not mouse-sel-selection-type) nil + + ;; If dragging forward, goal is next character + (if (and (eq direction 1) (not (eobp))) (forward-char 1)) + + ;; Move to start/end of selected thing + (let ((goal (point)) + last) + (goto-char (if (eq 1 direction) min max)) + (condition-case nil + (progn + (while (> (* direction (- goal (point))) 0) + (setq last (point)) + (forward-thing mouse-sel-selection-type + direction)) + (let ((end (point))) + (forward-thing mouse-sel-selection-type + (- direction)) + (goto-char + (if (> (* direction (- goal (point))) 0) + end last)))) + (error)))) + + ;; Move overlay + (move-overlay mouse-drag-overlay + (if (eq 1 direction) min (point)) + (if (eq -1 direction) max (point)) + (current-buffer)) + + ))) ; end track-mouse + + (let ((overlay-start (overlay-start mouse-drag-overlay)) + (overlay-end (overlay-end mouse-drag-overlay))) + + ;; Set region + (if (eq overlay-start overlay-end) + (deactivate-mark) + (if (and mouse-sel-leave-point-near-mouse (eq direction 1)) + (progn + (set-mark overlay-start) + (goto-char overlay-end)) + (set-mark overlay-end) + (goto-char overlay-start))) + + ;; Set selection + (if (and mark-active mouse-sel-set-selection-function) + (funcall mouse-sel-set-selection-function + (buffer-substring overlay-start overlay-end))) + + ;; Handle copy/kill + (cond + ((eq (car-safe last-input-event) 'down-mouse-2) + (copy-region-as-kill overlay-start overlay-end) + (read-event) (read-event)) + ((memq (car-safe last-input-event) '(down-mouse-1 down-mouse-3)) + (kill-region overlay-start overlay-end) + (deactivate-mark) + (read-event) (read-event))))) + + ;; Restore cursor + (modify-frame-parameters (selected-frame) + (list (cons 'cursor-type orig-cursor-type))) + ;; Remove overlay + (or mouse-sel-retain-highlight + (delete-overlay mouse-drag-overlay))))) + + (defun mouse-insert-selection (click) + "Insert the contents of the selection at mouse click." + (interactive "e") + (mouse-set-point click) + (deactivate-mark) + (if mouse-sel-get-selection-function + (insert (or (funcall mouse-sel-get-selection-function) "")))) + + (defun mouse-sel-validate-selection () + "Remove selection highlight if emacs no longer owns the primary selection." + (or (not mouse-sel-check-selection-function) + (funcall mouse-sel-check-selection-function) + (delete-overlay mouse-drag-overlay))) + + (add-hook 'pre-command-hook 'mouse-sel-validate-selection) + + ;;=== Key bindings ======================================================== + + (if (not mouse-sel-default-bindings) nil + + (global-unset-key [mouse-1]) + (global-unset-key [drag-mouse-1]) + (global-unset-key [mouse-3]) + + (global-set-key [down-mouse-1] 'mouse-select) + (global-set-key [down-mouse-3] 'mouse-extend) + + (if (eq mouse-sel-default-bindings 'interprogram-cut-paste) nil + + (global-set-key [mouse-2] 'mouse-insert-selection) + (setq interprogram-cut-function nil + interprogram-paste-function nil)) + + ) + + ;; mouse-sel.el ends here. diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/mouse.el emacs-19.20/lisp/mouse.el *** emacs-19.19/lisp/mouse.el Thu Aug 12 18:20:41 1993 --- emacs-19.20/lisp/mouse.el Tue Nov 2 19:48:04 1993 *************** *** 107,111 **** (defun mouse-set-region (click) ! "Set the region to the text that the mouse is dragged over. This should be bound to a mouse drag event." (interactive "e") --- 107,111 ---- (defun mouse-set-region (click) ! "Set the region to the text dragged over, and copy to kill ring. This should be bound to a mouse drag event." (interactive "e") *************** *** 122,126 **** (set-mark (point)) (if (numberp (posn-point end)) ! (goto-char (posn-point end))))) (defvar mouse-scroll-delay 0.25 --- 122,130 ---- (set-mark (point)) (if (numberp (posn-point end)) ! (goto-char (posn-point end))) ! ;; Don't set this-command to kill-region, so that a following ! ;; C-w will not double the text in the kill ring. ! (let (this-command) ! (copy-region-as-kill (mark) (point))))) (defvar mouse-scroll-delay 0.25 *************** *** 159,162 **** --- 163,168 ---- (overlay-put mouse-drag-overlay 'face 'region) + (defvar mouse-selection-click-count nil) + (defun mouse-drag-region (start-event) "Set the region to the text that the mouse is dragged over. *************** *** 175,183 **** (nth 3 bounds) ;; Don't count the mode line. ! (1- (nth 3 bounds))))) (mouse-set-point start-event) ! (move-overlay mouse-drag-overlay ! start-point start-point ! (window-buffer start-window)) (deactivate-mark) (let (event end end-point) --- 181,191 ---- (nth 3 bounds) ;; Don't count the mode line. ! (1- (nth 3 bounds)))) ! (click-count (1- (event-click-count start-event)))) ! (setq mouse-selection-click-count click-count) (mouse-set-point start-event) ! (let ((range (mouse-start-end start-point start-point click-count))) ! (move-overlay mouse-drag-overlay (car range) (nth 1 range) ! (window-buffer start-window))) (deactivate-mark) (let (event end end-point) *************** *** 202,207 **** (integer-or-marker-p end-point)) (goto-char end-point) ! (move-overlay mouse-drag-overlay ! start-point (point))) ;; Are we moving on a different window on the same frame? --- 210,215 ---- (integer-or-marker-p end-point)) (goto-char end-point) ! (let ((range (mouse-start-end start-point (point) click-count))) ! (move-overlay mouse-drag-overlay (car range) (nth 1 range)))) ;; Are we moving on a different window on the same frame? *************** *** 234,287 **** (eq (posn-window (event-end event)) start-window) (numberp (posn-point (event-end event)))) ! (progn ! (mouse-set-point event) ! (if (= (point) start-point) ! (deactivate-mark) ! (set-mark start-point)))) (delete-overlay mouse-drag-overlay)))) ! ;;;! (defun mouse-drag-region (click) ! ;;;! "Set the region to the text that the mouse is dragged over. ! ;;;! This must be bound to a button-down mouse event." ! ;;;! (interactive "e") ! ;;;! (let ((posn (event-start click)) ! ;;;! done event (mark-active nil)) ! ;;;! (select-window (posn-window posn)) ! ;;;! ;; Set point temporarily, so user sees where it is. ! ;;;! (if (numberp (posn-point posn)) ! ;;;! (goto-char (posn-point posn))) ! ;;;! ;; Turn off the old mark when we set up an empty region. ! ;;;! (setq deactivate-mark t))) ! ;;;! ! ;;;! ;;;Nice hack, but too slow, so not normally in use. ! ;;;! (defun mouse-drag-region-1 (click) ! ;;;! "Set the region to the text that the mouse is dragged over. ! ;;;! This must be bound to a button-down mouse event." ! ;;;! (interactive "e") ! ;;;! (let (newmark) ! ;;;! (let ((posn (event-start click)) ! ;;;! done event omark (mark-active t)) ! ;;;! (select-window (posn-window posn)) ! ;;;! (setq omark (and mark-active (mark))) ! ;;;! (if (numberp (posn-point posn)) ! ;;;! (goto-char (posn-point posn))) ! ;;;! ;; Set mark temporarily, so highlighting does what we want. ! ;;;! (set-marker (mark-marker) (point)) ! ;;;! (track-mouse ! ;;;! (while (not done) ! ;;;! (setq event (read-event)) ! ;;;! (if (eq (car-safe event) 'mouse-movement) ! ;;;! (goto-char (posn-point (event-start event))) ! ;;;! ;; Exit when we get the drag event; ignore that event. ! ;;;! (setq done t)))) ! ;;;! (if (/= (mark) (point)) ! ;;;! (setq newmark (mark))) ! ;;;! ;; Restore previous mark status. ! ;;;! (if omark (set-marker (mark-marker) omark))) ! ;;;! ;; Now, if we dragged, set the mark at the proper place. ! ;;;! (if newmark ! ;;;! (push-mark newmark t t) ! ;;;! ;; Turn off the old mark when we set up an empty region. ! ;;;! (setq deactivate-mark t)))) ;; Subroutine: set the mark where CLICK happened, --- 242,320 ---- (eq (posn-window (event-end event)) start-window) (numberp (posn-point (event-end event)))) ! (let ((fun (key-binding (vector (car event))))) ! (if (memq fun '(mouse-set-region mouse-set-point)) ! (if (not (= (overlay-start mouse-drag-overlay) ! (overlay-end mouse-drag-overlay))) ! (let (this-command) ! (push-mark (overlay-start mouse-drag-overlay) t t) ! (goto-char (overlay-end mouse-drag-overlay)) ! (copy-region-as-kill (point) (mark t))) ! (goto-char (overlay-end mouse-drag-overlay)) ! (setq this-command 'mouse-set-point)) ! (if (fboundp fun) ! (funcall fun event))))) (delete-overlay mouse-drag-overlay)))) + + ;; Commands to handle xterm-style multiple clicks. ! (defun mouse-skip-word (dir) ! "Skip over word, over whitespace, or over identical punctuation. ! If DIR is positive skip forward; if negative, skip backward." ! (let* ((char (following-char)) ! (syntax (char-to-string (char-syntax char)))) ! (if (or (string= syntax "w") (string= syntax " ")) ! (if (< dir 0) ! (skip-syntax-backward syntax) ! (skip-syntax-forward syntax)) ! (if (< dir 0) ! (while (and (not (bobp)) (= (preceding-char) char)) ! (forward-char -1)) ! (while (and (not (eobp)) (= (following-char) char)) ! (forward-char 1)))))) ! ! ;; Return a list of region bounds based on START and END according to MODE. ! ;; If MODE is 0 then set point to (min START END), mark to (max START END). ! ;; If MODE is 1 then set point to start of word at (min START END), ! ;; mark to end of word at (max START END). ! ;; If MODE is 2 then do the same for lines. ! (defun mouse-start-end (start end mode) ! (if (> start end) ! (let ((temp start)) ! (setq start end ! end temp))) ! (cond ((= mode 0) ! (list start end)) ! ((and (= mode 1) ! (= start end) ! (not (eobp)) ! (= (char-syntax (char-after start)) ?\()) ! (list start (save-excursion (forward-sexp 1) (point)))) ! ((and (= mode 1) ! (= start end) ! (not (eobp)) ! (= (char-syntax (char-after start)) ?\))) ! (list (save-excursion ! (goto-char (1+ start)) ! (backward-sexp 1) ! (point)) ! (1+ start))) ! ((= mode 1) ! (list (save-excursion ! (goto-char start) ! (mouse-skip-word -1) ! (point)) ! (save-excursion ! (goto-char end) ! (mouse-skip-word 1) ! (point)))) ! ((= mode 2) ! (list (save-excursion ! (goto-char start) ! (beginning-of-line 1) ! (point)) ! (save-excursion ! (goto-char end) ! (forward-line 1) ! (point)))))) ;; Subroutine: set the mark where CLICK happened, *************** *** 327,330 **** --- 360,364 ---- (interactive "e\nP") (mouse-set-point click) + (setq this-command 'yank) (yank arg)) *************** *** 345,348 **** --- 379,401 ---- (defvar mouse-save-then-kill-posn nil) + (defun mouse-save-then-kill-delete-region () + ;; Delete just one char, so in case buffer is being modified + ;; for the first time, the undo list records that fact. + (delete-region (point) + (+ (point) (if (> (mark) (point)) 1 -1))) + ;; Now delete the rest of the specified region, + ;; but don't record it. + (let ((buffer-undo-list t)) + (delete-region (point) (mark))) + (if (not (eq buffer-undo-list t)) + (let ((tail buffer-undo-list)) + ;; Search back in buffer-undo-list for the string + ;; that came from the first delete-region. + (while (and tail (not (stringp (car (car tail))))) + (setq tail (cdr tail))) + ;; Replace it with an entry for the entire deleted text. + (and tail + (setcar tail (cons (car kill-ring) (point))))))) + (defun mouse-save-then-kill (click) "Save text to point in kill ring; the second time, kill the text. *************** *** 350,354 **** at the front of the kill ring, this deletes the text. Otherwise, it adds the text to the kill ring, like \\[kill-ring-save], ! which prepares for a second click to delete the text." (interactive "e") (let ((click-posn (posn-point (event-start click))) --- 403,412 ---- at the front of the kill ring, this deletes the text. Otherwise, it adds the text to the kill ring, like \\[kill-ring-save], ! which prepares for a second click to delete the text. ! ! If you have selected words or lines, this command extends the ! selection through the word or line clicked on. If you do this ! again in a different position, it extends the selection again. ! If you do this twice in the same position, the selection is killed." (interactive "e") (let ((click-posn (posn-point (event-start click))) *************** *** 356,389 **** ;; prevent setting this-command to kill-region. (this-command this-command)) ! (if (and (eq last-command 'mouse-save-then-kill) ! mouse-save-then-kill-posn ! (eq (car mouse-save-then-kill-posn) (car kill-ring)) ! (equal (cdr mouse-save-then-kill-posn) (list (point) click-posn))) ! ;; If this is the second time we've called ! ;; mouse-save-then-kill, delete the text from the buffer. ! (progn ! ;; Delete just one char, so in case buffer is being modified ! ;; for the first time, the undo list records that fact. ! (delete-region (point) ! (+ (point) (if (> (mark) (point)) 1 -1))) ! ;; Now delete the rest of the specified region, ! ;; but don't record it. ! (let ((buffer-undo-list t)) ! (delete-region (point) (mark))) ! (if (not (eq buffer-undo-list t)) ! (let ((tail buffer-undo-list)) ! ;; Search back in buffer-undo-list for the string ! ;; that came from the first delete-region. ! (while (and tail (not (stringp (car (car tail))))) ! (setq tail (cdr tail))) ! ;; Replace it with an entry for the entire deleted text. ! (and tail ! (setcar tail (cons (car kill-ring) (point))))))) ! ;; Otherwise, save this region. ! (mouse-set-mark-fast click) ! (kill-ring-save (point) (mark t)) ! (mouse-show-mark) ! (setq mouse-save-then-kill-posn ! (list (car kill-ring) (point) click-posn))))) (global-set-key [M-mouse-1] 'mouse-start-secondary) --- 414,477 ---- ;; prevent setting this-command to kill-region. (this-command this-command)) ! (if (> mouse-selection-click-count 0) ! (if (not (and (eq last-command 'mouse-save-then-kill) ! (equal click-posn ! (car (cdr-safe (cdr-safe mouse-save-then-kill-posn)))))) ! ;; Find both ends of the object selected by this click. ! (let* ((range ! (mouse-start-end click-posn click-posn ! mouse-selection-click-count))) ! ;; Move whichever end is closer to the click. ! ;; That's what xterm does, and it seems reasonable. ! (if (< (abs (- click-posn (mark t))) ! (abs (- click-posn (point)))) ! (set-mark (car range)) ! (goto-char (nth 1 range))) ! ;; We have already put the old region in the kill ring. ! ;; Replace it with the extended region. ! ;; (It would be annoying to make a separate entry.) ! (setcar kill-ring (buffer-substring (point) (mark t))) ! (if interprogram-cut-function ! (funcall interprogram-cut-function (car kill-ring))) ! ;; Arrange for a repeated mouse-3 to kill this region. ! (setq mouse-save-then-kill-posn ! (list (car kill-ring) (point) click-posn)) ! (mouse-show-mark)) ! ;; If we click this button again without moving it, ! ;; that time kill. ! (mouse-save-then-kill-delete-region)) ! (if (and (eq last-command 'mouse-save-then-kill) ! mouse-save-then-kill-posn ! (eq (car mouse-save-then-kill-posn) (car kill-ring)) ! (equal (cdr mouse-save-then-kill-posn) (list (point) click-posn))) ! ;; If this is the second time we've called ! ;; mouse-save-then-kill, delete the text from the buffer. ! (mouse-save-then-kill-delete-region) ! (if (or (eq last-command 'mouse-save-then-kill) ! (and mark-active transient-mark-mode) ! (and (eq last-command 'mouse-drag-region) ! (or mark-even-if-inactive ! (not transient-mark-mode)))) ! ;; We have a selection or suitable region, so adjust it. ! (let* ((posn (event-start click)) ! (new (posn-point posn))) ! (select-window (posn-window posn)) ! (if (numberp new) ! (progn ! ;; Move whichever end of the region is closer to the click. ! ;; That is what xterm does, and it seems reasonable. ! (if (< (abs (- new (point))) (abs (- new (mark t)))) ! (goto-char new) ! (set-mark new)) ! (setq deactivate-mark nil))) ! (setcar kill-ring (buffer-substring (point) (mark t))) ! (if interprogram-cut-function ! (funcall interprogram-cut-function (car kill-ring)))) ! ;; We just have point, so set mark here. ! (mouse-set-mark-fast click) ! (kill-ring-save (point) (mark t)) ! (mouse-show-mark)) ! (setq mouse-save-then-kill-posn ! (list (car kill-ring) (point) click-posn)))))) (global-set-key [M-mouse-1] 'mouse-start-secondary) *************** *** 435,451 **** (overlay-put mouse-secondary-overlay 'face 'secondary-selection)))) ! (defun mouse-drag-secondary (click) "Set the secondary selection to the text that the mouse is dragged over. This must be bound to a button-down mouse event." (interactive "e") ! (let ((posn (event-start click))) ! (save-window-excursion ! (select-window (posn-window posn)) ! ;; Set point temporarily, so user sees where it is. ! (save-excursion ! (if (numberp (posn-point posn)) ! (goto-char (posn-point posn))) ! (setq unread-command-events ! (cons (read-event) unread-command-events)))))) (defun mouse-kill-secondary () --- 523,624 ---- (overlay-put mouse-secondary-overlay 'face 'secondary-selection)))) ! (defun mouse-drag-secondary (start-event) "Set the secondary selection to the text that the mouse is dragged over. + Highlight the drag area as you move the mouse. This must be bound to a button-down mouse event." (interactive "e") ! (let* ((start-posn (event-start start-event)) ! (start-point (posn-point start-posn)) ! (start-window (posn-window start-posn)) ! (start-frame (window-frame start-window)) ! (bounds (window-edges start-window)) ! (top (nth 1 bounds)) ! (bottom (if (window-minibuffer-p start-window) ! (nth 3 bounds) ! ;; Don't count the mode line. ! (1- (nth 3 bounds)))) ! (click-count (1- (event-click-count start-event)))) ! (save-excursion ! (set-buffer (window-buffer start-window)) ! (setq mouse-selection-click-count click-count) ! ;; Cancel any preexisting secondary selection. ! (or mouse-secondary-overlay ! (setq mouse-secondary-overlay ! (make-overlay (point) (point)))) ! (if (> click-count 0) ! (let ((range (mouse-start-end start-point start-point click-count))) ! (set-marker mouse-secondary-start nil) ! (move-overlay mouse-secondary-overlay 1 1 ! (window-buffer start-window)) ! (move-overlay mouse-secondary-overlay (car range) (nth 1 range) ! (window-buffer start-window))) ! (or mouse-secondary-start ! (setq mouse-secondary-start (make-marker))) ! (set-marker mouse-secondary-start start-point) ! (delete-overlay mouse-secondary-overlay)) ! (let (event end end-point) ! (track-mouse ! (while (progn ! (setq event (read-event)) ! (or (mouse-movement-p event) ! (eq (car-safe event) 'switch-frame))) ! ! (if (eq (car-safe event) 'switch-frame) ! nil ! (setq end (event-end event) ! end-point (posn-point end)) ! (cond ! ! ;; Ignore switch-frame events. ! ((eq (car-safe event) 'switch-frame)) ! ! ;; Are we moving within the original window? ! ((and (eq (posn-window end) start-window) ! (integer-or-marker-p end-point)) ! (if (/= start-point end-point) ! (set-marker mouse-secondary-start nil)) ! (let ((range (mouse-start-end start-point end-point ! click-count))) ! (move-overlay mouse-secondary-overlay ! (car range) (nth 1 range)))) ! ! ;; Are we moving on a different window on the same frame? ! ((and (windowp (posn-window end)) ! (eq (window-frame (posn-window end)) start-frame)) ! (let ((mouse-row ! (+ (nth 1 (window-edges (posn-window end))) ! (cdr (posn-col-row end))))) ! (cond ! ((< mouse-row top) ! (mouse-scroll-subr ! (- mouse-row top) mouse-secondary-overlay start-point)) ! ((and (not (eobp)) ! (>= mouse-row bottom)) ! (mouse-scroll-subr (1+ (- mouse-row bottom)) ! mouse-drag-overlay start-point))))) ! ! (t ! (let ((mouse-y (cdr (cdr (mouse-position)))) ! (menu-bar-lines (or (cdr (assq 'menu-bar-lines ! (frame-parameters))) ! 0))) ! ! ;; Are we on the menu bar? ! (and (integerp mouse-y) (< mouse-y menu-bar-lines) ! (mouse-scroll-subr (- mouse-y menu-bar-lines) ! mouse-secondary-overlay start-point)))))))) ! ! (if (and (eq (get (event-basic-type event) 'event-kind) 'mouse-click) ! (eq (posn-window (event-end event)) start-window) ! (numberp (posn-point (event-end event)))) ! (if (marker-position mouse-secondary-start) ! (save-window-excursion ! (delete-overlay mouse-secondary-overlay) ! (select-window start-window) ! (save-excursion ! (goto-char mouse-secondary-start) ! (sit-for 1))) ! (kill-ring-save (overlay-start mouse-secondary-overlay) ! (overlay-end mouse-secondary-overlay)))))))) (defun mouse-kill-secondary () *************** *** 458,498 **** (defun mouse-secondary-save-then-kill (click) ! "Save text to secondary start point in kill ring; if twice, kill it. ! If the text between secondary start point and the mouse is the same as what's at the front of the kill ring, this deletes the text. Otherwise, it adds the text to the kill ring, like \\[kill-ring-save], ! which prepares for a second click to delete the text." (interactive "e") ! (let ((click-posn (posn-point (event-start click))) ! (start (+ 0 mouse-secondary-start)) ;; Don't let a subsequent kill command append to this one: ;; prevent setting this-command to kill-region. (this-command this-command)) ! (if (and (eq last-command 'mouse-secondary-save-then-kill) ! mouse-save-then-kill-posn ! (eq (car mouse-save-then-kill-posn) (car kill-ring)) ! (equal (cdr mouse-save-then-kill-posn) ! (list start click-posn))) ! ;; If this is the second time we've called ! ;; mouse-save-then-kill, delete the text from the buffer. ! (progn ! (let ((buffer-undo-list t)) (delete-overlay mouse-secondary-overlay) ! (delete-region start click-posn)) ! ;; Make the undo list by hand so it is shared. ! (if (not (eq buffer-undo-list t)) ! (setq buffer-undo-list ! (cons (cons (car kill-ring) (marker-position start)) ! buffer-undo-list)))) ! ;; Otherwise, save this region. ! (save-excursion ! (set-buffer (window-buffer (posn-window (event-start click)))) ! (kill-ring-save start click-posn) ! (if mouse-secondary-overlay ! (move-overlay mouse-secondary-overlay start click-posn) ! (setq mouse-secondary-overlay (make-overlay start click-posn))) ! (overlay-put mouse-secondary-overlay 'face 'secondary-selection) (setq mouse-save-then-kill-posn ! (list (car kill-ring) start click-posn)))))) (defun mouse-buffer-menu (event) --- 631,725 ---- (defun mouse-secondary-save-then-kill (click) ! "Save text to point in kill ring; the second time, kill the text. ! If the text between point and the mouse is the same as what's at the front of the kill ring, this deletes the text. Otherwise, it adds the text to the kill ring, like \\[kill-ring-save], ! which prepares for a second click to delete the text. ! ! If you have selected words or lines, this command extends the ! selection through the word or line clicked on. If you do this ! again in a different position, it extends the selection again. ! If you do this twice in the same position, the selection is killed." (interactive "e") ! (let ((posn (event-start click)) ! (click-posn (posn-point (event-start click))) ;; Don't let a subsequent kill command append to this one: ;; prevent setting this-command to kill-region. (this-command this-command)) ! (if (> mouse-selection-click-count 0) ! (if (not (and (eq last-command 'mouse-secondary-save-then-kill) ! (equal click-posn ! (car (cdr-safe (cdr-safe mouse-save-then-kill-posn)))))) ! ;; Find both ends of the object selected by this click. ! (let* ((range ! (mouse-start-end click-posn click-posn ! mouse-selection-click-count))) ! ;; Move whichever end is closer to the click. ! ;; That's what xterm does, and it seems reasonable. ! (if (< (abs (- click-posn (overlay-start mouse-secondary-overlay))) ! (abs (- click-posn (overlay-end mouse-secondary-overlay)))) ! (move-overlay mouse-secondary-overlay (car range) ! (overlay-end mouse-secondary-overlay)) ! (move-overlay mouse-secondary-overlay ! (overlay-start mouse-secondary-overlay) ! (nth 1 range))) ! ;; We have already put the old region in the kill ring. ! ;; Replace it with the extended region. ! ;; (It would be annoying to make a separate entry.) ! (setcar kill-ring (buffer-substring ! (overlay-start mouse-secondary-overlay) ! (overlay-end mouse-secondary-overlay))) ! (if interprogram-cut-function ! (funcall interprogram-cut-function (car kill-ring))) ! ;; Arrange for a repeated mouse-3 to kill this region. ! (setq mouse-save-then-kill-posn ! (list (car kill-ring) (point) click-posn))) ! ;; If we click this button again without moving it, ! ;; that time kill. ! (progn (delete-overlay mouse-secondary-overlay) ! (mouse-save-then-kill-delete-region))) ! (if (and (eq last-command 'mouse-secondary-save-then-kill) ! mouse-save-then-kill-posn ! (eq (car mouse-save-then-kill-posn) (car kill-ring)) ! (equal (cdr mouse-save-then-kill-posn) (list (point) click-posn))) ! ;; If this is the second time we've called ! ;; mouse-secondary-save-then-kill, delete the text from the buffer. ! (progn ! (delete-overlay mouse-secondary-overlay) ! (mouse-save-then-kill-delete-region)) ! (if (overlay-start mouse-secondary-overlay) ! ;; We have a selection, so adjust it. ! (progn ! (select-window (posn-window posn)) ! (if (numberp click-posn) ! (progn ! ;; Move whichever end of the region is closer to the click. ! ;; That is what xterm does, and it seems reasonable. ! (if (< (abs (- click-posn (overlay-start mouse-secondary-overlay))) ! (abs (- click-posn (overlay-end mouse-secondary-overlay)))) ! (move-overlay mouse-secondary-overlay click-posn ! (overlay-end mouse-secondary-overlay)) ! (move-overlay mouse-secondary-overlay ! (overlay-start mouse-secondary-overlay) ! click-posn)) ! (setq deactivate-mark nil))) ! (setcar kill-ring (buffer-substring ! (overlay-start mouse-secondary-overlay) ! (overlay-end mouse-secondary-overlay))) ! (if interprogram-cut-function ! (funcall interprogram-cut-function (car kill-ring)))) ! (if mouse-secondary-start ! ;; All we have is one end of a selection, ! ;; so put the other end here. ! (let ((start (+ 0 mouse-secondary-start))) ! (set-buffer (window-buffer (posn-window (event-start click)))) ! (kill-ring-save start click-posn) ! (if mouse-secondary-overlay ! (move-overlay mouse-secondary-overlay start click-posn) ! (setq mouse-secondary-overlay (make-overlay start click-posn))) ! (overlay-put mouse-secondary-overlay 'face 'secondary-selection)))) (setq mouse-save-then-kill-posn ! (list (car kill-ring) (point) click-posn)))))) (defun mouse-buffer-menu (event) *************** *** 869,876 **** ;; Choose a completion with the mouse. (defun mouse-choose-completion (event) "Click on an alternative in the `*Completions*' buffer to choose it." (interactive "e") ! (let (choice) (save-excursion (set-buffer (window-buffer (posn-window (event-start event)))) --- 1096,1118 ---- ;; Choose a completion with the mouse. + ;; Delete the longest partial match for STRING + ;; that can be found before POINT. + (defun mouse-delete-max-match (string) + (let ((len (min (length string) + (- (point-max) (point-min))))) + (goto-char (max (point-min) (- (point) (length string)))) + (while (and (> len 0) + (let ((tail (buffer-substring (point) + (+ (point) len)))) + (not (string= tail (substring string 0 len))))) + (setq len (1- len)) + (forward-char 1)) + (delete-char len))) + (defun mouse-choose-completion (event) "Click on an alternative in the `*Completions*' buffer to choose it." (interactive "e") ! (let ((buffer (window-buffer)) ! choice) (save-excursion (set-buffer (window-buffer (posn-window (event-start event)))) *************** *** 881,893 **** (skip-chars-forward "^ \t\n") (setq choice (buffer-substring beg (point)))))) ! (set-buffer (window-buffer (minibuffer-window))) ! (goto-char (max (point-min) (- (point-max) (length choice)))) ! (while (and (not (eobp)) ! (let ((tail (buffer-substring (point) (point-max)))) ! (not (string= tail (substring choice 0 (length tail)))))) ! (forward-char 1)) (insert choice) ! (delete-region (point) (point-max)) ! (minibuffer-complete-and-exit))) ;; Font selection. --- 1123,1131 ---- (skip-chars-forward "^ \t\n") (setq choice (buffer-substring beg (point)))))) ! (set-buffer buffer) ! (mouse-delete-max-match choice) (insert choice) ! (and (equal buffer (window-buffer (minibuffer-window))) ! (minibuffer-complete-and-exit)))) ;; Font selection. *************** *** 983,986 **** --- 1221,1228 ---- (global-set-key [mouse-1] 'mouse-set-point) (global-set-key [drag-mouse-1] 'mouse-set-region) + + ;; These are tested for in mouse-drag-region. + (global-set-key [double-mouse-1] 'mouse-set-point) + (global-set-key [triple-mouse-1] 'mouse-set-point) (global-set-key [mouse-2] 'mouse-yank-at-click) diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/outline.el emacs-19.20/lisp/outline.el *** emacs-19.19/lisp/outline.el Sat Aug 14 05:12:59 1993 --- emacs-19.20/lisp/outline.el Sat Sep 18 21:58:27 1993 *************** *** 195,199 **** (setq selective-display t) (run-hooks 'outline-minor-mode-hook)) ! (setq selective-display nil))) (defvar outline-level 'outline-level --- 195,200 ---- (setq selective-display t) (run-hooks 'outline-minor-mode-hook)) ! (setq selective-display nil)) ! (set-buffer-modified-p (buffer-modified-p))) (defvar outline-level 'outline-level diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/pascal.el emacs-19.20/lisp/pascal.el *** emacs-19.19/lisp/pascal.el --- emacs-19.20/lisp/pascal.el Mon Nov 8 09:46:51 1993 *************** *** 0 **** --- 1,980 ---- + ;;; pascal.el - Major mode for editing pascal source in emacs. + + ;;; Copyright (C) 1993 Free Software Foundation, Inc. + + ;; Author: Espen Skoglund (espensk@stud.cs.uit.no) + ;; Keywords: languages + + ;; This file is part of GNU Emacs. + + ;; GNU Emacs is free software; you can redistribute it and/or modify + ;; it under the terms of the GNU General Public License as published by + ;; the Free Software Foundation; either version 2, or (at your option) + ;; any later version. + + ;; GNU Emacs is distributed in the hope that it will be useful, + ;; but WITHOUT ANY WARRANTY; without even the implied warranty of + ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ;; GNU General Public License for more details. + + ;; You should have received a copy of the GNU General Public License + ;; along with GNU Emacs; see the file COPYING. If not, write to + ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + + ;;; Commentary: + + ;;; If you want to customize the pascal mode in your startup file, you + ;;; can add these lines to your .emacs file (and remove the ;s at the + ;;; beginning of the line): + ;;; + ;;; ;;; Pascal-mode custumization. + ;;; (autoload 'pascal-mode "pascal-mode" nil t) + ;;; (setq auto-mode-alist (append (list (cons "\\.p$" 'pascal-mode) + ;;; (cons "\\.pas$" 'pascal-mode)) + ;;; auto-mode-alist)) + ;;; (setq pascal-mode-hook '(lambda () + ;;; ;; User specifications + ;;; (setq pascal-tab-always-indent t + ;;; pascal-auto-newline nil + ;;; pascal-auto-endcomments t + ;;; pascal-indent-level 3 + ;;; pascal-continued-expr 1 + ;;; pascal-label-offset -2 + ;;; pascal-case-offset 2 + ;;; pascal-typedecl-indent 10 + ;;; pascal-vardecl-indent 20))) + + ;;; USAGE + ;;; ===== + ;;; If you have modified your startup file as described above, emacs + ;;; should enter pascal-mode when you load a pascal source into emacs. + ;;; If not, you will have to start pascal-mode manually: + ;;; M-x load-library pascal-mode + ;;; M-x pascal-mode + ;;; When you have entered pascal-mode, you may get more info by pressing + ;;; C-h m. You may also get online help describing various functions by: + ;;; C-h d + + ;;; KNOWN BUGS / BUGREPORTS + ;;; ======================= + ;;; As far as I know, there are no bugs in the current version of this + ;;; package. This may not be true however, since I never use this mode + ;;; myself and therefore would never notice them anyway. But if you DO + ;;; find any bugd, you may submitt them to: espensk@stud.cs.uit.no + + ;;; LCD Archive Entry: + ;;; pascal-mode|Espen Skoglund|espensk@stud.cs.uit.no| + ;;; Major mode for editing Pascal code| + ;;; 14-Sep-93|$Revision: 1.1 $|~/modes/pascal-mode.el.Z| + + (defconst pascal-mode-version "1.3" + "Version of this pascal mode.") + + (defvar pascal-mode-abbrev-table nil + "Abbrev table in use in Pascal-mode buffers.") + (define-abbrev-table 'pascal-mode-abbrev-table ()) + + (defvar pascal-mode-map () + "Keymap used in Pascal mode.") + (if (null pascal-mode-map) + (setq pascal-mode-map (make-sparse-keymap))) + + (define-key pascal-mode-map ";" 'electric-pascal-semi) + (define-key pascal-mode-map "." 'electric-pascal-dot) + (define-key pascal-mode-map ":" 'electric-pascal-colon) + (define-key pascal-mode-map "=" 'electric-pascal-equal) + (define-key pascal-mode-map "\r" 'electric-pascal-terminate-line) + (define-key pascal-mode-map "\t" 'electric-pascal-tab) + (define-key pascal-mode-map "\177" 'backward-delete-char-untabify) + (define-key pascal-mode-map "\C-\M-a" 'pascal-backward-to-beginning-of-function) + (define-key pascal-mode-map "\C-\M-e" 'pascal-forward-to-end-of-function) + (define-key pascal-mode-map "\C-\M-h" 'pascal-mark-function) + (define-key pascal-mode-map "\C-c\C-b" 'pascal-insert-block) + (define-key pascal-mode-map "\C-c\C-c" 'pascal-comment-area) + (define-key pascal-mode-map "\C-c\C-u" 'pascal-uncomment-area) + (define-key pascal-mode-map "\M-*" 'pascal-star-comment) + + ;;; A command to change the whole buffer won't be used terribly + ;;; often, so no need for a key binding. + ;;;(define-key pascal-mode-map "\C-c\C-l" 'pascal-downcase-keywords) + ;;;(define-key pascal-mode-map "\C-c\C-u" 'pascal-upcase-keywords) + ;;;(define-key pascal-mode-map "\C-c\C-c" 'pascal-capitalize-keywords) + + (defvar pascal-keywords '("and" "array" "begin" "case" "const" "div" "do" + "downto" "else" "end" "file" "for" "function" "goto" "if" "in" "label" "mod" + "nil" "not" "of" "or" "packed" "procedure" "program" "record" "repeat" "set" + "then" "to" "type" "until" "var" "while" "with" + ;; The following are not standard in pascal, but widely used. + "get" "put" "input" "output" "read" "readln" "reset" "rewrite" "write" + "writeln")) + + (defvar pascal-mode-syntax-table nil + "Syntax table in use in Pascal-mode buffers.") + + (if pascal-mode-syntax-table + () + (setq pascal-mode-syntax-table (make-syntax-table)) + (modify-syntax-entry ?\\ "\\" pascal-mode-syntax-table) + (modify-syntax-entry ?( ". 1" pascal-mode-syntax-table) + (modify-syntax-entry ?) ". 4" pascal-mode-syntax-table) + (modify-syntax-entry ?* ". 23" pascal-mode-syntax-table) + (modify-syntax-entry ?{ "<" pascal-mode-syntax-table) + (modify-syntax-entry ?} ">" pascal-mode-syntax-table) + (modify-syntax-entry ?+ "." pascal-mode-syntax-table) + (modify-syntax-entry ?- "." pascal-mode-syntax-table) + (modify-syntax-entry ?= "." pascal-mode-syntax-table) + (modify-syntax-entry ?% "." pascal-mode-syntax-table) + (modify-syntax-entry ?< "." pascal-mode-syntax-table) + (modify-syntax-entry ?> "." pascal-mode-syntax-table) + (modify-syntax-entry ?& "." pascal-mode-syntax-table) + (modify-syntax-entry ?| "." pascal-mode-syntax-table) + (modify-syntax-entry ?_ "w" pascal-mode-syntax-table) + (modify-syntax-entry ?\' "\"" pascal-mode-syntax-table)) + + (defconst pascal-indent-level 3 + "*Indentation of Pascal statements with respect to containing block.") + (defconst pascal-continued-expr 1 + "*Indentation of line that is a continued expression.") + (defconst pascal-label-offset -1 + "*Offset of Pascal label lines, case statements and record lines. + This is relative to usual indentation.") + (defconst pascal-case-offset 2 + "*Indentation after case statements.") + (defconst pascal-vardecl-indent 15 + "*Indentation (from the beginning of line to `:' of the declaration.") + (defconst pascal-typedecl-indent 10 + "*Indentation (from the beginning of line to `=' of the declaration.") + (defconst pascal-auto-newline nil + "*Non-nil means automatically newline after semicolons and `end'.") + (defconst pascal-tab-always-indent t + "*Non-nil means TAB in Pascal mode should always reindent the current line. + It does so regardless of where in the line point is + when the TAB command is used.") + (defconst pascal-auto-endcomments t + "*Non-nil means make a comment { ... } after the end for a case or function. + The name of the function or case is put between the braces.") + + ;;;###autoload + (defun pascal-mode () + "Major mode for editing Pascal code. + Tab indents for Pascal code. + Delete converts tabs to spaces as it moves back. + \\{pascal-mode-map} + Variables controlling indentation style: + pascal-tab-always-indent (default t) + Non-nil means TAB in Pascal mode should always reindent the current line, + regardless of where in the line point is when the TAB command is used. + pascal-auto-newline (default nil) + Non-nil means automatically newline after semicolons and the punctation + mark after an end. + pascal-auto-endcomments (default t) + Non-nil means automatically set name of function or `case' in braces after + after the `end' if this end ends a function or a case block. + pascal-indent-level (default 3) + Indentation of Pascal statements within surrounding block. + pascal-continued-expr (default 1) + Indentation of a line that is a continued expression. + pascal-typedecl-indent (default 10) + Indentation to the `=' in type declarations. (Or constant declarations.) + pascal-vardecl-indent (default 20) + Indentation to the `:' in var declarations. + pascal-label-offset (default -1) + Extra indentation for line that is a label, case statement or part of + a record block. + pascal-case-offset (default 2) + Extra indent to the `:' in case statements. + + The only auto indention this mode doesn't fully support is if there is a + case within a type declaration. However, this is seldom used. + + When typing text, you should not worry about to get right indentions, they + will be set when you hit return. The mode will also automatically delete the + whitespaces between `*' and `)' when ending a starcomment. + + Turning on Pascal mode calls the value of the variable pascal-mode-hook with + no args, if that value is non-nil." + (interactive) + (kill-all-local-variables) + (use-local-map pascal-mode-map) + (setq major-mode 'pascal-mode) + (setq mode-name "Pascal") + (setq local-abbrev-table pascal-mode-abbrev-table) + (set-syntax-table pascal-mode-syntax-table) + (make-local-variable 'indent-line-function) + (setq indent-line-function 'pascal-indent-line) + (setq comment-indent-hook 'pascal-indent-within-comment) + (make-local-variable 'parse-sexp-ignore-comments) + (setq parse-sexp-ignore-comments t) + (make-local-variable 'case-fold-search) + (setq case-fold-search t) + (run-hooks 'pascal-mode-hook)) + + ;;; + ;;; Electric functions + ;;; + + (defun electric-pascal-terminate-line () + "Terminate line and indent next line." + (interactive) + (save-excursion + (beginning-of-line) + (skip-chars-forward " \t") + (if (looking-at "until\\b\\|end\\(\\b\\|;\\|\\.\\)\\|begin\\b\\|repeat\\b\\|else\\b") + (pascal-indent-line))) + (newline) + (pascal-indent-line) + ;; Maybe we should set some endcomments + (if pascal-auto-endcomments + (pascal-set-auto-comments)) + ;; Check if we shall indent inside comment + (let ((setstar nil)) + (save-excursion + (forward-line -1) + (skip-chars-forward " \t") + (cond ((looking-at "\\*[ \t]*)") + ;; Delete region between `*' and `)' if there is only whitespaces. + (forward-char 1) + (pascal-delete-whitespaces)) + ((and (looking-at "(\\*\\|\\*[^)]") + (not (save-excursion + (search-forward "*)" (pascal-get-end-of-line) t)))) + (setq setstar t)))) + ;; If last line was a star comment line then this one shall be too. + (if setstar + (progn + (insert "*") + (pascal-indent-command)) + (pascal-indent-line)))) + + (defun electric-pascal-semi () + "Insert ; character and correct this line's indention." + (interactive) + (insert last-command-char) + (save-excursion + (beginning-of-line) + (pascal-indent-line)) + (if pascal-auto-newline + (electric-pascal-terminate-line))) + + (defun electric-pascal-dot () + "Insert a period and correct this line's indention." + (interactive) + (insert last-command-char) + (save-excursion + (beginning-of-line) + (pascal-indent-line)) + (if pascal-auto-newline + (electric-pascal-terminate-line))) + + (defun electric-pascal-colon () + "Insert : and do all indentions except line indent on this line." + (interactive) + (insert last-command-char) + ;; Do nothing of within string. + (if (not (pascal-within-string)) + (progn + (if (save-excursion + (backward-char 2) + (looking-at "[0-9]")) + (save-excursion + (beginning-of-line) + (pascal-indent-line))) + (let ((pascal-tab-always-indent nil)) + (pascal-indent-command))))) + + (defun electric-pascal-equal () + "Insert = and do indention if within type declaration." + (interactive) + (insert last-command-char) + (if (eq (nth 1 (pascal-calculate-indent t)) 'decl) + (let ((pascal-tab-always-indent nil)) + (pascal-indent-command)))) + + (defun electric-pascal-tab () + "Function called when tab is pressed." + (interactive) + ;; Do nothing if within a string. + (if (not (pascal-within-string)) + ;; If pascal-tab-always-indent is set then indent the beginning of + ;; the line. + (progn + (if pascal-tab-always-indent + (save-excursion + (beginning-of-line) + (pascal-indent-line))) + (pascal-indent-command)))) + + ;;; + ;;; Interactive functions + ;;; + (defun pascal-insert-block () + "Insert begin ... end; block in the code with right indents." + (interactive) + (pascal-indent-line) + (insert "begin") + (electric-pascal-terminate-line) + (save-excursion + (electric-pascal-terminate-line) + (insert "end;") + (beginning-of-line) + (pascal-indent-line))) + + (defun pascal-star-comment () + "Insert star comment in the code." + (interactive) + (pascal-indent-line) + (insert "(*") + (electric-pascal-terminate-line) + (save-excursion + (electric-pascal-terminate-line) + (pascal-delete-whitespaces) + (insert ")"))) + + (defun pascal-mark-function () + "Mark the current pascal function (or procedure). + Put the mark at the end of the function, and point at the beginning." + (interactive) + (push-mark (point)) + (pascal-forward-to-end-of-function) + (push-mark (point)) + (pascal-backward-to-beginning-of-function) + (zmacs-activate-region)) + + (defun pascal-comment-area (start end) + "Put the current region in a comment. + The comments that are in this area are + be changed so that `*)' becomes `!(*' and `}' becomes `!{'. These will + however be turned back to normal when the area is uncommented by pressing + \\[pascal-uncomment-area]. + The commented area starts with: `{---\\/---EXCLUDED---\\/---' , and ends with: + ` ---/\\---EXCLUDED---/\\---}'. If these texts are changed, uncomment-area + will not be able to recognize them." + (interactive "r") + (save-excursion + ;; Insert start and endcomments + (goto-char end) + (if (and (save-excursion (skip-chars-forward " \t") (eolp)) + (not (save-excursion (skip-chars-backward " \t") (bolp)))) + (forward-line 1) + (beginning-of-line)) + (insert " ---/\\---EXCLUDED---/\\---}") + (setq end (point)) + (newline) + (goto-char start) + (beginning-of-line) + (insert "{---\\/---EXCLUDED---\\/--- ") + (newline) + ;; Replace end-comments within commented area + (goto-char end) + (save-excursion + (while (re-search-backward "\\*)" start t) + (replace-match "!(*" t t))) + (save-excursion + (while (re-search-backward "}" start t) + (replace-match "!{" t t))))) + + (defun pascal-uncomment-area () + "Uncomment a commented area. + Change all deformed comments in this area back to normal. + This function does nothing if the pointer is not in a commented + area. See also `pascal-comment-area'." + (interactive) + (save-excursion + (let ((start (point)) + (end (point))) + ;; Find the boundaries of the comment + (save-excursion + (setq start (progn (search-backward "{---\\/---EXCLUDED---\\/--" nil t) + (point))) + (setq end (progn (search-forward "---/\\---EXCLUDED---/\\---}" nil t) + (point)))) + ;; Check if we're really inside a comment + (if (or (equal start (point)) (<= end (point))) + (message "Not standing within commented area.") + (progn + ;; Remove endcomment + (goto-char end) + (beginning-of-line) + (let ((pos (point))) + (end-of-line) + (delete-region pos (1+ (point)))) + ;; Change comments back to normal + (save-excursion + (while (re-search-backward "!{" start t) + (replace-match "}" t t))) + (save-excursion + (while (re-search-backward "!(\\*" start t) + (replace-match "*)" t t))) + ;; Remove startcomment + (goto-char start) + (beginning-of-line) + (let ((pos (point))) + (end-of-line) + (delete-region pos (1+ (point))))))))) + + (defun pascal-backward-to-beginning-of-function () + "Move backwards to the beginning of this function or procedure." + (interactive) + ;; Check if this is a + (if (save-excursion + (re-search-backward "\\\\|\\<") nil t) + (funcall change-word -1)))) + + ;;; + ;;; Other functions + ;;; + (defun pascal-delete-whitespaces () + "Deletes the whitespaces around the current point." + (interactive) + (let ((pos (progn (skip-chars-backward " \t") (point)))) + (skip-chars-forward " \t") + (delete-region pos (point)))) + + (defun pascal-get-beg-of-line () + (save-excursion + (beginning-of-line) + (point))) + + (defun pascal-get-end-of-line () + (save-excursion + (end-of-line) + (point))) + + (defun pascal-within-string () + "Return t if within string; nil otherwise." + (and (save-excursion (search-backward "\"" (pascal-get-beg-of-line) t)) + (save-excursion (not (search-backward "\"" (pascal-get-beg-of-line) t 2))))) + + (defun pascal-check-if-within-comment () + "If within a comment, return the correct indent. Return nil otherwise." + (let ((comstart (point)) + (comend (point))) + (save-excursion + (if (re-search-backward "(\\*\\|{" nil t) + (setq comstart (point)) + (setq comstart 0))) + (save-excursion + (if (re-search-backward "\\*)\\|}" nil t) + (setq comend (point)) + (setq comend 0))) + (if (< comend comstart) + (save-excursion + (goto-char comstart) + ;; Add 1 to indent if this is a starcomment + (if (looking-at "(\\*") + (1+ (current-column)) + (current-column))) + nil))) + + (defun pascal-set-auto-comments () + "Put { case } or { FUNNAME } on this line if appropriate after `end'." + (save-excursion + (forward-line -1) + (skip-chars-forward " \t") + (if (and (looking-at "end\\(\>\\|;\\)") + (not (save-excursion + (end-of-line) + (search-backward "}" (pascal-get-beg-of-line) t)))) + (progn + (if (eq (nth 1 (pascal-calculate-indent)) 'case) + ;; This is a case block + (progn + (end-of-line) + (pascal-delete-whitespaces) + (insert " { case }")) + (let ((nest 1)) + ;; Check if this is the end of a function + (save-excursion + (while (not (or (looking-at "function\\b\\|\\procedure\\b") + (bobp))) + (backward-sexp 1) + (cond ((looking-at "begin\\b\\|case\\b") + (setq nest (1- nest))) + ((looking-at "end\\(\\b\\|;\\|\\.\\)") + (setq nest (1+ nest))))) + (if (bobp) + (setq nest 1))) + (if (zerop nest) + (let ((last-command nil)) + ;; Find the function name and put it in braces + (save-excursion + (pascal-backward-to-beginning-of-function) + (skip-chars-forward "^ \t") + (skip-chars-forward " \t") + (copy-region-as-kill (point) + (save-excursion + (skip-chars-forward "a-zA-Z0-9_") + (point)))) + (end-of-line) + (pascal-delete-whitespaces) + (insert " { ") + ;; We've filled up the kill ring, but hey, who cares? + (yank) (rotate-yank-pointer 1) + (insert " }"))))))))) + + ;;; + ;;; Indent functions and calculation of indent + ;;; + (defun pascal-indent-command () + "Indent current line as Pascal code and/or indent within line." + ;; Call pascal-indent-line. This does nothing if we're not at the + ;; beginning of the line. + (pascal-indent-line) + (let ((indent (pascal-calculate-indent t)) + (pos 0)) + (save-excursion + (cond ((or (eq (nth 1 indent) 'case) + (eq (nth 1 indent) 'record)) + ;; Indent for case and record blocks + (beginning-of-line) + (if (search-forward ":" (pascal-get-end-of-line) t) + (progn + ;; Indent before colon + (backward-char 1) + (pascal-delete-whitespaces) + (indent-to (max (pascal-find-leading-case-colon) + (1+ (current-column)))) + ;; Indent after colon + (forward-char 1) + (pascal-delete-whitespaces) + (indent-to (1+ (current-column)))) + ;; Indent if there is no colon + (progn + (beginning-of-line) + (skip-chars-forward " \t") + (if (not (eolp)) + (progn + (skip-chars-forward "0-9a-zA-Z\"\'_;") + (pascal-delete-whitespaces) + (indent-to (max (pascal-find-leading-case-colon) + (1+ (current-column))))))))) + ((eq (nth 1 indent) 'decl) + ;; Indent for declarations + (let ((posii (pascal-get-beg-of-line))) + (re-search-backward "\\<\\(var\\|type\\|const\\|label\\)\\>" + nil t) + (cond ((looking-at "var\\b") + (pascal-declindent-middle-of-line + ":" posii pascal-vardecl-indent)) + ((looking-at "type\\b\\|const\\b") + (pascal-declindent-middle-of-line + "=" posii pascal-typedecl-indent))))) + ((eq (nth 1 indent) 'function) + ;; Indent for parameterlist + ;; Done twice in case something has changed + (pascal-indent-parameter-list) + (pascal-indent-parameter-list)))) + ;; Go to the end of a line if rest of line contains only whitespaces + (if (save-excursion (skip-chars-forward " \t") (eolp)) + (end-of-line)))) + + (defun pascal-indent-line () + "Indent current line as Pascal code." + (let ((indent (list 0 nil)) + (comindent 0) + beg (point)) + (save-excursion + (beginning-of-line) + (setq indent (pascal-calculate-indent))) + ;; If we are inside a comment, do special indent. + (if (setq comindent (pascal-check-if-within-comment)) + (pascal-indent-within-comment comindent) + ;; Skip the rest if we're not standing on the beginning of a line. + (if (save-excursion (skip-chars-backward " \t") (bolp)) + (progn + (beginning-of-line) + (pascal-delete-whitespaces) + ;; When to skip the ekstra indent: + ;; If we are standing at end or until. + ;; If we are in an if statement and standing at else, + ;; begin or repeat + ;; If we are in a with, while or for statement and standing + ;; at begin or end. + (cond ((or (or (looking-at "end\\b\\|until\\b") + (not (nth 1 indent))) + (and (eq (nth 1 indent) 'if) + (looking-at "begin\\b\\|\\repeat\\b\\|else\\b")) + (and (eq (nth 1 indent) 'whilewith) + (looking-at "begin\\b\\|\\repeat\\b"))) + (indent-to (car indent))) + ;; Continued expression + ((eq (nth 1 indent) 'contexp) + (indent-to (+ (car indent) pascal-continued-expr))) + ;; If this is a part of a case or record block, + ;; then modify the indent level. + ((or (eq (nth 1 indent) 'case) + (eq (nth 1 indent) 'record)) + (indent-to (+ (car indent) pascal-indent-level + pascal-label-offset))) + ;; If this is a label - don't indent. + ((looking-at "[0-9]*:") + (skip-chars-forward "0-9:") + (pascal-delete-whitespaces) + (indent-to (+ (car indent) pascal-indent-level))) + ;; If this is insde a parameter list, do special indent + ((eq (nth 1 indent) 'function) + (pascal-indent-parameter-list)) + ;; All other indents are set normaly. + (t + (indent-to (+ (car indent) pascal-indent-level))))))))) + + (defun pascal-calculate-indent (&optional arg) + "Search backward in code to find the right indent level. + Return a list containing: + 1. Indent level + 2. The indent keyword (begin, case etc.), or nil if backtracking failed. + If arg is non-nil, we do not search for continued expressions." + (let ((pascal-nest-depth 1) + (oldpos (save-excursion (forward-line -1) (end-of-line) (point))) + (samepos (point)) (if-is-set t) + (return-struct (list 0 nil)) (pos 0) + (contexpr nil) (after-contexpr (not arg)) + (case-fold-search t)) + (save-excursion + (while (and (not (zerop pascal-nest-depth)) + (not (bobp))) + (progn + (backward-sexp 1) + (if (save-excursion + (setq pos (point)) + (end-of-line) + (search-backward ";" pos t)) + (setq if-is-set nil + after-contexpr nil)) + (if (looking-at "then\\b\\|end\\b\\|else\\b\\|do\\b") + (setq after-contexpr nil)) + + (cond ((looking-at "begin\\b\\|case\\b\\|record\\b\\|repeat\\b") + (setq pascal-nest-depth (1- pascal-nest-depth))) + ;; + ;; END | UNTIL + ((looking-at "end\\(\\b\\|;\\|\\.\\)\\|until\\b") + (setq if-is-set nil) + (if after-contexpr + (setq pascal-nest-depth 0 + contexpr t) + (setq pascal-nest-depth (1+ pascal-nest-depth)))) + ;; + ;; IF | ELSE | WITH | WHILE | FOR + ;; LABEL | CONST | TYPE | FUNCTION | PROCEDURE + ((or (and (looking-at "if\\b\\|else\\b\\|with\\b\\|while\\b\\|for\\b") + if-is-set) + (looking-at "label\\b\\|const\\b\\|type\\b\\|function\\b\\|procedure\\b")) + (setq pascal-nest-depth 0)) + ;; + ;; VAR + ((looking-at "var\\b") + ;; A `var' can be in a declaration part or parameter part + (let ((stpos 0) (edpos 0)) + (save-excursion + (if (not (re-search-backward + "\\<\\(function\\|procedure\\)\\>" nil t)) + (beginning-of-buffer)) + (setq stpos (save-excursion + (search-forward "(" nil t) (point))) + (setq edpos (save-excursion + (search-forward ")" nil t) (point)))) + (cond ((or (= stpos edpos) (< samepos stpos) + (and (> (point) edpos) (> edpos stpos))) + ;; This is really a declaration block!! + nil) + ((and (>= samepos stpos) (or (< samepos edpos) + (> stpos edpos))) + ;; Hmm... part of a parameter + (re-search-backward + "\\<\\(function\\|procedure\\)\\>" nil t)) + (t + ;; This is just after a parameter declaration + (forward-char 1))) + ;; We'll quit anyway + (setq pascal-nest-depth 0))) + ;; + ;; CONTINUED EXPRESSIONS + (after-contexpr + (save-excursion + ;; First, we have to be at the begining of a line + (if (and (progn (skip-chars-backward " \t") (bolp)) + ;; Blank lines don't count + (not (progn (skip-chars-forward " \t") (eolp))) + ;; But nonblank without ';' do + (not (search-forward ";" (pascal-get-end-of-line) t))) + (save-excursion + (forward-line -1) + (end-of-line) + (backward-sexp 1) + (if (or (looking-at "\\(do\\|then\\|of\\\|begin\\|repeat\\|else\\)\\>") + (progn + (skip-chars-forward "^; " (pascal-get-end-of-line)) + (equal (char-to-string (following-char)) + ";"))) + (setq pascal-nest-depth 0)) + (setq contexpr t))))) + ))) + (cond (contexpr + (setq return-struct (list (pascal-lstart-col) 'contexp))) + ((looking-at "begin\\b") + (setq return-struct (list (pascal-lstart-col) 'begin))) + ((looking-at "else\\b") + (setq return-struct (list (save-excursion + (re-search-backward "if\\b" nil t) + (pascal-lstart-col)) 'if)) + ;; Indent line in case this is a multiple if + (beginning-of-line) + (pascal-delete-whitespaces) + (indent-to (car return-struct))) + ((looking-at "if\\b") + (if (save-excursion + (narrow-to-region (pascal-get-beg-of-line) (point)) + (backward-sexp 1) + (widen) + (looking-at "else\\b")) + ;; Indent line if this is a multiple if + (progn + (beginning-of-line) + (pascal-delete-whitespaces) + (indent-to (save-excursion + (re-search-backward "if\\b" nil t) + (pascal-lstart-col))))) + ;; This could be a continued expression + (if (and after-contexpr + (not (save-excursion (re-search-forward + "then\\b" (pascal-get-end-of-line) t)))) + (setq return-struct (list (pascal-lstart-col) 'contexp)) + (setq return-struct (list (pascal-lstart-col) 'if)))) + ((looking-at "repeat\\b") + (setq return-struct (list (pascal-lstart-col) 'repeat))) + ((looking-at "case\\b") + (setq return-struct (list (current-column) 'case))) + ((looking-at "record\\b") + (setq return-struct (list (current-column) 'record))) + ((looking-at "while\\b\\|with\\b\\|for\\b") + ;; This could ba a continued expression + (if (and after-contexpr + (not (save-excursion (re-search-forward + "do\\b" (pascal-get-end-of-line) t)))) + (setq return-struct (list (pascal-lstart-col) 'contexp)) + (setq return-struct (list (current-column) 'whilewith)))) + ((looking-at "procedure\\b\\|function\\b") + ;; Make sure that this is a function with parameters, and + ;; that we are actually standing inside the paranthesis. + (let ((spos (save-excursion + (search-forward "(" samepos t) (point))) + (epos (save-excursion + (search-forward ")" samepos t) (point)))) + (if (and (>= samepos spos) (or (< samepos epos) + (> spos epos))) + (setq return-struct (list 0 'function)) + (setq return-struct (list 0 nil))))) + ((looking-at "var\\b\\|label\\b\\|const\\b\\|type\\b") + ;; Are we really in the declaration part?(Check for blank lines) + (if (< oldpos (point)) + (setq return-struct (list 0 'decl)) + (if (save-excursion + (not (re-search-forward "^[ \t]*$" oldpos t))) + (setq return-struct (list 0 'decl)) + (setq return-struct (list 0 nil))))) + (t + (setq return-struct (list 0 nil)))) + return-struct))) + + (defun pascal-lstart-col () + "Return the column of the beginning of the first command on the line." + (save-excursion + (beginning-of-line) + (skip-chars-forward ":0-9") + (skip-chars-forward " \t") + (current-column))) + + (defun pascal-indent-parameter-list () + "Indent this line as part of a parameter list in a function." + (let ((indents (pascal-get-highest-indents-in-parameterlist)) + (pos 0)) + (if (not (progn (beginning-of-line) + (search-forward "(" (pascal-get-end-of-line) t))) + (progn (beginning-of-line) + (skip-chars-forward " \t"))) + ;; Indent region in front of var + (skip-chars-forward " \t") + (pascal-delete-whitespaces) + (indent-to (nth 0 indents)) + (if (looking-at "var\\b") + (forward-char 3)) + ;; Indent parameternames + (pascal-delete-whitespaces) + (indent-to (nth 1 indents)) + (if (not (save-excursion (skip-chars-forward " \t") (eolp))) + (progn + ;; Indent colon + (if (search-forward ":" (pascal-get-end-of-line) t) + (backward-char 1) + (end-of-line)) + (pascal-delete-whitespaces) + (indent-to (nth 2 indents)) + ;; Indent after colon + (if (equal (following-char) ?:) + (progn + (forward-char 1) + (pascal-delete-whitespaces) + (indent-to (+ 2 (nth 2 indents))))))))) + + ;; Get the indents to use in a parameterlist. + ;; Returns: + ;; 1. Indent to the beginning of the line. + ;; 2. Indent to the beginning of the parameter names. + ;; 3. Indent to the right colon position." + (defun pascal-get-highest-indents-in-parameterlist () + (save-excursion + (let ((start (progn + (re-search-backward + "\\<\\(function\\|procedure\\)\\>" nil t) + (search-forward "(") + (current-column))) + (arglength 0) (vardecl nil) (done nil)) + (while (not (or done (eobp))) + (beginning-of-line) + (if (save-excursion + (re-search-forward "\\" (pascal-get-end-of-line) t)) + (setq vardecl t)) + (if (not (re-search-forward ":" (pascal-get-end-of-line) t)) + (setq done t)) + (skip-chars-backward ": \t") + (setq arglength (max arglength (current-column))) + (forward-line 1)) + (if vardecl + (list start (+ start 4) (1+ arglength)) + (list start start (1+ arglength)))))) + + (defun pascal-declindent-middle-of-line (declkey endpos defaultindent) + "Indent declaration line." + (let ((decindent 0)) + (if (search-forward declkey endpos t) + (setq decindent (1- (current-column))) + (setq decindent defaultindent)) + (goto-char endpos) + (end-of-line) + (if (save-excursion (search-backward declkey endpos t)) + (progn (search-backward declkey) (skip-chars-backward " \t")) + (skip-chars-backward " \t")) + (pascal-delete-whitespaces) + (indent-to (max decindent (1+ (current-column)))) + ;; Indent after `declkey' + (if (looking-at declkey) + (progn + (forward-char 1) + (pascal-delete-whitespaces) + (indent-to (1+ (current-column))))))) + + (defun pascal-indent-within-comment (indent) + "Indent comments and/or indent text within comment." + (progn + ;; If we are at the beginning of the line, then we indent this line. + (if (save-excursion (skip-chars-backward " \t") (bolp)) + (progn + (beginning-of-line) + (pascal-delete-whitespaces) + (indent-to indent)) + ;; Do nothing if we're not in a star comment. + (if (save-excursion + (beginning-of-line) + (skip-chars-forward " \t") + (looking-at "\\*\\|(\\*")) + (save-excursion + (beginning-of-line) + (search-forward "*") + (pascal-delete-whitespaces) + (indent-to (+ (current-column) 2))))))) + + (defun pascal-find-leading-case-colon () + "Return hpos of first colon after the case-of or record line. + If there's no such line, use the place where it ought to be." + (let ((pos (save-excursion + (beginning-of-line) + (skip-chars-forward " \t") + (point)))) + (save-excursion + (re-search-backward "\\<\\(case\\|record\\)\\>") + (forward-line 1) + (skip-chars-forward " \t") + (if (not (eq pos (point))) + (progn + (search-forward ":" (pascal-get-end-of-line) t) + (1- (current-column))) + (+ (current-column) pascal-case-offset))))) + + (provide 'pascal) + + ;; pascal.el ends here. diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/paths.el emacs-19.20/lisp/paths.el *** emacs-19.19/lisp/paths.el Sun Aug 15 01:22:53 1993 --- emacs-19.20/lisp/paths.el Fri Sep 10 01:05:01 1993 *************** *** 101,108 **** (defconst rmail-spool-directory ! (if (memq system-type '(dgux-unix hpux usg-unix-v unisoft-unix rtu ! irix silicon-graphics-unix)) ! "/usr/mail/" ! "/usr/spool/mail/") "Name of directory used by system mailer for delivering new mail. Its name should end with a slash.") --- 101,110 ---- (defconst rmail-spool-directory ! (cond ((memq system-type '(dgux-unix hpux usg-unix-v unisoft-unix rtu ! irix silicon-graphics-unix)) ! "/usr/mail/") ! ((eq system-type 'netbsd) ! "/var/mail/") ! (t "/usr/spool/mail/")) "Name of directory used by system mailer for delivering new mail. Its name should end with a slash.") diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/pp.el emacs-19.20/lisp/pp.el *** emacs-19.19/lisp/pp.el --- emacs-19.20/lisp/pp.el Sun Oct 10 18:16:54 1993 *************** *** 0 **** --- 1,171 ---- + ;; pp.el --- pretty printer for Emacs Lisp + ;; Copyright (C) 1989, 1993 Free Software Foundation, Inc. + + ;; Author: Randal Schwartz + + ;; This file is part of GNU Emacs. + + ;; GNU Emacs is free software; you can redistribute it and/or modify + ;; it under the terms of the GNU General Public License as published by + ;; the Free Software Foundation; either version 2, or (at your option) + ;; any later version. + + ;; GNU Emacs is distributed in the hope that it will be useful, + ;; but WITHOUT ANY WARRANTY; without even the implied warranty of + ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ;; GNU General Public License for more details. + + ;; You should have received a copy of the GNU General Public License + ;; along with GNU Emacs; see the file COPYING. If not, write to + ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + + ;;; Code: + + (defvar pp-escape-newlines t + "*Value of print-escape-newlines used by pp-* functions.") + + (defun pp-to-string (object) + "Return a string containing the pretty-printed representation of OBJECT, + any Lisp object. Quoting characters are used when needed to make output + that `read' can handle, whenever this is possible." + (save-excursion + (set-buffer (generate-new-buffer " pp-to-string")) + (unwind-protect + (progn + (emacs-lisp-mode) + (let ((print-escape-newlines pp-escape-newlines)) + (prin1 object (current-buffer))) + (goto-char (point-min)) + (while (not (eobp)) + ;; (message "%06d" (- (point-max) (point))) + (cond + ((looking-at "\\s\(") + (while (looking-at "\\s(") + (forward-char 1))) + ((and (looking-at "\\(quote[ \t]+\\)\\([^.)]\\)") + (> (match-beginning 1) 1) + (= ?\( (char-after (1- (match-beginning 1)))) + ;; Make sure this is a two-element list. + (save-excursion + (goto-char (match-beginning 2)) + (forward-sexp) + ;; (looking-at "[ \t]*\)") + ;; Avoid mucking with match-data; does this test work? + (char-equal ?\) (char-after (point))))) + ;; -1 gets the paren preceding the quote as well. + (delete-region (1- (match-beginning 1)) (match-end 1)) + (insert "'") + (forward-sexp 1) + (if (looking-at "[ \t]*\)") + (delete-region (match-beginning 0) (match-end 0)) + (error "Malformed quote")) + (backward-sexp 1)) + ((condition-case err-var + (prog1 t (down-list 1)) + (error nil)) + (backward-char 1) + (skip-chars-backward " \t") + (delete-region + (point) + (progn (skip-chars-forward " \t") (point))) + (if (not (char-equal ?' (char-after (1- (point))))) + (insert ?\n))) + ((condition-case err-var + (prog1 t (up-list 1)) + (error nil)) + (while (looking-at "\\s)") + (forward-char 1)) + (skip-chars-backward " \t") + (delete-region + (point) + (progn (skip-chars-forward " \t") (point))) + (if (not (char-equal ?' (char-after (1- (point))))) + (insert ?\n))) + (t (goto-char (point-max))))) + (goto-char (point-min)) + (indent-sexp) + (buffer-string)) + (kill-buffer (current-buffer))))) + + (defun pp (object &optional stream) + "Output the pretty-printed representation of OBJECT, any Lisp object. + Quoting characters are printed when needed to make output that `read' + can handle, whenever this is possible. + Output stream is STREAM, or value of `standard-output' (which see)." + (princ (pp-to-string object) (or stream standard-output))) + + (defun pp-eval-expression (expression) + "Evaluate EXPRESSION and pretty-print value into a new display buffer. + If the pretty-printed value fits on one line, the message line is used + instead. Value is also consed on to front of variable values 's + value." + (interactive "xPp-eval: ") + (setq values (cons (eval expression) values)) + (let* ((old-show-hook + (or (let ((sym (if (> (string-to-int emacs-version) 18) + 'temp-buffer-show-function + 'temp-buffer-show-hook))) + (and (boundp 'sym) (symbol-value sym))) + 'display-buffer)) + (temp-buffer-show-hook + (function + (lambda (buf) + (save-excursion + (set-buffer buf) + (goto-char (point-min)) + (end-of-line 1) + (if (or (< (1+ (point)) (point-max)) + (>= (- (point) (point-min)) (screen-width))) + (progn + (goto-char (point-min)) ; expected by some hooks ... + (funcall old-show-hook buf)) + (message "%s" (buffer-substring (point-min) (point))) + (delete-windows-on buf) ; no need to kill it + ))))) + (temp-buffer-show-function temp-buffer-show-hook)) ; emacs19 name + (with-output-to-temp-buffer "*Pp Eval Output*" + (pp (car values))) + (save-excursion + (set-buffer "*Pp Eval Output*") + (emacs-lisp-mode)))) + + (defun pp-eval-last-sexp (arg) + "Run `pp-eval-expression' on sexp before point (which see). + With argument, pretty-print output into current buffer. + Ignores leading comment characters." + (interactive "P") + (let ((stab (syntax-table)) (pt (point)) start exp) + (set-syntax-table emacs-lisp-mode-syntax-table) + (save-excursion + (forward-sexp -1) + ;; If first line is commented, ignore all leading comments: + (if (save-excursion (beginning-of-line) (looking-at "[ \t]*;")) + (progn + (setq exp (buffer-substring (point) pt)) + (while (string-match "\n[ \t]*;+" exp start) + (setq start (1+ (match-beginning 0)) + exp (concat (substring exp 0 start) + (substring exp (match-end 0))))) + (setq exp (read exp))) + (setq exp (read (current-buffer))))) + (set-syntax-table stab) + (if arg + (insert (pp-to-string (eval exp))) + (pp-eval-expression exp)))) + + ;;; Test cases for quote + ;; (pp-eval-expression ''(quote quote)) + ;; (pp-eval-expression ''((quote a) (quote b))) + ;; (pp-eval-expression ''('a 'b)) ; same as above + ;; (pp-eval-expression ''((quote (quote quote)) (quote quote))) + ;; These do not satisfy the quote test. + ;; (pp-eval-expression ''quote) + ;; (pp-eval-expression ''(quote)) + ;; (pp-eval-expression ''(quote . quote)) + ;; (pp-eval-expression ''(quote a b)) + ;; (pp-eval-expression ''(quotefoo)) + ;; (pp-eval-expression ''(a b)) + + (provide 'pp) ; so (require 'pp) works + + ;;; pp.el ends here. diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/regi.el emacs-19.20/lisp/regi.el *** emacs-19.19/lisp/regi.el --- emacs-19.20/lisp/regi.el Wed Oct 13 02:07:11 1993 *************** *** 0 **** --- 1,259 ---- + ;;; regi.el --- REGular expression Interpreting engine + + ;; Author: 1993 Barry A. Warsaw, Century Computing, Inc. + ;; Maintainer: bwarsaw@cen.com + ;; Created: 24-Feb-1993 + ;; Version: 1.8 + ;; Last Modified: 1993/06/01 21:33:00 + ;; Keywords: regular expression regexp matching text + + ;; Copyright (C) 1993 Barry A. Warsaw + + ;; This file is not yet part of GNU Emacs. + ;; + ;; This program is free software; you can redistribute it and/or modify + ;; it under the terms of the GNU General Public License as published by + ;; the Free Software Foundation; either version 2 of the License, or + ;; (at your option) any later version. + ;; + ;; This program is distributed in the hope that it will be useful, + ;; but WITHOUT ANY WARRANTY; without even the implied warranty of + ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ;; GNU General Public License for more details. + ;; + ;; You should have received a copy of the GNU General Public License + ;; along with this program; if not, write to the Free Software + ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + ;; LCD Archive Entry + ;; regi|Barry A. Warsaw|bwarsaw@cen.com + ;; |REGular expression Interpreting engine + ;; |1993/06/01 21:33:00|1.8| + + ;;; Code: + + + (defun regi-pos (&optional position col-p) + "Return the character position at various buffer positions. + Optional POSITION can be one of the following symbols: + + `bol' == beginning of line + `boi' == beginning of indentation + `eol' == end of line [default] + `bonl' == beginning of next line + `bopl' == beginning of previous line + + Optional COL-P non-nil returns `current-column' instead of character position." + (save-excursion + (cond + ((eq position 'bol) (beginning-of-line)) + ((eq position 'boi) (back-to-indentation)) + ((eq position 'bonl) (forward-line 1)) + ((eq position 'bopl) (forward-line -1)) + (t (end-of-line))) + (if col-p (current-column) (point)))) + + (defun regi-mapcar (predlist func &optional negate-p case-fold-search-p) + "Build a regi frame where each element of PREDLIST appears exactly once. + The frame contains elements where each member of PREDLIST is + associated with FUNC, and optionally NEGATE-P and CASE-FOLD-SEARCH-P." + (let (frame tail) + (if (or negate-p case-fold-search-p) + (setq tail (list negate-p))) + (if case-fold-search-p + (setq tail (append tail (list case-fold-search-p)))) + (while predlist + (let ((element (list (car predlist) func))) + (if tail + (setq element (append element tail))) + (setq frame (append frame (list element)) + predlist (cdr predlist)) + )) + frame)) + + + (defun regi-interpret (frame &optional start end) + "Interpret the regi frame FRAME. + If optional START and END are supplied, they indicate the region of + interest, and the buffer is narrowed to the beginning of the line + containing START, and beginning of the line after the line containing + END. Otherwise, point and mark are not set and processing continues + until your FUNC returns the `abort' symbol (see below). Beware! Not + supplying a START or END could put you in an infinite loop. + + A regi frame is a list of entries of the form: + + (PRED FUNC [NEGATE-P [CASE-FOLD-SEARCH]]) + + PRED is a predicate against which each line in the region is tested, + and if a match occurs, FUNC is `eval'd. Point is then moved to the + beginning of the next line, the frame is reset and checking continues. + If a match doesn't occur, the next entry is checked against the + current line until all entries in the frame are checked. At this + point, if no match occurred, the frame is reset and point is moved to + the next line. Checking continues until every line in the region is + checked. Optional NEGATE-P inverts the result of PRED before FUNC is + called and `case-fold-search' is bound to the optional value of + CASE-FOLD-SEARCH for the PRED check. + + PRED can be a string, variable, function or one of the following + symbols: t, nil, `begin', `end', and `every'. If PRED is a string, or + a variable or list that evaluates to a string, it is interpreted as a + regular expression and is matched against the current line (from the + beginning) using `looking-at'. If PRED does not evaluate to a string, + it is interpreted as a binary value (nil or non-nil). + + PRED can also be one of the following symbols: + + t -- always produces a true outcome + `begin' -- always executes before anything else + `end' -- always executes after everything else + `every' -- execute after frame is matched on a line + + Note that NEGATE-P and CASE-FOLD-SEARCH are meaningless if PRED is one + of these special symbols. Only the first occurance of each symbol in + a frame entry is used, the rest are ignored. + + Your FUNC can return values which control regi processing. If a list + is returned from your function, it can contain any combination of the + following elements: + + the symbol `continue' + Tells regi to continue processing frame-entries after a match, + instead of resetting to the first entry and advancing to the next + line, as is the default behavior. When returning this symbol, + you must take care not to enter an infinite loop. + + the symbol `abort' + Tells regi to terminate processing this frame. any end + frame-entry is still processed. + + the list `(frame . NEWFRAME)' + Tells regi to use NEWFRAME as its current frame. In other words, + your FUNC can modify the executing regi frame on the fly. + + the list `(step . STEP)' + Tells regi to move STEP number of lines forward during normal + processing. By default, regi moves forward 1 line. STEP can be + negative, but be careful of infinite loops. + + You should usually take care to explicitly return nil from your + function if no action is to take place. Your FUNC will always be + `eval'ed. The following variables will be temporarily bound to some + useful information: + + `curline' + the current line in the buffer, as a string + + `curframe' + the full, current frame being executed + + `curentry' + the current frame entry being executed." + + (save-excursion + (save-restriction + (let (begin-tag end-tag every-tag current-frame working-frame donep) + + ;; set up the narrowed region + (and start + end + (let* ((tstart start) + (start (min start end)) + (end (max start end))) + (narrow-to-region + (progn (goto-char end) (regi-pos 'bonl)) + (progn (goto-char start) (regi-pos 'bol))))) + + ;; lets find the special tags and remove them from the working + ;; frame. note that only the last special tag is used. + (mapcar + (function + (lambda (entry) + (let ((pred (car entry)) + (func (car (cdr entry)))) + (cond + ((eq pred 'begin) (setq begin-tag func)) + ((eq pred 'end) (setq end-tag func)) + ((eq pred 'every) (setq every-tag func)) + (t + (setq working-frame (append working-frame (list entry)))) + ) ; end-cond + ))) + frame) ; end-mapcar + + ;; execute the begin entry + (eval begin-tag) + + ;; now process the frame + (setq current-frame working-frame) + (while (not (or donep (eobp))) + (let* ((entry (car current-frame)) + (pred (nth 0 entry)) + (func (nth 1 entry)) + (negate-p (nth 2 entry)) + (case-fold-search (nth 3 entry)) + match-p) + (catch 'regi-throw-top + (cond + ;; we are finished processing the frame for this line + ((not current-frame) + (setq current-frame working-frame) ;reset frame + (forward-line 1) + (throw 'regi-throw-top t)) + ;; see if predicate evaluates to a string + ((stringp (setq match-p (eval pred))) + (setq match-p (looking-at match-p))) + ) ; end-cond + + ;; now that we've done the initial matching, check for + ;; negation of match + (and negate-p + (setq match-p (not match-p))) + + ;; if the line matched, package up the argument list and + ;; funcall the FUNC + (if match-p + (let* ((curline (buffer-substring + (regi-pos 'bol) + (regi-pos 'eol))) + (curframe current-frame) + (curentry entry) + (result (eval func)) + (step (or (cdr (assq 'step result)) 1)) + ) + ;; changing frame on the fly? + (if (assq 'frame result) + (setq working-frame (cdr (assq 'frame result)))) + + ;; continue processing current frame? + (if (memq 'continue result) + (setq current-frame (cdr current-frame)) + (forward-line step) + (setq current-frame working-frame)) + + ;; abort current frame? + (if (memq 'abort result) + (progn + (setq donep t) + (throw 'regi-throw-top t))) + ) ; end-let + + ;; else if no match occurred, then process the next + ;; frame-entry on the current line + (setq current-frame (cdr current-frame)) + + ) ; end-if match-p + ) ; end catch + ) ; end let + + ;; after every cycle, evaluate every-tag + (eval every-tag) + ) ; end-while + + ;; now process the end entry + (eval end-tag))))) + + + (provide 'regi) + ;;; regi.el ends here diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/register.el emacs-19.20/lisp/register.el *** emacs-19.19/lisp/register.el Sun Aug 15 01:23:05 1993 --- emacs-19.20/lisp/register.el Mon Nov 8 08:14:46 1993 *************** *** 64,68 **** Use \\[jump-to-register] to restore the configuration. Argument is a character, naming the register." ! (interactive "cPoint to register: \nP") (set-register char (current-window-configuration))) --- 64,68 ---- Use \\[jump-to-register] to restore the configuration. Argument is a character, naming the register." ! (interactive "cWindow configuration to register: \nP") (set-register char (current-window-configuration))) *************** *** 71,79 **** Use \\[jump-to-register] to restore the configuration. Argument is a character, naming the register." ! (interactive "cPoint to register: \nP") (set-register char (current-frame-configuration))) (defalias 'register-to-point 'jump-to-register) ! (defun jump-to-register (char) "Move point to location stored in a register. If the register contains a file name, find that file. --- 71,79 ---- Use \\[jump-to-register] to restore the configuration. Argument is a character, naming the register." ! (interactive "cFrame configuration to register: \nP") (set-register char (current-frame-configuration))) (defalias 'register-to-point 'jump-to-register) ! (defun jump-to-register (char &optional delete) "Move point to location stored in a register. If the register contains a file name, find that file. *************** *** 81,91 **** If the register contains a window configuration (one frame) or a frame configuration (all frames), restore that frame or all frames accordingly. ! Argument is a character, naming the register." ! (interactive "cJump to register: ") (let ((val (get-register char))) (cond ((and (fboundp 'frame-configuration-p) (frame-configuration-p val)) ! (set-frame-configuration val)) ((window-configuration-p val) (set-window-configuration val)) --- 81,94 ---- If the register contains a window configuration (one frame) or a frame configuration (all frames), restore that frame or all frames accordingly. ! First argument is a character, naming the register. ! Optional second arg non-nil (interactively, prefix argument) says to ! delete any existing frames that the frame configuration doesn't mention. ! \(Otherwise, these frames are iconified.)" ! (interactive "cJump to register: \nP") (let ((val (get-register char))) (cond ((and (fboundp 'frame-configuration-p) (frame-configuration-p val)) ! (set-frame-configuration val (not delete))) ((window-configuration-p val) (set-window-configuration val)) diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/replace.el emacs-19.20/lisp/replace.el *** emacs-19.19/lisp/replace.el Sun Aug 15 01:23:06 1993 --- emacs-19.20/lisp/replace.el Wed Nov 10 21:46:12 1993 *************** *** 228,232 **** (make-local-variable 'occur-buffer) (make-local-variable 'occur-nlines) ! (make-local-variable 'occur-pos-list)) (defun occur-mode-goto-occurrence () --- 228,233 ---- (make-local-variable 'occur-buffer) (make-local-variable 'occur-nlines) ! (make-local-variable 'occur-pos-list) ! (run-hooks 'occur-mode-hook)) (defun occur-mode-goto-occurrence () diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/reporter.el emacs-19.20/lisp/reporter.el *** emacs-19.19/lisp/reporter.el Sun Aug 15 01:23:11 1993 --- emacs-19.20/lisp/reporter.el Wed Oct 13 02:15:31 1993 *************** *** 1,25 **** ;;; reporter.el --- customizable bug reporting of lisp programs - ;; Copyright (C) 1993 Free Software Foundation, Inc. ;; Author: 1993 Barry A. Warsaw, Century Computing Inc. ;; Maintainer: bwarsaw@cen.com ;; Created: 19-Apr-1993 ;; Keywords: bug reports lisp ! ;; This file is not yet part of GNU Emacs. ! ;; ! ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ! ;; the Free Software Foundation; either version 2 of the License, or ! ;; (at your option) any later version. ! ;; ! ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ! ;; ;; You should have received a copy of the GNU General Public License ! ;; along with this program; if not, write to the Free Software ! ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ;; Introduction --- 1,28 ---- ;;; reporter.el --- customizable bug reporting of lisp programs ;; Author: 1993 Barry A. Warsaw, Century Computing Inc. ;; Maintainer: bwarsaw@cen.com ;; Created: 19-Apr-1993 + ;; Version: 1.23 + ;; Last Modified: 1993/09/02 20:28:36 ;; Keywords: bug reports lisp ! ;; Copyright (C) 1993 Free Software Foundation, Inc. ! ! ;; This file is part of GNU Emacs. ! ! ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ! ;; the Free Software Foundation; either version 2, or (at your option) ! ;; any later version. ! ! ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ! ;; You should have received a copy of the GNU General Public License ! ;; along with GNU Emacs; see the file COPYING. If not, write to ! ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. ;; Introduction *************** *** 57,61 **** ;; etc. This list's intended audience is elisp package authors who are ;; using reporter and want to stay current with releases. Here are the ! ;; relevant addresses: ;; ;; Administrivia: reporter-request@anthem.nlm.nih.gov --- 60,64 ---- ;; etc. This list's intended audience is elisp package authors who are ;; using reporter and want to stay current with releases. Here are the ! ;; relevent addresses: ;; ;; Administrivia: reporter-request@anthem.nlm.nih.gov *************** *** 63,69 **** ;; LCD Archive Entry: ! ;; reporter|Barry A. Warsaw|warsaw@cen.com| ;; Customizable bug reporting of lisp programs.| ! ;; 1993/05/22 00:29:49|1.18|~/misc/reporter.el.Z| ;;; Code: --- 66,72 ---- ;; LCD Archive Entry: ! ;; reporter|Barry A. Warsaw|bwarsaw@cen.com| ;; Customizable bug reporting of lisp programs.| ! ;; 1993/09/02 20:28:36|1.23|~/misc/reporter.el.Z| ;;; Code: *************** *** 73,78 **** ;; user defined variables ! (defvar reporter-mailer 'mail ! "*Mail package to use to generate bug report buffer.") ;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --- 76,85 ---- ;; user defined variables ! (defvar reporter-mailer '(vm-mail mail) ! "*Mail package to use to generate bug report buffer. ! This can either be a function symbol or a list of function symbols. ! If a list, it tries to use each specified mailer in order until an ! existing one is found.") ! ;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ *************** *** 84,87 **** --- 91,95 ---- variables. Current buffer will always be the mail buffer being composed.") + (defun reporter-dump-variable (varsym) *************** *** 151,161 **** for details). Optional PRE-HOOKS and POST-HOOKS are passed to `reporter-dump-state'. Optional SALUTATION is inserted at the top of the ! mail buffer, and point is left after the salutation. The mailer used is described in the variable `reporter-mailer'." - (let ((reporter-eval-buffer (current-buffer)) ! (mailbuf (progn (call-interactively reporter-mailer) ! (current-buffer)))) (require 'sendmail) (pop-to-buffer reporter-eval-buffer) --- 159,184 ---- for details). Optional PRE-HOOKS and POST-HOOKS are passed to `reporter-dump-state'. Optional SALUTATION is inserted at the top of the ! mail buffer, and point is left after the saluation. The mailer used is described in the variable `reporter-mailer'." (let ((reporter-eval-buffer (current-buffer)) ! (mailbuf ! (progn ! (call-interactively ! (if (nlistp reporter-mailer) ! reporter-mailer ! (let ((mlist reporter-mailer) ! (mailer nil)) ! (while mlist ! (if (commandp (car mlist)) ! (setq mailer (car mlist) ! mlist nil) ! (setq mlist (cdr mlist)))) ! (if (not mailer) ! (error ! "variable `%s' does not contain a command for mailing." ! "reporter-mailer")) ! mailer))) ! (current-buffer)))) (require 'sendmail) (pop-to-buffer reporter-eval-buffer) diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/rlogin.el emacs-19.20/lisp/rlogin.el *** emacs-19.19/lisp/rlogin.el Sun Aug 15 01:23:16 1993 --- emacs-19.20/lisp/rlogin.el Fri Oct 22 13:12:57 1993 *************** *** 24,33 **** ;; Support for remote logins using `rlogin'. ! ;; ! ;; Todo: add directory tracking using ange-ftp style patchnames for the cwd. ;;; Code: (require 'comint) ;;;###autoload --- 24,37 ---- ;; Support for remote logins using `rlogin'. ! ;; $Id: rlogin.el,v 1.13 1993/10/22 17:12:54 rms Exp $ + ;;; Todo: + + ;; Make this mode deal with comint-last-input-end properly. + ;;; Code: (require 'comint) + (require 'shell) ;;;###autoload *************** *** 52,55 **** --- 56,66 ---- a pty is being used, and errors will result from using a pipe instead.") + ;;;###autoload + ;(setq rlogin-initially-track-cwd nil) + (defvar rlogin-initially-track-cwd t + "*If non-`nil', do remote directory tracking via ange-ftp right away. + If `nil', you can still enable directory tracking by doing + `M-x dirtrack-toggle'.") + ;; Leave this nil because it makes rlogin-filter a tiny bit faster. Plus ;; you can still call rlogin-password by hand. *************** *** 64,70 **** (defvar rlogin-mode-map '()) (cond ((not rlogin-mode-map) ! (setq rlogin-mode-map (full-copy-sparse-keymap comint-mode-map)) ! ;(define-key rlogin-mode-map "\M-\t" 'comint-dynamic-complete) ! ;(define-key rlogin-mode-map "\M-?" 'comint-dynamic-list-completions) (define-key rlogin-mode-map "\C-c\C-c" 'rlogin-send-Ctrl-C) (define-key rlogin-mode-map "\C-c\C-z" 'rlogin-send-Ctrl-Z) --- 75,79 ---- (defvar rlogin-mode-map '()) (cond ((not rlogin-mode-map) ! (setq rlogin-mode-map (cons 'keymap shell-mode-map)) (define-key rlogin-mode-map "\C-c\C-c" 'rlogin-send-Ctrl-C) (define-key rlogin-mode-map "\C-c\C-z" 'rlogin-send-Ctrl-Z) *************** *** 73,83 **** ;;;###autoload ! (defun rlogin (&optional prefix host) "Open a network login connection to HOST via the `rlogin' program. Input is sent line-at-a-time to the remote connection. ! Communication with HOST is recorded in a buffer *rlogin-HOST*. ! If a prefix argument is given and the buffer *rlogin-HOST* already exists, ! a new buffer with a different connection will be made. The variable `rlogin-program' contains the name of the actual program to --- 82,93 ---- ;;;###autoload ! (defun rlogin (input-args &optional prefix) "Open a network login connection to HOST via the `rlogin' program. Input is sent line-at-a-time to the remote connection. ! Communication with the remote host is recorded in a buffer *rlogin-HOST*, ! where HOST is the first word in the string ARGS. If a prefix argument is ! given and the buffer *rlogin-HOST* already exists, a new buffer with a ! different connection will be made. The variable `rlogin-program' contains the name of the actual program to *************** *** 85,97 **** The variable `rlogin-explicit-args' is a list of arguments to give to ! the rlogin when starting." ! (interactive (list current-prefix-arg ! (read-from-minibuffer "Open rlogin connection to host: "))) (let* ((process-connection-type rlogin-process-connection-type) ! (buffer-name (format "*rlogin-%s*" host)) ! (args (if (and rlogin-explicit-args (listp rlogin-explicit-args)) ! (cons host rlogin-explicit-args) ! (list host))) ! proc) (and prefix (setq buffer-name (buffer-name (generate-new-buffer buffer-name)))) --- 95,114 ---- The variable `rlogin-explicit-args' is a list of arguments to give to ! the rlogin when starting. They are added after any arguments given in ARGS." ! (interactive (list (read-from-minibuffer "rlogin arguments (hostname first): ") ! current-prefix-arg)) (let* ((process-connection-type rlogin-process-connection-type) ! (buffer-name (format "*rlogin-%s*" input-args)) ! args ! proc ! (old-match-data (match-data))) ! (while (string-match "[ \t]*\\([^ \t]+\\)$" input-args) ! (setq args ! (cons (substring input-args (match-beginning 1) (match-end 1)) ! args) ! input-args (substring input-args 0 (match-beginning 0)))) ! (store-match-data old-match-data) ! (setq buffer-name (format "*rlogin-%s*" (car args)) ! args (append args rlogin-explicit-args)) (and prefix (setq buffer-name (buffer-name (generate-new-buffer buffer-name)))) *************** *** 105,131 **** ;; buffer from a previous exited process. (set-marker (process-mark proc) (point-max)) (set-process-filter proc 'rlogin-filter) ! (rlogin-mode))))) ! ! ;;;###autoload ! (defun rlogin-with-args (host args) ! "Open a new rlogin connection to HOST, even if one already exists. ! String ARGS is given as arguments to the `rlogin' program, overriding the ! value of `rlogin-explicit-args'." ! (interactive (list (read-from-minibuffer "Open rlogin connection to host: ") ! (read-from-minibuffer "with arguments: "))) ! (let ((old-match-data (match-data)) ! (rlogin-explicit-args nil)) ! (unwind-protect ! (progn ! (while (string-match "[ \t]*\\([^ \t]+\\)$" args) ! (setq rlogin-explicit-args ! (cons (substring args ! (match-beginning 1) ! (match-end 1)) ! rlogin-explicit-args) ! args (substring args 0 (match-beginning 0))))) ! (store-match-data old-match-data)) ! (rlogin 1 host))) ;;;###autoload --- 122,136 ---- ;; buffer from a previous exited process. (set-marker (process-mark proc) (point-max)) + (rlogin-mode) + ;; Set this *after* running rlogin-mode because rlogin-mode calls + ;; shell-mode, which munges the process filter. (set-process-filter proc 'rlogin-filter) ! ;; Set the prefix for filename completion and directory tracking ! ;; to find the remote machine's files by ftp. ! (setq comint-file-name-prefix (concat "/" (car args) ":")) ! (and rlogin-initially-track-cwd ! ;; Presume the user will start in his remote home directory. ! ;; If this is wrong, M-x dirs will fix it. ! (cd-absolute (concat "/" (car args) ":~/"))))))) ;;;###autoload *************** *** 157,165 **** (interactive) (kill-all-local-variables) ! (comint-mode) ! (setq comint-prompt-regexp shell-prompt-pattern) (setq major-mode 'rlogin-mode) (setq mode-name "rlogin") (use-local-map rlogin-mode-map) (run-hooks 'rlogin-mode-hook)) --- 162,171 ---- (interactive) (kill-all-local-variables) ! (shell-mode) (setq major-mode 'rlogin-mode) (setq mode-name "rlogin") (use-local-map rlogin-mode-map) + (setq shell-dirtrackp rlogin-initially-track-cwd) + (make-local-variable 'comint-file-name-prefix) (run-hooks 'rlogin-mode-hook)) diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/rmail.el emacs-19.20/lisp/rmail.el *** emacs-19.19/lisp/rmail.el Wed Aug 11 20:23:31 1993 --- emacs-19.20/lisp/rmail.el Wed Nov 10 15:50:25 1993 *************** *** 86,89 **** --- 86,93 ---- "*Non-nil means Rmail makes a new frame for composing outgoing mail.") + ;;;###autoload + (defvar rmail-retry-setup-hook nil + "Hook that `rmail-retry-failure' uses in place of `mail-setup-hook'.") + ;; These may be altered by site-init.el to match the format of mmdf files ;; delimiting used on a given host (delim1 and delim2 from the config *************** *** 191,195 **** (defun rmail (&optional file-name-arg) "Read and edit incoming mail. ! Moves messages into file named by rmail-file-name (a babyl format file) and edits that file in RMAIL Mode. Type \\[describe-mode] once editing that file, for a list of RMAIL commands. --- 195,199 ---- (defun rmail (&optional file-name-arg) "Read and edit incoming mail. ! Moves messages into file named by `rmail-file-name' (a babyl format file) and edits that file in RMAIL Mode. Type \\[describe-mode] once editing that file, for a list of RMAIL commands. *************** *** 233,237 **** (rmail-show-message)))) (let ((existing-unseen (rmail-first-unseen-message))) ! (rmail-get-new-mail) ;; Show the first unseen message, which might be from a previous session ;; or might have been just read in by rmail-get-new-mail. Must --- 237,242 ---- (rmail-show-message)))) (let ((existing-unseen (rmail-first-unseen-message))) ! (or file-name-arg ! (rmail-get-new-mail)) ;; Show the first unseen message, which might be from a previous session ;; or might have been just read in by rmail-get-new-mail. Must *************** *** 270,274 **** --- 275,283 ---- (let ((buffer-read-only nil)) (insert "BABYL OPTIONS: -*- rmail -*-\n"))) + ((equal (point-min) (point-max)) + ;; Empty RMAIL file. Just insert the header. + (rmail-insert-rmail-file-header)) (t + ;; Non-empty file in non-RMAIL format. Add header and convert. (setq convert t) (rmail-insert-rmail-file-header))) *************** *** 277,293 **** ;; convert file as necessary. (if (or convert ! (progn (goto-char (point-max)) ! (search-backward "\^_") ! (forward-char 1) ! (looking-at "\n*From "))) (let ((buffer-read-only nil)) (message "Converting to Babyl format...") ! ;;; If file needs conversion, convert it all. ! ;;; (narrow-to-region (point) (point-max)) (rmail-convert-to-babyl-format) (message "Converting to Babyl format...done"))))) ! ; I have checked that adding "-*- rmail -*-" to the BABYL OPTIONS line ! ; will not cause emacs 18.55 problems. (defun rmail-insert-rmail-file-header () --- 286,307 ---- ;; convert file as necessary. (if (or convert ! (save-excursion ! (goto-char (point-max)) ! (search-backward "\^_") ! (forward-char 1) ! (looking-at "\n*From "))) (let ((buffer-read-only nil)) (message "Converting to Babyl format...") ! ;; If file needs conversion, convert it all, ! ;; except for the BABYL header. ! ;; (rmail-convert-to-babyl-format would delete the header.) ! (goto-char (point-min)) ! (search-forward "\n\^_" nil t) ! (narrow-to-region (point) (point-max)) (rmail-convert-to-babyl-format) (message "Converting to Babyl format...done"))))) ! ;;; I have checked that adding "-*- rmail -*-" to the BABYL OPTIONS line ! ;;; will not cause emacs 18.55 problems. (defun rmail-insert-rmail-file-header () *************** *** 887,892 **** (eol (progn (end-of-line) (point)))) (read (buffer-substring beg eol))))))) ! (if size ! (goto-char (+ header-end size)))) (if (re-search-forward --- 901,906 ---- (eol (progn (end-of-line) (point)))) (read (buffer-substring beg eol))))))) ! (and size (numberp size) (>= size 0) ! (goto-char (+ header-end size)))) (if (re-search-forward *************** *** 919,923 **** ;; Delete the "From ..." line, creating various other headers with ;; information from it if they don't already exist. Now puts the ! ;; original line into a mail-from: header line for debugging. (defun rmail-nuke-pinhead-header () (save-excursion --- 933,938 ---- ;; Delete the "From ..." line, creating various other headers with ;; information from it if they don't already exist. Now puts the ! ;; original line into a mail-from: header line for debugging and for ! ;; use by the rmail-output function. (defun rmail-nuke-pinhead-header () (save-excursion *************** *** 982,987 **** (forward-line 1) (let ((case-fold-search t)) ! (if (looking-at "Summary-line: ") ! (forward-line 1))) (if (looking-at "\\*\\*\\* EOOH \\*\\*\\*\n") (delete-region (point) --- 997,1002 ---- (forward-line 1) (let ((case-fold-search t)) ! (while (looking-at "Summary-line:\\|Mail-From:") ! (forward-line 1))) (if (looking-at "\\*\\*\\* EOOH \\*\\*\\*\n") (delete-region (point) *************** *** 1023,1028 **** (forward-line 1) (let ((case-fold-search t)) ! (if (looking-at "Summary-Line:") ! (forward-line 1))) (insert "*** EOOH ***\n") (forward-char -1) --- 1038,1043 ---- (forward-line 1) (let ((case-fold-search t)) ! (while (looking-at "Summary-Line:\\|Mail-From:") ! (forward-line 1))) (insert "*** EOOH ***\n") (forward-char -1) *************** *** 1322,1326 **** "Show following non-deleted message. With prefix arg N, moves forward N non-deleted messages, ! or backward if N is negative." (interactive "p") (rmail-maybe-set-message-counters) --- 1337,1343 ---- "Show following non-deleted message. With prefix arg N, moves forward N non-deleted messages, ! or backward if N is negative. ! ! Returns t if a new message is being shown, nil otherwise." (interactive "p") (rmail-maybe-set-message-counters) *************** *** 1336,1344 **** (setq lastwin current n (1+ n)))) (if (/= lastwin rmail-current-message) ! (rmail-show-message lastwin)) ! (if (< n 0) ! (message "No previous nondeleted message")) ! (if (> n 0) ! (message "No following nondeleted message")))) (defun rmail-previous-undeleted-message (n) --- 1353,1363 ---- (setq lastwin current n (1+ n)))) (if (/= lastwin rmail-current-message) ! (progn (rmail-show-message lastwin) ! t) ! (if (< n 0) ! (message "No previous nondeleted message")) ! (if (> n 0) ! (message "No following nondeleted message")) ! nil))) (defun rmail-previous-undeleted-message (n) *************** *** 1558,1562 **** "Delete this message and move to next nondeleted one. Deleted messages stay in the file until the \\[rmail-expunge] command is given. ! With prefix argument, delete and move backward." (interactive "P") (rmail-set-attribute "deleted" t) --- 1577,1583 ---- "Delete this message and move to next nondeleted one. Deleted messages stay in the file until the \\[rmail-expunge] command is given. ! With prefix argument, delete and move backward. ! ! Returns t if a new message is displayed after the delete, or nil otherwise." (interactive "P") (rmail-set-attribute "deleted" t) *************** *** 1566,1571 **** (set-buffer rmail-summary-buffer) (rmail-summary-mark-deleted del-msg))) ! (rmail-next-undeleted-message (if backward -1 1)) ! (rmail-maybe-display-summary))) (defun rmail-delete-backward () --- 1587,1592 ---- (set-buffer rmail-summary-buffer) (rmail-summary-mark-deleted del-msg))) ! (prog1 (rmail-next-undeleted-message (if backward -1 1)) ! (rmail-maybe-display-summary)))) (defun rmail-delete-backward () *************** *** 1656,1660 **** (defun rmail-start-mail (&rest args) ! (if rmail-mail-new-frame (prog1 (apply 'mail-other-frame args) --- 1677,1681 ---- (defun rmail-start-mail (&rest args) ! (if (and window-system rmail-mail-new-frame) (prog1 (apply 'mail-other-frame args) *************** *** 1825,1829 **** rmail-current-message))) (save-excursion ! (goto-char (point-max)) (forward-line 1) (insert-buffer forward-buffer)))))) --- 1846,1853 ---- rmail-current-message))) (save-excursion ! ;; Insert after header separator--before signature if any. ! (goto-char (point-min)) ! (search-forward-regexp ! (concat "^" (regexp-quote mail-header-separator))) (forward-line 1) (insert-buffer forward-buffer)))))) *************** *** 1868,1871 **** --- 1892,1897 ---- ;;>> Insert resent-to: and bcc if need be. (let ((before (point))) + (if mail-self-blind + (insert "Resent-Bcc: " (user-login-name) "\n")) (insert "Resent-To: " (if (stringp address) address *************** *** 1896,1899 **** --- 1922,1926 ---- "^ *---+ +Original message +---+ *$\\|" "^ *--+ +begin message +--+ *$\\|" + "^ *---+ +Original message follows +---+ *$\\|" "^|? *---+ +Message text follows: +---+ *|?$")) *************** *** 1927,1931 **** ;; Turn off the usual actions for initializing the message body ;; because we want to get only the text from the failure message. ! (let (mail-signature mail-setup-hook) (if (rmail-start-mail nil to subj irp2 cc (current-buffer)) ;; Insert original text as initial text of new draft message. --- 1954,1959 ---- ;; Turn off the usual actions for initializing the message body ;; because we want to get only the text from the failure message. ! (let (mail-signature ! (mail-setup-hook rmail-retry-setup-hook)) (if (rmail-start-mail nil to subj irp2 cc (current-buffer)) ;; Insert original text as initial text of new draft message. diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/rmailout.el emacs-19.20/lisp/rmailout.el *** emacs-19.19/lisp/rmailout.el Sun Aug 15 01:23:23 1993 --- emacs-19.20/lisp/rmailout.el Wed Oct 13 20:10:52 1993 *************** *** 31,34 **** --- 31,35 ---- "*Alist matching regexps to suggested output Rmail files. This is a list of elements of the form (REGEXP . NAME-EXP). + The suggestion is taken if REGEXP matches anywhere in the message buffer. NAME-EXP may be a string constant giving the file name to use, or more generally it may be any kind of expression that returns *************** *** 155,158 **** --- 156,163 ---- When called from lisp code, N may be omitted. + If the pruned message header is shown on the current message, then + messages will be appended with pruned headers; otherwise, messages + will be appended with their original headers. + The optional third argument NOATTRIBUTE, if non-nil, says not to set the `filed' attribute, and not to display a message." *************** *** 176,183 **** (if (and (file-readable-p file-name) (rmail-file-p file-name)) (rmail-output-to-rmail-file file-name count) ! (while (> count 0) ! (let ((rmailbuf (current-buffer)) ! (tembuf (get-buffer-create " rmail-output")) ! (case-fold-search t)) (save-excursion (set-buffer tembuf) --- 181,207 ---- (if (and (file-readable-p file-name) (rmail-file-p file-name)) (rmail-output-to-rmail-file file-name count) ! (let ((orig-count count) ! (rmailbuf (current-buffer)) ! (case-fold-search t) ! (tembuf (get-buffer-create " rmail-output")) ! (original-headers-p ! (save-excursion ! (save-restriction ! (narrow-to-region (rmail-msgbeg rmail-current-message) (point-max)) ! (goto-char (point-min)) ! (forward-line 1) ! (= (following-char) ?0)))) ! header-beginning ! mail-from) ! (while (> count 0) ! (setq mail-from ! (save-excursion ! (save-restriction ! (widen) ! (goto-char (rmail-msgbeg rmail-current-message)) ! (setq header-beginning (point)) ! (search-forward "\n*** EOOH ***\n") ! (narrow-to-region header-beginning (point)) ! (mail-fetch-field "Mail-From")))) (save-excursion (set-buffer tembuf) *************** *** 186,195 **** (insert "\n") (goto-char (point-min)) ! (insert "From " ! (mail-strip-quoted-names (or (mail-fetch-field "from") ! (mail-fetch-field "really-from") ! (mail-fetch-field "sender") ! "unknown")) ! " " (current-time-string) "\n") ;; ``Quote'' "\nFrom " as "\n>From " ;; (note that this isn't really quoting, as there is no requirement --- 210,221 ---- (insert "\n") (goto-char (point-min)) ! (if mail-from ! (insert mail-from "\n") ! (insert "From " ! (mail-strip-quoted-names (or (mail-fetch-field "from") ! (mail-fetch-field "really-from") ! (mail-fetch-field "sender") ! "unknown")) ! " " (current-time-string) "\n")) ;; ``Quote'' "\nFrom " as "\n>From " ;; (note that this isn't really quoting, as there is no requirement *************** *** 200,212 **** (write-region (point-min) (point-max) file-name t (if noattribute 'nomsg))) ! (kill-buffer tembuf)) ! (or noattribute ! (if (equal major-mode 'rmail-mode) ! (rmail-set-attribute "filed" t))) ! (setq count (1- count)) ! (if rmail-delete-after-output ! (rmail-delete-forward) ! (if (> count 0) ! (rmail-next-undeleted-message 1)))))) ;;; rmailout.el ends here --- 226,250 ---- (write-region (point-min) (point-max) file-name t (if noattribute 'nomsg))) ! (or noattribute ! (if (equal major-mode 'rmail-mode) ! (rmail-set-attribute "filed" t))) ! (setq count (1- count)) ! (let ((next-message-p ! (if rmail-delete-after-output ! (rmail-delete-forward) ! (if (> count 0) ! (rmail-next-undeleted-message 1)))) ! (num-appended (- orig-count count))) ! (if (and next-message-p original-headers-p) ! (rmail-toggle-header)) ! (if (and (> count 0) (not next-message-p)) ! (progn ! (error ! (save-excursion ! (set-buffer rmailbuf) ! (format "Only %d message%s appended" num-appended ! (if (= num-appended 1) "" "s")))) ! (setq count 0))))) ! (kill-buffer tembuf)))) ;;; rmailout.el ends here Only in emacs-19.19/lisp: sc-elec.el diff -rc2P --exclude-from=/gd2/gnu/emacs/exceptions emacs-19.19/lisp/sc.el emacs-19.20/lisp/sc.el *** emacs-19.19/lisp/sc.el Sun Aug 15 01:23:32 1993 --- emacs-19.20/lisp/sc.el Wed Oct 13 02:22:27 1993 *************** *** 1,1565 **** ! ;; -*- Mode: Emacs-Lisp -*- ! ;; sc.el -- Version 2.3 (used to be supercite.el) ! ! ;; ========== Introduction ========== ! ;; Citation and attribution package for various GNU emacs news and ! ;; electronic mail reading subsystems. This version of supercite will ! ;; interface to VM 4.40+ and MH-E 3.7 (shipped w/ emacs 18.57) as is. ! ;; It will also interface with GNUS 3.12+, RMAIL 18.55+, GNEWS, and ! ;; probably most other news/mail subsystems by using the overloading ! ;; functions provided in sc-oloads.el (see that file or the README for ! ;; more information on interfacing supercite with your reader subsystem). ! ;; This version should now be compatible with Lucid Emacs 19.x emacses. ! ! ;; This package does not do any yanking of messages, but instead ! ;; massages raw reply buffers set up by the reply/forward functions in ! ;; the news/mail subsystems. Therefore, such useful operations as ! ;; yanking and citing portions of the original article (instead of the ! ;; whole article) are not within the ability or responsibility of ! ;; supercite. ! ! ;; ========== Disclaimer ========== ! ;; This software is distributed in the hope that it will be useful, ! ;; but WITHOUT ANY WARRANTY. No author or distributor, nor any ! ;; author's past, present, or future employers accepts responsibility ! ;; to anyone for the consequences of using it or for whether it serves ! ;; any particular purpose or works at all, unless he says so in ! ;; writing. ! ! ;; Some of this software was written as part of the supercite author's ! ;; official duty as an employee of the United States Government and is ! ;; thus not subject to copyright. You are free to use that particular ! ;; software as you wish, but WITHOUT ANY WARRANTY WHATSOEVER. It ! ;; would be nice, though if when you use any of this or other freely ! ;; available code, you give due credit to the author. ! ! ;; Other parts of this code were written by other people. Wherever ! ;; possible, credit to that author, and the copy* notice supplied by ! ;; the author are included with that code. The supercite author is no ! ;; longer an employee of the U.S. Government so the GNU Public Licence ! ;; should be considered in effect for all enhancements and bug fixes ! ;; performed by the author. ! ! ;; ========== Author (unless otherwise stated) ======================== ! ;; NAME: Barry A. Warsaw USMAIL: Century Computing, Inc. ! ;; TELE: (301) 593-3330 1014 West Street ! ;; INET: bwarsaw@cen.com Laurel, Md 20707 ! ;; UUCP: uunet!cen.com!bwarsaw ! ;; ! ;; Want to be on the Supercite mailing list? ! ;; ! ;; Send articles to: ! ;; Internet: supercite@anthem.nlm.nih.gov ! ;; UUCP: uunet!anthem.nlm.nih.gov!supercite ! ;; ! ;; Send administrivia (additions/deletions to list, etc) to: ! ;; Internet: supercite-request@anthem.nlm.nih.gov ! ;; UUCP: uunet!anthem.nlm.nih.gov!supercite-request ! ! ;; ========== Credits and Thanks ========== ! ;; This package was derived from the Superyank 1.11 package as posted ! ;; to the net. Superyank 1.11 was inspired by code and ideas from ! ;; Martin Neitzel and Ashwin Ram. Supercite version 2.3 has evolved ! ;; through the comments and suggestions of the supercite mailing list ! ;; which consists of many authors and users of the various mail and ! ;; news reading subsystems. ! ! ;; Many folks on the supercite mailing list have contributed their ! ;; help in debugging, making suggestions and supplying support code or ! ;; bug fixes for the previous versions of supercite. I want to thank ! ;; everyone who helped, especially (in no particular order): ! ;; ! ;; Mark D. Baushke, Khalid Sattar, David Lawrence, Chris Davis, Kyle ! ;; Jones, Kayvan Sylvan, Masanobu Umeda, Dan Jacobson, Piet van ! ;; Oostrum, Hamish (H.I.) Macdonald, and Joe Wells. ! ;; ! ;; I don't mean to leave anyone out. All who have helped have been ! ;; appreciated. ! ! ;; ========== Getting Started ========== ! ;; Here is a quick guide to getting started with supercite. The ! ;; information contained here is mostly excerpted from the more ! ;; detailed explanations given in the accompanying README file. ! ;; Naturally, there are many customizations you can do to give your ! ;; replies that personalized flair, but the instructions in this ! ;; section should be sufficient for getting started. ! ! ;; With this release of supercite overloading is the only supported ! ;; way to get supercite hooked into your favorite news/mail reading ! ;; subsystems. Overloading will be necessary for RMAIL, GNUS, GNEWS, ! ;; RNEWS and PCMAIL. Overloading will not be needed for VM 4.37+ or ! ;; MH-E 3.7+. MH-E comes with emacs 18.57 but if you have an earlier ! ;; version of emacs, you should be able to ftp MH-E 3.7 separately. Or ! ;; you can extract the MH-E overloading stuff from version 2.1's ! ;; sc-oloads.el. ! ! ;; First, to connect supercite to any mail/news reading subsystem, put ! ;; this in your .emacs file: ! ;; ! ;; (setq mail-yank-hooks 'sc-cite-original) ; for old mail agents ! ;; (setq mh-yank-hooks 'sc-cite-original) ; for MH-E only ! ;; (add-hook 'mail-citation-hook 'sc-cite-original) ; for newer mail agents ! ;; ! ;; If supercite is not pre-loaded into your emacs session, you should ! ;; add the following autoload: ! ;; ! ;; (autoload 'sc-cite-original "sc" "Supercite 2.3" t) ! ;; ! ;; Then, if you need to overload, put the following in your .emacs file: ! ;; ! ;; (defun my-sc-overload-hook () ! ;; (require 'sc-oloads) ; be sure this file is on your load-path ! ;; (sc-overload-functions)) ! ;; ! ;; (setq news-reply-mode-hook 'my-sc-overload-hook) ; for RNEWS,GNUS,GNEWS ! ;; (setq mail-setup-hook 'my-sc-overload-hook) ; for RMAIL, PCMAIL ! ;; ! ;; Finally, if you want to customize supercite, you should do it in a ! ;; function called my-supercite-hook and: ! ;; ! ;; (setq sc-load-hook 'my-supercite-hook) ! ! (require 'assoc) ! ! ! ;; vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv ! ;; start of user defined variables ! ;; vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv ! ! (defvar sc-nested-citation-p nil ! "*Controls whether to use nested or non-nested citation style. ! Non-nil uses nested citations, nil uses non-nested citations. Type ! \\[sc-describe] for more information.") ! ! (defvar sc-citation-leader " " ! "*String comprising first part of a citation.") ! ! (defvar sc-citation-delimiter ">" ! "*String comprising third part of a citation. ! This string is used in both nested and non-nested citations.") ! ! (defvar sc-citation-separator " " ! "*String comprising fourth and last part of a citation.") ! ! (defvar sc-default-author-name "Anonymous" ! "*String used when author's name cannot be determined.") ! ! (defvar sc-default-attribution "Anon" ! "*String used when author's attribution cannot be determined.") ! ! ;; Noriya KOBAYASHI (nk@ics.osaka-u.ac.jp) writes to the supercite ! ;; mailing list: ! ;; I use supercite in Nemacs-3.3.2. In order to handle citation using ! ;; Kanji, [...set sc-cite-regexp to...] ! ;; "\\s *\\([a-zA-Z0-9]\\|\\cc\\|\\cC\\|\\ch\\|\\cH\\|\\ck\\|\\cK\\)*\\s *>+" ! ;; ! (defvar sc-cite-regexp "\\s *[-a-zA-Z0-9_.]*>+\\s *" ! "*Regular expression describing how a already cited line begins. ! The regexp is only used at the beginning of a line, so it doesn't need ! to start with a '^'.") ! ! (defvar sc-titlecue-regexp "\\s +-+\\s +" ! "*Regular expression describing the separator between names and titles. ! Set to nil to treat entire field as a name.") ! ! (defvar sc-spacify-name-chars '(?_ ?* ?+ ?=) ! "*List of characters to convert to spaces if found in an author's name.") ! ! (defvar sc-nicknames-alist ! '(("Michael" "Mike") ! ("Daniel" "Dan") ! ("David" "Dave") ! ("Jonathan" "John") ! ("William" "Bill") ! ("Elizabeth" "Beth") ! ("Elizabeth" "Betsy") ! ("Kathleen" "Kathy") ! ("Smith" "Smitty")) ! "*Association list of names and their common nicknames. ! Entries are of the form (NAME NICKNAME), and NAMEs can have more than ! one nickname. Nicknames will not be automatically used as an ! attribution string, since I'm not sure this is really polite, but if a ! name is glommed from the author name and presented in the attribution ! string completion list, the matching nicknames will also be presented. ! Set this variable to nil to defeat nickname expansions. Also note that ! nicknames are not put in the supercite information alist.") ! ! (defvar sc-confirm-always-p t ! "*If non-nil, always confirm attribution string before citing text body.") ! ! (defvar sc-preferred-attribution 'firstname ! "*Specifies which part of the author's name becomes the attribution. ! The value of this variable must be one of the following quoted symbols: ! ! emailname -- email terminus name ! initials -- initials of author ! firstname -- first name of author ! lastname -- last name of author ! middlename1 -- first middle name of author ! middlename2 -- second middle name of author ! ... ! ! Middle name indexes can be any positive integer greater than 0, though ! it is unlikely that many authors will supply more than one middle ! name, if that many.") ! ! (defvar sc-use-only-preference-p nil ! "*Controls what happens when the preferred attribution cannot be found. ! If non-nil, then sc-default-attribution will be used. If nil, then ! some secondary scheme will be employed to find a suitable attribution ! string.") ! ! (defvar sc-downcase-p nil ! "*Non-nil means downcase the attribution and citation strings.") ! ! (defvar sc-rewrite-header-list ! '((sc-no-header) ! (sc-header-on-said) ! (sc-header-inarticle-writes) ! (sc-header-regarding-adds) ! (sc-header-attributed-writes) ! (sc-header-verbose) ! (sc-no-blank-line-or-header) ! ) ! "*List of reference header rewrite functions. ! The variable sc-preferred-header-style controls which function in this ! list is chosen for automatic reference header insertions. Electric ! reference mode will cycle through this list of functions. For more ! information, type \\[sc-describe].") ! ! (defvar sc-preferred-header-style 1 ! "*Index into sc-rewrite-header-list specifying preferred header style. ! Index zero accesses the first function in the list.") ! ! (defvar sc-electric-references-p t ! "*Use electric references if non-nil.") ! ! (defvar sc-electric-circular-p t ! "*Treat electric references as circular if non-nil.") ! ! (defvar sc-mail-fields-list ! '("date" "message-id" "subject" "newsgroups" "references" ! "from" "return-path" "path" "reply-to" "organization" ! "reply" ) ! "*List of mail header whose values will be saved by supercite. ! These values can be used in header rewrite functions by accessing them ! with the sc-field function. Mail headers in this list are case ! insensitive and do not require a trailing colon.") ! ! (defvar sc-mumble-string "" ! "*Value returned by sc-field if chosen field cannot be found.") ! ! (defvar sc-nuke-mail-headers-p t ! "*Nuke or don't nuke mail headers. ! If non-nil, nuke mail headers after gleaning useful information from ! them.") ! ! (defvar sc-reference-tag-string ">>>>> " ! "*String used at the beginning of built-in reference headers.") ! ! (defvar sc-fill-paragraph-hook 'sc-fill-paragraph ! "*Hook for filling a paragraph. ! This hook gets executed when you fill a paragraph either manually or ! automagically. It expects point to be within the extent of the ! paragraph that is going to be filled. This hook allows you to use a ! different paragraph filling package than the one supplied with ! supercite.") ! ! (defvar sc-auto-fill-region-p nil ! "*If non-nil, automatically fill each paragraph after it has been cited.") ! ! (defvar sc-auto-fill-query-each-paragraph-p nil ! "*If non-nil, query before filling each paragraph. ! No querying and no filling will be performed if sc-auto-fill-region-p ! is set to nil.") ! ! (defvar sc-fixup-whitespace-p nil ! "*If non-nil,