From: tomo Date: Tue, 8 Jun 1999 08:48:48 +0000 (+0000) Subject: Sync up with r21-2-15-tomo-1. X-Git-Tag: r21-2-18-utf-2000-0_3-1~6 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=0c81fd05d8666edbb745f49ac0e4bc65294a0e82;p=chise%2Fxemacs-chise.git Sync up with r21-2-15-tomo-1. --- diff --git a/Makefile.in b/Makefile.in deleted file mode 100644 index 2975600..0000000 --- a/Makefile.in +++ /dev/null @@ -1,632 +0,0 @@ -## DIST: This is the distribution Makefile for XEmacs. configure can -## DIST: make most of the changes to this file you might want, so try -## DIST: that first. - -## This file is part of XEmacs. - -## XEmacs is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by the -## Free Software Foundation; either version 2, or (at your option) any -## later version. - -## XEmacs is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -## for more details. - -## You should have received a copy of the GNU General Public License -## along with XEmacs; see the file COPYING. If not, write to -## the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -## Boston, MA 02111-1307, USA. - -## make all to compile and build XEmacs. -## make install to build and install it. -## make install-only to install after a previous complete build -## make TAGS to update tags tables. - -## make clean or make mostlyclean -## Delete all files from the current directory that are normally -## created by building the program. Don't delete the files that -## record the configuration. Also preserve files that could be made -## by building, but normally aren't because the distribution comes -## with them. - -## Delete `.dvi' files here if they are not part of the distribution. - -## make distclean -## Delete all files from the current directory that are created by -## configuring or building the program. If you have unpacked the -## source and built the program without creating any other files, -## `make distclean' should leave only the files that were in the -## distribution. - -## make realclean -## Delete everything from the current directory that can be -## reconstructed with this Makefile. This typically includes -## everything deleted by distclean, plus more: C source files -## produced by Bison, tags tables, info files, and so on. - -## make extraclean -## Still more severe - delete backup and autosave files, too. - -@SET_MAKE@ -RECURSIVE_MAKE=@RECURSIVE_MAKE@ -SHELL = /bin/sh -LANG = C -RM = rm -f -pwd = /bin/pwd - -## ==================== Things `configure' Might Edit ==================== - -CC=@CC@ -CPP=@CPP@ -LN_S=@LN_S@ -CFLAGS=@CFLAGS@ -CPPFLAGS=@CPPFLAGS@ -LDFLAGS=@LDFLAGS@ - -## These help us choose version- and architecture-specific directories -## to install files in. - -## This should be the number of the XEmacs version we're building, -## like `19.12' or `19.13'. -version=@version@ - -## This should be the name of the configuration we're building XEmacs -## for, like `mips-dec-ultrix' or `sparc-sun-sunos'. -configuration=@configuration@ - -## This will be the name of the generated binary and is set automatically -## by configure. -PROGNAME=@PROGNAME@ - -## ==================== Where To Install Things ==================== - -## The default location for installation. Everything is placed in -## subdirectories of this directory. The default values for many of -## the variables below are expressed in terms of this one, so you may -## not need to change them. This defaults to /usr/local. -prefix=@prefix@ - -## Like `prefix', but used for architecture-specific files. -exec_prefix=@exec_prefix@ - -## Where to install XEmacs and other binaries that people will want to -## run directly (like etags). -bindir=@bindir@ - -## Where to install architecture-independent data files. -## ${lispdir} and ${etcdir} are subdirectories of this. -datadir=@datadir@ - -## Where to find XEmacs packages. -pkgdir=@pkgdir@ - -## Where to install and expect the files that XEmacs modifies as it runs. -## These files are all architecture-independent. Right now, the -## only such data is the locking directory; -## ${lockdir} is a subdirectory of this. -statedir=@statedir@ - -## Where to install and expect executable files to be run by XEmacs -## rather than directly by users, and other architecture-dependent data -## ${archlibdir} is a subdirectory of this. -libdir=@libdir@ - -## Where to install XEmacs's man pages, and what extension they should have. -mandir=@mandir@ -manext=.1 - -## Where to install and expect the info files describing XEmacs. In the -## past, this defaulted to a subdirectory of ${prefix}/lib/xemacs, but -## since there are now many packages documented with the texinfo -## system, it is inappropriate to imply that it is part of XEmacs. -infodir=@infodir@ - -## Document me. -## See callproc.c for code which references this. -infopath=@infopath@ - -## Where to find the source code. The source code for XEmacs's C kernel is -## expected to be in ${srcdir}/src, and the source code for XEmacs's -## utility programs is expected to be in ${srcdir}/lib-src. This is -## set by the configure script's `--srcdir' option. -srcdir=@srcdir@ - -## Where the build is done. -blddir=@blddir@ - -## ==================== XEmacs-specific directories ==================== - -## These variables hold the values XEmacs will actually use. They are -## based on the values of the standard Make variables above. - -## Where to install the lisp files distributed with -## XEmacs. This includes the XEmacs version, so that the -## lisp files for different versions of XEmacs will install -## themselves in separate directories. -lispdir=@lispdir@ - -## Directory XEmacs should search for lisp files specific -## to this site (i.e. customizations), before consulting -## ${lispdir}. -sitelispdir=@sitelispdir@ - -## Where XEmacs will search for its lisp files while -## building. This is only used during the process of -## compiling XEmacs, to help XEmacs find its lisp files -## before they've been installed in their final location. -## It's usually identical to lispdir, except that the -## entry for the directory containing the installed lisp -## files has been replaced with ../lisp. This should be a -## colon-separated list of directories. -buildlispdir=${srcdir}/lisp - -## Where to install the other architecture-independent -## data files distributed with XEmacs (like the tutorial, -## the cookie recipes and the Zippy database). This path -## usually contains the XEmacs version number, so the data -## files for multiple versions of XEmacs may be installed -## at once. -etcdir=@etcdir@ - -## Where to create and expect the locking directory, where -## the XEmacs locking code keeps track of which files are -## currently being edited. -lockdir=@lockdir@ - -## Where to put executables to be run by XEmacs rather than -## the user. This path usually includes the XEmacs version -## and configuration name, so that multiple configurations -## for multiple versions of XEmacs may be installed at -## once. -archlibdir=@archlibdir@ - -## ==================== Utility Programs for the Build ==================== - -## Allow the user to specify the install program. -INSTALL = @install_pp@ @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ - -## ============================= Targets ============================== - -## Subdirectories to make recursively. `lisp' is not included -## because the compiled lisp files are part of the distribution -## and you cannot remake them without installing XEmacs first. -MAKE_SUBDIR = @MAKE_SUBDIR@ - -## Subdirectories that can be made recursively. -SUBDIR = ${MAKE_SUBDIR} man - -## The makefiles of the directories in ${MAKE_SUBDIR}. -SUBDIR_MAKEFILES = @SUBDIR_MAKEFILES@ - -## Subdirectories to `make install-arch-dep' recursively -INSTALL_ARCH_DEP_SUBDIR = @INSTALL_ARCH_DEP_SUBDIR@ - -## Subdirectories to install, and where they'll go. -## lib-src's makefile knows how to install it, so we don't do that here. -## When installing the info files, we need to do special things to -## avoid nuking an existing dir file, so we don't do that here; -## instead, we have written out explicit code in the `install' targets. -COPYDIR = ${srcdir}/etc ${srcdir}/lisp -COPYDESTS = ${etcdir} ${lispdir} -GENERATED_HEADERS = src/paths.h src/Emacs.ad.h src/puresize-adjust.h src/config.h lwlib/config.h src/sheap-adjust.h -GENERATED_LISP = lisp/finder-inf.el - -all: ${PROGNAME} all-elc info - -${PROGNAME}: ${GENERATED_HEADERS} ${MAKE_SUBDIR} ${GENERATED_LISP} - -## For performance and consistency, no built-in rules -.SUFFIXES: - -.NO_PARALLEL: ${GENERATED_HEADERS} ${MAKE_SUBDIR} dump-elcs -.PHONY: ${SUBDIR} all beta all-elc all-elcs dump-elc dump-elcs autoloads finder - -## Convenience target for XEmacs beta testers -beta: clean all-elc finder - -## Convenience target for XEmacs maintainers -## This would run `make-xemacsdist' if I were really confident that everything -## was turnkey. -dist: all-elc info - -## Convenience target for XEmacs maintainers -## Updates some rarely generated files: -## - configure from configure.in -## - config.values.in from configure -## - src/depend from src/*.[ch] -.PHONY: config configure depend -config: configure depend -configure: ${srcdir}/configure -${srcdir}/configure: ${srcdir}/configure.in - cd ${srcdir} && autoconf - cd ${srcdir} && /bin/sh lib-src/config.values.sh - -depend ${srcdir}/src/depend: - cd ${srcdir}/src && \ - perl ./make-src-depend > depend.tmp && \ - $(RM) depend && mv depend.tmp depend - -## Build XEmacs and recompile out-of-date and missing .elc files along -## the way. -all-elc all-elcs: lib-src lwlib dump-elcs src - MAKE='$(MAKE)' EMACS='./src/$(PROGNAME)' sh ${srcdir}/lib-src/update-elc.sh - -## Sub-target for all-elc. -dump-elc dump-elcs: ${GENERATED_HEADERS} FRC.dump-elcs - cd ./src && $(RECURSIVE_MAKE) dump-elcs - -autoloads: src - MAKE='$(MAKE)' EMACS='./src/$(PROGNAME)' sh ${srcdir}/lib-src/update-autoloads.sh - -custom-loads: - MAKE='$(MAKE)' EMACS='./src/$(PROGNAME)' sh ${srcdir}/lib-src/update-custom.sh - -finder: src - @echo "Building finder database ..." - @(cd ./lisp; \ - ${blddir}/src/${PROGNAME} -batch -vanilla \ - -eval '(setq finder-compile-keywords-quiet t)' \ - -l finder -f finder-compile-keywords ) - @echo "Building finder database ...(done)" - -lisp/finder-inf.el: - @echo "Building finder database ..." - @(cd ./lisp; \ - ${blddir}/src/${PROGNAME} -batch -vanilla \ - -eval '(setq finder-compile-keywords-quiet t)' \ - -l finder -f finder-compile-keywords ) - @echo "Building finder database ...(done)" - -## We have to force the building of Emacs.ad.h as well in order to get it -## updated correctly when VPATH is being used. Since we use move-if-change, -## it will only actually change if the user modified ${etcdir}/Emacs.ad. -src/Emacs.ad.h: ${srcdir}/etc/Emacs.ad - @echo "Producing \`src/Emacs.ad.h' from \`etc/Emacs.ad'." - @$(RM) src/Emacs.ad.h - @(echo "/* Do not edit this file!" ; \ - echo " Automatically generated from ${srcdir}/etc/Emacs.ad" ; \ - echo " */" ; \ - /bin/sh ${srcdir}/lib-src/ad2c ${srcdir}/etc/Emacs.ad ) > \ - src/Emacs.ad.h - -src/puresize-adjust.h: ${srcdir}/src/puresize.h - @echo "Resetting \`src/puresize-adjust.h'."; \ - (echo "/* Do not edit this file!" ; \ - echo " Automatically generated by XEmacs */" ; \ - echo "#define PURESIZE_ADJUSTMENT 0") > $@ - -src/sheap-adjust.h: - @echo "Resetting \`src/sheap-adjust.h'."; \ - (echo "/* Do not edit this file!" ; \ - echo " Automatically generated by XEmacs */" ; \ - echo "#define SHEAP_ADJUSTMENT 0") > $@ - -src: @SRC_SUBDIR_DEPS@ FRC.src -pkg-src/tree-x: pkg-src/FRC.tree-x -lib-src: FRC.lib-src -lwlib: FRC.lwlib -dynodump: FRC.dynodump -FRC.src FRC.lib-src FRC.lwlib FRC.dynodump pkg-src/FRC.tree-x: -FRC.lisp.finder-inf.el: - -${SUBDIR}: ${SUBDIR_MAKEFILES} ${GENERATED_HEADERS} FRC - cd ./$@ && $(RECURSIVE_MAKE) all - -Makefile: ${srcdir}/Makefile.in config.status - ./config.status - -src/Makefile: ${srcdir}/src/Makefile.in.in ${srcdir}/src/depend config.status - ./config.status - -lib-src/Makefile: ${srcdir}/lib-src/Makefile.in.in config.status - ./config.status - -lwlib/Makefile: ${srcdir}/lwlib/Makefile.in.in config.status - ./config.status - -pkg-src/tree-x/Makefile: ${srcdir}/pkg-src/tree-x/Makefile.in.in config.status - ./config.status - -src/config.h: ${srcdir}/src/config.h.in - ./config.status && touch $@ - -src/paths.h: ${srcdir}/src/paths.h.in - ./config.status && touch $@ - -lwlib/config.h: ${srcdir}/lwlib/config.h.in - ./config.status && touch $@ - -## ==================== Installation ==================== - -## If we let lib-src do its own installation, that means we -## don't have to duplicate the list of utilities to install in -## this Makefile as well. - -## On AIX, use tar xBf. -## On Xenix, use tar xpf. - -.PHONY: install-only install install-arch-dep install-arch-indep gzip.el mkdir -.PHONY: check-features - -## We delete each directory in ${COPYDESTS} before we copy into it; -## that way, we can reinstall over directories that have been put in -## place with their files read-only (perhaps because they are checked -## into RCS). In order to make this safe, we make sure that the -## source exists and is distinct from the destination. - -## FSF doesn't depend on `all', but rather on ${MAKE_SUBDIR}, so that -## they "won't ever modify src/paths.h". But that means you can't do -## 'make install' right off the bat because src/paths.h won't exist. -## And, in XEmacs case, src/Emacs.ad.h won't exist either. I also -## don't see the point in avoiding modifying paths.h. It creates an -## inconsistency in the build process. So we go ahead and depend on -## all. --cet - -check-features: all - ${blddir}/src/${PROGNAME} -batch -l check-features.el - -install-only: ${MAKE_SUBDIR} check-features install-arch-dep install-arch-indep - -install: all check-features install-arch-dep install-arch-indep - -install-arch-dep: mkdir - for subdir in ${INSTALL_ARCH_DEP_SUBDIR}; do \ - (cd ./$${subdir} && $(RECURSIVE_MAKE) install prefix=${prefix} \ - exec_prefix=${exec_prefix} bindir=${bindir} libdir=${libdir} \ - archlibdir=${archlibdir}) ; done - if test "`(cd ${archlibdir} && $(pwd))`" != \ - "`(cd ./lib-src && $(pwd))`"; then \ - if test -f ../Installation; then \ - ${INSTALL_DATA} ../Installation ${archlibdir}/Installation; \ - fi; \ - for f in DOC config.values; do \ - ${INSTALL_DATA} lib-src/$${f} ${archlibdir}/$${f}; \ - done ; \ - for subdir in `find ${archlibdir} -type d ! -name RCS ! -name SCCS ! -name CVS -print` ; \ - do (cd $${subdir} && $(RM) -r RCS CVS SCCS \#* *~) ; done ; \ - else true; fi - ${INSTALL_PROGRAM} src/${PROGNAME} ${bindir}/${PROGNAME}-${version} - -chmod 0755 ${bindir}/${PROGNAME}-${version} - cd ${bindir} && $(RM) ./${PROGNAME} && ${LN_S} ${PROGNAME}-${version} ./${PROGNAME} - if test "${prefix}" != "${exec_prefix}"; then \ - for dir in \ - lib/${PROGNAME} \ - lib/${PROGNAME}-${version}/etc \ - lib/${PROGNAME}-${version}/info \ - lib/${PROGNAME}-${version}/lisp; do \ - if test ! -d ${exec_prefix}/$${dir}; then \ - $(LN_S) ${prefix}/$${dir} ${exec_prefix}/$${dir}; fi; \ - done; \ - fi - -install-arch-indep: mkdir info - -@set ${COPYDESTS} ; \ - for dir in ${COPYDIR} ; do \ - if test "`(cd $$1 && $(pwd))`" != \ - "`(cd $${dir} && $(pwd))`"; then \ - : do nothing - echo "rm -rf $$1" ; \ - fi ; \ - shift ; \ - done - -set ${COPYDESTS} ; \ - for dir in ${COPYDESTS} ; do \ - if test ! -d $${dir} ; then mkdir $${dir} ; fi ; \ - done ; \ - for dir in ${COPYDIR} ; do \ - dest=$$1 ; shift ; \ - test -d $${dir} \ - -a "`(cd $${dir} && $(pwd))`" != \ - "`(cd $${dest} && $(pwd))`" \ - && (echo "Copying $${dir}..." ; \ - (cd $${dir} && tar -cf - . ) | \ - (cd $${dest} && umask 022 && tar -xf - );\ - chmod 0755 $${dest}; \ - for subdir in `find $${dest} -type d ! -name RCS ! -name SCCS ! -name CVS -print` ; do \ - (cd $${subdir} && $(RM) -r RCS CVS SCCS \#* *~) ; \ - done) ; \ - done - if test "`(cd ${srcdir}/info && $(pwd))`" != \ - "`(cd ${infodir} && $(pwd))`" && cd ${srcdir}/info; then \ - if test ! -f ${infodir}/dir -a -f dir ; then \ - ${INSTALL_DATA} ${srcdir}/info/dir ${infodir}/dir ; \ - fi ; \ - for file in *.info* ; do \ - ${INSTALL_DATA} $${file} ${infodir}/$${file} ; \ - chmod 0644 ${infodir}/$${file}; \ - done ; \ - fi - ## Note it's `xemacs' not ${PROGNAME} - cd ${srcdir}/etc && \ - for page in xemacs etags ctags gnuserv gnuclient gnuattach gnudoit; do \ - ${INSTALL_DATA} ${srcdir}/etc/$${page}.1 ${mandir}/$${page}${manext} ; \ - chmod 0644 ${mandir}/$${page}${manext} ; \ - done - @echo "If you would like to save approximately 2M of disk space, do" - @echo "make gzip-el" - @echo "or you may run " - @echo ${srcdir}/lib-src/gzip-el.sh lispdir " from the command line." - @echo "Where lispdir is where the lisp files were installed, i.e.," - @echo "${lispdir}" - -gzip-el: - ${srcdir}/lib-src/gzip-el.sh ${lispdir} - -MAKEPATH=./lib-src/make-path -## Build all the directories to install XEmacs in. -## Since we may be creating several layers of directories, -## (e.g. /usr/local/lib/${PROGNAME}-20.5/sparc-sun-solaris2.6), we use -## make-path instead of mkdir. Not all mkdirs have the `-p' flag. -mkdir: FRC.mkdir - ${MAKEPATH} ${COPYDESTS} ${lockdir} ${infodir} ${archlibdir} \ - ${mandir} ${bindir} ${datadir} ${libdir} ${pkgdir} - -chmod 0777 ${lockdir} - -## Delete all the installed files that the `install' target would -## create (but not the noninstalled files such as `make all' would -## create). - -#### Don't delete the lisp and etc directories if they're in the source tree. -#### This target has not been updated in sometime and until it is it -#### would be extremely dangerous for anyone to use it. -#uninstall: -# (cd ./lib-src; \ -# $(RECURSIVE_MAKE) uninstall \ -# prefix=${prefix} exec_prefix=${exec_prefix} \ -# bindir=${bindir} libdir=${libdir} archlibdir=${archlibdir}) -# for dir in ${lispdir} ${etcdir} ; do \ -# case `(cd $${dir} ; $(pwd))` in \ -# `(cd ${srcdir} ; $(pwd))`* ) ;; \ -# * ) $(RM) $${dir} ;; \ -# esac ; \ -# case $${dir} in \ -# ${datadir}/${PROGNAME}/${version}/* ) \ -# $(RM) -r ${datadir}/${PROGNAME}/${version} \ -# ;; \ -# esac ; \ -# done -# cd ${infodir} && $(RM) cl* ${PROGNAME}* forms* info* vip* -# cd ${mandir} && $(RM) xemacs.1 etags.1 ctags.1 gnuserv.1 -# cd ${bindir} && $(RM) ${PROGNAME}-${version} ${PROGNAME} - - -## Some makes seem to remember that they've built something called FRC, -## so you can only use a given FRC once per makefile. -FRC FRC.src.paths.h FRC.mkdir FRC.dump-elcs FRC.info: -FRC.mostlyclean FRC.clean FRC.distclean FRC.realclean FRC.tags: - -## ==================== Cleaning up and miscellanea ==================== - -.PHONY: mostlyclean clean distclean realclean extraclean - -## `mostlyclean' -## Like `clean', but may refrain from deleting a few files that people -## normally don't want to recompile. For example, the `mostlyclean' -## target for GCC does not delete `libgcc.a', because recompiling it -## is rarely necessary and takes a lot of time. -mostlyclean: FRC.mostlyclean - for d in $(SUBDIR); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done - -## `clean' -## Delete all files from the current directory that are normally -## created by building the program. Don't delete the files that -## record the configuration. Also preserve files that could be made -## by building, but normally aren't because the distribution comes -## with them. - -## Delete `.dvi' files here if they are not part of the distribution. -clean: FRC.clean - for d in $(SUBDIR); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done - $(RM) core - -## `distclean' -## Delete all files from the current directory that are created by -## configuring or building the program. If you have unpacked the -## source and built the program without creating any other files, -## `make distclean' should leave only the files that were in the -## distribution. -top_distclean=\ - $(RM) config.status config.log config-tmp-* build-install Installation ; \ - for d in src lib-src lwlib dynodump ; do \ - $(RM) $$d/Makefile $$d/Makefile.in ; \ - done ; \ - $(RM) core .sbinit Makefile lock/*; \ - $(RM) lisp/finder-inf.el* Installation.el Installation.elc; \ - $(RM) packages mule-packages site-lisp - -distclean: FRC.distclean - for d in $(SUBDIR); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done - -${top_distclean} - -## `realclean' -## Delete everything from the current directory that can be -## reconstructed with this Makefile. This typically includes -## everything deleted by distclean, plus more: C source files -## produced by Bison, tags tables, info files, and so on. - -## One exception, however: `make realclean' should not delete -## `configure' even if `configure' can be remade using a rule in the -## Makefile. More generally, `make realclean' should not delete -## anything that needs to exist in order to run `configure' and then -## begin to build the program. -realclean: FRC.realclean - for d in $(SUBDIR); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done - -${top_distclean} - $(RM) TAGS - -## This doesn't actually appear in the coding standards, but Karl -## says GCC supports it, and that's where the configuration part of -## the coding standards seem to come from. It's like distclean, but -## it deletes backup and autosave files too. -extraclean: - for d in $(SUBDIR); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done - $(RM) *~ \#* - -${top_distclean} - -## Unlocking and relocking. The idea of these productions is to reduce -## hassles when installing an incremental tar of XEmacs. Do `make unlock' -## before unlocking the file to take the write locks off all sources so -## that tar xvof will overwrite them without fuss. Then do `make relock' -## afterward so that VC mode will know which files should be checked in -## if you want to mung them. - -## Note: it's no disaster if these productions miss a file or two; tar -## and VC will swiftly let you know if this happens, and it is easily -## corrected. -SOURCES = ChangeLog GETTING.GNU.SOFTWARE INSTALL Makefile.in PROBLEMS \ - README build-install.in configure make-dist move-if-change - -.PHONY: unlock relock TAGS tags check dist info dvi mcs - -unlock: - chmod u+w $(SOURCES) cpp/* - -cd ./elisp && chmod u+w Makefile README *.texi - for d in src etc lib-src lisp; do (cd ./$$d && $(RECURSIVE_MAKE) $@); done - cd ./lisp/term && chmod u+w README *.el - cd ./man && chmod u+w *texi* ChangeLog split-man - cd ./lwlib && chmod u+w *.[ch] Makefile.in.in - -relock: - chmod u-w $(SOURCES) cpp/* - -cd ./elisp && chmod u-w Makefile README *.texi - for d in src etc lib-src lisp; do (cd ./$$d && $(RECURSIVE_MAKE) $@); done - cd ./lisp/term && chmod u+w README *.el - cd ./man && chmod u+w *texi* ChangeLog split-man - cd ./lwlib && chmod u+w *.[ch] Makefile.in.in - -PRUNE_VC = -name SCCS -prune -o -name RCS -prune -o -name CVS -prune -o -tagslisp = lisp -TAGS tags: FRC.tags - @echo "If you don't have a copy of etags around, then do 'make lib-src' first." - $(RM) ${srcdir}/TAGS - @PATH=`$(pwd)`/lib-src:$$PATH HOME=/-=-; export PATH HOME; \ - echo "Using etags from `which etags`." - PATH=`$(pwd)`/lib-src:$$PATH ; export PATH; cd ${srcdir} && \ - find src lwlib lib-src ${PRUNE_VC} -name '*.[ch]' -print | \ - xargs etags -a -r '/[ ]*DEF\(VAR\|INE\)_[A-Z_]+[ ]*([ ]*"\([^"]+\)"/\2/'; \ - find ${tagslisp} ${PRUNE_VC} -name '*.el' -print | \ - xargs etags -a -l none -r "/^(def\\(var\\|un\\|alias\\|const\\|macro\\)[ ]+'?\\([^ ]+\\)/\\2/" - -## We have automated tests! -testdir = ${srcdir}/tests -tests = ${testdir}/basic-lisp.el ${testdir}/database.el - -check: - src/${PROGNAME} -batch -l ${testdir}/test-emacs.el -f batch-test-emacs ${tests} - -info: FRC.info - cd ${srcdir}/man && $(RECURSIVE_MAKE) $@ - -dvi: - cd ${srcdir}/man && $(RECURSIVE_MAKE) $@ - -## Fix up version information in executables (Solaris-only) -mcs: - date=`LANG=C LC_ALL=C date -u '+%e %b %Y'`; \ - ident="@(#)RELEASE VERSION XEmacs ${version} $${date}"; \ - for f in `file lib-src/* src/${PROGNAME} | grep ELF | sed -e 's/:.*//'`; do \ - mcs -da "$${ident} `echo $${f} | sed 's/.*\///'`" $${f}; \ - done diff --git a/lib-src/install-sid b/lib-src/install-sid deleted file mode 100755 index 60083f5..0000000 --- a/lib-src/install-sid +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/sh -# Drop in the SUBMITTER id into a site's installed send-pr script. -# Copyright (C) 1993 Free Software Foundation, Inc. -# Contributed by Brendan Kehoe (brendan@cygnus.com), based on a -# version written by Heinz G. Seidl (hgs@ide.com). -# -# This file is part of GNU GNATS. -# -# GNU GNATS is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# GNU GNATS is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU GNATS; see the file COPYING. If not, write to -# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -COMMAND=`echo $0 | sed -e 's,.*/,,g'` -USAGE="Usage: $COMMAND [--install-dir=prefix] [--help] [--version] submitter-id" - -VERSION=3.101 - -BINDIR=/usr/bin - -SUBMITTER= -TEMP=/tmp/sp$$ - -if [ $# -eq 0 ]; then - echo "$USAGE" - exit 1 -fi - -while [ $# -gt 0 ]; do - case "$1" in - -install-dir=*|--install-dir=*|--install-di=*|--install-d=*|--install-=*|--install=*|--instal=*|--insta=*|--inst=*|--ins=*|--in=*|--i=*) - I=`echo "$1" | sed 's/-*i[a-z\-]*=//'` - BINDIR=$I/bin ;; - --version) echo $COMMAND version $VERSION ; exit 1 ;; - -*) echo "$USAGE" ; exit 1 ;; - *) SUBMITTER=$1 ;; - esac - shift -done - -path=`echo $0 | sed -e "s;${COMMAND};;"` - -[ -z "$path" ] && path=. - -examinebindir=yes - -if [ "$examinebindir" = yes ] && [ -f $BINDIR/send-pr ]; then - SPPATHLIST=$BINDIR/send-pr -else - if [ -f $path/send-pr ]; then - SPPATHLIST=$path/send-pr - else - echo "$COMMAND: cannot find \`$BINDIR/send-pr' or \`$path/send-pr'" >&2 - exit 1 - fi -fi - -trap 'rm -f $TEMP ; exit 0' 0 -trap 'echo "$COM: Aborting ..."; rm -f $TEMP ; exit 1' 1 2 3 13 15 - -for SPPATH in $SPPATHLIST; do - sed -e "s/^SUBMITTER=.*/SUBMITTER=${SUBMITTER}/" $SPPATH > $TEMP - - if grep $SUBMITTER $TEMP > /dev/null; then - cp $SPPATH $SPPATH.orig && - rm -f $SPPATH && - cp $TEMP $SPPATH && - chmod a+rx $SPPATH && - rm -f $TEMP $SPPATH.orig || - { echo "$COMMAND: unable to replace send-pr" >&2 ; exit 1; } - else - echo "$COMMAND: something went wrong when sed-ing the submitter into send-pr" >&2 - exit 1 - fi -done - -echo "$COMMAND: \`$SUBMITTER' is now the default submitter ID for send-pr" - -exit 0 diff --git a/lib-src/send-pr b/lib-src/send-pr deleted file mode 100755 index 3c97e40..0000000 --- a/lib-src/send-pr +++ /dev/null @@ -1,530 +0,0 @@ -#!/bin/sh -# Submit a problem report to a GNATS site. -# Copyright (C) 1993 Free Software Foundation, Inc. -# Contributed by Brendan Kehoe (brendan@cygnus.com), based on a -# version written by Heinz G. Seidl (hgs@cygnus.com). -# -# This file is part of GNU GNATS. -# -# GNU GNATS is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# GNU GNATS is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU GNATS; see the file COPYING. If not, write to -# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -# The version of this send-pr. -VERSION=3.101 - -# The submitter-id for your site. -SUBMITTER=net - -# Where the GNATS directory lives, if at all. -[ -z "$GNATS_ROOT" ] && -GNATS_ROOT=/usr/lib/gnats/gnats-db - -# The default mail address for PR submissions. -GNATS_ADDR=bugs@xemacs.org - -# Where the gnats category tree lives. -[ -z "$DATADIR" ] && -DATADIR=/usr/share - -# If we've been moved around, try using GCC_EXEC_PREFIX. -[ ! -d $DATADIR/gnats -a -d "$GCC_EXEC_PREFIX" ] && - DATADIR=${GCC_EXEC_PREFIX}../../../lib - - -# The default release for this host. -DEFAULT_RELEASE="gnats-3.101" - -# The default organization. -DEFAULT_ORGANIZATION="XEmacs Users" - -# The default site to look for. -GNATS_SITE=xemacs.org - -# Newer config information? -[ -f ${GNATS_ROOT}/gnats-adm/config ] && . ${GNATS_ROOT}/gnats-adm/config - -# What mailer to use. This must come after the config file, since it is -# host-dependent. -MAIL_AGENT="/usr/lib/sendmail -oi -t" - -# How to read the passwd database. -PASSWD="cat /etc/passwd" - -ECHON=bsd - -if [ $ECHON = bsd ] ; then - ECHON1="echo -n" - ECHON2= -elif [ $ECHON = sysv ] ; then - ECHON1=echo - ECHON2='\c' -else - ECHON1=echo - ECHON2= -fi - -# - -if [ -z "$TMPDIR" ]; then - TMPDIR=/tmp -else - if [ "`echo $TMPDIR | grep '/$'`" != "" ]; then - TMPDIR="`echo $TMPDIR | sed -e 's,/$,,'`" - fi -fi - -TEMP=$TMPDIR/p$$ -BAD=$TMPDIR/pbad$$ -REF=$TMPDIR/pf$$ - -# find a user name -if [ "$LOGNAME" = "" ]; then - if [ "$USER" != "" ]; then - LOGNAME="$USER" - else - LOGNAME="UNKNOWN" - fi -fi - -FROM="$LOGNAME" -if [ -z "$REPLYTO" ]; then - REPLYTO="$LOGNAME" -fi - -# Find out the name of the originator of this PR. -if [ -n "$NAME" ]; then - ORIGINATOR="$NAME" -elif [ -f $HOME/.fullname ]; then - ORIGINATOR="`sed -e '1q' $HOME/.fullname`" -else - # Must use temp file due to incompatibilities in quoting behavior - # and to protect shell metacharacters in the expansion of $LOGNAME - $PASSWD | grep "^$LOGNAME:" | awk -F: '{print $5}' | sed -e 's/,.*//' > $TEMP - ORIGINATOR="`cat $TEMP`" - rm -f $TEMP -fi - -if [ -n "$ORGANIZATION" ]; then - if [ -f "$ORGANIZATION" ]; then - ORGANIZATION="`cat $ORGANIZATION`" - fi -else - if [ -n "$DEFAULT_ORGANIZATION" ]; then - ORGANIZATION="$DEFAULT_ORGANIZATION" - elif [ -f $HOME/.organization ]; then - ORGANIZATION="`cat $HOME/.organization`" - elif [ -f $HOME/.signature ]; then - ORGANIZATION="`cat $HOME/.signature`" - fi -fi - -# If they don't have a preferred editor set, then use -if [ -z "$VISUAL" ]; then - if [ -z "$EDITOR" ]; then - EDIT=vi - else - EDIT="$EDITOR" - fi -else - EDIT="$VISUAL" -fi - -# Find out some information. -SYSTEM=`( [ -f /bin/uname ] && /bin/uname -a ) || \ - ( [ -f /usr/bin/uname ] && /usr/bin/uname -a ) || echo ""` -ARCH=`[ -f /bin/arch ] && /bin/arch` -MACHINE=`[ -f /bin/machine ] && /bin/machine` - -COMMAND=`echo $0 | sed -e 's,.*/,,'` -USAGE="Usage: $COMMAND [-PVL] [-t address] [-f filename] [-s severity] - [-c address] [--request-id] [--version]" -REMOVE= -BATCH= -CC= -SEVERITY_C= - -while [ $# -gt 0 ]; do - case "$1" in - -r) ;; # Ignore for backward compat. - -t | --to) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi - shift ; GNATS_ADDR="$1" - EXPLICIT_GNATS_ADDR=true - ;; - -f | --file) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi - shift ; IN_FILE="$1" - if [ "$IN_FILE" != "-" -a ! -r "$IN_FILE" ]; then - echo "$COMMAND: cannot read $IN_FILE" - exit 1 - fi - ;; - -b | --batch) BATCH=true ;; - -c | --cc) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi - shift ; CC="$1" - ;; - -s | --severity) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi - shift ; SEVERITY_C="$1" - ;; - -p | -P | --print) PRINT=true ;; - -L | --list) FORMAT=norm ;; - -l | -CL | --lisp) FORMAT=lisp ;; - --request-id) REQUEST_ID=true ;; - -h | --help) echo "$USAGE"; exit 0 ;; - -V | --version) echo "$VERSION"; exit 0 ;; - -*) echo "$USAGE" ; exit 1 ;; - *) if [ -z "$USER_GNATS_SITE" ]; then - if [ ! -r "$DATADIR/gnats/$1" ]; then - echo "$COMMAND: the GNATS site $1 does not have a categories list." - exit 1 - else - # The site name is the alias they'll have to have created. - USER_GNATS_SITE=$1 - fi - else - echo "$USAGE" ; exit 1 - fi - ;; - esac - shift -done - -if [ -n "$USER_GNATS_SITE" ] && [ "$USER_GNATS_SITE" != "$GNATS_SITE" ]; then - GNATS_SITE=$USER_GNATS_SITE - GNATS_ADDR=$USER_GNATS_SITE-gnats -fi - -if [ "$SUBMITTER" = "unknown" -a -z "$REQUEST_ID" -a -z "$IN_FILE" ]; then - cat << '__EOF__' -It seems that send-pr is not installed with your unique submitter-id. -You need to run - - install-sid YOUR-SID - -where YOUR-SID is the identification code you received with `send-pr'. -`send-pr' will automatically insert this value into the template field -`>Submitter-Id'. If you've downloaded `send-pr' from the Net, use `net' -for this value. If you do not know your id, run `send-pr --request-id' to -get one from your support site. -__EOF__ - exit 1 -fi - -if [ -r "$DATADIR/gnats/$GNATS_SITE" ]; then - CATEGORIES=`grep -v '^#' $DATADIR/gnats/$GNATS_SITE | sort` -else - echo "$COMMAND: could not read $DATADIR/gnats/$GNATS_SITE for categories list." - exit 1 -fi - -if [ -z "$CATEGORIES" ]; then - echo "$COMMAND: the categories list for $GNATS_SITE was empty!" - exit 1 -fi - -case "$FORMAT" in - lisp) echo "$CATEGORIES" | \ - awk 'BEGIN {printf "( "} {printf "(\"%s\") ",$0} END {printf ")\n"}' - exit 0 - ;; - norm) l=`echo "$CATEGORIES" | \ - awk 'BEGIN {max = 0; } { if (length($0) > max) { max = length($0); } } - END {print max + 1;}'` - c=`expr 70 / $l` - if [ $c -eq 0 ]; then c=1; fi - echo "$CATEGORIES" | \ - awk 'BEGIN {print "Known categories:"; i = 0 } - { printf ("%-'$l'.'$l's", $0); if ((++i % '$c') == 0) { print "" } } - END { print ""; }' - exit 0 - ;; -esac - -ORIGINATOR_C='' -ORGANIZATION_C='' -CONFIDENTIAL_C='<[ yes | no ] (one line)>' -SYNOPSIS_C='' -if [ -z "$SEVERITY_C" ]; then - SEVERITY_C='<[ non-critical | serious | critical ] (one line)>' -fi -PRIORITY_C='<[ low | medium | high ] (one line)>' -CATEGORY_C='' -CLASS_C='<[ sw-bug | doc-bug | change-request | support ] (one line)>' -RELEASE_C='' -ENVIRONMENT_C='' -DESCRIPTION_C='' -HOW_TO_REPEAT_C='' -FIX_C='' - -# Catch some signals. ($xs kludge needed by Sun /bin/sh) -xs=0 -trap 'rm -f $REF $TEMP; exit $xs' 0 -trap 'echo "$COMMAND: Aborting ..."; rm -f $REF $TEMP; xs=1; exit' 1 2 3 13 15 - -# If they told us to use a specific file, then do so. -if [ -n "$IN_FILE" ]; then - if [ "$IN_FILE" = "-" ]; then - # The PR is coming from the standard input. - if [ -n "$EXPLICIT_GNATS_ADDR" ]; then - sed -e "s;^[Tt][Oo]:.*;To: $GNATS_ADDR;" > $TEMP - else - cat > $TEMP - fi - else - # Use the file they named. - if [ -n "$EXPLICIT_GNATS_ADDR" ]; then - sed -e "s;^[Tt][Oo]:.*;To: $GNATS_ADDR;" $IN_FILE > $TEMP - else - cat $IN_FILE > $TEMP - fi - fi -else - - if [ -n "$PR_FORM" -a -z "$PRINT_INTERN" ]; then - # If their PR_FORM points to a bogus entry, then bail. - if [ ! -f "$PR_FORM" -o ! -r "$PR_FORM" -o ! -s "$PR_FORM" ]; then - echo "$COMMAND: can't seem to read your template file (\`$PR_FORM'), ignoring PR_FORM" - sleep 1 - PRINT_INTERN=bad_prform - fi - fi - - if [ -n "$PR_FORM" -a -z "$PRINT_INTERN" ]; then - cp $PR_FORM $TEMP || - ( echo "$COMMAND: could not copy $PR_FORM" ; xs=1; exit ) - else - for file in $TEMP $REF ; do - cat > $file << '__EOF__' -SEND-PR: -*- send-pr -*- -SEND-PR: Lines starting with `SEND-PR' will be removed automatically, as -SEND-PR: will all comments (text enclosed in `<' and `>'). -SEND-PR: -SEND-PR: Please consult the send-pr man page `send-pr(1)' or the Texinfo -SEND-PR: manual if you are not sure how to fill out a problem report. -SEND-PR: -SEND-PR: Choose from the following categories: -SEND-PR: -__EOF__ - - # Format the categories so they fit onto lines. - l=`echo "$CATEGORIES" | \ - awk 'BEGIN {max = 0; } { if (length($0) > max) { max = length($0); } } - END {print max + 1;}'` - c=`expr 61 / $l` - if [ $c -eq 0 ]; then c=1; fi - echo "$CATEGORIES" | \ - awk 'BEGIN {printf "SEND-PR: "; i = 0 } - { printf ("%-'$l'.'$l's", $0); - if ((++i % '$c') == 0) { printf "\nSEND-PR: " } } - END { printf "\nSEND-PR:\n"; }' >> $file - - cat >> $file << __EOF__ -To: $GNATS_ADDR -Subject: -From: $FROM -Reply-To: $REPLYTO -Cc: $CC -X-send-pr-version: $VERSION - - ->Submitter-Id: $SUBMITTER ->Originator: $ORIGINATOR ->Organization: -${ORGANIZATION- $ORGANIZATION_C} ->Confidential: $CONFIDENTIAL_C ->Synopsis: $SYNOPSIS_C ->Severity: $SEVERITY_C ->Priority: $PRIORITY_C ->Category: $CATEGORY_C ->Class: $CLASS_C ->Release: ${DEFAULT_RELEASE-$RELEASE_C} ->Environment: - $ENVIRONMENT_C -`[ -n "$SYSTEM" ] && echo System: $SYSTEM` -`[ -n "$ARCH" ] && echo Architecture: $ARCH` -`[ -n "$MACHINE" ] && echo Machine: $MACHINE` ->Description: - $DESCRIPTION_C ->How-To-Repeat: - $HOW_TO_REPEAT_C ->Fix: - $FIX_C -__EOF__ - done - fi - - if [ "$PRINT" = true -o "$PRINT_INTERN" = true ]; then - cat $TEMP - xs=0; exit - fi - - chmod u+w $TEMP - if [ -z "$REQUEST_ID" ]; then - eval $EDIT $TEMP - else - ed -s $TEMP << '__EOF__' -/^Subject/s/^Subject:.*/Subject: request for a customer id/ -/^>Category/s/^>Category:.*/>Category: send-pr/ -w -q -__EOF__ - fi - - if cmp -s $REF $TEMP ; then - echo "$COMMAND: problem report not filled out, therefore not sent" - xs=1; exit - fi -fi - -# -# Check the enumeration fields - -# This is a "sed-subroutine" with one keyword parameter -# (with workaround for Sun sed bug) -# -SED_CMD=' -/$PATTERN/{ -s||| -s|<.*>|| -s|^[ ]*|| -s|[ ]*$|| -p -q -}' - - -while [ -z "$REQUEST_ID" ]; do - CNT=0 - - # 1) Confidential - # - PATTERN=">Confidential:" - CONFIDENTIAL=`eval sed -n -e "\"$SED_CMD\"" $TEMP` - case "$CONFIDENTIAL" in - ""|yes|no) CNT=`expr $CNT + 1` ;; - *) echo "$COMMAND: \`$CONFIDENTIAL' is not a valid value for \`Confidential'." ;; - esac - # - # 2) Severity - # - PATTERN=">Severity:" - SEVERITY=`eval sed -n -e "\"$SED_CMD\"" $TEMP` - case "$SEVERITY" in - ""|non-critical|serious|critical) CNT=`expr $CNT + 1` ;; - *) echo "$COMMAND: \`$SEVERITY' is not a valid value for \`Severity'." - esac - # - # 3) Priority - # - PATTERN=">Priority:" - PRIORITY=`eval sed -n -e "\"$SED_CMD\"" $TEMP` - case "$PRIORITY" in - ""|low|medium|high) CNT=`expr $CNT + 1` ;; - *) echo "$COMMAND: \`$PRIORITY' is not a valid value for \`Priority'." - esac - # - # 4) Category - # - PATTERN=">Category:" - CATEGORY=`eval sed -n -e "\"$SED_CMD\"" $TEMP` - FOUND= - for C in $CATEGORIES - do - if [ "$C" = "$CATEGORY" ]; then FOUND=true ; break ; fi - done - if [ -n "$FOUND" ]; then - CNT=`expr $CNT + 1` - else - if [ -z "$CATEGORY" ]; then - echo "$COMMAND: you must include a Category: field in your report." - else - echo "$COMMAND: \`$CATEGORY' is not a known category." - fi - fi - # - # 5) Class - # - PATTERN=">Class:" - CLASS=`eval sed -n -e "\"$SED_CMD\"" $TEMP` - case "$CLASS" in - ""|sw-bug|doc-bug|change-request|support) CNT=`expr $CNT + 1` ;; - *) echo "$COMMAND: \`$CLASS' is not a valid value for \`Class'." - esac - - [ $CNT -lt 5 -a -z "$BATCH" ] && - echo "Errors were found with the problem report." - - while true; do - if [ -z "$BATCH" ]; then - $ECHON1 "a)bort, e)dit or s)end? $ECHON2" - read input - else - if [ $CNT -eq 5 ]; then - input=s - else - input=a - fi - fi - case "$input" in - a*) - if [ -z "$BATCH" ]; then - echo "$COMMAND: the problem report remains in $BAD and is not sent." - mv $TEMP $BAD - else - echo "$COMMAND: the problem report is not sent." - fi - xs=1; exit - ;; - e*) - eval $EDIT $TEMP - continue 2 - ;; - s*) - break 2 - ;; - esac - done -done -# -# Remove comments and send the problem report -# (we have to use patterns, where the comment contains regex chars) -# -# /^>Originator:/s;$ORIGINATOR;; -sed -e " -/^SEND-PR:/d -/^>Organization:/,/^>[A-Za-z-]*:/s;$ORGANIZATION_C;; -/^>Confidential:/s;<.*>;; -/^>Synopsis:/s;$SYNOPSIS_C;; -/^>Severity:/s;<.*>;; -/^>Priority:/s;<.*>;; -/^>Category:/s;$CATEGORY_C;; -/^>Class:/s;<.*>;; -/^>Release:/,/^>[A-Za-z-]*:/s;$RELEASE_C;; -/^>Environment:/,/^>[A-Za-z-]*:/s;$ENVIRONMENT_C;; -/^>Description:/,/^>[A-Za-z-]*:/s;$DESCRIPTION_C;; -/^>How-To-Repeat:/,/^>[A-Za-z-]*:/s;$HOW_TO_REPEAT_C;; -/^>Fix:/,/^>[A-Za-z-]*:/s;$FIX_C;; -" $TEMP > $REF - -if $MAIL_AGENT < $REF; then - echo "$COMMAND: problem report sent" - xs=0; exit -else - echo "$COMMAND: mysterious mail failure." - if [ -z "$BATCH" ]; then - echo "$COMMAND: the problem report remains in $BAD and is not sent." - mv $REF $BAD - else - echo "$COMMAND: the problem report is not sent." - fi - xs=1; exit -fi diff --git a/lib-src/tm-au b/lib-src/tm-au deleted file mode 100755 index 4309ebe..0000000 --- a/lib-src/tm-au +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh - -# -# $Id: tm-au,v 1.6 1997/02/15 22:20:26 steve Exp $ -# -# Copyright 1994,1995,1996,1997 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Emacs; see the file COPYING. If not, write to the -# Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH - -if [ "$TM_TMP_DIR" = "" ]; then - TM_TMP_DIR=/tmp - export TM_TMP_DIR -fi - -if [ "$5" = "" ]; then - filename="$TM_TMP_DIR/mime$$.au" -else - filename="$TM_TMP_DIR/$5" -fi - - -case "$4" in -"play") - echo "$2; $3 ->" - tmdecode $3 $1 $filename - if [ "$AUDIOSERVER" = "" ]; then - case "`uname`" in - IRIX ) sfplay $filename ;; - OSF1 ) decsound -play $filename ;; - * ) cat $filename > /dev/audio ;; - esac - else - autool -v 40 $filename - fi - - trap 'rm -f $filename' 0 1 2 3 13 15 - ;; -"extract") - echo "$2; $3 -> $filename" - echo "extract to $filename" - tmdecode $3 $1 $filename - ;; -esac diff --git a/lib-src/tm-file b/lib-src/tm-file deleted file mode 100755 index 359b357..0000000 --- a/lib-src/tm-file +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -# -# $Id: tm-file,v 1.4 1997/01/30 02:22:30 steve Exp $ -# -# Copyright 1994,1995,1996,1997 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Emacs; see the file COPYING. If not, write to the -# Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH - -if [ "$TM_TMP_DIR" = "" ]; then - TM_TMP_DIR=/tmp - export TM_TMP_DIR -fi - -if [ "$5" = "" ]; then - filename="$TM_TMP_DIR/mime$$" -else - filename="$TM_TMP_DIR/$5" -fi - - -echo "$2; $3 -> $filename" - -tmdecode $3 $1 $filename diff --git a/lib-src/tm-html b/lib-src/tm-html deleted file mode 100755 index aa4d27d..0000000 --- a/lib-src/tm-html +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/sh -# -# $Id: tm-html,v 1.4 1997/01/30 02:22:30 steve Exp $ -# -# Copyright 1994,1995,1996,1997 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Emacs; see the file COPYING. If not, write to the -# Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH - -if [ "$TM_TMP_DIR" = "" ]; then - TM_TMP_DIR=/tmp - export TM_TMP_DIR -fi - -if [ "$TM_WWW_BROWSER" = "" ]; then - TM_WWW_BROWSER=netscape - export TM_WWW_BROWSER -fi - -if [ "$5" = "" ]; then - filename="$TM_TMP_DIR/mime$$.html" -else - filename="$TM_TMP_DIR/$5" -fi - -echo "$2; $3 -> $filename" - -tmdecode "$3" $1 $filename - -case "$4" in -"play") - if [ `echo $TM_WWW_BROWSER | grep netscape` ]; then - echo netscape - if [ -h $HOME/.netscape/lock ]; then - netscape -remote "openURL(file:$filename,new-window)" - else - netscape $filename - fi - else - echo not netscape - $TM_WWW_BROWSER $filename - fi - trap 'rm -f $filename' 0 1 2 3 13 15 - ;; -"extract") - echo "extract to $filename" - ;; -esac diff --git a/lib-src/tm-image b/lib-src/tm-image deleted file mode 100755 index 78646e1..0000000 --- a/lib-src/tm-image +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/sh - -# -# $Id: tm-image,v 1.4 1997/01/30 02:22:30 steve Exp $ -# -# Copyright 1994, 1995, 1996 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Emacs; see the file COPYING. If not, write to the -# Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH - -if [ "$TM_TMP_DIR" = "" ]; then - TM_TMP_DIR=/tmp - export TM_TMP_DIR -fi -if [ "$5" = "" ]; then - case "$2" in - "image/gif") - filename="$TM_TMP_DIR/mime$$.gif" - ;; - "image/jpeg") - filename="$TM_TMP_DIR/mime$$.jpg" - ;; - "image/tiff"|"image/x-tiff") - filename="$TM_TMP_DIR/mime$$.tif" - ;; - "image/x-xwd") - filename="$TM_TMP_DIR/mime$$.xwd" - ;; - "image/x-xbm") - filename="$TM_TMP_DIR/mime$$.xbm" - ;; - "image/x-pic") - filename="$TM_TMP_DIR/mime$$.pic" - ;; - "image/x-mag") - filename="$TM_TMP_DIR/mime$$.mag" - ;; - *) - filename="$TM_TMP_DIR/mime$$.img" - ;; - esac -else - filename="$TM_TMP_DIR/$5" -fi - -echo "$2; $3 -> $filename" - -tmdecode $3 $1 $filename - -case "$4" in -"play") - xv -geometry +1+1 $filename - trap 'rm -f $filename' 0 1 2 3 13 15 - ;; -"extract") - echo "extract to $filename" - ;; -esac diff --git a/lib-src/tm-mpeg b/lib-src/tm-mpeg deleted file mode 100755 index 88c5c1c..0000000 --- a/lib-src/tm-mpeg +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh - -# -# $Id: tm-mpeg,v 1.4 1997/01/30 02:22:30 steve Exp $ -# -# Copyright 1994, 1995, 1996 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Emacs; see the file COPYING. If not, write to the -# Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH - -if [ "$TM_TMP_DIR" = "" ]; then - TM_TMP_DIR=/tmp - export TM_TMP_DIR -fi -if [ "$5" = "" ]; then - filename="$TM_TMP_DIR/mime$$.mpg" -else - filename="$TM_TMP_DIR/$5" -fi - -echo "$2; $3 -> $filename" - -tmdecode $3 $1 $filename - -case "$4" in -"play") - if [ "$VIDEO_DITHER" = "" ]; then - VIDEO_DITHER=gray - export VIDEO_DITHER - fi - mpeg_play -dither $VIDEO_DITHER $filename - trap 'rm -f $filename' 0 1 2 3 13 15 - ;; -"extract") - echo "extract to $filename" - ;; -esac diff --git a/lib-src/tm-plain b/lib-src/tm-plain deleted file mode 100755 index 7035779..0000000 --- a/lib-src/tm-plain +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh - -# -# $Id: tm-plain,v 1.4 1997/01/30 02:22:30 steve Exp $ -# -# Copyright 1994,1995,1996,1997 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Emacs; see the file COPYING. If not, write to the -# Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH - -if [ "$TM_TMP_DIR" = "" ]; then - TM_TMP_DIR=/tmp - export TM_TMP_DIR -fi -if [ "$5" = "" ]; then - filename="$TM_TMP_DIR/mime$$.pln" -else - filename="$TM_TMP_DIR/$5" -fi - -case "$4" in -"play") - echo "$2; $3 ->" - tmdecode "$3" "$1" /dev/stdout - ;; -"extract") - echo "$2; $3 -> $filename" - echo "extract to $filename" - tmdecode "$3" "$1" $filename - ;; -"print") - echo "$2; $3 ->" - tmdecode "$3" "$1" /dev/stdout | lpr - ;; -esac diff --git a/lib-src/tm-ps b/lib-src/tm-ps deleted file mode 100755 index d816945..0000000 --- a/lib-src/tm-ps +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh - -# -# $Id: tm-ps,v 1.4 1997/01/30 02:22:30 steve Exp $ -# -# Copyright 1994, 1995, 1996 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Emacs; see the file COPYING. If not, write to the -# Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH - -if [ "$TM_TMP_DIR" = "" ]; then - TM_TMP_DIR=/tmp - export TM_TMP_DIR -fi -if [ "$5" = "" ]; then - filename="$TM_TMP_DIR/mime$$.pln" -else - filename="$TM_TMP_DIR/$5" -fi - -case "$4" in -"play") - echo "$2; $3 -> $filename" - tmdecode $3 $1 $filename - ghostview $filename - trap 'rm -f $filename' 0 1 2 3 13 15 - ;; -"extract") - echo "$2; $3 -> $filename" - echo "extract to $filename" - tmdecode "$3" "$1" $filename - ;; -"print") - echo "$2; $3 ->" - tmdecode "$3" "$1" /dev/stdout | lpr - ;; -esac diff --git a/lib-src/tmdecode b/lib-src/tmdecode deleted file mode 100755 index ebb02fc..0000000 --- a/lib-src/tmdecode +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/sh - -# -# $Id: tmdecode,v 1.4 1997/01/30 02:22:30 steve Exp $ -# -# Copyright 1994, 1995, 1996 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Emacs; see the file COPYING. If not, write to the -# Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH - -trap 'rm -f $2' 0 1 2 3 13 15 - -case "$3" in -/dev/stdout) - OUTPUT= - ;; -*) - OUTPUT='> $3' - ;; -esac - -case "$1" in -""|"7bit"|"8bit"|"binary") - eval "cat $2 $OUTPUT" - ;; -"base64") - #eval "decode-b < $2 $OUTPUT" - eval "mmencode -u $2 $OUTPUT" - ;; -"quoted-printable") - eval "mmencode -q -u $2 $OUTPUT" - ;; -"x-uue"|"x-uuencode") - (cd $TM_TMP_DIR ; uudecode $2) - ;; -"x-gzip64") - #eval "decode-b < $2 | gzip -cd $OUTPUT" - eval "mmencode -u $2 | gzip -cd $OUTPUT" - ;; -*) - echo "unknown encoding" - exit -1 - ;; -esac - -# echo "$2 was removed." diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a0a99f2..037ca4b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,22 @@ +1999-06-04 MORIOKA Tomohiko + + * files.el (insert-file-contents-literally): Treat file as binary; + call file-name-handlers. [sync with Emacs 20.3.10] + +1999-06-04 MORIOKA Tomohiko + + * code-files.el (buffer-file-coding-system): Use `raw-text' as + default value. + (load): Use `raw-text' instead of `no-conversion'. + (insert-file-contents): Likewise. + + * bytecomp.el (byte-compile-insert-header): Use `raw-text' instead + of `no-conversion'. + +1999-06-03 MORIOKA Tomohiko + + * coding.el: Don't copy `no-conversion' to `raw-text'. + 1999-06-04 XEmacs Build Bot * XEmacs 21.2.15 is released diff --git a/lisp/bytecomp.el b/lisp/bytecomp.el index d8ab789..1ce8d27 100644 --- a/lisp/bytecomp.el +++ b/lisp/bytecomp.el @@ -1747,7 +1747,7 @@ With argument, insert value in current buffer after the form." ;; file if under Mule. If there are any extended characters in the ;; input file, use `escape-quoted' to make sure that both binary and ;; extended characters are output properly and distinguished properly. - ;; Otherwise, use `no-conversion' for maximum portability with non-Mule + ;; Otherwise, use `raw-text' for maximum portability with non-Mule ;; Emacsen. (when (featurep 'mule) (defvar buffer-file-coding-system) @@ -1758,7 +1758,7 @@ With argument, insert value in current buffer after the form." (skip-chars-forward (concat (char-to-string 0) "-" (char-to-string 255))) (eq (point) (point-max))) - (setq buffer-file-coding-system 'no-conversion) + (setq buffer-file-coding-system 'raw-text) (insert "(require 'mule)\n;;;###coding system: escape-quoted\n") (setq buffer-file-coding-system 'escape-quoted) ;; #### Lazy loading not yet implemented for MULE files diff --git a/lisp/code-files.el b/lisp/code-files.el index 434695a..c07749a 100644 --- a/lisp/code-files.el +++ b/lisp/code-files.el @@ -35,7 +35,7 @@ ;;; Code: -(setq-default buffer-file-coding-system 'no-conversion) +(setq-default buffer-file-coding-system 'raw-text) (put 'buffer-file-coding-system 'permanent-local t) (define-obsolete-variable-alias @@ -287,7 +287,7 @@ Return t if file exists." (save-excursion (set-buffer (get-buffer-create " *load*")) (erase-buffer) - (let ((coding-system-for-read 'no-conversion)) + (let ((coding-system-for-read 'raw-text)) (insert-file-contents path nil 1 3001)) (find-coding-system-magic-cookie)) (if elc @@ -384,7 +384,7 @@ The coding system used for decoding the file is determined as follows: 3. The matching value for this filename from `file-coding-system-alist', if any. 4. `buffer-file-coding-system-for-read', if non-nil. -5. The coding system 'no-conversion. +5. The coding system 'raw-text. If a local value for `buffer-file-coding-system' in the current buffer does not exist, it is set to the coding system which was actually used @@ -413,7 +413,7 @@ and `insert-file-contents-post-hook'." ;; #4. buffer-file-coding-system-for-read ;; #5. - 'no-conversion)) + 'raw-text)) (if (consp coding-system) (setq return-val coding-system) (if (null (find-coding-system coding-system)) diff --git a/lisp/coding.el b/lisp/coding.el index 7a5856d..5a4a1c4 100644 --- a/lisp/coding.el +++ b/lisp/coding.el @@ -204,8 +204,6 @@ Does not modify STR. Returns the encoded string on successful conversion." ;; compatibility for old XEmacsen (don't use it) (copy-coding-system 'undecided 'automatic-conversion) -(copy-coding-system 'no-conversion 'raw-text) - (make-compatible-variable 'enable-multibyte-characters "Unimplemented") (define-obsolete-variable-alias diff --git a/lisp/files.el b/lisp/files.el index 186043f..4f41c82 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -864,14 +864,17 @@ If there is no such live buffer, return nil." found)))) (defun insert-file-contents-literally (filename &optional visit beg end replace) - "Like `insert-file-contents', q.v., but only reads in the file. + "Like `insert-file-contents', q.v., but only reads in the file literally. A buffer may be modified in several ways after reading into the buffer due -to advanced Emacs features, such as file-name-handlers, format decoding, -find-file-hooks, etc. - This function ensures that none of these modifications will take place." - (let ((file-name-handler-alist nil) - (format-alist nil) +to advanced Emacs features, such as format decoding, character code +conversion,find-file-hooks, automatic uncompression, etc. + +This function ensures that none of these modifications will take place." + (let ((format-alist nil) (after-insert-file-functions nil) + (coding-system-for-read 'binary) + (coding-system-for-write 'binary) + (jka-compr-compression-info-list nil) (find-buffer-file-type-function (if (fboundp 'find-buffer-file-type) (symbol-function 'find-buffer-file-type) diff --git a/lisp/finder-inf.el b/lisp/finder-inf.el deleted file mode 100644 index 6c5365a..0000000 --- a/lisp/finder-inf.el +++ /dev/null @@ -1,3677 +0,0 @@ -;;; finder-inf.el --- keyword-to-package mapping -;; Keywords: help -;;; Commentary: -;; Don't edit this file. It's generated by finder.el - -;;; Code: - -(defconst finder-package-info '( - ("eos.el" - "Intereactively loads the XEmacs/SPARCworks interface" - (sparcworks eos era on sparcworks load) - "/home/martin/x/packages/lisp/Sun/") - ("sccs.el" - "easy-to-use SCCS control from within Emacs" - nil - "/home/martin/x/packages/lisp/Sun/") - ("sun-eos-browser.el" - "Implements the XEmacs/SPARCworks SourceBrowser interface" - (sparcworks eos era on sparcworks sbrowser source browser) - "/home/martin/x/packages/lisp/Sun/") - ("sun-eos-debugger-extra.el" - "Implements the XEmacs/SPARCworks Debugger interface" - (sparcworks eos era on sparcworks debugger dbx) - "/home/martin/x/packages/lisp/Sun/") - ("sun-eos-debugger.el" - "Implements the XEmacs/SPARCworks interface" - (sparcworks eos era on sparcworks debugger dbx) - "/home/martin/x/packages/lisp/Sun/") - ("sun-eos-editor.el" - "Implements the XEmacs/SPARCworks editor protocol" - (sparcworks eos era on sparcworks editor) - "/home/martin/x/packages/lisp/Sun/") - ("sun-eos-init.el" - "Initializes the XEmacs/SPARCworks interface" - (sparcworks eos era on sparcworks initialize) - "/home/martin/x/packages/lisp/Sun/") - ("sun-eos-load.el" - "Loads the XEmacs/SPARCworks interface code" - (sparcworks eos era on sparcworks debugger dbx) - "/home/martin/x/packages/lisp/Sun/") - ("sun-eos-menubar.el" - "Implements the XEmacs/SPARCworks menubar" - (sparcworks eos era on sparcworks menubar) - "/home/martin/x/packages/lisp/Sun/") - ("sun-eos-toolbar.el" - "Implements the EOS toolbar interface" - (sparcworks eos era on sparcworks toolbar) - "/home/martin/x/packages/lisp/Sun/") - ("sun-eos.el" - "Intereactively loads the XEmacs/SPARCworks interface" - (sparcworks eos era on sparcworks load) - "/home/martin/x/packages/lisp/Sun/") - ("sunpro-keys.el" - "SunPro-specific key bindings" - nil - "/home/martin/x/packages/lisp/Sun/") - ("sunpro-menubar.el" - "Initialize the SunPro menubar" - (sunpro menubar initialization) - "/home/martin/x/packages/lisp/Sun/") - ("sunpro-sparcworks.el" - "support SPARCworks manager ToolTalk messages" - (sparcworks tooltalk messages) - "/home/martin/x/packages/lisp/Sun/") - ("ada-mode.el" - "An Emacs major-mode for editing Ada source." - (languages oop ada) - "/home/martin/x/packages/lisp/ada/") - ("custom-load.el" - "automatically extracted custom dependencies" - nil - "/home/martin/x/packages/lisp/ada/") - ("atype.el" - "atype functions" - (atype) - "/home/martin/x/packages/lisp/apel/") - ("emu-20.el" - "emu API implementation for Emacs 20 and XEmacs/mule" - (emulation compatibility mule) - "/home/martin/x/packages/lisp/apel/") - ("emu-e19.el" - "emu module for Emacs 19 and XEmacs 19" - (emulation compatibility mule latin-1) - "/home/martin/x/packages/lisp/apel/") - ("emu-x20.el" - "emu API implementation for XEmacs with mule" - (emulation compatibility mule xemacs) - "/home/martin/x/packages/lisp/apel/") - ("emu-xemacs.el" - "emu API implementation for XEmacs" - (emulation compatibility xemacs) - "/home/martin/x/packages/lisp/apel/") - ("emu.el" - "Emulation module for each Emacs variants" - (emulation compatibility nemacs mule emacs/mule xemacs) - "/home/martin/x/packages/lisp/apel/") - ("file-detect.el" - "Path management or file detection utility" - (file detection install module) - "/home/martin/x/packages/lisp/apel/") - ("filename.el" - "file name filter" - (file name string) - "/home/martin/x/packages/lisp/apel/") - ("install.el" - "Emacs Lisp package install utility" - (install byte-compile directory detection) - "/home/martin/x/packages/lisp/apel/") - ("mule-caesar.el" - "ROT 13-47 Caesar rotation utility" - (rot 13-47 caesar mail news text/x-rot13-47) - "/home/martin/x/packages/lisp/apel/") - ("path-util.el" - "Emacs Lisp file detection utility" - (file detection install module) - "/home/martin/x/packages/lisp/apel/") - ("richtext.el" - "read and save files in text/richtext format" - (wp faces mime multimedia) - "/home/martin/x/packages/lisp/apel/") - ("std11-parse.el" - "STD 11 parser for GNU Emacs" - (mail news rfc 822 std 11) - "/home/martin/x/packages/lisp/apel/") - ("std11.el" - "STD 11 functions for GNU Emacs" - (mail news rfc 822 std 11) - "/home/martin/x/packages/lisp/apel/") - ("font-latex.el" - "LaTeX fontification for Font Lock mode." - (latex faces) - "/home/martin/x/packages/lisp/auctex/") - ("latex.el" - "Support for LaTeX documents." - (wp) - "/home/martin/x/packages/lisp/auctex/") - ("multi-prompt.el" - "completing read of multiple strings." - (extensions) - "/home/martin/x/packages/lisp/auctex/") - ("tex.el" - "Support for TeX documents." - (wp) - "/home/martin/x/packages/lisp/auctex/") - ("bbdb-print.el" - "for printing BBDB databases using TeX." - nil - "/home/martin/x/packages/lisp/bbdb/") - ("bbdb-reportmail.el" - "Hooks the Insidious Big Brother Database" - nil - "/home/martin/x/packages/lisp/bbdb/") - ("bbdb-snarf.el" - "convert free-form text to BBDB records" - nil - "/home/martin/x/packages/lisp/bbdb/") - ("bbdb-whois.el" - "Big Brother gets a little help from Big Brother" - nil - "/home/martin/x/packages/lisp/bbdb/") - ("c-comment-edit.el" - "edit C comments" - (languages) - "/home/martin/x/packages/lisp/c-support/") - ("c-comment.el" - "edit C comments" - (languages) - "/home/martin/x/packages/lisp/c-support/") - ("c-style.el" - "sets c-style control variables." - nil - "/home/martin/x/packages/lisp/c-support/") - ("cmacexp.el" - "expand C macros in a region" - (c) - "/home/martin/x/packages/lisp/c-support/") - ("ctypes.el" - "Enhanced Font lock support for custom defined types." - nil - "/home/martin/x/packages/lisp/c-support/") - ("hideif.el" - "hides selected code within ifdef." - (c outlines) - "/home/martin/x/packages/lisp/c-support/") - ("hideshow.el" - "minor mode cmds to selectively display blocks of code" - (c c++ lisp tools editing) - "/home/martin/x/packages/lisp/c-support/") - ("appt.el" - "appointment notification functions." - (calendar) - "/home/martin/x/packages/lisp/calendar/") - ("cal-china.el" - "calendar functions for the Chinese calendar." - (calendar) - "/home/martin/x/packages/lisp/calendar/") - ("cal-coptic.el" - "calendar functions for the Coptic/Ethiopic calendars." - (calendar) - "/home/martin/x/packages/lisp/calendar/") - ("cal-dst.el" - "calendar functions for daylight savings rules." - (calendar) - "/home/martin/x/packages/lisp/calendar/") - ("cal-french.el" - "calendar functions for the French Revolutionary calendar." - (calendar) - "/home/martin/x/packages/lisp/calendar/") - ("cal-hebrew.el" - "calendar functions for the Hebrew calendar." - (calendar) - "/home/martin/x/packages/lisp/calendar/") - ("cal-islam.el" - "calendar functions for the Islamic calendar." - (calendar) - "/home/martin/x/packages/lisp/calendar/") - ("cal-iso.el" - "calendar functions for the ISO calendar." - (calendar) - "/home/martin/x/packages/lisp/calendar/") - ("cal-julian.el" - "calendar functions for the Julian calendar." - (calendar) - "/home/martin/x/packages/lisp/calendar/") - ("cal-mayan.el" - "calendar functions for the Mayan calendars." - (calendar) - "/home/martin/x/packages/lisp/calendar/") - ("cal-move.el" - "calendar functions for movement in the calendar" - (calendar) - "/home/martin/x/packages/lisp/calendar/") - ("cal-persia.el" - "calendar functions for the Persian calendar." - (calendar) - "/home/martin/x/packages/lisp/calendar/") - ("cal-tex.el" - "calendar functions for printing calendars with LaTeX." - (calendar) - "/home/martin/x/packages/lisp/calendar/") - ("cal-x.el" - "calendar windows in dedicated frames in x-windows" - (calendar) - "/home/martin/x/packages/lisp/calendar/") - ("cal-xemacs.el" - "calendar functions for menu bar and popup menu support" - (calendar) - "/home/martin/x/packages/lisp/calendar/") - ("calendar.el" - "Calendar functions. -*-byte-compile-dynamic: t;-*-" - (calendar) - "/home/martin/x/packages/lisp/calendar/") - ("diary-lib.el" - "diary functions." - (calendar) - "/home/martin/x/packages/lisp/calendar/") - ("holidays.el" - "holiday functions for the calendar package" - (holidays calendar) - "/home/martin/x/packages/lisp/calendar/") - ("lunar.el" - "calendar functions for phases of the moon." - (calendar) - "/home/martin/x/packages/lisp/calendar/") - ("solar.el" - "calendar functions for solar events." - (calendar) - "/home/martin/x/packages/lisp/calendar/") - ("cc-align.el" - "custom indentation functions for CC Mode" - (c languages oop) - "/home/martin/x/packages/lisp/cc-mode/") - ("cc-cmds.el" - "user level commands for CC Mode " - (c languages oop) - "/home/martin/x/packages/lisp/cc-mode/") - ("cc-compat.el" - "cc-mode compatibility with c-mode.el confusion" - (c languages oop) - "/home/martin/x/packages/lisp/cc-mode/") - ("cc-defs.el" - "compile time definitions for CC Mode" - (c languages oop) - "/home/martin/x/packages/lisp/cc-mode/") - ("cc-engine.el" - "core syntax guessing engine for CC mode" - (c languages oop) - "/home/martin/x/packages/lisp/cc-mode/") - ("cc-langs.el" - "specific language support for CC Mode" - (c languages oop) - "/home/martin/x/packages/lisp/cc-mode/") - ("cc-menus.el" - "imenu support for CC Mode" - (c languages oop) - "/home/martin/x/packages/lisp/cc-mode/") - ("cc-mode.el" - "major mode for editing C, C++, Objective-C, and Java code" - (c languages oop) - "/home/martin/x/packages/lisp/cc-mode/") - ("cc-styles.el" - "support for styles in CC Mode" - (c languages oop) - "/home/martin/x/packages/lisp/cc-mode/") - ("cc-vars.el" - "user customization variables for CC Mode" - (c languages oop) - "/home/martin/x/packages/lisp/cc-mode/") - ("cookie1.el" - "retrieve random phrases from fortune cookie files" - (games) - "/home/martin/x/packages/lisp/cookie/") - ("spook.el" - "spook phrase utility for overloading the NSA line eater" - (games) - "/home/martin/x/packages/lisp/cookie/") - ("yow.el" - "quote random zippyisms" - (games) - "/home/martin/x/packages/lisp/cookie/") - ("crisp.el" - "CRiSP/Brief Emacs emulator" - (emulations brief crisp) - "/home/martin/x/packages/lisp/crisp/") - ("scroll-lock.el" - "scroll-locking minor mode" - (scroll crisp brief lock) - "/home/martin/x/packages/lisp/crisp/") - ("dbx.el" - "run dbx under Emacs" - (c unix tools debugging) - "/home/martin/x/packages/lisp/debug/") - ("gdb-highlight.el" - "make gdb buffers be mouse-sensitive." - (extensions c unix tools debugging) - "/home/martin/x/packages/lisp/debug/") - ("gdb.el" - "run gdb under Emacs" - (c unix tools debugging) - "/home/martin/x/packages/lisp/debug/") - ("gdbsrc.el" - "Source-based (as opposed to comint-based) debugger" - (c unix tools debugging) - "/home/martin/x/packages/lisp/debug/") - ("gud.el" - "Grand Unified Debugger mode for gdb, sdb, dbx, or xdb" - (c unix tools debugging) - "/home/martin/x/packages/lisp/debug/") - ("history.el" - "Generic history stuff" - nil - "/home/martin/x/packages/lisp/debug/") - ("advise-eval-region.el" - "Wrap advice around eval-region" - (extensions lisp) - "/home/martin/x/packages/lisp/edebug/") - ("cust-print.el" - "handles print-level and print-circle." - (extensions) - "/home/martin/x/packages/lisp/edebug/") - ("edebug-cl-read.el" - "Edebug reader macros for use with cl-read." - (lisp tools maint) - "/home/martin/x/packages/lisp/edebug/") - ("edebug.el" - "a source-level debugger for Emacs Lisp" - (lisp tools maint) - "/home/martin/x/packages/lisp/edebug/") - ("eval-reg.el" - "Redefine eval-region, and subrs that use it, in Lisp" - (lisp) - "/home/martin/x/packages/lisp/edebug/") - ("ediff-diff.el" - "diff-related utilities" - nil - "/home/martin/x/packages/lisp/ediff/") - ("ediff-help.el" - "Code related to the contents of Ediff help buffers" - nil - "/home/martin/x/packages/lisp/ediff/") - ("ediff-hook.el" - "setup for Ediff's menus and autoloads" - nil - "/home/martin/x/packages/lisp/ediff/") - ("ediff-init.el" - "Macros, variables, and defsubsts used by Ediff" - nil - "/home/martin/x/packages/lisp/ediff/") - ("ediff-merg.el" - "merging utilities" - nil - "/home/martin/x/packages/lisp/ediff/") - ("ediff-mult.el" - "support for multi-file/multi-buffer processing in Ediff" - nil - "/home/martin/x/packages/lisp/ediff/") - ("ediff-ptch.el" - "Ediff's patch support" - nil - "/home/martin/x/packages/lisp/ediff/") - ("ediff-tbar.el" - "A toolbar for Ediff control buffer" - nil - "/home/martin/x/packages/lisp/ediff/") - ("ediff-util.el" - "the core commands and utilities of ediff" - nil - "/home/martin/x/packages/lisp/ediff/") - ("ediff-vers.el" - "version control interface to Ediff" - nil - "/home/martin/x/packages/lisp/ediff/") - ("ediff-wind.el" - "window manipulation utilities" - nil - "/home/martin/x/packages/lisp/ediff/") - ("ediff.el" - "a comprehensive visual interface to diff & patch" - (comparing merging patching version control.) - "/home/martin/x/packages/lisp/ediff/") - ("abbrevlist.el" - "list one abbrev table alphabetically ordered." - (abbrev) - "/home/martin/x/packages/lisp/edit-utils/") - ("after-save-commands.el" - "Run a shell command after saving a file" - (processes unix) - "/home/martin/x/packages/lisp/edit-utils/") - ("array.el" - "array editing commands for XEmacs" - (extensions) - "/home/martin/x/packages/lisp/edit-utils/") - ("atomic-extents.el" - "treat regions of text as a single object" - (extensions) - "/home/martin/x/packages/lisp/edit-utils/") - ("avoid.el" - "make mouse pointer stay out of the way of editing" - (mouse) - "/home/martin/x/packages/lisp/edit-utils/") - ("backup-dir.el" - "allow backup files to live in some other directory(s)." - (backup file) - "/home/martin/x/packages/lisp/edit-utils/") - ("big-menubar.el" - "an alternate menubar" - (mouse menubar) - "/home/martin/x/packages/lisp/edit-utils/") - ("blink-cursor.el" - "Blink the cursor on or off" - (display) - "/home/martin/x/packages/lisp/edit-utils/") - ("blink-paren.el" - "blink the matching paren, just like Zmacs" - (faces) - "/home/martin/x/packages/lisp/edit-utils/") - ("bookmark.el" - "set bookmarks, maybe annotate them, jump to them later." - (bookmarks placeholders annotations) - "/home/martin/x/packages/lisp/edit-utils/") - ("compare-w.el" - "compare text between windows for Emacs." - nil - "/home/martin/x/packages/lisp/edit-utils/") - ("completion.el" - "dynamic word-completion code" - (abbrev) - "/home/martin/x/packages/lisp/edit-utils/") - ("dabbrev.el" - "dynamic abbreviation package" - (abbrev expand completion) - "/home/martin/x/packages/lisp/edit-utils/") - ("desktop.el" - "save partial status of Emacs when killed" - (customization) - "/home/martin/x/packages/lisp/edit-utils/") - ("detached-minibuf.el" - "Support a detached minibuffer for XEmacs." - (extensions) - "/home/martin/x/packages/lisp/edit-utils/") - ("edit-faces.el" - "interactive face editing mode" - (faces) - "/home/martin/x/packages/lisp/edit-utils/") - ("edit-toolbar.el" - "Interactive toolbar editing mode for XEmacs" - (tools) - "/home/martin/x/packages/lisp/edit-utils/") - ("fast-lock.el" - "Automagic text properties caching for fast Font Lock mode." - (faces files) - "/home/martin/x/packages/lisp/edit-utils/") - ("file-part.el" - "treat a section of a buffer as a separate file" - (extensions tools) - "/home/martin/x/packages/lisp/edit-utils/") - ("floating-toolbar.el" - "popup toolbar support for XEmacs." - (lisp) - "/home/martin/x/packages/lisp/edit-utils/") - ("flow-ctrl.el" - "help for lusers on cu(1) or ttys with wired-in ^S/^Q flow control" - (hardware) - "/home/martin/x/packages/lisp/edit-utils/") - ("foldout.el" - "Folding extensions for outline-mode and outline-minor-mode." - (folding outline) - "/home/martin/x/packages/lisp/edit-utils/") - ("func-menu.el" - "Jump to a function within a buffer." - (tools c lisp) - "/home/martin/x/packages/lisp/edit-utils/") - ("hippie-exp.el" - "expand text trying various ways to find its expansion." - (abbrev) - "/home/martin/x/packages/lisp/edit-utils/") - ("id-select.el" - "Select larger and larger syntax-driven regions in a buffer" - (matching mouse) - "/home/martin/x/packages/lisp/edit-utils/") - ("info-look.el" - "major-mode-sensitive Info index lookup facility." - (help languages) - "/home/martin/x/packages/lisp/edit-utils/") - ("iswitchb.el" - "switch between buffers using substrings" - (extensions) - "/home/martin/x/packages/lisp/edit-utils/") - ("lazy-lock.el" - "Lazy demand-driven fontification for fast Font Lock mode." - (faces files) - "/home/martin/x/packages/lisp/edit-utils/") - ("lazy-shot.el" - "Lazy font locking for XEmacs" - (languages faces) - "/home/martin/x/packages/lisp/edit-utils/") - ("lispm-fonts.el" - "quick hack to parse LISPM-style font-shift codes" - (faces) - "/home/martin/x/packages/lisp/edit-utils/") - ("live-icon.el" - "make frame icons represent the current frame contents" - nil - "/home/martin/x/packages/lisp/edit-utils/") - ("makesum.el" - "generate key binding summary for Emacs" - (help) - "/home/martin/x/packages/lisp/edit-utils/") - ("man.el" - "browse UNIX manual pages" - (help) - "/home/martin/x/packages/lisp/edit-utils/") - ("mic-paren.el" - "highlight matching parenthesises." - (languages faces) - "/home/martin/x/packages/lisp/edit-utils/") - ("outl-mouse.el" - "outline mode mouse commands for Emacs" - (outlines mouse) - "/home/martin/x/packages/lisp/edit-utils/") - ("page-ext.el" - "extended page handling commands" - nil - "/home/martin/x/packages/lisp/edit-utils/") - ("paren.el" - "highlight (un)matching parens and whole expressions" - (languages faces) - "/home/martin/x/packages/lisp/edit-utils/") - ("permanent-buffers.el" - "Permanent buffers management package." - (extensions) - "/home/martin/x/packages/lisp/edit-utils/") - ("popper.el" - "shrink-wrapped temporary windows for Emacs" - (temporary window popup window) - "/home/martin/x/packages/lisp/edit-utils/") - ("recent-files.el" - "Maintain menu of recently opened files." - (menu file) - "/home/martin/x/packages/lisp/edit-utils/") - ("redo.el" - "Redo/undo system for XEmacs" - (lisp extensions) - "/home/martin/x/packages/lisp/edit-utils/") - ("resume.el" - "process command line args from within a suspended Emacs job" - (processes) - "/home/martin/x/packages/lisp/edit-utils/") - ("rsz-minibuf.el" - "dynamically resize minibuffer to display entire contents" - (minibuffer window frames display) - "/home/martin/x/packages/lisp/edit-utils/") - ("savehist.el" - "Save minibuffer history" - (minibuffer) - "/home/martin/x/packages/lisp/edit-utils/") - ("saveplace.el" - "automatically save place in files." - (bookmarks placeholders) - "/home/martin/x/packages/lisp/edit-utils/") - ("tempo.el" - "Flexible template insertion" - (extensions languages tools) - "/home/martin/x/packages/lisp/edit-utils/") - ("toolbar-utils.el" - "Toolbar utility functions for XEmacs" - (extensions) - "/home/martin/x/packages/lisp/edit-utils/") - ("uniquify.el" - "unique buffer names dependent on file name" - nil - "/home/martin/x/packages/lisp/edit-utils/") - ("where-was-i-db.el" - "Keep persistent state in visited files." - (tools data wp) - "/home/martin/x/packages/lisp/edit-utils/") - ("edt-lk201.el" - "Enhanced EDT Keypad Mode Emulation for LK-201 Keyboards" - (emulations) - "/home/martin/x/packages/lisp/edt/") - ("edt-mapper.el" - "Create an EDT LK-201 Map File for X-Windows Emacs" - (emulations) - "/home/martin/x/packages/lisp/edt/") - ("edt-pc.el" - "Enhanced EDT Keypad Mode Emulation for PC 101 Keyboards" - (emulations) - "/home/martin/x/packages/lisp/edt/") - ("edt-vt100.el" - "Enhanced EDT Keypad Mode Emulation for VT Series Terminals" - (emulations) - "/home/martin/x/packages/lisp/edt/") - ("edt.el" - "Enhanced EDT Keypad Mode Emulation for GNU Emacs 19" - (emulations) - "/home/martin/x/packages/lisp/edt/") - ("dll-debug.el" - "A slow implementation of dll for debugging." - (extensions lisp) - "/home/martin/x/packages/lisp/elib/") - ("emerge.el" - "merge diffs under Emacs control" - (unix tools) - "/home/martin/x/packages/lisp/emerge/") - ("term.el" - "general command interpreter in a window stuff" - nil - "/home/martin/x/packages/lisp/eterm/") - ("tshell.el" - "specialized term.el for running the shell." - (processes) - "/home/martin/x/packages/lisp/eterm/") - ("eudc-bbdb.el" - "Emacs Unified Directory Client - BBDB Backend" - (help) - "/home/martin/x/packages/lisp/eudc/") - ("eudc-custom-vars.el" - "Emacs Unified Directory Client" - (help) - "/home/martin/x/packages/lisp/eudc/") - ("eudc-ldap.el" - "Emacs Unified Directory Client - LDAP Backend" - (help) - "/home/martin/x/packages/lisp/eudc/") - ("eudc-ph.el" - "Emacs Unified Directory Client - CCSO PH/QI Backend" - (help) - "/home/martin/x/packages/lisp/eudc/") - ("eudc.el" - "Emacs Unified Directory Client" - (help) - "/home/martin/x/packages/lisp/eudc/") - ("footnote-cyrillic.el" - "Cyrillic lettering for footnote mode" - (mule news mail) - "/home/martin/x/packages/lisp/footnote/") - ("footnote-greek.el" - "Greek lettering for footnote mode" - (mule news mail) - "/home/martin/x/packages/lisp/footnote/") - ("footnote-han.el" - "Han Japanese footnote support" - (mail news mule) - "/home/martin/x/packages/lisp/footnote/") - ("footnote-hebrew.el" - "Hebrew lettering for footnote mode" - (mule news mail) - "/home/martin/x/packages/lisp/footnote/") - ("footnote-kana.el" - "more Japanese footnote support" - (mail news mule) - "/home/martin/x/packages/lisp/footnote/") - ("footnote.el" - "Footnote support for message mode" - (mail news) - "/home/martin/x/packages/lisp/footnote/") - ("forms-d2.el" - "demo forms-mode" - nil - "/home/martin/x/packages/lisp/forms/") - ("forms-pass.el" - "passwd file demo for forms-mode" - nil - "/home/martin/x/packages/lisp/forms/") - ("forms.el" - "Forms mode: edit a file as a form to fill in" - (extensions) - "/home/martin/x/packages/lisp/forms/") - ("frame-icon.el" - "set up mode-specific icons for each frame under XEmacs" - (frames lisp extensions) - "/home/martin/x/packages/lisp/frame-icon/") - ("overlay.el" - "overlay support." - (internal) - "/home/martin/x/packages/lisp/fsf-compat/") - ("thingatpt.el" - "Get the `thing' at point" - (extensions matching mouse) - "/home/martin/x/packages/lisp/fsf-compat/") - ("timer.el" - "run a function with args at some time in future." - nil - "/home/martin/x/packages/lisp/fsf-compat/") - ("x-popup-menu.el" - "Mimic x-popup-menu in FSF Emacs" - (frames) - "/home/martin/x/packages/lisp/fsf-compat/") - ("gamegrid.el" - "Library for implementing grid-based games on Emacs." - (games) - "/home/martin/x/packages/lisp/games/") - ("snake.el" - "Implementation of Snake for Emacs." - (games) - "/home/martin/x/packages/lisp/games/") - ("sokoban.el" - "Implementation of Sokoban for Emacs." - (games) - "/home/martin/x/packages/lisp/games/") - ("tetris.el" - "Implementation of Tetris for Emacs." - (games) - "/home/martin/x/packages/lisp/games/") - ("dgnushack.el" - "a hack to set the load path for byte-compiling" - (news path) - "/home/martin/x/packages/lisp/gnus/") - ("earcon.el" - "Sound effects for messages" - nil - "/home/martin/x/packages/lisp/gnus/") - ("gnus-agent.el" - "unplugged support for Gnus" - nil - "/home/martin/x/packages/lisp/gnus/") - ("gnus-art.el" - "article mode commands for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-async.el" - "asynchronous support for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-audio.el" - "Sound effects for Gnus" - nil - "/home/martin/x/packages/lisp/gnus/") - ("gnus-bcklg.el" - "backlog functions for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-cache.el" - "cache interface for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-cite.el" - "parse citations in articles for Gnus" - nil - "/home/martin/x/packages/lisp/gnus/") - ("gnus-cus.el" - "customization commands for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-demon.el" - "daemonic Gnus behaviour" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-draft.el" - "draft message support for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-dup.el" - "suppression of duplicate articles in Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-eform.el" - "a mode for editing forms for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-ems.el" - "functions for making Gnus work under different Emacsen" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-gl.el" - "an interface to GroupLens for Gnus" - (news score) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-group.el" - "group mode commands for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-int.el" - "backend interface functions for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-kill.el" - "kill commands for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-load.el" - "automatically extracted custom dependencies" - nil - "/home/martin/x/packages/lisp/gnus/") - ("gnus-logic.el" - "advanced scoring code for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-mh.el" - "mh-e interface for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-move.el" - "commands for moving Gnus from one server to another" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-msg.el" - "mail and post interface for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-nocem.el" - "NoCeM pseudo-cancellation treatment" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-picon.el" - "displaying pretty icons in Gnus" - (news xpm annotation glyph faces) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-range.el" - "range and sequence functions for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-salt.el" - "alternate summary mode interfaces for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-score.el" - "scoring code for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-setup.el" - "Initialization & Setup for Gnus 5" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-soup.el" - "SOUP packet writing support for Gnus" - (news mail) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-spec.el" - "format spec functions for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-srvr.el" - "virtual server support for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-start.el" - "startup functions for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-sum.el" - "summary mode commands for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-topic.el" - "a folding minor mode for Gnus group buffers" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-undo.el" - "minor mode for undoing in Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-util.el" - "utility functions for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-uu.el" - "extract (uu)encoded files in Gnus" - nil - "/home/martin/x/packages/lisp/gnus/") - ("gnus-vm.el" - "vm interface for Gnus" - (news mail) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-win.el" - "window configuration functions for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus-xmas.el" - "Gnus functions for XEmacs" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("gnus.el" - "a newsreader for GNU Emacs" - (news mail) - "/home/martin/x/packages/lisp/gnus/") - ("mailheader.el" - "Mail header parsing, merging, formatting" - (tools mail news) - "/home/martin/x/packages/lisp/gnus/") - ("md5.el" - "MD5 Message Digest Algorithm" - nil - "/home/martin/x/packages/lisp/gnus/") - ("message.el" - "composing mail and news messages" - (mail news) - "/home/martin/x/packages/lisp/gnus/") - ("messagexmas.el" - "XEmacs extensions to message" - (mail news) - "/home/martin/x/packages/lisp/gnus/") - ("messcompat.el" - "making message mode compatible with mail mode" - (mail news) - "/home/martin/x/packages/lisp/gnus/") - ("nnagent.el" - "offline backend for Gnus" - (news mail) - "/home/martin/x/packages/lisp/gnus/") - ("nnbabyl.el" - "rmail mbox access for Gnus" - (news mail) - "/home/martin/x/packages/lisp/gnus/") - ("nndb.el" - "nndb access for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("nndir.el" - "single directory newsgroup access for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("nndoc.el" - "single file access for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("nndraft.el" - "draft article access for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("nneething.el" - "arbitrary file access for Gnus" - (news mail) - "/home/martin/x/packages/lisp/gnus/") - ("nnfolder.el" - "mail folder access for Gnus" - (mail) - "/home/martin/x/packages/lisp/gnus/") - ("nngateway.el" - "posting news via mail gateways" - (news mail) - "/home/martin/x/packages/lisp/gnus/") - ("nnheader.el" - "header access macros for Gnus and its backends" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("nnheaderxm.el" - "making Gnus backends work under XEmacs" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("nnkiboze.el" - "select virtual news access for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("nnlistserv.el" - "retrieving articles via web mailing list archives" - (news mail) - "/home/martin/x/packages/lisp/gnus/") - ("nnmail.el" - "mail support functions for the Gnus mail backends" - (news mail) - "/home/martin/x/packages/lisp/gnus/") - ("nnmbox.el" - "mail mbox access for Gnus" - (news mail) - "/home/martin/x/packages/lisp/gnus/") - ("nnmh.el" - "mhspool access for Gnus" - (news mail) - "/home/martin/x/packages/lisp/gnus/") - ("nnml.el" - "mail spool access for Gnus" - (news mail) - "/home/martin/x/packages/lisp/gnus/") - ("nnoo.el" - "OO Gnus Backends" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("nnsoup.el" - "SOUP access for Gnus" - (news mail) - "/home/martin/x/packages/lisp/gnus/") - ("nnspool.el" - "spool access for GNU Emacs" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("nntp.el" - "nntp access for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("nnvirtual.el" - "virtual newsgroups access for Gnus" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("nnweb.el" - "retrieving articles via web search engines" - (news) - "/home/martin/x/packages/lisp/gnus/") - ("parse-time.el" - "Parsing time strings" - (util) - "/home/martin/x/packages/lisp/gnus/") - ("pop3.el" - "Post Office Protocol (RFC 1460) interface" - (mail pop3) - "/home/martin/x/packages/lisp/gnus/") - ("score-mode.el" - "mode for editing Gnus score files" - (news mail) - "/home/martin/x/packages/lisp/gnus/") - ("smiley.el" - "displaying smiley faces" - (fun) - "/home/martin/x/packages/lisp/gnus/") - ("hm--html-menu.el" - "A menu for the hm--html-mode." - nil - "/home/martin/x/packages/lisp/hm--html-menus/") - ("hm--html-mode.el" - "Major mode for editing HTML documents for the WWW" - (hypermedia languages help docs wp) - "/home/martin/x/packages/lisp/hm--html-menus/") - ("html-view.el" - "routines for communicating with a NCSA Mosaic process" - (comm unix wp help) - "/home/martin/x/packages/lisp/hm--html-menus/") - ("internal-drag-and-drop.el" - "Internal drag and drop interface" - (mouse) - "/home/martin/x/packages/lisp/hm--html-menus/") - ("tmpl-minor-mode.el" - "Template Minor Mode" - (data tools) - "/home/martin/x/packages/lisp/hm--html-menus/") - ("igrep.el" - "An improved interface to `grep` and `find`." - nil - "/home/martin/x/packages/lisp/igrep/") - ("jde-db.el" - "Debugger mode for jdb." - (java tools) - "/home/martin/x/packages/lisp/jde/") - ("jde-gen.el" - "Integrated Development Environment for Java." - (java tools) - "/home/martin/x/packages/lisp/jde/") - ("jde-make.el" - "Integrated Development Environment for Java." - (java tools) - "/home/martin/x/packages/lisp/jde/") - ("jde-run.el" - "runs the Java app in the current buffer." - (tools processes) - "/home/martin/x/packages/lisp/jde/") - ("jde.el" - "Integrated Development Environment for Java." - (java tools) - "/home/martin/x/packages/lisp/jde/") - ("browse-url.el" - "ask a WWW browser to load a URL" - (hypertext) - "/home/martin/x/packages/lisp/mail-lib/") - ("highlight-headers.el" - "highlighting message headers." - (mail news) - "/home/martin/x/packages/lisp/mail-lib/") - ("mail-abbrevs.el" - "Abbrev-expansion of mail aliases." - nil - "/home/martin/x/packages/lisp/mail-lib/") - ("mail-extr.el" - "extract full name and address from RFC 822 mail header." - (mail) - "/home/martin/x/packages/lisp/mail-lib/") - ("mail-utils.el" - "utility functions used both by rmail and rnews" - (mail news) - "/home/martin/x/packages/lisp/mail-lib/") - ("reporter.el" - "customizable bug reporting of lisp programs" - (maint mail tools) - "/home/martin/x/packages/lisp/mail-lib/") - ("rfc822.el" - "hairy rfc822 parser for mail and news and suchlike" - (mail) - "/home/martin/x/packages/lisp/mail-lib/") - ("rmail-mini.el" - "minimal core of \"RMAIL\" mail reader for Emacs." - (mail) - "/home/martin/x/packages/lisp/mail-lib/") - ("rmailout.el" - "\"RMAIL\" mail reader for Emacs: output message to a file." - (mail) - "/home/martin/x/packages/lisp/mail-lib/") - ("sendmail.el" - "mail sending commands for Emacs." - (mail) - "/home/martin/x/packages/lisp/mail-lib/") - ("mc-remail.el" - "Remailer support for Mailcrypt" - nil - "/home/martin/x/packages/lisp/mailcrypt/") - ("mew-attach.el" - "attachments for Mew Draft mode" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-bq.el" - "Base64 and Quoted-Printable encoding for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-cache.el" - "Cache management for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-complete.el" - "Completion magic for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-decode.el" - "MIME syntax decoder for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-demo.el" - "Startup demo for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-draft.el" - "Draft mode for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-encode.el" - "MIME syntax encoder for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-env.el" - "Environment setup for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-ext.el" - "Message/External-Body support for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-fib.el" - "Filling blanks for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-func.el" - "Basic functions for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-header.el" - "Mail header stuff for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-highlight.el" - "Highlight for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-lang-jp.el" - "Japanese specific stuff for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-mark.el" - "Marking for Mew Summary and Virtual mode" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-message.el" - "Message mode for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-mime.el" - "MIME launcher for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-minibuf.el" - "Minibuffer input methods for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-mule0.el" - "Environment of non-Mule for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-mule2.el" - "Environment of Mule version 2 for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-mule3.el" - "Environment of Mule version 3 for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-pgp.el" - "PGP/MIME for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-pick.el" - "Picking up messages for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-refile.el" - "Refile for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-scan.el" - "Scanning messages for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-sort.el" - "Sorting messages for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-summary.el" - "Summary mode for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-syntax.el" - "Internal syntax for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-temacs.el" - "Environment of Text Emacs for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-unix.el" - "MIME content type for UNIX" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-vars.el" - "Variables and Constants for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-virtual.el" - "Virtual mode for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-win32.el" - "Settings for Mew on Win32" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew-xemacs.el" - "Environment of XEmacs for Mew" - nil - "/home/martin/x/packages/lisp/mew/") - ("mew.el" - "Messaging in the Emacs World" - nil - "/home/martin/x/packages/lisp/mew/") - ("mh-comp.el" - "mh-e functions for composing messages" - nil - "/home/martin/x/packages/lisp/mh-e/") - ("mh-e.el" - "GNU Emacs interface to the MH mail system" - (mail) - "/home/martin/x/packages/lisp/mh-e/") - ("mh-funcs.el" - "mh-e functions not everyone will use right away" - nil - "/home/martin/x/packages/lisp/mh-e/") - ("mh-mime.el" - "mh-e support for composing MIME messages" - nil - "/home/martin/x/packages/lisp/mh-e/") - ("mh-pick.el" - "make a search pattern and search for a message in mh-e" - nil - "/home/martin/x/packages/lisp/mh-e/") - ("mh-seq.el" - "mh-e sequences support" - nil - "/home/martin/x/packages/lisp/mh-e/") - ("mh-utils.el" - "mh-e code needed for both sending and reading" - nil - "/home/martin/x/packages/lisp/mh-e/") - ("xmine.el" - "Mine game for XEmacs" - (games) - "/home/martin/x/packages/lisp/mine/") - ("NeXTify.el" - "Character insertion variation" - (games) - "/home/martin/x/packages/lisp/misc-games/") - ("advocacy.el" - "blatant XEmacs self promotion" - nil - "/home/martin/x/packages/lisp/misc-games/") - ("blackbox.el" - "blackbox game in Emacs Lisp" - (games) - "/home/martin/x/packages/lisp/misc-games/") - ("conx.el" - "Yet another dissociater" - (games) - "/home/martin/x/packages/lisp/misc-games/") - ("decipher.el" - "Cryptanalyze monoalphabetic substitution ciphers" - (games) - "/home/martin/x/packages/lisp/misc-games/") - ("dissociate.el" - "scramble text amusingly for Emacs." - (games) - "/home/martin/x/packages/lisp/misc-games/") - ("doctor.el" - "psychological help for frustrated users." - (games) - "/home/martin/x/packages/lisp/misc-games/") - ("dunnet.el" - "Text adventure for Emacs" - (games) - "/home/martin/x/packages/lisp/misc-games/") - ("flame.el" - "Automated insults" - (games) - "/home/martin/x/packages/lisp/misc-games/") - ("gomoku.el" - "Gomoku game between you and Emacs" - (games) - "/home/martin/x/packages/lisp/misc-games/") - ("hanoi.el" - "towers of hanoi in GNUmacs" - (games) - "/home/martin/x/packages/lisp/misc-games/") - ("life.el" - "John Horton Conway's `Life' game for GNU Emacs" - (games) - "/home/martin/x/packages/lisp/misc-games/") - ("morse.el" - "Convert text to morse code and back." - nil - "/home/martin/x/packages/lisp/misc-games/") - ("mpuz.el" - "multiplication puzzle for XEmacs" - (games) - "/home/martin/x/packages/lisp/misc-games/") - ("rot13.el" - "display a buffer in rot13." - nil - "/home/martin/x/packages/lisp/misc-games/") - ("studly.el" - "StudlyCaps (tm)(r)(c)(xxx)" - (games) - "/home/martin/x/packages/lisp/misc-games/") - ("emacsbug.el" - "command to report Emacs bugs to appropriate mailing list." - (maint mail) - "/home/martin/x/packages/lisp/net-utils/") - ("feedmail.el" - "assist other email packages to massage outgoing messages " - (email queue mail sendmail message spray smtp draft) - "/home/martin/x/packages/lisp/net-utils/") - ("metamail.el" - "Metamail interface for GNU Emacs" - (mail news mime multimedia) - "/home/martin/x/packages/lisp/net-utils/") - ("net-utils.el" - "Network functions" - nil - "/home/martin/x/packages/lisp/net-utils/") - ("rcompile.el" - "run a compilation on a remote machine" - (tools processes) - "/home/martin/x/packages/lisp/net-utils/") - ("shadowfile.el" - "automatic file copying for Emacs 19" - (comm) - "/home/martin/x/packages/lisp/net-utils/") - ("webjump.el" - "programmable Web hotlist" - (comm www) - "/home/martin/x/packages/lisp/net-utils/") - ("webster-www.el" - "Look up a word in WWW Merriam-Webster dictionaries" - (comm hypermedia) - "/home/martin/x/packages/lisp/net-utils/") - ("arc-mode.el" - "simple editing of archives" - (data unix) - "/home/martin/x/packages/lisp/os-utils/") - ("background.el" - "fun with background jobs" - (processes) - "/home/martin/x/packages/lisp/os-utils/") - ("crypt.el" - "code for handling all sorts of compressed and encrypted files" - (extensions) - "/home/martin/x/packages/lisp/os-utils/") - ("ftelnet.el" - "remote login interface" - (unix comm) - "/home/martin/x/packages/lisp/os-utils/") - ("inf-lisp.el" - "an inferior-lisp mode" - (processes lisp) - "/home/martin/x/packages/lisp/os-utils/") - ("jka-compr.el" - "reading/writing/loading compressed files" - (data) - "/home/martin/x/packages/lisp/os-utils/") - ("kermit.el" - "additions to shell mode for use with kermit, etc." - (comm) - "/home/martin/x/packages/lisp/os-utils/") - ("ledit.el" - "Emacs side of ledit interface" - nil - "/home/martin/x/packages/lisp/os-utils/") - ("lpr.el" - "print Emacs buffer on line printer." - (unix) - "/home/martin/x/packages/lisp/os-utils/") - ("mchat.el" - "Multicast Chatting package for XEmacs." - (comm processes) - "/home/martin/x/packages/lisp/os-utils/") - ("ps-print.el" - "Jim's Pretty-Good PostScript Generator for Emacs 19." - (print postscript) - "/home/martin/x/packages/lisp/os-utils/") - ("rlogin.el" - "remote login interface" - (unix comm) - "/home/martin/x/packages/lisp/os-utils/") - ("spell.el" - "spelling correction interface for Emacs." - (wp unix) - "/home/martin/x/packages/lisp/os-utils/") - ("ssh.el" - "remote login interface" - (unix comm) - "/home/martin/x/packages/lisp/os-utils/") - ("tar-mode.el" - "simple editing of tar files from GNU emacs" - (unix) - "/home/martin/x/packages/lisp/os-utils/") - ("telnet.el" - "run a telnet session from within an Emacs buffer" - (comm unix) - "/home/martin/x/packages/lisp/os-utils/") - ("terminal.el" - "terminal emulator for GNU Emacs." - (comm terminals) - "/home/martin/x/packages/lisp/os-utils/") - ("uncompress.el" - "auto-decompression hook for visiting .Z files" - (unix extensions) - "/home/martin/x/packages/lisp/os-utils/") - ("delbs.el" - "a small lisp package to allow you to swap around DEL/BS keys" - (lisp terminals) - "/home/martin/x/packages/lisp/pc/") - ("fusion.el" - "CodeWright Fusion-style motion and text selection" - (keyboard selection region) - "/home/martin/x/packages/lisp/pc/") - ("pc-select.el" - "PC shift selection minor mode for XEmacs" - (hardware mouse) - "/home/martin/x/packages/lisp/pc/") - ("pending-del.el" - "Making insertions replace any selected text." - nil - "/home/martin/x/packages/lisp/pc/") - ("s-region.el" - "set region using shift key." - (terminals) - "/home/martin/x/packages/lisp/pc/") - ("dired-cvs.el" - "Extensions to dired." - nil - "/home/martin/x/packages/lisp/pcl-cvs/") - ("generic-sc.el" - "generic interface to source control systems" - (tools unix) - "/home/martin/x/packages/lisp/pcl-cvs/") - ("pcl-cvs.el" - "A Front-end to CVS. Release R-2_0-Beta_2." - (cvs version control release management) - "/home/martin/x/packages/lisp/pcl-cvs/") - ("ph.el" - "Client for the CCSO directory system (aka PH/QI)" - (help) - "/home/martin/x/packages/lisp/ph/") - ("asm-mode.el" - "mode for editing assembler code" - (tools languages) - "/home/martin/x/packages/lisp/prog-modes/") - ("autoconf-mode.el" - "autoconf code editing commands for Emacs" - (languages faces m4 configure) - "/home/martin/x/packages/lisp/prog-modes/") - ("awk-mode.el" - "AWK code editing commands for Emacs" - (unix languages) - "/home/martin/x/packages/lisp/prog-modes/") - ("cl-indent.el" - "enhanced lisp-indent mode" - (lisp tools) - "/home/martin/x/packages/lisp/prog-modes/") - ("cperl-mode.el" - "Perl code editing commands for XEmacs" - (languages) - "/home/martin/x/packages/lisp/prog-modes/") - ("cvs.el" - "Light cvs support for emacs (ediff + msb + dired + mode line)" - (cvs ediff mode-line) - "/home/martin/x/packages/lisp/prog-modes/") - ("f90.el" - "Fortran-90 mode (free format)" - (fortran f90 languages) - "/home/martin/x/packages/lisp/prog-modes/") - ("fortran-misc.el" - "Routines than can be used with fortran mode." - (languages) - "/home/martin/x/packages/lisp/prog-modes/") - ("fortran.el" - "Fortran mode for GNU Emacs" - (languages) - "/home/martin/x/packages/lisp/prog-modes/") - ("icon.el" - "mode for editing Icon code" - (languages) - "/home/martin/x/packages/lisp/prog-modes/") - ("ksh-mode.el" - "sh (ksh, bash) script editing mode for GNU Emacs." - (shell korn bourne sh ksh bash) - "/home/martin/x/packages/lisp/prog-modes/") - ("m4-mode.el" - "m4 code editing commands for Emacs" - (languages faces) - "/home/martin/x/packages/lisp/prog-modes/") - ("make-mode.el" - "makefile editing commands for Emacs" - (unix tools) - "/home/martin/x/packages/lisp/prog-modes/") - ("modula2.el" - "Modula-2 editing support package" - (languages) - "/home/martin/x/packages/lisp/prog-modes/") - ("pascal.el" - "major mode for editing pascal source in Emacs" - (languages) - "/home/martin/x/packages/lisp/prog-modes/") - ("perl-mode.el" - "Perl code editing commands for GNU Emacs" - (languages) - "/home/martin/x/packages/lisp/prog-modes/") - ("postscript.el" - "major mode for editing PostScript programs" - (langauges) - "/home/martin/x/packages/lisp/prog-modes/") - ("prolog.el" - "major mode for editing and running Prolog under Emacs" - (languages) - "/home/martin/x/packages/lisp/prog-modes/") - ("python-mode.el" - "Major mode for editing Python programs" - (python languages oop) - "/home/martin/x/packages/lisp/prog-modes/") - ("rexx-mode.el" - "major mode for editing REXX program files" - (languages) - "/home/martin/x/packages/lisp/prog-modes/") - ("simula.el" - "SIMULA 87 code editing commands for Emacs" - (languages) - "/home/martin/x/packages/lisp/prog-modes/") - ("sql.el" - "specialized comint.el for SQL interpreters" - (processes sql) - "/home/martin/x/packages/lisp/prog-modes/") - ("tcl.el" - "Tcl code editing commands for Emacs" - (languages) - "/home/martin/x/packages/lisp/prog-modes/") - ("teco.el" - "Teco interpreter for Gnu Emacs, version 1." - (emulators) - "/home/martin/x/packages/lisp/prog-modes/") - ("verilog-mode.el" - "major mode for editing verilog source in Emacs" - (languages) - "/home/martin/x/packages/lisp/prog-modes/") - ("vrml-mode.el" - "major mode for editing VRML (.wrl) files" - (languages vrml modes) - "/home/martin/x/packages/lisp/prog-modes/") - ("iso-sgml.el" - "display SGML entity references as ISO 8859-1 characters" - (sgml html iso latin i18n) - "/home/martin/x/packages/lisp/psgml/") - ("psgml-api.el" - "Extra API functions for PSGML" - nil - "/home/martin/x/packages/lisp/psgml/") - ("psgml-dtd.el" - "DTD parser for SGML-editing mode with parsing support" - nil - "/home/martin/x/packages/lisp/psgml/") - ("psgml-edit.el" - "Editing commands for SGML-mode with parsing support" - nil - "/home/martin/x/packages/lisp/psgml/") - ("psgml-fs.el" - "Format a SGML-file according to a style file" - nil - "/home/martin/x/packages/lisp/psgml/") - ("psgml-html.el" - "HTML mode in conjunction with PSGML" - nil - "/home/martin/x/packages/lisp/psgml/") - ("psgml-other.el" - "Part of SGML-editing mode with parsing support" - nil - "/home/martin/x/packages/lisp/psgml/") - ("psgml-parse.el" - "Parser for SGML-editing mode with parsing support" - nil - "/home/martin/x/packages/lisp/psgml/") - ("psgml-xemacs.el" - "Part of SGML-editing mode with parsing support" - nil - "/home/martin/x/packages/lisp/psgml/") - ("psgml.el" - "SGML-editing mode with parsing support" - (languages) - "/home/martin/x/packages/lisp/psgml/") - ("reftex.el" - "Minor mode for doing \\label, \\ref and \\cite in LaTeX" - (tex) - "/home/martin/x/packages/lisp/reftex/") - ("rmail-kill.el" - "Mail filtering for rmail" - (mail) - "/home/martin/x/packages/lisp/rmail/") - ("rmail-xemacs.el" - "Mouse and font support for RMAIL running on XEmacs" - (mail) - "/home/martin/x/packages/lisp/rmail/") - ("rmail.el" - "main code of \"RMAIL\" mail reader for Emacs." - (mail) - "/home/martin/x/packages/lisp/rmail/") - ("rmailedit.el" - "\"RMAIL edit mode\" Edit the current message." - (mail) - "/home/martin/x/packages/lisp/rmail/") - ("rmailkwd.el" - "part of the \"RMAIL\" mail reader for Emacs." - (mail) - "/home/martin/x/packages/lisp/rmail/") - ("rmailmsc.el" - "miscellaneous support functions for the RMAIL mail reader" - (mail) - "/home/martin/x/packages/lisp/rmail/") - ("rmailsort.el" - "Rmail: sort messages." - (mail) - "/home/martin/x/packages/lisp/rmail/") - ("rmailsum.el" - "make summary buffers for the mail reader" - (mail) - "/home/martin/x/packages/lisp/rmail/") - ("undigest.el" - "digest-cracking support for the RMAIL mail reader" - (mail) - "/home/martin/x/packages/lisp/rmail/") - ("unrmail.el" - "convert Rmail files to mailbox files." - (mail) - "/home/martin/x/packages/lisp/rmail/") - ("cmuscheme.el" - "Scheme process in a buffer. Adapted from tea.el." - (processes lisp) - "/home/martin/x/packages/lisp/scheme/") - ("cmuscheme48.el" - "Scheme process in a buffer. Adapted from cmuscheme.el." - nil - "/home/martin/x/packages/lisp/scheme/") - ("scheme.el" - "Scheme (and DSSSL) editing mode." - (languages lisp) - "/home/martin/x/packages/lisp/scheme/") - ("xscheme.el" - "Run MIT-Scheme under XEmacs" - (languages lisp) - "/home/martin/x/packages/lisp/scheme/") - ("linuxdoc-sgml.el" - "sgml-mode enhancements for linuxdoc" - (docs languages) - "/home/martin/x/packages/lisp/sgml/") - ("sgml-mode.el" - "SGML- and HTML-editing modes" - (wp hypermedia comm languages) - "/home/martin/x/packages/lisp/sgml/") - ("executable.el" - "base functionality for executable interpreter scripts" - (languages unix) - "/home/martin/x/packages/lisp/sh-script/") - ("sh-script.el" - "shell-script editing commands for Emacs" - (languages unix) - "/home/martin/x/packages/lisp/sh-script/") - ("color-selector.el" - "a graphical widget of three sliders to change faces. " - (extensions faces) - "/home/martin/x/packages/lisp/slider/") - ("slider.el" - "graphical sliders for XEmacs. (c) 1997" - (utilities) - "/home/martin/x/packages/lisp/slider/") - ("sb-gud.el" - "Speedbar support for the Grand Unified Debugger" - (tools gud) - "/home/martin/x/packages/lisp/speedbar/") - ("sb-info.el" - "Speedbar support for Info" - (file tags tools) - "/home/martin/x/packages/lisp/speedbar/") - ("sb-rmail.el" - "Speedbar support for rmail" - (file tags tools) - "/home/martin/x/packages/lisp/speedbar/") - ("sb-w3.el" - "Speedbar support for w3." - (file tags tools) - "/home/martin/x/packages/lisp/speedbar/") - ("speedbar.el" - "quick access to files and tags" - (file tags tools) - "/home/martin/x/packages/lisp/speedbar/") - ("speedbspec.el" - "Buffer specialized configurations for speedbar" - (file tags tools) - "/home/martin/x/packages/lisp/speedbar/") - ("strokes.el" - "Control XEmacs through mouse strokes --" - (lisp mouse extensions) - "/home/martin/x/packages/lisp/strokes/") - ("supercite.el" - "minor mode for citing mail and news replies" - (citation attribution mail news article reply followup) - "/home/martin/x/packages/lisp/supercite/") - ("detexinfo.el" - "remove Texinfo commands from a Texinfo source file" - (tex docs) - "/home/martin/x/packages/lisp/texinfo/") - ("informat.el" - "info support functions package for Emacs" - (help) - "/home/martin/x/packages/lisp/texinfo/") - ("makeinfo.el" - "run makeinfo conveniently" - nil - "/home/martin/x/packages/lisp/texinfo/") - ("tex-mode.el" - "TeX, LaTeX, and SliTeX mode commands." - nil - "/home/martin/x/packages/lisp/texinfo/") - ("texinfmt.el" - "format Texinfo files into Info files." - nil - "/home/martin/x/packages/lisp/texinfo/") - ("texinfo.el" - "major mode for editing Texinfo files" - (maint tex docs) - "/home/martin/x/packages/lisp/texinfo/") - ("texnfo-upd.el" - "utilities for updating nodes and menus in Texinfo files" - (maint tex docs) - "/home/martin/x/packages/lisp/texinfo/") - ("autoinsert.el" - "automatic mode-dependent insertion of text into new files" - nil - "/home/martin/x/packages/lisp/text-modes/") - ("flyspell.el" - "On-the-fly spell checker" - (convenience) - "/home/martin/x/packages/lisp/text-modes/") - ("folding.el" - "A folding-editor-like minor mode." - (tools) - "/home/martin/x/packages/lisp/text-modes/") - ("hexl.el" - "edit a file in a hex dump format using the hexl filter." - (data) - "/home/martin/x/packages/lisp/text-modes/") - ("image-mode.el" - "Major mode for navigate images" - (image graphics) - "/home/martin/x/packages/lisp/text-modes/") - ("iso-acc.el" - "minor mode providing electric accent keys" - (i18n) - "/home/martin/x/packages/lisp/text-modes/") - ("iso-ascii.el" - "set up char tables for ISO 8859/1 on ASCII terminals." - (i18n) - "/home/martin/x/packages/lisp/text-modes/") - ("iso-cvt.el" - "translate to ISO 8859-1 from/to net/TeX conventions" - (tex iso latin i18n) - "/home/martin/x/packages/lisp/text-modes/") - ("iso-insert.el" - "insert functions for ISO 8859/1." - (i18n) - "/home/martin/x/packages/lisp/text-modes/") - ("iso-swed.el" - "set up char tables for ISO 8859/1 for Swedish/Finnish ttys" - (i18n) - "/home/martin/x/packages/lisp/text-modes/") - ("nroff-mode.el" - "GNU Emacs major mode for editing nroff source" - (wp) - "/home/martin/x/packages/lisp/text-modes/") - ("scribe.el" - "scribe mode, and its idiosyncratic commands." - (wp) - "/home/martin/x/packages/lisp/text-modes/") - ("swedish.el" - "miscellaneous functions for dealing with Swedish." - (i18n) - "/home/martin/x/packages/lisp/text-modes/") - ("tabify.el" - "tab conversion commands for XEmacs" - nil - "/home/martin/x/packages/lisp/text-modes/") - ("underline.el" - "insert/remove underlining (done by overstriking) in Emacs." - (wp) - "/home/martin/x/packages/lisp/text-modes/") - ("whitespace-mode.el" - "minor mode for making whitespace visible" - (modes extensions) - "/home/martin/x/packages/lisp/text-modes/") - ("winmgr-mode.el" - "generic window manager mode" - (languages) - "/home/martin/x/packages/lisp/text-modes/") - ("ws-mode.el" - "WordStar emulation mode for GNU Emacs" - (emulations) - "/home/martin/x/packages/lisp/text-modes/") - ("xpm-mode.el" - "minor mode for editing XPM files" - (data tools) - "/home/martin/x/packages/lisp/text-modes/") - ("xrdb-mode.el" - "mode for editing X resource database files" - (data languages) - "/home/martin/x/packages/lisp/text-modes/") - ("bib-mode.el" - "bib-mode, major mode for editing bib files." - (bib) - "/home/martin/x/packages/lisp/textools/") - ("bibtex.el" - "BibTeX mode for GNU Emacs" - (bibtex latex tex) - "/home/martin/x/packages/lisp/textools/") - ("doctex.el" - "grind GNU Emacs DOC file into LaTeX input" - (tex docs) - "/home/martin/x/packages/lisp/textools/") - ("refbib.el" - "convert refer-style references to ones usable by Latex bib" - (bib tex) - "/home/martin/x/packages/lisp/textools/") - ("time.el" - "display time and load in mode line of Emacs." - nil - "/home/martin/x/packages/lisp/time/") - ("char-util.el" - "character utility" - (character emacs/mule) - "/home/martin/x/packages/lisp/tm/") - ("cless.el" - "Common lisp and Emacs Lisp source sharing" - (common lisp) - "/home/martin/x/packages/lisp/tm/") - ("gnus-art-mime.el" - "MIME extension for article mode of Gnus" - (news mime multimedia multilingual encoded-word) - "/home/martin/x/packages/lisp/tm/") - ("gnus-charset.el" - "MIME charset extension for Gnus" - (news mime multimedia multilingual encoded-word) - "/home/martin/x/packages/lisp/tm/") - ("gnus-mime.el" - "MIME extensions for Gnus" - (news mime multimedia multilingual encoded-word) - "/home/martin/x/packages/lisp/tm/") - ("gnus-sum-mime.el" - "MIME extension for summary mode of Gnus" - (news mime multimedia multilingual encoded-word) - "/home/martin/x/packages/lisp/tm/") - ("latex-math-symbol.el" - "LaTeX math symbol decoder" - (latex math mule) - "/home/martin/x/packages/lisp/tm/") - ("message-mime.el" - "MIME extensions for message.el" - (news mime multimedia multilingual encoded-word) - "/home/martin/x/packages/lisp/tm/") - ("mime-setup.el" - "setup file for tm viewer and composer." - (mail news mime multimedia multilingual encoded-word) - "/home/martin/x/packages/lisp/tm/") - ("mu-bbdb.el" - "`attribution' function for mu-cite with BBDB." - nil - "/home/martin/x/packages/lisp/tm/") - ("mu-cite.el" - "yet another citation tool for GNU Emacs" - (mail news citation) - "/home/martin/x/packages/lisp/tm/") - ("range.el" - "range functions" - (range) - "/home/martin/x/packages/lisp/tm/") - ("signature.el" - "a signature utility for GNU Emacs" - (mail news signature) - "/home/martin/x/packages/lisp/tm/") - ("texi-util.el" - "Texinfo utility" - (texinfo) - "/home/martin/x/packages/lisp/tm/") - ("tl-atype.el" - "atype functions" - (atype) - "/home/martin/x/packages/lisp/tm/") - ("tl-list.el" - "utility functions about list" - (list) - "/home/martin/x/packages/lisp/tm/") - ("tl-misc.el" - "miscellaneous utility of tl." - (load-path module structure) - "/home/martin/x/packages/lisp/tm/") - ("tl-seq.el" - "sequence functions" - (sequence) - "/home/martin/x/packages/lisp/tm/") - ("tl-str.el" - "Emacs Lisp Library module about string" - (string) - "/home/martin/x/packages/lisp/tm/") - ("tm-bbdb.el" - "tm shared module for BBDB" - (mail news mime multimedia multilingual bbdb) - "/home/martin/x/packages/lisp/tm/") - ("tm-def.el" - "definition module for tm" - (mail news mime multimedia definition) - "/home/martin/x/packages/lisp/tm/") - ("tm-edit-mc.el" - "Mailcrypt interface for tm-edit" - (mail news mime multimedia multilingual security pgp) - "/home/martin/x/packages/lisp/tm/") - ("tm-edit.el" - "Simple MIME Composer for GNU Emacs" - (mail news mime multimedia multilingual) - "/home/martin/x/packages/lisp/tm/") - ("tm-ew-d.el" - "RFC 2047 based encoded-word decoder for GNU Emacs" - (encoded-word mime multilingual header mail news) - "/home/martin/x/packages/lisp/tm/") - ("tm-ew-e.el" - "RFC 2047 based encoded-word encoder for GNU Emacs" - (encoded-word mime multilingual header mail news) - "/home/martin/x/packages/lisp/tm/") - ("tm-file.el" - "tm-view internal method for file extraction" - (mail news mime multimedia file extract) - "/home/martin/x/packages/lisp/tm/") - ("tm-ftp.el" - "tm-view internal method for anonymous ftp" - (anonymous ftp mime multimedia mail news) - "/home/martin/x/packages/lisp/tm/") - ("tm-image.el" - "tm-view filter to display images in XEmacs or MULE buffers" - (image picture x-face mime multimedia mail news) - "/home/martin/x/packages/lisp/tm/") - ("tm-mail.el" - "mail-mode extension." - (mail mime multimedia) - "/home/martin/x/packages/lisp/tm/") - ("tm-mh-e.el" - "MIME extension for mh-e" - (mail mh mime multimedia encoded-word multilingual) - "/home/martin/x/packages/lisp/tm/") - ("tm-parse.el" - "MIME message parser" - (mail news mime multimedia) - "/home/martin/x/packages/lisp/tm/") - ("tm-partial.el" - "Grabbing all MIME \"message/partial\"s." - (mail news mime multimedia message/partial) - "/home/martin/x/packages/lisp/tm/") - ("tm-pgp.el" - "tm-view internal methods for PGP." - (mail news mime multimedia pgp security) - "/home/martin/x/packages/lisp/tm/") - ("tm-play.el" - "decoder for tm-view.el" - (mail news mime multimedia) - "/home/martin/x/packages/lisp/tm/") - ("tm-rmail.el" - "MIME extension for RMAIL" - (mail mime multimedia multilingual encoded-word) - "/home/martin/x/packages/lisp/tm/") - ("tm-setup.el" - "setup file for tm viewer." - (mail news mime multimedia multilingual encoded-word) - "/home/martin/x/packages/lisp/tm/") - ("tm-view.el" - "interactive MIME viewer for GNU Emacs" - (mail news mime multimedia) - "/home/martin/x/packages/lisp/tm/") - ("tm-vm.el" - "tm-MUA (MIME Extension module) for VM" - (mail mime multimedia multilingual encoded-word) - "/home/martin/x/packages/lisp/tm/") - ("tmh-comp.el" - "tm-mh-e functions for composing messages" - (mail mh mime multimedia encoded-word multilingual) - "/home/martin/x/packages/lisp/tm/") - ("tu-comment.el" - "a comment out utility for Lisp programs." - (comment lisp) - "/home/martin/x/packages/lisp/tm/") - ("tu-replace.el" - "a replacing utility for GNU Emacs" - (replace) - "/home/martin/x/packages/lisp/tm/") - ("tpu-doc.el" - "Documentation for TPU-edt" - (emulations) - "/home/martin/x/packages/lisp/tpu/") - ("tpu-edt.el" - "Emacs emulating TPU emulating EDT" - (emulations) - "/home/martin/x/packages/lisp/tpu/") - ("tpu-extras.el" - "Scroll margins and free cursor mode for TPU-edt" - (emulations) - "/home/martin/x/packages/lisp/tpu/") - ("tpu-mapper.el" - "Create a TPU-edt X-windows keymap file" - (emulations) - "/home/martin/x/packages/lisp/tpu/") - ("vc-hooks.el" - "resident support for version-control" - nil - "/home/martin/x/packages/lisp/vc/") - ("vc.el" - "drive a version-control system from within Emacs" - nil - "/home/martin/x/packages/lisp/vc/") - ("vhdl-mode.el" - "major mode for editing VHDL code" - (languages vhdl) - "/home/martin/x/packages/lisp/vhdl/") - ("view-process-mode.el" - "Display current running processes" - (processes) - "/home/martin/x/packages/lisp/view-process/") - ("view-process-system-specific.el" - "System specific stuff for view-process" - (processes) - "/home/martin/x/packages/lisp/view-process/") - ("view-process-xemacs.el" - "XEmacs specific code for view-process" - (processes) - "/home/martin/x/packages/lisp/view-process/") - ("viper-cmd.el" - "Vi command support for Viper" - nil - "/home/martin/x/packages/lisp/viper/") - ("viper-ex.el" - "functions implementing the Ex commands for Viper" - nil - "/home/martin/x/packages/lisp/viper/") - ("viper-init.el" - "some common definitions for Viper" - nil - "/home/martin/x/packages/lisp/viper/") - ("viper-keym.el" - "Viper keymaps" - nil - "/home/martin/x/packages/lisp/viper/") - ("viper-macs.el" - "functions implementing keyboard macros for Viper" - nil - "/home/martin/x/packages/lisp/viper/") - ("viper-mous.el" - "mouse support for Viper" - nil - "/home/martin/x/packages/lisp/viper/") - ("viper-util.el" - "Utilities used by viper.el" - nil - "/home/martin/x/packages/lisp/viper/") - ("viper.el" - "A full-featured Vi emulator for GNU Emacs and XEmacs," - (emulations) - "/home/martin/x/packages/lisp/viper/") - ("vm-easymenu.el" - "support the easymenu interface for defining a menu." - (emulations) - "/home/martin/x/packages/lisp/vm/") - ("vm-loaddefs.el" - "autoloads for VM formerly in loaddefs.el" - (mail dumped) - "/home/martin/x/packages/lisp/vm/") - ("base64.el" - "Base64 encoding functions" - (extensions) - "/home/martin/x/packages/lisp/w3/") - ("css.el" - "Cascading Style Sheet parser" - nil - "/home/martin/x/packages/lisp/w3/") - ("dsssl-flow.el" - "DSSSL flow objects" - nil - "/home/martin/x/packages/lisp/w3/") - ("dsssl.el" - "DSSSL parser" - nil - "/home/martin/x/packages/lisp/w3/") - ("images.el" - "Automatic image converters" - (images) - "/home/martin/x/packages/lisp/w3/") - ("mm.el" - "Mailcap parsing routines, and MIME handling" - (mail news hypermedia) - "/home/martin/x/packages/lisp/w3/") - ("mule-sysdp.el" - "consolidate MULE-version dependencies in one file." - (lisp tools) - "/home/martin/x/packages/lisp/w3/") - ("socks.el" - "A Socks v5 Client for Emacs" - (comm firewalls) - "/home/martin/x/packages/lisp/w3/") - ("ssl.el" - "ssl functions for emacsen without them builtin" - (comm) - "/home/martin/x/packages/lisp/w3/") - ("url-auth.el" - "Uniform Resource Locator authorization modules" - (comm data processes hypermedia) - "/home/martin/x/packages/lisp/w3/") - ("url-cache.el" - "Uniform Resource Locator retrieval tool" - (comm data processes hypermedia) - "/home/martin/x/packages/lisp/w3/") - ("url-cookie.el" - "Netscape Cookie support" - (comm data processes hypermedia) - "/home/martin/x/packages/lisp/w3/") - ("url-file.el" - "File retrieval code" - (comm data processes) - "/home/martin/x/packages/lisp/w3/") - ("url-gopher.el" - "Gopher Uniform Resource Locator retrieval code" - (comm data processes) - "/home/martin/x/packages/lisp/w3/") - ("url-gw.el" - "Gateway munging for URL loading" - (comm data processes) - "/home/martin/x/packages/lisp/w3/") - ("url-http.el" - "HTTP Uniform Resource Locator retrieval code" - (comm data processes) - "/home/martin/x/packages/lisp/w3/") - ("url-irc.el" - "IRC URL interface" - (comm data processes) - "/home/martin/x/packages/lisp/w3/") - ("url-mail.el" - "Mail Uniform Resource Locator retrieval code" - (comm data processes) - "/home/martin/x/packages/lisp/w3/") - ("url-misc.el" - "Misc Uniform Resource Locator retrieval code" - (comm data processes) - "/home/martin/x/packages/lisp/w3/") - ("url-news.el" - "News Uniform Resource Locator retrieval code" - (comm data processes) - "/home/martin/x/packages/lisp/w3/") - ("url-nfs.el" - "NFS URL interface" - (comm data processes) - "/home/martin/x/packages/lisp/w3/") - ("url-ns.el" - "Various netscape-ish functions for proxy definitions" - (comm data processes hypermedia) - "/home/martin/x/packages/lisp/w3/") - ("url-parse.el" - "Uniform Resource Locator parser" - (comm data processes) - "/home/martin/x/packages/lisp/w3/") - ("url-vars.el" - "Variables for Uniform Resource Locator tool" - (comm data processes hypermedia) - "/home/martin/x/packages/lisp/w3/") - ("url.el" - "Uniform Resource Locator retrieval tool" - (comm data processes hypermedia) - "/home/martin/x/packages/lisp/w3/") - ("w3-about.el" - "About pages for emacs-w3" - (hypermedia) - "/home/martin/x/packages/lisp/w3/") - ("w3-cfg.el" - "Configuration info from Emacs/W3" - (hypermedia) - "/home/martin/x/packages/lisp/w3/") - ("w3-cus.el" - "Customization support for Emacs-W3" - (comm help hypermedia) - "/home/martin/x/packages/lisp/w3/") - ("w3-display.el" - "display engine" - (faces help hypermedia) - "/home/martin/x/packages/lisp/w3/") - ("w3-e19.el" - "Emacs 19.xx specific functions for emacs-w3" - (faces help mouse hypermedia) - "/home/martin/x/packages/lisp/w3/") - ("w3-e20.el" - "Emacs 20.xx specific functions for emacs-w3" - (faces help mouse hypermedia) - "/home/martin/x/packages/lisp/w3/") - ("w3-elisp.el" - "Scripting support for emacs-lisp" - (hypermedia scripting) - "/home/martin/x/packages/lisp/w3/") - ("w3-emulate.el" - "All variable definitions for emacs-w3" - (comm help hypermedia) - "/home/martin/x/packages/lisp/w3/") - ("w3-forms.el" - "Emacs-w3 forms parsing code for new display engine" - (faces help comm data languages) - "/home/martin/x/packages/lisp/w3/") - ("w3-hot.el" - "Main functions for emacs-w3 on all platforms/versions" - (faces help comm news mail processes mouse hypermedia) - "/home/martin/x/packages/lisp/w3/") - ("w3-imap.el" - "Imagemap functions" - (hypermedia) - "/home/martin/x/packages/lisp/w3/") - ("w3-jscript.el" - "Scripting support for javascript" - (hypermedia scripting) - "/home/martin/x/packages/lisp/w3/") - ("w3-keyword.el" - "Emacs-W3 binding style sheet mechanism" - (hypermedia) - "/home/martin/x/packages/lisp/w3/") - ("w3-latex.el" - "Emacs-W3 printing via LaTeX" - (hypermedia printing typesetting) - "/home/martin/x/packages/lisp/w3/") - ("w3-menu.el" - "Menu functions for emacs-w3" - (menu hypermedia) - "/home/martin/x/packages/lisp/w3/") - ("w3-mouse.el" - "Mouse specific functions for emacs-w3" - (mouse hypermedia) - "/home/martin/x/packages/lisp/w3/") - ("w3-prefs.el" - "Preferences panels for Emacs-W3" - (hypermedia preferences) - "/home/martin/x/packages/lisp/w3/") - ("w3-print.el" - "Printing support for emacs-w3" - (faces help printing hypermedia) - "/home/martin/x/packages/lisp/w3/") - ("w3-props.el" - "Additional text property stuff" - (faces) - "/home/martin/x/packages/lisp/w3/") - ("w3-script.el" - "Scripting support" - (hypermedia scripting) - "/home/martin/x/packages/lisp/w3/") - ("w3-speak.el" - "Emacs-W3 speech interface" - (hypermedia speech) - "/home/martin/x/packages/lisp/w3/") - ("w3-style.el" - "Emacs/W3 binding style sheet mechanism" - (faces hypermedia) - "/home/martin/x/packages/lisp/w3/") - ("w3-sysdp.el" - "consolidate Emacs-version dependencies in one file." - (lisp tools) - "/home/martin/x/packages/lisp/w3/") - ("w3-toolbar.el" - "Toolbar functions for emacs-w3" - (mouse toolbar) - "/home/martin/x/packages/lisp/w3/") - ("w3-vars.el" - "All variable definitions for emacs-w3" - (comm help hypermedia) - "/home/martin/x/packages/lisp/w3/") - ("w3-widget.el" - "An image widget" - (faces images) - "/home/martin/x/packages/lisp/w3/") - ("w3-xemac.el" - "XEmacs specific functions for emacs-w3" - (faces help mouse hypermedia) - "/home/martin/x/packages/lisp/w3/") - ("w3.el" - "Main functions for emacs-w3 on all platforms/versions" - (faces help comm news mail processes mouse hypermedia) - "/home/martin/x/packages/lisp/w3/") - ("add-log.el" - "change log maintenance commands for Emacs" - (maint) - "/home/martin/x/packages/lisp/xemacs-base/") - ("advice.el" - "an overloading mechanism for Emacs Lisp functions" - (extensions lisp tools) - "/home/martin/x/packages/lisp/xemacs-base/") - ("annotations.el" - "interface to marginal annotations" - (extensions hypermedia outlines) - "/home/martin/x/packages/lisp/xemacs-base/") - ("assoc.el" - "insert/delete/sort functions on association lists" - (extensions) - "/home/martin/x/packages/lisp/xemacs-base/") - ("case-table.el" - "code to extend the character set and support case tables." - (i18n) - "/home/martin/x/packages/lisp/xemacs-base/") - ("chistory.el" - "list command history" - nil - "/home/martin/x/packages/lisp/xemacs-base/") - ("comint-xemacs.el" - "Face customizations for comint" - (help faces) - "/home/martin/x/packages/lisp/xemacs-base/") - ("comint.el" - "general command interpreter in a window stuff" - (processes) - "/home/martin/x/packages/lisp/xemacs-base/") - ("compile.el" - "run compiler as inferior of Emacs, parse error messages." - (tools processes) - "/home/martin/x/packages/lisp/xemacs-base/") - ("debug.el" - "debuggers and related commands for XEmacs" - nil - "/home/martin/x/packages/lisp/xemacs-base/") - ("ebuff-menu.el" - "electric-buffer-list mode" - (frames) - "/home/martin/x/packages/lisp/xemacs-base/") - ("echistory.el" - "Electric Command History Mode" - (extensions) - "/home/martin/x/packages/lisp/xemacs-base/") - ("edmacro.el" - "keyboard macro editor" - (abbrev internal) - "/home/martin/x/packages/lisp/xemacs-base/") - ("ehelp.el" - "bindings for electric-help mode" - (help extensions) - "/home/martin/x/packages/lisp/xemacs-base/") - ("electric.el" - "window maker and Command loop for `electric' modes." - (extensions) - "/home/martin/x/packages/lisp/xemacs-base/") - ("enriched.el" - "read and save files in text/enriched format" - (wp faces) - "/home/martin/x/packages/lisp/xemacs-base/") - ("env.el" - "functions to manipulate environment variables." - (processes unix) - "/home/martin/x/packages/lisp/xemacs-base/") - ("facemenu.el" - "create a face menu for interactively adding fonts to text" - (faces) - "/home/martin/x/packages/lisp/xemacs-base/") - ("ffap.el" - "find file (or url) at point" - (files hypermedia matching mouse) - "/home/martin/x/packages/lisp/xemacs-base/") - ("helper.el" - "utility help package supporting help in electric modes" - (help) - "/home/martin/x/packages/lisp/xemacs-base/") - ("imenu.el" - "Framework for mode-specific buffer indexes." - (tools) - "/home/martin/x/packages/lisp/xemacs-base/") - ("iso-syntax.el" - "set up case-conversion and syntax tables for ISO 8859/1" - (i18n) - "/home/martin/x/packages/lisp/xemacs-base/") - ("macros.el" - "non-primitive commands for keyboard macros." - (abbrev) - "/home/martin/x/packages/lisp/xemacs-base/") - ("novice.el" - "handling of disabled commands (\"novice mode\") for XEmacs." - (internal help) - "/home/martin/x/packages/lisp/xemacs-base/") - ("outline.el" - "outline mode commands for Emacs" - (outlines) - "/home/martin/x/packages/lisp/xemacs-base/") - ("passwd.el" - "Prompting for passwords semi-securely" - (comm extensions) - "/home/martin/x/packages/lisp/xemacs-base/") - ("pp.el" - "pretty printer for Emacs Lisp" - (lisp tools language extensions) - "/home/martin/x/packages/lisp/xemacs-base/") - ("regi.el" - "REGular expression Interpreting engine" - (extensions matching) - "/home/martin/x/packages/lisp/xemacs-base/") - ("ring.el" - "handle rings of items" - (extensions) - "/home/martin/x/packages/lisp/xemacs-base/") - ("shell.el" - "specialized comint.el for running the shell." - (processes shell terminal csh tcsh bash sh) - "/home/martin/x/packages/lisp/xemacs-base/") - ("skeleton.el" - "Lisp language extension for writing statement skeletons" - (extensions abbrev languages tools) - "/home/martin/x/packages/lisp/xemacs-base/") - ("sort.el" - "commands to sort text in an XEmacs buffer." - (unix) - "/home/martin/x/packages/lisp/xemacs-base/") - ("thing.el" - "find language-specific contiguous pieces of text" - (extensions languages) - "/home/martin/x/packages/lisp/xemacs-base/") - ("time-stamp.el" - "Maintain last change time stamps in files edited by Emacs" - (tools) - "/home/martin/x/packages/lisp/xemacs-base/") - ("timezone.el" - "time zone package for XEmacs" - (news) - "/home/martin/x/packages/lisp/xemacs-base/") - ("xbm-button.el" - "Create XBM text buttons under XEmacs" - (frames internal) - "/home/martin/x/packages/lisp/xemacs-base/") - ("xpm-button.el" - "create XPM buttons" - (frames internal) - "/home/martin/x/packages/lisp/xemacs-base/") - ("bench.el" - "benchmarking utility for emacsen" - (internal maint) - "/home/martin/x/packages/lisp/xemacs-devel/") - ("docref.el" - "Simple cross references for Elisp documentation strings" - (docs help lisp) - "/home/martin/x/packages/lisp/xemacs-devel/") - ("eldoc.el" - "show function arglist or variable docstring in echo area" - (extensions) - "/home/martin/x/packages/lisp/xemacs-devel/") - ("elp.el" - "Emacs Lisp Profiler" - (debugging lisp tools) - "/home/martin/x/packages/lisp/xemacs-devel/") - ("eval-expr.el" - "enhanced eval-expression command" - (extensions) - "/home/martin/x/packages/lisp/xemacs-devel/") - ("find-func.el" - "find the definition of the Emacs Lisp function near point" - (emacs-lisp functions variables) - "/home/martin/x/packages/lisp/xemacs-devel/") - ("find-gc.el" - "detect functions that call the garbage collector" - (maint) - "/home/martin/x/packages/lisp/xemacs-devel/") - ("hide-copyleft.el" - "hide obnoxious copyright prologs" - nil - "/home/martin/x/packages/lisp/xemacs-devel/") - ("ielm.el" - "interaction mode for Emacs Lisp" - (lisp) - "/home/martin/x/packages/lisp/xemacs-devel/") - ("pretty-print.el" - "Emacs Lisp pretty printer and macro expander" - (lisp internal) - "/home/martin/x/packages/lisp/xemacs-devel/") - ("profile.el" - "basic profiling commands for XEmacs" - (internal) - "/home/martin/x/packages/lisp/xemacs-devel/") - ("regexp-opt.el" - "generate efficient regexps to match strings." - (strings regexps) - "/home/martin/x/packages/lisp/xemacs-devel/") - ("reposition.el" - "center a Lisp function or comment on the screen" - nil - "/home/martin/x/packages/lisp/xemacs-devel/") - ("trace.el" - "tracing facility for Emacs Lisp functions" - (tools lisp) - "/home/martin/x/packages/lisp/xemacs-devel/") - ("zenirc-18.el" - "compatibility functions for Emacs 18" - (extensions zenirc) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-8ball.el" - "magic 8 ball for ZenIRC" - (zenirc extensions magic 8ball) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-away.el" - "fancy away processing for ZenIRC" - (zenirc extensions oink) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-bork.el" - "Swedish Chef message catalog for ZenIRC" - (extensions) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-color.el" - "color messages in zenirc" - (zenirc extensions) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-complete.el" - "complete commands, nicknames, etc. in ZenIRC" - (zenirc completion extensions oink) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-dcc.el" - "CTCP DCC module for ZenIRC" - (zenirc extensions) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-doto.el" - "do things to who, list, links replies" - (extensions) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-eval.el" - "join the \"mi emacs es tu emacs\" club" - (zenirc extensions eval oink) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-fill.el" - "fill messages in zenirc" - (extensions) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-finnish.el" - "Finnish message catalog for ZenIRC" - (extensions) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-format.el" - "format nick!user@host for zenirc" - (zenirc extensions) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-fortran.el" - "emulate F-BOT FORTRAN bot program with ZenIRC" - (extensions) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-french.el" - "French message catalog for ZenIRC" - (extensions) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-history.el" - "keep a history of commands in ZenIRC" - (zenirc history) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-ignore.el" - "ignore module for zenirc." - (zenirc ignorance) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-iwantop.el" - "IWANTOP ctcp for granting channel operator bits" - (zenirc extensions) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-latin.el" - "Latin message catalog for ZenIRC" - (extensions) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-make.el" - "a hack to set the load path for byte-compiling" - (zenirc make) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-meditate.el" - "admonish others for disturbing your meditation" - (zenirc extensions) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-netsplit.el" - "hide excessive spew from netsplits" - (zenirc extensions) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-notify.el" - "Notifies you when people signon/off" - (zenirc notify extensions) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-oink.el" - "auto-oink" - (zenirc extensions) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-ojnk.el" - "Send ojnks - example of adding commands to zenirc" - (extensions) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-popup.el" - "pop up zenirc buffer window on signal" - (extensions) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-prime-p.el" - "flag prime numbers" - (zenirc extensions oink "mmmm primes") - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-signal.el" - "Fancy signal formatting for ZenIRC" - (extensions) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-stamp.el" - "timestamping for ZenIRC" - (extensions) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-swedish.el" - "Swedish message catalog for ZenIRC" - (extensions) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-yow-filter.el" - "neutralize yowage" - (zenirc extensions oink yow) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc-yow.el" - "important pinheadery for ZenIRC" - (zenirc extensions oink yow) - "/home/martin/x/packages/lisp/zenirc/") - ("zenirc.el" - "Waste time on Internet Relay Chat (ZenIRC client)" - (extensions zenirc) - "/home/martin/x/packages/lisp/zenirc/") - ("dui-registry.el" - "Registry of dui dictionary methods" - (mule dictionary) - "/home/martin/x/mule-packages/lisp/edict/") - ("dui.el" - "Dictionary user interface" - (mule dictionary) - "/home/martin/x/mule-packages/lisp/edict/") - ("edict-edit.el" - "Edit an EDICT dictionary." - (mule edict dictionary) - "/home/martin/x/mule-packages/lisp/edict/") - ("edict-english.el" - "English morphology rules for edict.el" - (mule edict dictionary) - "/home/martin/x/mule-packages/lisp/edict/") - ("edict-japanese.el" - "Japanese morphology rules for edict.el" - (mule edict dictionary) - "/home/martin/x/mule-packages/lisp/edict/") - ("edict-morphology.el" - "morphology rewrite engine for edict.el" - (mule edict dictionary) - "/home/martin/x/mule-packages/lisp/edict/") - ("edict.el" - "Word lookup (with deinflection) in EDICT" - (mule edict dictionary) - "/home/martin/x/mule-packages/lisp/edict/") - ("ts-mode.el" - "Insert time-stamps in buffers" - (minor mode) - "/home/martin/x/mule-packages/lisp/edict/") - ("egg-cwnn-leim.el" - "Egg/CWnn-related code for LEIM" - (japanese input method leim) - "/home/martin/x/mule-packages/lisp/egg-its/") - ("egg-kwnn-leim.el" - "Egg/CWnn-related code for LEIM" - (japanese input method leim) - "/home/martin/x/mule-packages/lisp/egg-its/") - ("egg-leim.el" - "Egg/Wnn-related code for LEIM" - (japanese input method leim) - "/home/martin/x/mule-packages/lisp/egg-its/") - ("egg-sj3-leim.el" - "Egg/SJ3-related code for LEIM" - (japanese input method leim) - "/home/martin/x/mule-packages/lisp/egg-its/") - ("egg-wnn.el" - "a inputting method communicating with [jck]server" - (inputting method) - "/home/martin/x/mule-packages/lisp/egg-its/") - ("cyril-jis.el" - "Quail package for inputting JISX0208 Cyrillic letters" - (multilingual input method cyrillic) - "/home/martin/x/mule-packages/lisp/leim/") - ("cyrillic.el" - "Quail package for inputting Cyrillic characters" - (multilingual input method cyrillic) - "/home/martin/x/mule-packages/lisp/leim/") - ("greek.el" - "Quail package for inputting Greek" - (multilingual input method greek) - "/home/martin/x/mule-packages/lisp/leim/") - ("hangul.el" - "Quail package for inputting Korean Hangul characters" - (multilingual input method korean hangul) - "/home/martin/x/mule-packages/lisp/leim/") - ("hangul3.el" - "Quail package for inputting Korean Hangul characters" - (multilingual input method korean hangul) - "/home/martin/x/mule-packages/lisp/leim/") - ("hanja-jis.el" - "Quail package for inputting Korean Hanja (JISX0208)" - (multilingual input method korean hangul) - "/home/martin/x/mule-packages/lisp/leim/") - ("hanja.el" - "Quail-package for Korean Hanja (KSC5601)" - (multilingual input method korean hanja) - "/home/martin/x/mule-packages/lisp/leim/") - ("ipa.el" - "Quail package for inputting IPA characters" - (multilingual input method ipa) - "/home/martin/x/mule-packages/lisp/leim/") - ("latin-pre.el" - "Quail packages for inputting various European characters." - (mule multilingual latin input method) - "/home/martin/x/mule-packages/lisp/leim/") - ("leim-list.el" - "list of LEIM (Library of Emacs Input Method)" - nil - "/home/martin/x/mule-packages/lisp/leim/") - ("py-punct.el" - "Quail packages for Chinese (pinyin + extra symbols)" - (multilingual input method chienese) - "/home/martin/x/mule-packages/lisp/leim/") - ("pypunct-b5.el" - "Quail packages for Chinese (pinyin + extra symbols)" - (multilingual input method chienese) - "/home/martin/x/mule-packages/lisp/leim/") - ("quail.el" - "Provides simple input method for multilingual text" - (mule multilingual input method) - "/home/martin/x/mule-packages/lisp/leim/") - ("symbol-ksc.el" - "Quail-package for Korean Symbol (KSC5601)" - (multilingual input method korean hangul) - "/home/martin/x/mule-packages/lisp/leim/") - ("arabic.el" - "pre-loaded support for Arabic." - nil - "/home/martin/x/mule-packages/lisp/mule-base/") - ("canna-leim.el" - "Canna-related code for LEIM" - (japanese input method leim) - "/home/martin/x/mule-packages/lisp/mule-base/") - ("canna.el" - "Interface to the Canna input method." - (canna japanese input method mule multilingual) - "/home/martin/x/mule-packages/lisp/mule-base/") - ("char-table.el" - "display table of charset" - (character mule) - "/home/martin/x/mule-packages/lisp/mule-base/") - ("chartblxmas.el" - "display table of charset by pop-up menu" - (character xemacs/mule) - "/home/martin/x/mule-packages/lisp/mule-base/") - ("china-util.el" - "utilities for Chinese" - (mule multilingual chinese) - "/home/martin/x/mule-packages/lisp/mule-base/") - ("chinese.el" - "Support for Chinese" - (multilingual chinese) - "/home/martin/x/mule-packages/lisp/mule-base/") - ("cyril-util.el" - "utilities for Cyrillic scripts" - (mule multilingual cyrillic) - "/home/martin/x/mule-packages/lisp/mule-base/") - ("english.el" - "English support" - (multibyte character character set syntax category) - "/home/martin/x/mule-packages/lisp/mule-base/") - ("european.el" - "Support for European languages" - (multilingual european) - "/home/martin/x/mule-packages/lisp/mule-base/") - ("hebrew.el" - "Support for Hebrew" - (multilingual hebrew) - "/home/martin/x/mule-packages/lisp/mule-base/") - ("isearch-mule.el" - "incremental search with front-end inputting method" - (search) - "/home/martin/x/mule-packages/lisp/mule-base/") - ("japan-util.el" - "utilities for Japanese" - (mule multilingual japanese) - "/home/martin/x/mule-packages/lisp/mule-base/") - ("japanese.el" - "Japanese support" - (multilingual japanese) - "/home/martin/x/mule-packages/lisp/mule-base/") - ("kinsoku.el" - "Kinsoku (line wrap) processing for XEmacs/Mule" - nil - "/home/martin/x/mule-packages/lisp/mule-base/") - ("korean.el" - "Support for Korean" - (multilingual korean) - "/home/martin/x/mule-packages/lisp/mule-base/") - ("misc-lang.el" - "support for miscellaneous languages (characters)" - (multilingual character set coding system) - "/home/martin/x/mule-packages/lisp/mule-base/") - ("mule-category.el" - "category functions for XEmacs/Mule." - nil - "/home/martin/x/mule-packages/lisp/mule-base/") - ("mule-ccl.el" - "CCL (Code Conversion Language) compiler" - (ccl mule multilingual character set coding-system) - "/home/martin/x/mule-packages/lisp/mule-base/") - ("mule-charset.el" - "Charset functions for Mule." - nil - "/home/martin/x/mule-packages/lisp/mule-base/") - ("mule-cmds.el" - "Commands for multilingual environment" - (mule multilingual) - "/home/martin/x/mule-packages/lisp/mule-base/") - ("mule-cne.el" - "interface between input methods Canna and EGG." - nil - "/home/martin/x/mule-packages/lisp/mule-base/") - ("mule-coding.el" - "Coding-system functions for Mule." - nil - "/home/martin/x/mule-packages/lisp/mule-base/") - ("mule-debug.el" - "debugging functions for Mule." - nil - "/home/martin/x/mule-packages/lisp/mule-base/") - ("mule-diag.el" - "Show diagnosis of multilingual environment (MULE)" - (multilingual charset coding system fontset diagnosis) - "/home/martin/x/mule-packages/lisp/mule-base/") - ("mule-files.el" - "File I/O functions for XEmacs/Mule." - nil - "/home/martin/x/mule-packages/lisp/mule-base/") - ("mule-help.el" - "Mule-ized Help functions " - (help internal) - "/home/martin/x/mule-packages/lisp/mule-base/") - ("mule-keyboard.el" - "Direct input of multilingual chars from keyboard." - nil - "/home/martin/x/mule-packages/lisp/mule-base/") - ("mule-misc.el" - "Miscellaneous Mule functions." - nil - "/home/martin/x/mule-packages/lisp/mule-base/") - ("mule-tty-init.el" - "Initialization code for console tty under MULE" - (mule tty console dumped) - "/home/martin/x/mule-packages/lisp/mule-base/") - ("mule-util.el" - "Utility functions for multilingual environment (mule)" - (mule multilingual) - "/home/martin/x/mule-packages/lisp/mule-base/") - ("mule-x-init.el" - "initialization code for X Windows under MULE" - (mule x11) - "/home/martin/x/mule-packages/lisp/mule-base/") - ("thai-util.el" - "utilities for Thai" - (mule multilingual thai) - "/home/martin/x/mule-packages/lisp/mule-base/") - ("thai.el" - "Support for Thai" - (multilingual thai) - "/home/martin/x/mule-packages/lisp/mule-base/") - ("viet-chars.el" - "pre-loaded support for Vietnamese, part 1." - nil - "/home/martin/x/mule-packages/lisp/mule-base/") - ("skk-auto.el" - "$BAw$j2>L>$N<+F0=hM}$N$?$a$N%W%m%0%i%`(B" - (japanese) - "/home/martin/x/mule-packages/lisp/skk/") - ("skk-comp.el" - "$BJd40$N$?$a$N%W%m%0%i%`(B" - (japanese) - "/home/martin/x/mule-packages/lisp/skk/") - ("skk-foreword.el" - "$BA0=q$-(B" - (japanese) - "/home/martin/x/mule-packages/lisp/skk/") - ("skk-gadget.el" - "$B +;; modified by MORIOKA Tomohiko for XEmacs. + +;;; Code: + +;; Ethiopic +(make-charset 'ethiopic "Ethiopic" + '(registry "Ethio" + dimension 2 + chars 94 + final ?3 + graphic 0 + )) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; ETHIOPIC +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define-category ?E "Ethiopic (Ge'ez) character.") +(modify-category-entry 'ethiopic ?E) + +(define-ccl-program ccl-encode-ethio-font + '(0 + ;; In: R0:ethiopic (not checked) + ;; R1:position code 1 + ;; R2:position code 2 + ;; Out: R1:font code point 1 + ;; R2:font code point 2 + ((r1 -= 33) + (r2 -= 33) + (r1 *= 94) + (r2 += r1) + (if (r2 < 256) + (r1 = ?\x12) + (if (r2 < 448) + ((r1 = ?\x13) (r2 -= 256)) + ((r1 = ?\xfd) (r2 -= 208)) + )))) + "CCL program to encode an Ethiopic code to code point of Ethiopic font.") + +;; (setq font-ccl-encoder-alist +;; (cons (cons "ethiopic" ccl-encode-ethio-font) font-ccl-encoder-alist)) +(set-charset-ccl-program 'ethiopic ccl-encode-ethio-font) + +(set-language-info-alist + "Ethiopic" '((setup-function . setup-ethiopic-environment-internal) + (exit-function . exit-ethiopic-environment) + (charset ethiopic) + (coding-system iso-2022-7bit) + (coding-priority iso-2022-7bit) + (input-method . "ethiopic") + (features ethio-util) + (sample-text . "$(3$Q#U!.(B") + (documentation . t))) + +;;; ethiopic.el ends here diff --git a/lisp/mule/mule-files.el b/lisp/mule/mule-files.el deleted file mode 100644 index e228426..0000000 --- a/lisp/mule/mule-files.el +++ /dev/null @@ -1,35 +0,0 @@ -;;; mule-files.el --- File I/O functions for XEmacs/Mule. - -;; Copyright (C) 1992,93,94,95 Free Software Foundation, Inc. -;; Copyright (C) 1995 Amdahl Corporation. -;; Copyright (C) 1995 Sun Microsystems. - -;; This file is part of XEmacs. - -;; XEmacs is free software; you can redistribute it and/or modify it -;; under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; XEmacs is distributed in the hope that it will be useful, but -;; WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. - -;;; Commentary: - -;;; Derived from mule.el in the original Mule but heavily modified -;;; by Ben Wing. Mostly moved to code-files.el - -;; 1997/3/11 modified by MORIOKA Tomohiko to sync with Emacs 20 API. - -;;; Code: - -(setq-default buffer-file-coding-system 'iso-2022-8) - -;;; mule-files.el ends here diff --git a/lisp/mule/thai-xtis.el b/lisp/mule/thai-xtis.el new file mode 100644 index 0000000..1fe6b88 --- /dev/null +++ b/lisp/mule/thai-xtis.el @@ -0,0 +1,300 @@ +;;; thai-xtis.el --- Thai support for pre-composed font (for XTIS). + +;; Copyright (C) 1999 Electrotechnical Laboratory, JAPAN. +;; Licensed to the Free Software Foundation. + +;; Author: TAKAHASHI Naoto +;; MORIOKA Tomohiko +;; Created: 1998-03-27 for Emacs-20.3 by TAKAHASHI Naoto +;; 1999-03-29 imported and modified for XEmacs by MORIOKA Tomohiko + +;; Keywords: mule, multilingual, Thai, XTIS + +;; This file is part of XEmacs. + +;; XEmacs is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; XEmacs is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with XEmacs; see the file COPYING. If not, write to the Free +;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +;; 02111-1307, USA. + +;;; Commentary: + +;; For Thai, the pre-composed character set proposed by +;; Virach Sornlertlamvanich is supported. + +;;; Code: + +(when (featurep 'xemacs) + (make-charset 'thai-xtis "Precomposed Thai (XTIS by Virach)." + '(registry "xtis-0$" + dimension 2 + chars 94 + final ?? + graphic 0)) + + (modify-syntax-entry 'thai-xtis "w") + + (define-category ?T "Precomposed Thai character.") + (modify-category-entry 'thai-xtis ?T) + ) + + +(defvar leading-code-private-21 #x9F) + +(defconst thai-xtis-leading-code + (concat (char-to-string leading-code-private-21) + (char-to-string (charset-id 'thai-xtis)))) + +(define-ccl-program ccl-thai-xtis-consonant + `(0 + (if (r1 == 0) + ((write ,thai-xtis-leading-code) + (write r0) + (r1 = r2)) + (if (r1 == r2) + ((write r1) + (write ,thai-xtis-leading-code) + (write r0)) + ((write r1) + (write ,thai-xtis-leading-code) + (write r0) + (r1 = r2)))))) + +(define-ccl-program ccl-thai-xtis-vowel-d1 + `(0 + (if (r1 == 0) + ((write ,thai-xtis-leading-code) + (write r0 r2)) + (if (r1 == r2) + (r1 = ?\xb8) + ((write r1) + (write ,thai-xtis-leading-code) + (write r0 r2) + (r1 = 0)))))) + +(define-ccl-program ccl-thai-xtis-vowel + `(0 + (if (r1 == 0) + ((write ,thai-xtis-leading-code) + (write r0 r2)) + (if (r1 == r2) + (r1 = ((r0 - 188) << 3)) + ((write r1) + (write ,thai-xtis-leading-code) + (write r0 r2) + (r1 = 0)))))) + +(define-ccl-program ccl-thai-xtis-vowel-ee + `(0 + (if (r1 == 0) + ((write ,thai-xtis-leading-code) + (write r0 r2)) + (if (r1 == r2) + (r1 = ?\xf8) + ((write r1) + (write ,thai-xtis-leading-code) + (write r0 r2) + (r1 = 0)))))) + +(define-ccl-program ccl-thai-xtis-tone + `(0 + (if (r1 == 0) + ((write ,thai-xtis-leading-code) + (write r0 r2)) + (if (r1 == r2) + ((r0 -= 54) + (write r0) + (r1 = 0)) + ((r1 += (r0 - ?\xe6)) + (write r1) + (r1 = 0)))))) + +(define-ccl-program ccl-thai-xtis-symbol + `(0 + (if (r1 == 0) + ((write ,thai-xtis-leading-code) + (write r0 r2)) + (if (r1 == r2) + ((write r2) + (write ,thai-xtis-leading-code) + (write r0 r2) + (r1 = 0)) + ((write r1) + (write ,thai-xtis-leading-code) + (write r0 r2) + (r1 = 0)))))) + +(define-ccl-program ccl-decode-thai-xtis + `(4 + ((read r0) + (r1 = 0) + (r2 = ?\xb0) + (loop + (if (r0 < 161) + (if (r1 == 0) + (write r0) + (if (r1 == r2) + ((write r2 r0) + (r1 = 0)) + ((write r1 r0) + (r1 = 0)))) + (branch (r0 - 161) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-symbol) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-symbol) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-consonant) + (call ccl-thai-xtis-symbol) + (call ccl-thai-xtis-symbol) + (call ccl-thai-xtis-vowel-d1) + (call ccl-thai-xtis-symbol) + (call ccl-thai-xtis-symbol) + (call ccl-thai-xtis-vowel) + (call ccl-thai-xtis-vowel) + (call ccl-thai-xtis-vowel) + (call ccl-thai-xtis-vowel) + (call ccl-thai-xtis-vowel) + (call ccl-thai-xtis-vowel) + (call ccl-thai-xtis-vowel) + nil + nil + nil + nil + (call ccl-thai-xtis-symbol) + (call ccl-thai-xtis-symbol) + (call ccl-thai-xtis-symbol) + (call ccl-thai-xtis-symbol) + (call ccl-thai-xtis-symbol) + (call ccl-thai-xtis-symbol) + (call ccl-thai-xtis-symbol) + (call ccl-thai-xtis-symbol) + (call ccl-thai-xtis-tone) + (call ccl-thai-xtis-tone) + (call ccl-thai-xtis-tone) + (call ccl-thai-xtis-tone) + (call ccl-thai-xtis-tone) + (call ccl-thai-xtis-tone) + (call ccl-thai-xtis-tone) + (call ccl-thai-xtis-vowel-ee) + (call ccl-thai-xtis-symbol) + (call ccl-thai-xtis-symbol) + (call ccl-thai-xtis-symbol) + (call ccl-thai-xtis-symbol) + (call ccl-thai-xtis-symbol) + (call ccl-thai-xtis-symbol) + (call ccl-thai-xtis-symbol) + (call ccl-thai-xtis-symbol) + (call ccl-thai-xtis-symbol) + (call ccl-thai-xtis-symbol) + (call ccl-thai-xtis-symbol) + (call ccl-thai-xtis-symbol) + (call ccl-thai-xtis-symbol) + nil + nil + nil)) + (read r0) + (repeat))) + + (if (r1 != 0) + (write r1) + nil))) + +(define-ccl-program ccl-encode-thai-xtis + `(1 + ((read r0) + (loop + (if (r0 == ,leading-code-private-21) + ((read r1) + (if (r1 == ,(charset-id 'thai-xtis)) + ((read r0) + (write r0) + (read r0) + (r1 = (r0 & 7)) + (r0 = ((r0 - ?\xb0) >> 3)) + (if (r0 != 0) + (write r0 [0 209 212 213 214 215 216 217 218 238])) + (if (r1 != 0) + (write r1 [0 231 232 233 234 235 236 237])) + (read r0) + (repeat)) + ((write r0 r1) + (read r0) + (repeat)))) + (write-read-repeat r0)))))) + +(if (featurep 'xemacs) + (make-coding-system + 'tis-620 'ccl + "external=tis620, internal=thai-xtis" + `(mnemonic "TIS620" + decode ,ccl-decode-thai-xtis + encode ,ccl-encode-thai-xtis)) + (make-coding-system + 'tis-620 4 ?T "external=tis620, internal=thai-xtis" + '(ccl-decode-thai-xtis . ccl-encode-thai-xtis) + '((safe-charsets . t))) + ) + + +(set-language-info-alist + "Thai-XTIS" + '((setup-function . setup-thai-xtis-environment) + (exit-function . exit-thai-xtis-environment) + (charset thai-xtis) + (coding-system tis-620 iso-2022-7bit) + (coding-priority tis-620 iso-2022-7bit) + (sample-text . "$(?!:(B") + (documentation . t))) + +;; thai-xtis.el ends here. diff --git a/lisp/mule/vietnamese.el b/lisp/mule/vietnamese.el new file mode 100644 index 0000000..d71dbcf --- /dev/null +++ b/lisp/mule/vietnamese.el @@ -0,0 +1,279 @@ +;;; vietnamese.el --- Support for Vietnamese + +;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. +;; Licensed to the Free Software Foundation. +;; Copyright (C) 1997 MORIOKA Tomohiko + +;; Keywords: multilingual, Vietnamese + +;; This file is part of XEmacs. + +;; XEmacs is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; XEmacs is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with XEmacs; see the file COPYING. If not, write to the Free +;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +;; 02111-1307, USA. + +;;; Commentary: + +;; For Vietnames, the character sets VISCII and VSCII are supported. + +;;; Code: + +(eval-and-compile + +(defvar viet-viscii-decode-table + [;; VISCII is a full 8-bit code. + 0 1 ?.2NF 3 4 ?NG ?Ng 7 8 9 10 11 12 13 14 15 + 16 17 18 19 ?.2NV 21 22 23 24 ?N[ 26 27 28 29 ?N\ 31 + 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 + 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 + 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 + 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 + 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 + 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 + ?.2NU ?N! ?N" ?N# ?N$ ?N% ?N& ?N' ?N( ?N) ?N* ?N+ ?N, ?N- ?N. ?N/ + ?.2N0 ?N1 ?N2 ?N5 ?N~ ?N> ?N6 ?N7 ?N8 ?Nv ?Nw ?No ?N| ?N{ ?Nx ?NO + ?.2Nu ?.1N! ?N" ?N# ?N$ ?N% ?N& ?N' ?N( ?N) ?N* ?N+ ?N, ?N- ?N. ?N/ + ?.1N0 ?N1 ?N2 ?.2N^ ?N= ?.1N5 ?N6 ?N7 ?N8 ?.2Nq ?NQ ?NW ?NX ?.1N= ?N> ?.2N_ + ?.2N` ?Na ?Nb ?Nc ?Nd ?Ne ?.1NF ?NG ?.2Nh ?Ni ?Nj ?Nk ?Nl ?Nm ?Nn ?.1NO + ?.2Np ?.1NQ ?.2Nr ?Ns ?Nt ?.1NU ?NV ?NW ?NX ?.2Ny ?Nz ?.1N[ ?N\ ?.2N} ?.1N^ ?N_ + ?.1N` ?Na ?Nb ?Nc ?Nd ?Ne ?Nf ?Ng ?Nh ?Ni ?Nj ?Nk ?Nl ?Nm ?Nn ?No + ?.1Np ?Nq ?Nr ?Ns ?Nt ?Nu ?Nv ?Nw ?Nx ?Ny ?Nz ?N{ ?N| ?N} ?N~ ?.2Nf ] + "Vietnamese VISCII decoding table.") + +(defvar viet-viscii-encode-table + (let ((table-lower (make-vector 128 0)) + (table-upper (make-vector 128 0)) + (i 0) + char-component) + (while (< i 256) + (setq char-component + (split-char-or-char-int (aref viet-viscii-decode-table i))) + (cond ((eq (car char-component) 'vietnamese-viscii-lower) + (aset table-lower (nth 1 char-component) i)) + ((eq (car char-component) 'vietnamese-viscii-upper) + (aset table-upper (nth 1 char-component) i))) + (setq i (1+ i))) + (cons table-lower table-upper)) + "Vietnamese VISCII encoding table. +Cons of tables for encoding lower-case chars and upper-case characters. +Both tables are indexed by the position code of Vietnamese characters.") + +(defvar viet-vscii-decode-table + [;; VSCII is a full 8-bit code. + 0 ?.2Nz ?Nx 3 ?NW ?NX ?Nf 7 8 9 10 11 12 13 14 15 + 16 ?.2NQ ?N_ ?NO ?NV ?N[ ?N} ?N\ 24 25 26 27 28 29 30 31 + 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 + 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 + 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 + 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 + 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 + 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 + ?.2N` ?Nd ?Nc ?Na ?NU ?N# ?N' ?Nh ?Nk ?N( ?Ni ?N) ?N. ?Nl ?No ?Nn + ?.2Nm ?N8 ?Nr ?Nv ?Nu ?Ns ?Nw ?N5 ?N6 ?N7 ?N^ ?N> ?N~ ?Ny ?N| ?N{ + 160 ?.2Ne ?Nb ?Nj ?Nt ?N= ?N_ ?Np ?.1Ne ?Nb ?Nj ?Nt ?N> ?Ny ?Np ?.2N" + 192 193 194 195 196 ?.1N` ?Nd ?Nc ?Na ?NU ?.2NF ?.1N" ?NF ?NG ?N! ?.2NG + ?.2N! ?N% ?N& ?Ng ?N% ?N+ ?.1N# ?N% ?N& ?Ng ?N$ ?N' ?Nh ?.2N, ?.1Nk ?N( + ?.1Ni ?N) ?N+ ?N, ?N- ?N* ?N. ?Nl ?No ?.2N- ?N* ?N0 ?.1Nn ?Nm ?N8 ?Nr + ?.2N1 ?.1Nv ?Nu ?Ns ?Nw ?N0 ?N1 ?N2 ?N/ ?N5 ?N6 ?N7 ?N^ ?N> ?N~ ?Ny + ?.2N2 ?.1N| ?N{ ?Nz ?Nx ?NW ?NX ?Nf ?NQ ?Nq ?NO ?NV ?N[ ?N} ?N\ ?.2N/] + "Vietnamese VSCII decoding table.") + +(defvar viet-vscii-encode-table + (let ((table-lower (make-vector 128 0)) + (table-upper (make-vector 128 0)) + (i 0) + char-component) + (while (< i 256) + (setq char-component + (split-char-or-char-int (aref viet-vscii-decode-table i))) + (cond ((eq (car char-component) 'vietnamese-viscii-lower) + (aset table-lower (nth 1 char-component) i)) + ((eq (car char-component) 'vietnamese-viscii-upper) + (aset table-upper (nth 1 char-component) i))) + (setq i (1+ i))) + (cons table-lower table-upper)) + "Vietnamese VSCII encoding table. +Cons of tables for encoding lower-case chars and upper-case characters. +Both tables are indexed by the position code of Vietnamese characters.") + +) + +(define-ccl-program ccl-decode-viscii + `(3 + ((read r0) + (loop + (write-read-repeat r0 ,viet-viscii-decode-table)) + )) + "CCL program to decode VISCII 1.1") + +;; Multibyte form of a Vietnamese character is as follows (3-byte): +;; LEADING-CODE-PRIVATE-11 LEADING-CODE-EXTENDED-11 POSITION-CODE +;; where LEADING-CODE-EXTENDED-11 for Vietnamese is +;; `vietnamese-viscii-lower' or `vietnamese-viscii-upper'. + +(defvar leading-code-private-11 #x9E) + +(define-ccl-program ccl-encode-viscii + `(1 + ((read r0) + (loop + (if (r0 < 128) + ;; ASCII + (write-read-repeat r0) + ;; not ASCII + (if (r0 != ,leading-code-private-11) + ;; not Vietnamese + (write-read-repeat r0) + ((read-if (r0 == ,(charset-id 'vietnamese-viscii-lower)) + (;; Vietnamese lower + (read r0) + (r0 -= 128) + (write-read-repeat r0 ,(car viet-viscii-encode-table))) + (if (r0 == ,(charset-id 'vietnamese-viscii-upper)) + (;; Vietnamese upper + (read r0) + (r0 -= 128) + (write-read-repeat r0 ,(cdr viet-viscii-encode-table))) + ;; not Vietnamese + (write-read-repeat r0))))))))) + "CCL program to encode VISCII 1.1") + +(define-ccl-program ccl-encode-viscii-font + `(0 + ;; In: R0:vietnamese-viscii-lower/vietnamese-viscii-upper + ;; R1:position code + ;; Out: R1:font code point + (if (r0 == ,(charset-id 'vietnamese-viscii-lower)) + (r1 = r1 ,(car viet-viscii-encode-table)) + (r1 = r1 ,(cdr viet-viscii-encode-table))) + ) + "CCL program to encode Vietnamese chars to VISCII 1.1 font") + +(define-ccl-program ccl-decode-vscii + `(3 + ((read r0) + (loop + (write-read-repeat r0 ,viet-vscii-decode-table)) + )) + "CCL program to decode VSCII-1.") + +(define-ccl-program ccl-encode-vscii + `(1 + ((read r0) + (loop + (if (r0 < 128) + ;; ASCII + (write-read-repeat r0) + ;; not ASCII + (if (r0 != ,leading-code-private-11) + ;; not Vietnamese + (write-read-repeat r0) + (read-if (r0 == ,(charset-id 'vietnamese-viscii-lower)) + (;; Vietnamese lower + (read r0) + (r0 -= 128) + (write-read-repeat r0 ,(car viet-vscii-encode-table))) + (if (r0 == ,(charset-id 'vietnamese-viscii-upper)) + (;; Vietnamese upper + (read r0) + (r0 -= 128) + (write-read-repeat r0 ,(cdr viet-viscii-encode-table))) + ;; not Vietnamese + (write-read-repeat r0)))))))) + "CCL program to encode VSCII-1.") + +(define-ccl-program ccl-encode-vscii-font + `(0 + ;; In: R0:vietnamese-viscii-lower/vietnamese-viscii-upper + ;; R1:position code + ;; Out: R1:font code point + (if (r0 == ,(charset-id 'vietnamese-viscii-lower)) + (r1 = r1 ,(car viet-vscii-encode-table)) + (r1 = r1 ,(cdr viet-vscii-encode-table))) + ) + "CCL program to encode Vietnamese chars to VSCII-1 font.") + + +(make-coding-system + 'viscii 'ccl + "Coding-system used for VISCII 1.1." + `(mnemonic "VISCII" + decode ,ccl-decode-viscii + encode ,ccl-encode-viscii)) + +;; (make-coding-system +;; 'vietnamese-viscii 4 ?V +;; "8-bit encoding for Vietnamese VISCII 1.1 (MIME:VISCII)" +;; (cons ccl-decode-viscii ccl-encode-viscii)) + +;; (define-coding-system-alias 'viscii 'vietnamese-viscii) + +(make-coding-system + 'vscii 'ccl + "Coding-system used for VSCII 1.1." + `(mnemonic "VSCII" + decode ,ccl-decode-vscii + encode ,ccl-encode-vscii)) + +;; (make-coding-system +;; 'vietnamese-vscii 4 ?v +;; "8-bit encoding for Vietnamese VSCII-1" +;; (cons ccl-decode-vscii ccl-encode-vscii)) + +;; (define-coding-system-alias 'vscii 'vietnamese-vscii) + +(make-coding-system + 'viqr 'no-conversion + "Coding-system used for VIQR." + '(mnemonic "VIQR" + eol-type lf + post-read-conversion viqr-post-read-conversion + pre-write-conversion viqr-pre-write-conversion)) + +;; (make-coding-system +;; 'vietnamese-viqr 0 ?q +;; "Vietnamese latin transcription (VIQR)" +;; nil) +;; (put 'vietnamese-viqr 'post-read-conversion 'viqr-post-read-conversion) +;; (put 'vietnamese-viqr 'pre-write-conversion 'viqr-pre-write-conversion) + +;; (define-coding-system-alias 'viqr 'vietnamese-viqr) + +;; For VISCII users +(set-charset-ccl-program 'vietnamese-viscii-lower + ccl-encode-viscii-font) +(set-charset-ccl-program 'vietnamese-viscii-upper + ccl-encode-viscii-font) +;; For VSCII users +(set-charset-ccl-program 'vietnamese-viscii-lower ccl-encode-vscii-font) +(set-charset-ccl-program 'vietnamese-viscii-upper ccl-encode-vscii-font) + +;; (setq font-ccl-encoder-alist +;; (cons (cons "viscii" ccl-encode-viscii-font) font-ccl-encoder-alist)) + +;; (setq font-ccl-encoder-alist +;; (cons (cons "vscii" ccl-encode-vscii-font) font-ccl-encoder-alist)) + +(set-language-info-alist + "Vietnamese" '((setup-function . setup-vietnamese-environment) + (charset . (vietnamese-viscii-lower + vietnamese-viscii-upper)) + (coding-system . (viscii vscii viqr)) + (sample-text . "Vietnamese (Ti.1N*ng ViN.t) ChN`o bNUn") + (documentation . "\ +For Vietnamese, Emacs uses special charasets internally. +They can be decoded from and encoded to VISCC, VSCII, and VIQR.") + )) + +;;; vietnamese.el ends here diff --git a/lisp/package-get-base.el b/lisp/package-get-base.el deleted file mode 100644 index 2cdba73..0000000 --- a/lisp/package-get-base.el +++ /dev/null @@ -1,1543 +0,0 @@ -(setq package-get-base -'((bbdb - (standards-version 1.0 - version "1.01" - author-version "2.0" - date "1998-07-19" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority medium - category "comm" - dump nil - description "The Big Brother Data Base" - filename "bbdb-1.01-pkg.tar.gz" - md5sum "95ab2746d9cf3a105cab61eb65ecd64d" - size 274056 - provides (bbdb) - requires (bbdb edit-utils gnus mh-e rmail supercite vm tm apel mail-lib xemacs-base) - type regular -)) -(eudc - (standards-version 1.0 - version "1.22" - author-version "1.21" - date "1998-08-22" - build-date "1998-09-19" - maintainer "Oscar Figueiredo " - distribution stable - priority low - category "comm" - dump nil - description "Emacs Unified Directory Client (LDAP, PH)." - filename "eudc-1.22-pkg.tar.gz" - md5sum "25cd2405e5adcf796923f206d55cd3d6" - size 45221 - provides (eudc eudc-ldap eudc-ph) - requires (fsf-compat xemacs-base) - type regular -)) -(footnote - (standards-version 1.0 - version "1.06" - author-version "0.18x" - date "1998-08-27" - build-date "1998-09-19" - maintainer "SL Baur " - distribution stable - priority low - category "comm" - dump nil - description "Footnoting in mail message editing modes." - filename "footnote-1.06-pkg.tar.gz" - md5sum "796323a84d97bade70a5d78fd9076a2e" - size 13551 - provides (footnote) - requires (mail-lib xemacs-base) - type regular -)) -(gnats - (standards-version 1.0 - version "1.06" - author-version "3.101" - date "1998-08-01" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority high - category "comm" - dump nil - description "XEmacs bug reports." - filename "gnats-1.06-pkg.tar.gz" - md5sum "5759d3cdefcc57f7a36c2f30a5868abe" - size 186656 - provides (gnats gnats-admin send-pr) - requires (mail-lib xemacs-base) - type regular -)) -(gnus - (standards-version 1.0 - version "1.28" - author-version "5.6.43x1" - date "1998-09-05" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority medium - category "comm" - dump nil - description "The Gnus Newsreader and Mailreader." - filename "gnus-1.28-pkg.tar.gz" - md5sum "fc47129ff589191a7361d2eac494bde6" - size 1871939 - provides (gnus message) - requires (gnus w3 mh-e mailcrypt rmail mail-lib xemacs-base) - type regular -)) -(irchat - (standards-version 1.0 - version "1.01" - author-version "980625-2" - date "oc - key " - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority medium - category "comm" - dump nil - description "ZENIRC IRC Client." - filename "irchat-1.01-pkg.tar.gz" - md5sum "c94bd691cb42e5ba23fbfe26daea2dc8" - size 169192 - provides (irchat) - requires () - type regular -)) -(mailcrypt - (standards-version 1.0 - version "1.05" - author-version "3.4" - date "1998-01-24" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority low - category "comm" - dump nil - description "Support for messaging encryption with PGP." - filename "mailcrypt-1.05-pkg.tar.gz" - md5sum "9ae0b8a3dd2c9b308024813fef24cc3c" - size 88944 - provides (mailcrypt) - requires (gnus vm mail-lib xemacs-base) - type regular -)) -(mew - (standards-version 1.0 - version "1.01" - author-version "1.93b38" - date "1998-06-21" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution contrib - priority low - category "comm" - dump nil - description "Messaging in an Emacs World." - filename "mew-1.01-pkg.tar.gz" - md5sum "769d0647f7a411a8026aab4bf56d93c6" - size 523578 - provides (mew) - requires (mew) - type regular -)) -(mh-e - (standards-version 1.0 - version "1.07" - author-version "21.0" - date "1998-07-12" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution contrib - priority low - category "comm" - dump nil - description "Front end support for MH." - filename "mh-e-1.07-pkg.tar.gz" - md5sum "d9ac55c06077c00a4db554dcc6e41dea" - size 178838 - provides (mh-e) - requires (mail-lib xemacs-base) - type regular -)) -(net-utils - (standards-version 1.0 - version "1.09" - author-version "21.0" - date "1998-07-01" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority low - category "comm" - dump nil - description "Miscellaneous Networking Utilities." - filename "net-utils-1.09-pkg.tar.gz" - md5sum "597c6bc3aac41b64768d4eb7ae167805" - size 115926 - provides (ilisp-browse-cltl2 emacsbug feedmail metamail net-utils rcompile shadowfile webjump webster-www) - requires (w3 efs mail-lib xemacs-base) - type single -)) -(gnus - (standards-version 1.0 - version "1.01" - author-version "0.31" - date "1998-09-08" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution unstable - priority medium - category "comm" - dump nil - description "The Gnus Newsreader and Mailreader." - filename "pgnus-1.01-pkg.tar.gz" - md5sum "2725e2f5f52079a1966f6e2195aab479" - size 1969810 - provides (gnus message) - requires (pgnus w3 mh-e mailcrypt rmail mail-lib xemacs-base) - type regular -)) -(rmail - (standards-version 1.0 - version "1.06" - author-version "21.0" - date "1998-06-28" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution contrib - priority low - category "comm" - dump nil - description "An obsolete Emacs mailer." - filename "rmail-1.06-pkg.tar.gz" - md5sum "cc42e7660a4eb911b8cbc151f331c36b" - size 96472 - provides (rmail rmailsum) - requires (tm apel mail-lib xemacs-base) - type regular -)) -(supercite - (standards-version 1.0 - version "1.09" - author-version "3.55x2" - date "1998-08-9" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority low - category "comm" - dump nil - description "An Emacs citation tool for News & Mail messages." - filename "supercite-1.09-pkg.tar.gz" - md5sum "3b2758fd09e036b9c7ce258d0ee61d5a" - size 98926 - provides (supercite) - requires (mail-lib xemacs-base) - type regular -)) -(tm - (standards-version 1.0 - version "1.13" - author-version "21.0" - date "1998-08-27" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority low - category "comm" - dump nil - description "Emacs MIME support." - filename "tm-1.13-pkg.tar.gz" - md5sum "ba0feda4e61c1006c8e17c641de0b6d2" - size 336736 - provides (tm tm-edit tm-view mime-setup) - requires (gnus mh-e rmail vm mailcrypt mail-lib apel xemacs-base) - type regular -)) -(vm - (standards-version 1.0 - version "1.11" - author-version "6.62" - date "1998-09-19" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority medium - category "comm" - dump nil - description "An Emacs mailer." - filename "vm-1.11-pkg.tar.gz" - md5sum "56e65cbfb38283de030195b33f80be1b" - size 503615 - provides (vm) - requires (mail-lib xemacs-base) - type regular -)) -(w3 - (standards-version 1.0 - version "1.09" - author-version "4.0pre23" - date "1998-07-18" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution experimental - priority high - category "comm" - dump nil - description "A Web browser." - filename "w3-1.09-pkg.tar.gz" - md5sum "ceb4e1e0d9e11102b1ff2a5cb7b77d0f" - size 638496 - provides (w3 url) - requires (w3 mail-lib xemacs-base) - type regular -)) -(zenirc - (standards-version 1.0 - version "1.01" - author-version "2.112" - date "1998-08-15" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority medium - category "comm" - dump nil - description "ZENIRC IRC Client." - filename "zenirc-1.01-pkg.tar.gz" - md5sum "558723a7d70b1608a046068444f5045f" - size 290655 - provides (zenirc) - requires (zenirc) - type regular -)) -(cookie - (standards-version 1.0 - version "1.08" - author-version "21.0" - date "1998-04-07" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority low - category "games" - dump nil - description "Spook and Yow (Zippy quotes)." - filename "cookie-1.08-pkg.tar.gz" - md5sum "aa71e9df700ad89eb803d1100af331dd" - size 34274 - provides (cookie1 yow) - requires (xemacs-base) - type regular -)) -(games - (standards-version 1.0 - version "1.06" - author-version "1.04" - date "1998-06-04" - build-date "1998-09-19" - maintainer "Glynn Clements " - distribution stable - priority low - category "games" - dump nil - description "Tetris, Sokoban, and Snake." - filename "games-1.06-pkg.tar.gz" - md5sum "6db6e872cdcce09b3e9b1e3425dcc20a" - size 31993 - provides (gamegrid snake tetris sokoban) - requires (xemacs-base) - type regular -)) -(mine - (standards-version 1.0 - version "1.08" - author-version "1.9" - date "1998-05-09" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority low - category "games" - dump nil - description "Minehunt Game." - filename "mine-1.08-pkg.tar.gz" - md5sum "468ed5ccd1b86cd91572a901e156e7e2" - size 66924 - provides (xmine) - requires (xemacs-base) - type regular -)) -(misc-games - (standards-version 1.0 - version "1.07" - author-version "21.0" - date "1998-03-22" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority low - category "games" - dump nil - description "Other amusements and diversions." - filename "misc-games-1.07-pkg.tar.gz" - md5sum "c7898266da95831f5797e849f740fd4c" - size 175489 - provides (decipher gomoku hanoi life morse rot13) - requires (xemacs-base) - type single -)) -(Sun - (standards-version 1.0 - version "1.08" - author-version "21.0" - date "1998-07-25" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution sun - priority low - category "libs" - dump nil - description "Support for Sparcworks." - filename "Sun-1.08-pkg.tar.gz" - md5sum "faeaa48c2700604e5742b7a509b2a154" - size 72951 - provides (sccs eos-browser eos-common eos-debugger eos-debugger eos-editor eos-init eos-load eos-menubar eos-toolbar sunpro) - requires (cc-mode xemacs-base) - type regular -)) -(apel - (standards-version 1.0 - version "1.06" - author-version "3.3" - date "1998-07-23" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution mule - priority high - category "libs" - dump nil - description "A Portable Emacs Library. Used by XEmacs MIME support." - filename "apel-1.06-pkg.tar.gz" - md5sum "56aabd95da4333887bfd9134f5cbe6ac" - size 38742 - provides (atype emu-20 emu-e19 emu-x20 emu-xemacs emu file-detect filename install mule-caesar path-util richtext std11-parse std11 tinyrich) - requires (fsf-compat xemacs-base) - type regular -)) -(dired - (standards-version 1.0 - version "1.02" - author-version "7.9" - date "1998-05-05" - build-date "1998-09-19" - maintainer "Mike Sperber " - distribution stable - priority medium - category "libs" - dump nil - description "Manage file systems." - filename "dired-1.02-pkg.tar.gz" - md5sum "fd009a9bcff0f9a14d9f51665fe9c685" - size 197926 - provides (diff dired) - requires (xemacs-base) - type regular -)) -(edebug - (standards-version 1.0 - version "1.05" - author-version "21.0" - date "1998-03-12" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority low - category "libs" - dump nil - description "An Emacs Lisp debugger." - filename "edebug-1.05-pkg.tar.gz" - md5sum "26ff707c557ce5ae53317f391897dde9" - size 113971 - provides (edebug cl-read cust-print eval-reg cl-specs) - requires (xemacs-base) - type regular -)) -(efs - (standards-version 1.0 - version "1.10" - author-version "1.17" - date "1998-08-23" - build-date "1998-09-19" - maintainer "Mike Sperber " - distribution stable - priority medium - category "libs" - dump nil - description "Treat files on remote systems the same as local files." - filename "efs-1.10-pkg.tar.gz" - md5sum "5f4fdf921b2800eb5dc0de6241253419" - size 363608 - provides (efs) - requires (xemacs-base vm dired) - type regular -)) -(fsf-compat - (standards-version 1.0 - version "1.02" - author-version "21.0" - date "1998-03-25" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution mule - priority high - category "libs" - dump nil - description "FSF Emacs compatibility files." - filename "fsf-compat-1.02-pkg.tar.gz" - md5sum "3beb2ba9863cbee8a857acf5af00a8e8" - size 18208 - provides (overlay thingatpt timer) - requires () - type single -)) -(mail-lib - (standards-version 1.0 - version "1.17" - author-version "21.0" - date "1998-06-08" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority medium - category "libs" - dump nil - description "Fundamental lisp files for providing email support." - filename "mail-lib-1.17-pkg.tar.gz" - md5sum "efe51eec9acce37695c5fb092dabb079" - size 127025 - provides (browse-url highlight-headers mail-abbrevs mail-extr mail-utils reporter rfc822 rmail-mini rmailout sendmail smtpmail) - requires (xemacs-base) - type regular -)) -(sounds-au - (standards-version 1.0 - version "1.03" - author-version "21.0" - date "1998-06-30" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority high - category "libs" - dump nil - description "XEmacs Sun sound files." - filename "sounds-au-1.03-pkg.tar.gz" - md5sum "9ae6e0154c4fce763cfd453e98f94682" - size 125773 - provides () - requires () - type regular -)) -(sounds-wav - (standards-version 1.0 - version "1.03" - author-version "21.0" - date "1998-06-30" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority high - category "libs" - dump nil - description "XEmacs Microsoft sound files." - filename "sounds-wav-1.03-pkg.tar.gz" - md5sum "15a8c6e740202d0c7542c5ebc2837838" - size 148595 - provides () - requires () - type regular -)) -(tooltalk - (standards-version 1.0 - version "1.07" - author-version "21.0" - date "1998-07-25" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution contrib - priority low - category "libs" - dump nil - description "Support for building with Tooltalk." - filename "tooltalk-1.07-pkg.tar.gz" - md5sum "d9a97f43212d794ceebc964dc563dd17" - size 9213 - provides () - requires () - type regular -)) -(xemacs-base - (standards-version 1.0 - version "1.24" - author-version "21.0" - date "1998-08-06" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution mule - priority high - category "libs" - dump nil - description "Fundamental XEmacs support, you almost certainly need this." - filename "xemacs-base-1.24-pkg.tar.gz" - md5sum "505536311107548faff51c7a4510ad08" - size 456033 - provides (add-log advice annotations assoc case-table chistory comint-xemacs comint compile debug ebuff-menu echistory edmacro ehelp electric enriched env facemenu ffap helper imenu iso-syntax macros novice outline overlay passwd pp regi ring shell skeleton sort thing time-stamp timezone xbm-button xpm-button) - requires () - type regular -)) -(xemacs-devel - (standards-version 1.0 - version "1.16" - author-version "21.0" - date "1998-08-19" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority medium - category "libs" - dump nil - description "Emacs Lisp developer support." - filename "xemacs-devel-1.16-pkg.tar.gz" - md5sum "e5b592061957f041afcd45ed5ecc30cf" - size 85457 - provides (docref eldoc elp find-func hide-copyleft ielm regexp-opt trace) - requires (xemacs-base) - type single -)) -(edict - (standards-version 1.0 - version "1.05" - author-version "0.9.8" - date "1998-07-23" - build-date "1998-09-19" - maintainer "Stephen J. Turnbull " - distribution mule - priority high - category "mule" - dump nil - description "Lisp Interface to EDICT, Kanji Dictionary" - filename "edict-1.05-pkg.tar.gz" - md5sum "f3b0db7eb896cbbb0409d04d1f02ebbe" - size 75070 - provides (dui-registry dui edict-edit edict-english edict-japanese edict-morphology edict-test edict ts-mode) - requires (mule-base xemacs-base) - type regular -)) -(egg-its - (standards-version 1.0 - version "1.10" - author-version "21.0" - date "1998-08-11" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution mule - priority high - category "mule" - dump t - description "Wnn (4.2 and 6) support. SJ3 support." - filename "egg-its-1.10-pkg.tar.gz" - md5sum "2eb3fb60b3cfb1f3d7b63bd8a95426a6" - size 255348 - provides (egg-cnpinyin egg-cnzhuyin egg-cwnn-leim egg-jisx0201 egg-jsymbol egg-kwnn-leim egg-leim egg-sj3-client egg-sj3-leim egg-sj3 egg-wnn egg) - requires (leim mule-base fsf-compat xemacs-base) - type regular -)) -(leim - (standards-version 1.0 - version "1.09" - author-version "21.0" - date "1998-07-23" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution mule - priority medium - category "mule" - dump nil - description "Quail. All non-English and non-Japanese language support." - filename "leim-1.09-pkg.tar.gz" - md5sum "dab730405c3843bd2a14a9821a46d1cf" - size 1742759 - provides () - requires (mule-base fsf-compat xemacs-base) - type regular -)) -(locale - (standards-version 1.0 - version "1.09" - author-version "21.0" - date "1998-07-24" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution mule - priority high - category "mule" - dump nil - description "Localized menubars and localized splash screens." - filename "locale-1.09-pkg.tar.gz" - md5sum "c5d2bb5bcd35e8f2f3033b5ef03398fe" - size 32872 - provides () - requires (mule-base) - type regular -)) -(mule-base - (standards-version 1.0 - version "1.22" - author-version "21.0" - date "1998-08-12" - build-date "1998-09-19" - maintainer "SL Baur " - distribution mule - priority high - category "mule" - dump t - description "Basic Mule support, required for building with Mule." - filename "mule-base-1.22-pkg.tar.gz" - md5sum "82741caa8f936d8e007b3adf1e9c63c2" - size 519183 - provides (canna-leim canna char-table china-util cyril-util isearch-ext japan-util ccl can-n-egg mule-help) - requires (fsf-compat xemacs-base) - type regular -)) -(skk - (standards-version 1.0 - version "1.09" - author-version "10.38" - date "1998-07-23" - build-date "1998-09-19" - maintainer "SL Baur " - distribution mule - priority medium - category "mule" - dump t - description "Japanese Language Input Method." - filename "skk-1.09-pkg.tar.gz" - md5sum "21b1d3bb5bdfe939fb629719b67c68ac" - size 1524350 - provides (skk skk-tut) - requires (viper mule-base xemacs-base) - type regular -)) -(calc - (standards-version 1.0 - version "1.08" - author-version "2.02fX3" - date "1998-07-25" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority low - category "oa" - dump nil - description "Emacs calculator" - filename "calc-1.08-pkg.tar.gz" - md5sum "b5ffe11d94688709d4131c9d39541866" - size 1609129 - provides (calc) - requires () - type regular -)) -(calendar - (standards-version 1.0 - version "1.07" - author-version "21.0" - date "1998-09-01" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority low - category "oa" - dump nil - description "Calendar and diary support." - filename "calendar-1.07-pkg.tar.gz" - md5sum "61f7aafd5d103ed66cca835ed3583abe" - size 251917 - provides (appt cal-dst cal-french cal-mayan cal-x cal-xemacs calendar diary-ins diary-lib holidays lunar solar) - requires (xemacs-base) - type regular -)) -(edit-utils - (standards-version 1.0 - version "1.30" - author-version "21.0" - date "1998-09-18" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority high - category "oa" - dump nil - description "Miscellaneous editor extensions, you probably need this." - filename "edit-utils-1.30-pkg.tar.gz" - md5sum "9ed576dd1f01cd57a9f0b699cdce36fe" - size 595610 - provides (abbrevlist atomic-extents avoid backup-dir balloon-help big-menubar blink-cursor blink-paren bookmark compare-w completion dabbrev desktop detached-minibuf edit-toolbar fast-lock file-part floating-toolbar flow-ctrl foldout func-menu hippie-exp icomplete id-select info-look iswitchb lazy-lock lazy-shot live-icon man mic-paren paren popper mode-motion+ outl-mouse page-ext blink-paren paren permanent-buffers recent-files redo reportmail rsz-minibuf saveconfsavehist saveplace scroll-in-place tempo toolbar-utils tree-menu uniquify where-was-i-db) - requires (xemacs-base) - type single -)) -(forms - (standards-version 1.0 - version "1.07" - author-version "2.10" - date "1998-01-25" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution contrib - priority low - category "oa" - dump nil - description "Forms editing support (obsolete, use Widget instead)." - filename "forms-1.07-pkg.tar.gz" - md5sum "5efd98c58eb5ba6dce1e1a1e4059238d" - size 47896 - provides (forms forms-mode) - requires () - type regular -)) -(frame-icon - (standards-version 1.0 - version "1.04" - author-version "21.0" - date "1998-07-14" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution contrib - priority low - category "oa" - dump nil - description "Set up mode-specific icons for each frame under XEmacs" - filename "frame-icon-1.04-pkg.tar.gz" - md5sum "60c726b43b7dc20fcdd585796697e497" - size 33753 - provides (forms forms-mode) - requires () - type regular -)) -(hm--html-menus - (standards-version 1.0 - version "1.07" - author-version "5.9" - date "1998-01-25" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority low - category "oa" - dump nil - description "HTML editing." - filename "hm--html-menus-1.07-pkg.tar.gz" - md5sum "d90b6994d7d0868800b76042a6080bc5" - size 173431 - provides (adapt hm--date hm--html-configuration hm--html-drag-and-drop hm--html-indentation hm--html-keys hm--html-menu hm--html-mode hm--html-not-standard hm--html html-view tmpl-minor-mode) - requires (xemacs-base) - type regular -)) -(ispell - (standards-version 1.0 - version "1.10" - author-version "3.0x2" - date "1998-09-06" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority low - category "oa" - dump nil - description "Spell-checking with GNU ispell." - filename "ispell-1.10-pkg.tar.gz" - md5sum "f3b4ea8328648fde2ef6837e42e0e656" - size 66285 - provides (ispell) - requires () - type regular -)) -(pc - (standards-version 1.0 - version "1.12" - author-version "21.0" - date "1998-07-25" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority low - category "oa" - dump nil - description "PC style interface emulation." - filename "pc-1.12-pkg.tar.gz" - md5sum "7d0860e82e54ddbd3467980df674f447" - size 17497 - provides (delbs fusion pc-select pending-del s-region) - requires (xemacs-base) - type regular -)) -(psgml - (standards-version 1.0 - version "1.09" - author-version "1.01" - date "1998-07-06" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority medium - category "oa" - dump nil - description "Validated HTML/SGML editing." - filename "psgml-1.09-pkg.tar.gz" - md5sum "86bc71c63fc2e278717b4d91debfa2eb" - size 427133 - provides (psgml sgml) - requires (edit-utils) - type regular -)) -(sgml - (standards-version 1.0 - version "1.02" - author-version "21.0" - date "1998-01-25" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution contrib - priority low - category "oa" - dump nil - description "SGML/Linuxdoc-SGML editing." - filename "sgml-1.02-pkg.tar.gz" - md5sum "8e959375437e34425058fe348a9f0143" - size 29523 - provides (sgml linuxdoc-sgml) - requires (xemacs-base) - type regular -)) -(slider - (standards-version 1.0 - version "1.07" - author-version "0.3x1" - date "1998-08-13" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution experimental - priority low - category "oa" - dump nil - description "User interface tool." - filename "slider-1.07-pkg.tar.gz" - md5sum "ebfea81a8d3d52550e76ae4efb5e5399" - size 12174 - provides (slider color-selector) - requires () - type regular -)) -(speedbar - (standards-version 1.0 - version "1.06" - author-version "0.6.2" - date "1998-02-07" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority low - category "oa" - dump nil - description "??? Document me." - filename "speedbar-1.06-pkg.tar.gz" - md5sum "533b3c4dbfd82d44ed1243c3e285920a" - size 65542 - provides (speedbar) - requires (xemacs-base) - type regular -)) -(strokes - (standards-version 1.0 - version "1.02" - author-version "21.0" - date "1998-01-25" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority medium - category "oa" - dump nil - description "Mouse enhancement utility." - filename "strokes-1.02-pkg.tar.gz" - md5sum "016516c550b4369a40f666f3dda9afcb" - size 42765 - provides (strokes) - requires (text-modes edit-utils mail-lib xemacs-base) - type regular -)) -(text-modes - (standards-version 1.0 - version "1.10" - author-version "21.0" - date "1998-08-29" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority high - category "oa" - dump nil - description "Miscellaneous support for editing text files." - filename "text-modes-1.10-pkg.tar.gz" - md5sum "732ecc924eff930b5674453588c0bd2c" - size 204272 - provides (autoinsert crontab-edit filladapt fold-isearch folding image-mode iso-acc iso-ascii iso-cvt iso-insert iso-swed swedish tabify whitespace-mode winmgr-mode xpm-mode xrdb-mode) - requires (ispell fsf-compat xemacs-base) - type regular -)) -(time - (standards-version 1.0 - version "1.05" - author-version "1.17" - date "1998-04-24" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority medium - category "oa" - dump nil - description "Display time & date on the modeline." - filename "time-1.05-pkg.tar.gz" - md5sum "b6a082e80e20a4caceed5f30826a4b22" - size 19932 - provides (time) - requires (xemacs-base) - type regular -)) -(eterm - (standards-version 1.0 - version "1.06" - author-version "21.0" - date "1998-06-28" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority medium - category "os" - dump nil - description "Terminal emulation." - filename "eterm-1.06-pkg.tar.gz" - md5sum "086de2e838a20a30d67c4f4bb99171d2" - size 110620 - provides (eterm) - requires (xemacs-base) - type regular -)) -(igrep - (standards-version 1.0 - version "1.03" - author-version "2.83" - date "1998-08-11" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority low - category "os" - dump nil - description "Enhanced front-end for Grep." - filename "igrep-1.03-pkg.tar.gz" - md5sum "9a8946cef1c03e74d78382447bc345eb" - size 15263 - provides (igrep) - requires (dired xemacs-base) - type regular -)) -(ilisp - (standards-version 1.0 - version "1.05" - author-version "5.8" - date "1998-01-24" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority low - category "os" - dump nil - description "Front-end for Inferior Lisp." - filename "ilisp-1.05-pkg.tar.gz" - md5sum "a21c63df2265048e3f0fd4e290ee732f" - size 272263 - provides (ilisp completer) - requires (xemacs-base) - type regular -)) -(os-utils - (standards-version 1.0 - version "1.10" - author-version "21.0" - date "1998-07-14" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority medium - category "os" - dump nil - description "Miscellaneous O/S utilities." - filename "os-utils-1.10-pkg.tar.gz" - md5sum "d2f6b6f8d3f2dcfb024a0e601d3e81cf" - size 224824 - provides (archive-mode background crypt crypt++ inf-lisp jka-compr lpr mchat ps-print tar-mode telnet terminal uncompress) - requires (xemacs-base) - type single -)) -(view-process - (standards-version 1.0 - version "1.04" - author-version "2.4" - date "1998-01-24" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority low - category "os" - dump nil - description "A Unix process browsing tool." - filename "view-process-1.04-pkg.tar.gz" - md5sum "3ad505fa09f8300c034e7c44ab211d15" - size 62718 - provides (view-process-mode) - requires (xemacs-base) - type regular -)) -(ada - (standards-version 1.0 - version "1.04" - author-version "2.27" - date "1998-01-24" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority low - category "prog" - dump nil - description "Ada language support." - filename "ada-1.04-pkg.tar.gz" - md5sum "3eb8dc6d057fd9e3c2248f40df0c34f0" - size 55190 - provides (ada-mode ada-stmt) - requires () - type regular -)) -(c-support - (standards-version 1.0 - version "1.08" - author-version "21.0" - date "1998-03-25" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution contrib - priority low - category "prog" - dump nil - description "Basic single-file add-ons for editing C code." - filename "c-support-1.08-pkg.tar.gz" - md5sum "e03535f146371f8fa3ea440ecdb18f55" - size 73625 - provides (c-comment-edit cmacexp ctypes hideif hideshow) - requires (cc-mode xemacs-base) - type regular -)) -(cc-mode - (standards-version 1.0 - version "1.12" - author-version "5.22" - date "1998-03-05" - build-date "1998-09-19" - maintainer "Barry Warsaw " - distribution stable - priority medium - category "prog" - dump nil - description "C, C++ and Java language support." - filename "cc-mode-1.12-pkg.tar.gz" - md5sum "47a0d9fe2c0753985fa65596b68b8db6" - size 191141 - provides (cc-mode) - requires (xemacs-base) - type regular -)) -(debug - (standards-version 1.0 - version "1.05" - author-version "21.0" - date "1998-07-09" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution contrib - priority low - category "prog" - dump nil - description "GUD, gdb, dbx debugging support." - filename "debug-1.05-pkg.tar.gz" - md5sum "bbb9783b4e81cd085adcf2e383cd4fe7" - size 91169 - provides (dbx gdb-highlight gdb gdbsrc gud history) - requires (xemacs-base) - type regular -)) -(ediff - (standards-version 1.0 - version "1.10" - author-version "2.70.2" - date "1998-04-27" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority medium - category "prog" - dump nil - description "Interface over GNU patch." - filename "ediff-1.10-pkg.tar.gz" - md5sum "a2b4d368c71a21e32660f061f1b52086" - size 274999 - provides (ediff) - requires (pcl-cvs dired xemacs-base) - type regular -)) -(emerge - (standards-version 1.0 - version "1.03" - author-version "21.0" - date "1998-04-07" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority low - category "prog" - dump nil - description "Another interface over GNU patch." - filename "emerge-1.03-pkg.tar.gz" - md5sum "2ca964df916ec1f0b0a3f12a85e6741c" - size 60474 - provides (emerge) - requires () - type regular -)) -(jde - (standards-version 1.0 - version "1.05" - author-version "2.05" - date "1998-07-09" - build-date "1998-09-19" - maintainer "Andy Piper " - distribution stable - priority medium - category "prog" - dump nil - description "Java language and development support." - filename "jde-1.05-pkg.tar.gz" - md5sum "fa4444d0c5cbfef6d3f14e4ed04faef7" - size 129630 - provides (jde) - requires (cc-mode debug speedbar edit-utils mail-lib xemacs-base) - type regular -)) -(pcl-cvs - (standards-version 1.0 - version "1.12" - author-version "21.0" - date "1998-06-18" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority low - category "prog" - dump nil - description "CVS frontend." - filename "pcl-cvs-1.12-pkg.tar.gz" - md5sum "f69a484d2d8c7c829793f0a12c89ec91" - size 159090 - provides (pcl-cvs dll elib-node generic-sc) - requires (xemacs-base) - type regular -)) -(prog-modes - (standards-version 1.0 - version "1.10" - author-version "21.0" - date "1998-09-04" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority medium - category "prog" - dump nil - description "Support for various programming languages." - filename "prog-modes-1.10-pkg.tar.gz" - md5sum "61e1d86aba5774f74a5611b1eb7cf62c" - size 548374 - provides (autoconf-mode cperl-mode eiffel3 f90 fortran ksh-mode m4-mode makefile perl-mode postscript python-mode rexx-mode simula-mode tcl teco verilog-mod) - requires (mail-lib xemacs-base) - type regular -)) -(scheme - (standards-version 1.0 - version "1.04" - author-version "21.0" - date "1998-04-11" - build-date "1998-09-19" - maintainer "Karl M. Hegbloom " - distribution contrib - priority low - category "prog" - dump nil - description "Front-end support for Inferior Scheme." - filename "scheme-1.04-pkg.tar.gz" - md5sum "0815a048274697b7213604e02db0c2a9" - size 39734 - provides (scheme xscheme cmuscheme cmuscheme48) - requires (xemacs-base) - type regular -)) -(sh-script - (standards-version 1.0 - version "1.06" - author-version "2.0e" - date "1998-05-12" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority low - category "prog" - dump nil - description "Support for editing shell scripts." - filename "sh-script-1.06-pkg.tar.gz" - md5sum "b87b528df00464cbe1533ffdde81cd8e" - size 34485 - provides (sh-script executable) - requires (xemacs-base) - type regular -)) -(vc-cc - (standards-version 1.0 - version "1.08" - author-version "21.0" - date "1998-07-24" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution contrib - priority low - category "prog" - dump nil - description "Version Control for ClearCase (UnFree) systems." - filename "vc-cc-1.08-pkg.tar.gz" - md5sum "81e1ce88b7389e872d732441a5fdb29f" - size 97261 - provides (vc) - requires (dired xemacs-base) - type regular -)) -(vc - (standards-version 1.0 - version "1.12" - author-version "21.0" - date "1998-08-05" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority low - category "prog" - dump nil - description "Version Control for Free systems." - filename "vc-1.12-pkg.tar.gz" - md5sum "bf42fcd4d4dd78b5514e0d56e21082fc" - size 83630 - provides (vc) - requires (dired xemacs-base) - type regular -)) -(vhdl - (standards-version 1.0 - version "1.05" - author-version "2.74" - date "1998-01-24" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority low - category "prog" - dump nil - description "Support for VHDL." - filename "vhdl-1.05-pkg.tar.gz" - md5sum "486c16af86f0901d5c5385479b5c0e6a" - size 65812 - provides (vhdl-mode) - requires () - type regular -)) -(auctex - (standards-version 1.0 - version "1.12" - author-version "9.7p" - date "1998-08-05" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority medium - category "wp" - dump nil - description "Basic TeX/LaTeX support." - filename "auctex-1.12-pkg.tar.gz" - md5sum "a2826368828e89f0113401a38a49082b" - size 364768 - provides (auc-old bib-cite font-latex latex multi-prompt tex-buf tex-info tex-jp tex-site tex) - requires (xemacs-base) - type regular -)) -(crisp - (standards-version 1.0 - version "1.07" - author-version "1.34" - date "1998-08-18" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority low - category "wp" - dump nil - description "Crisp/Brief emulation." - filename "crisp-1.07-pkg.tar.gz" - md5sum "1c8ef81e2dce5a0f0f2625dd66fcbcfb" - size 10273 - provides (crisp scroll-lock) - requires () - type regular -)) -(edt - (standards-version 1.0 - version "1.05" - author-version "21.0" - date "1998-04-07" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution contrib - priority low - category "wp" - dump nil - description "DEC EDIT/EDT emulation." - filename "edt-1.05-pkg.tar.gz" - md5sum "c2d94f654e748bc3170d21f699faee5d" - size 48534 - provides (edt) - requires (xemacs-base) - type regular -)) -(reftex - (standards-version 1.0 - version "1.07" - author-version "3.38" - date "1998-08-11" - build-date "1998-09-19" - maintainer "Carsten Dominik " - distribution stable - priority medium - category "wp" - dump nil - description "Emacs support for LaTeX cross-references, citations.." - filename "reftex-1.07-pkg.tar.gz" - md5sum "cb821b60e394f6a285d2a43617384c79" - size 200286 - provides (reftex) - requires (fsf-compat xemacs-base) - type regular -)) -(texinfo - (standards-version 1.0 - version "1.12" - author-version "21.0" - date "1998-07-20" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority high - category "wp" - dump nil - description "XEmacs TeXinfo support." - filename "texinfo-1.12-pkg.tar.gz" - md5sum "ec1ff24ddc7c2e3dd0c121717a6ea6c1" - size 134975 - provides (makeinfo tex-mode texinfmt texinfo texnfo-tex texnfo-upd) - requires (xemacs-base) - type regular -)) -(textools - (standards-version 1.0 - version "1.06" - author-version "21.0" - date "1998-04-29" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stabl - priority medium - category "wp" - dump nil - description "Miscellaneous TeX support." - filename "textools-1.06-pkg.tar.gz" - md5sum "6805183aa443242b45689ffe6e46855f" - size 83197 - provides (bib-mode bibtex refer-to-bibtex) - requires (xemacs-base) - type single -)) -(tpu - (standards-version 1.0 - version "1.06" - author-version "4.2X" - date "1998-07-23" - build-date "1998-09-19" - maintainer "Kevin Oberman " - distribution normal - priority medium - category "wp" - dump nil - description "DEC EDIT/TPU support." - filename "tpu-1.06-pkg.tar.gz" - md5sum "cd777d6be222b85810927858d88fd642" - size 59897 - provides (tpu) - requires () - type regular -)) -(viper - (standards-version 1.0 - version "1.09" - author-version "3.03" - date "1998-02-25" - build-date "1998-09-19" - maintainer "XEmacs Development Team " - distribution stable - priority low - category "wp" - dump nil - description "VI emulation support." - filename "viper-1.09-pkg.tar.gz" - md5sum "1636a0aece86e5713e8587eea92c81c8" - size 318061 - provides (viper) - requires (xemacs-base) - type regular -)) -)) -(provide 'package-get-base) diff --git a/lock/.precious b/lock/.precious deleted file mode 100644 index 1650a2e..0000000 --- a/lock/.precious +++ /dev/null @@ -1 +0,0 @@ -Dummy file to keep CVS happy. diff --git a/lwlib/config.h b/lwlib/config.h deleted file mode 100644 index 34aab2c..0000000 --- a/lwlib/config.h +++ /dev/null @@ -1,33 +0,0 @@ -/* lwlib/config.h. Generated automatically by configure. */ -/* Lwlib site configuration template file. -*- C -*- - Copyright (C) 1997 Sun Microsystems, Inc. - -This file is part of XEmacs. - -XEmacs is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -XEmacs is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with XEmacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* Not in FSF. */ - -#ifndef _LWLIB_CONFIG_H_ -#define _LWLIB_CONFIG_H_ - -#include <../src/config.h> - -/* #undef NEED_MOTIF */ -/* #undef NEED_ATHENA */ -/* #undef NEED_LUCID */ - -#endif /* _LWLIB_CONFIG_H_ */ diff --git a/modules/Makefile.in b/modules/Makefile.in deleted file mode 100644 index 07405d2..0000000 --- a/modules/Makefile.in +++ /dev/null @@ -1,19 +0,0 @@ -@SET_MAKE@ -SUBDIR=ldap base64 zlib example -RECURSIVE_MAKE=@RECURSIVE_MAKE@ -SHELL = /bin/sh -RM = rm -f - -all: - -for d in $(SUBDIR) ; do (cd ./$${d} && $(RECURSIVE_MAKE) $@) ; done - -install clean mostlyclean: - -for d in $(SUBDIR) ; do (cd ./$${d} && $(RECURSIVE_MAKE) $@) ; done - -distclean: - $(RM) Makefile config.* - -for d in $(SUBDIR) ; do (cd ./$${d} && $(RECURSIVE_MAKE) $@) ; done - -realclean extraclean: - $(RM) *~ \#* - -for d in $(SUBDIR) ; do (cd ./$${d} && $(RECURSIVE_MAKE) $@) ; done diff --git a/modules/aclocal.m4 b/modules/aclocal.m4 deleted file mode 100644 index 1b1808d..0000000 --- a/modules/aclocal.m4 +++ /dev/null @@ -1,36 +0,0 @@ -AC_DEFUN(XE_EMACS, [ - dnl - dnl Apparently, if you run a shell window in Emacs, it sets the EMACS - dnl environment variable to 't'. Lets undo the damage. - dnl - if test "${EMACS}" = "t"; then - EMACS="" - fi - - AC_ARG_WITH(xemacs, --with-xemacs Use XEmacs to build, [ if test "${withval}" = "yes"; then EMACS=xemacs; else EMACS=${withval}; fi ]) - AC_ARG_WITH(emacs, --with-emacs Use Emacs to build, [ if test "${withval}" = "yes"; then EMACS=emacs; else EMACS=${withval}; fi ]) - AC_CHECK_PROG(EMACS, xemacs, xemacs, emacs) - AC_SUBST(EMACS) -]) - -AC_DEFUN(XE_CONFIG_VALUE, [ - OUTPUT=./conftest-$$ - rm -f ${OUTPUT} - ${EMACS} -batch -eval " -(let ((hash (config-value-hash-table)) - (desired (split-string \"$1\"))) - (mapcar - (lambda (key) - (message \"Checking for %S\" (intern key)) - (if (config-value (intern key)) - (progn - (write-region (format \"%s=\\\"%s\\\"\n\" key (config-value (intern key))) - nil \"${OUTPUT}\" t)))) - desired)) -" 2> /dev/null > /dev/null - test -f ${OUTPUT} && . ${OUTPUT} - rm -f ${OUTPUT} - for ac_func in $1; do - : - done -]) diff --git a/modules/base64/Makefile.in b/modules/base64/Makefile.in deleted file mode 100644 index 4170df4..0000000 --- a/modules/base64/Makefile.in +++ /dev/null @@ -1,37 +0,0 @@ -# NOTE!! -# The use of BLDDIR here is _BOGUS_. -# What really needs to happen is that we should install config.h into -# the architecture dependent directory when we really hash all this -# out. - -blddir=@blddir@ -dll_cflags=@dll_cflags@ -dll_oflags=@dll_oflags@ -dll_lflags=@dll_lflags@ -dll_ld=@dll_ld@ - -INCLUDES=-I$(blddir)/src -CFLAGS=@CFLAGS@ $(INCLUDES) -CC=@CC@ -RM=@RM@ - -TARGET=base64 - -.PHONY: clean mostlyclean distclean realclean install - -all: $(TARGET).ell - -$(TARGET).ell: $(TARGET).o - $(dll_ld) $(dll_oflags) $@ $(dll_lflags) $^ - -install: - echo "Don't know how to install yet" - -clean mostlyclean: - $(RM) *.o $(TARGET).ell - -distclean: clean - $(RM) Makefile - -realclean extraclean: distclean - $(RM) *~ \#* diff --git a/modules/configure.in b/modules/configure.in deleted file mode 100644 index 123fb37..0000000 --- a/modules/configure.in +++ /dev/null @@ -1,23 +0,0 @@ -AC_PREREQ(2.12) -AC_INIT(configure.in) - -XE_EMACS -XE_CONFIG_VALUE(dll_cflags dll_ld dll_lflags dll_oflags CFLAGS CC DEFS INSTALL top_srcdir blddir) - -RM='rm -f' - -AC_SUBST(INSTALL) -AC_SUBST(RM) -AC_SUBST(CC) -AC_SUBST(dll_cflags) -AC_SUBST(dll_oflags) -AC_SUBST(dll_lflags) -AC_SUBST(dll_ld) -AC_SUBST(top_srcdir) -AC_SUBST(blddir) - -AC_OUTPUT(Makefile - ldap/Makefile - base64/Makefile - example/Makefile - zlib/Makefile) diff --git a/modules/ldap/Makefile.in b/modules/ldap/Makefile.in deleted file mode 100644 index c35f80b..0000000 --- a/modules/ldap/Makefile.in +++ /dev/null @@ -1,37 +0,0 @@ -# NOTE!! -# The use of BLDDIR here is _BOGUS_. -# What really needs to happen is that we should install config.h into -# the architecture dependent directory when we really hash all this -# out. - -blddir=@blddir@ -dll_cflags=@dll_cflags@ -dll_oflags=@dll_oflags@ -dll_lflags=@dll_lflags@ -dll_ld=@dll_ld@ - -INCLUDES=-I$(blddir)/src -CFLAGS=@CFLAGS@ $(INCLUDES) -CC=@CC@ -RM=@RM@ - -TARGET=eldap - -.PHONY: clean mostlyclean distclean realclean install - -all: $(TARGET).ell - -$(TARGET).ell: $(TARGET).o - $(dll_ld) $(dll_oflags) $@ $(dll_lflags) $^ - -install: - echo "Don't know how to install yet" - -clean mostlyclean: - $(RM) *.o $(TARGET).ell - -distclean: clean - $(RM) Makefile - -realclean extraclean: distclean - $(RM) *~ \#* diff --git a/modules/ldap/configure.in b/modules/ldap/configure.in deleted file mode 100644 index 123fb37..0000000 --- a/modules/ldap/configure.in +++ /dev/null @@ -1,23 +0,0 @@ -AC_PREREQ(2.12) -AC_INIT(configure.in) - -XE_EMACS -XE_CONFIG_VALUE(dll_cflags dll_ld dll_lflags dll_oflags CFLAGS CC DEFS INSTALL top_srcdir blddir) - -RM='rm -f' - -AC_SUBST(INSTALL) -AC_SUBST(RM) -AC_SUBST(CC) -AC_SUBST(dll_cflags) -AC_SUBST(dll_oflags) -AC_SUBST(dll_lflags) -AC_SUBST(dll_ld) -AC_SUBST(top_srcdir) -AC_SUBST(blddir) - -AC_OUTPUT(Makefile - ldap/Makefile - base64/Makefile - example/Makefile - zlib/Makefile) diff --git a/modules/zlib/Makefile.in b/modules/zlib/Makefile.in deleted file mode 100644 index 5b86a45..0000000 --- a/modules/zlib/Makefile.in +++ /dev/null @@ -1,37 +0,0 @@ -# NOTE!! -# The use of BLDDIR here is _BOGUS_. -# What really needs to happen is that we should install config.h into -# the architecture dependent directory when we really hash all this -# out. - -blddir=@blddir@ -dll_cflags=@dll_cflags@ -dll_oflags=@dll_oflags@ -dll_lflags=@dll_lflags@ -dll_ld=@dll_ld@ - -INCLUDES=-I$(blddir)/src -CFLAGS=@CFLAGS@ $(INCLUDES) -CC=@CC@ -RM=@RM@ - -TARGET=zlib - -.PHONY: clean mostlyclean distclean realclean install - -all: $(TARGET).ell - -$(TARGET).ell: $(TARGET).o - $(dll_ld) $(dll_oflags) $@ $(dll_lflags) $^ - -install: - echo "Don't know how to install yet" - -clean mostlyclean: - $(RM) *.o $(TARGET).ell - -distclean: clean - $(RM) Makefile - -realclean extraclean: distclean - $(RM) *~ \#* diff --git a/nt/puresize-adjust.h b/nt/puresize-adjust.h deleted file mode 100644 index b10cdc8..0000000 --- a/nt/puresize-adjust.h +++ /dev/null @@ -1,3 +0,0 @@ -/* Do not edit this file! - Automatically generated by XEmacs */ -# define PURESIZE_ADJUSTMENT (0) diff --git a/src/ChangeLog b/src/ChangeLog index ad0ec97..f24a940 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,20 @@ +1999-06-03 MORIOKA Tomohiko + + * file-coding.c (coding_system_from_mask): Use `raw-text' instead + of `no-conversion'. + (complex_vars_of_mule_coding): Use `raw-text' as the coding-system + of coding-category `no-conversion'. + +1999-06-03 MORIOKA Tomohiko + + * file-coding.c (Qraw_text): New variable. + (syms_of_mule_coding): Add new symbol `raw-text'. + (complex_vars_of_mule_coding): Add new coding-system `raw-text'; + define coding-system `binary' independently; define coding-system + `no-conversion' as an alias for `raw-text'. + + * file-coding.h (Qraw_text): New variable. + 1999-06-04 XEmacs Build Bot * XEmacs 21.2.15 is released diff --git a/src/acldef.h b/src/acldef.h deleted file mode 100644 index eba2c59..0000000 --- a/src/acldef.h +++ /dev/null @@ -1,65 +0,0 @@ -/* This file is part of XEmacs. - -XEmacs is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -XEmacs is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with XEmacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* Synched up with: FSF 19.30. */ - -/* Authorship: - - FSF: Original version; a long time ago. - No changes for XEmacs. - */ - -#define ACL$K_LENGTH 12 -#define ACL$C_LENGTH 12 -#define ACL$C_FILE 1 -#define ACL$C_DEVICE 2 -#define ACL$C_JOBCTL_QUEUE 3 -#define ACL$C_COMMON_EF_CLUSTER 4 -#define ACL$C_LOGICAL_NAME_TABLE 5 -#define ACL$C_PROCESS 6 -#define ACL$C_GROUP_GLOBAL_SECTION 7 -#define ACL$C_SYSTEM_GLOBAL_SECTION 8 -#define ACL$C_ADDACLENT 1 -#define ACL$C_DELACLENT 2 -#define ACL$C_MODACLENT 3 -#define ACL$C_FNDACLENT 4 -#define ACL$C_FNDACETYP 5 -#define ACL$C_DELETEACL 6 -#define ACL$C_READACL 7 -#define ACL$C_ACLLENGTH 8 -#define ACL$C_READACE 9 -#define ACL$C_RLOCK_ACL 10 -#define ACL$C_WLOCK_ACL 11 -#define ACL$C_UNLOCK_ACL 12 -#define ACL$S_ADDACLENT 255 -#define ACL$S_DELACLENT 255 -#define ACL$S_MODACLENT 255 -#define ACL$S_FNDACLENT 255 -#define ACL$S_FNDACETYP 255 -#define ACL$S_DELETEACL 255 -#define ACL$S_READACL 512 -#define ACL$S_ACLLENGTH 4 -#define ACL$S_READACE 255 -#define ACL$S_RLOCK_ACL 4 -#define ACL$S_WLOCK_ACL 4 -#define ACL$S_UNLOCK_ACL 4 -#define ACL$S_ACLDEF 16 -#define ACL$L_FLINK 0 -#define ACL$L_BLINK 4 -#define ACL$W_SIZE 8 -#define ACL$B_TYPE 10 -#define ACL$L_LIST 12 diff --git a/src/chpdef.h b/src/chpdef.h deleted file mode 100644 index 196196c..0000000 --- a/src/chpdef.h +++ /dev/null @@ -1,57 +0,0 @@ -/* This file is part of XEmacs. - -XEmacs is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -XEmacs is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with XEmacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* Synched up with: FSF 19.30. */ - -#define CHP$_END 0 -#define CHP$_ACCESS 1 -#define CHP$_FLAGS 2 -#define CHP$_PRIV 3 -#define CHP$_ACMODE 4 -#define CHP$_ACCLASS 5 -#define CHP$_RIGHTS 6 -#define CHP$_ADDRIGHTS 7 -#define CHP$_MODE 8 -#define CHP$_MODES 9 -#define CHP$_MINCLASS 10 -#define CHP$_MAXCLASS 11 -#define CHP$_OWNER 12 -#define CHP$_PROT 13 -#define CHP$_ACL 14 -#define CHP$_AUDITNAME 15 -#define CHP$_ALARMNAME 16 -#define CHP$_MATCHEDACE 17 -#define CHP$_PRIVUSED 18 -#define CHP$_MAX_CODE 19 -#define CHP$M_SYSPRV 1 -#define CHP$M_BYPASS 2 -#define CHP$M_UPGRADE 4 -#define CHP$M_DOWNGRADE 8 -#define CHP$M_GRPPRV 16 -#define CHP$M_READALL 32 -#define CHP$V_SYSPRV 0 -#define CHP$V_BYPASS 1 -#define CHP$V_UPGRADE 2 -#define CHP$V_DOWNGRADE 3 -#define CHP$V_GRPPRV 4 -#define CHP$V_READALL 5 -#define CHP$M_READ 1 -#define CHP$M_WRITE 2 -#define CHP$M_USEREADALL 4 -#define CHP$V_READ 0 -#define CHP$V_WRITE 1 -#define CHP$V_USEREADALL 2 diff --git a/src/dll.c b/src/dll.c deleted file mode 100644 index 3620032..0000000 --- a/src/dll.c +++ /dev/null @@ -1,93 +0,0 @@ -/* Lisp interface to dynamic loading. - Copyright (C) 1998 Joshua Rowe. - Additional cleanup by Hrvoje Niksic. - -This file is part of XEmacs. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* Synched up with: Not in FSF. */ - -/* A shared object must have the symbol `emacs_initialize' defined. - It should contain initialization of functions, symbols, etc. and - their loading into Lisp-land. The function will be called without - arguments and is not expected to return any. - - All of this needs lots and LOTS of work. Some things to work on: - - 1) A good foreign interface. This is probably tough, because it - implies drawing a new border between "external" and "internal" - stuff (traditionally, Lisp code was external, while C was - internal). Also, we need a modules/ directory with a few nice - sample modules, a sample Makefile, etc. so people can start - hacking. - - 2) All of this is sooo simple-minded. As it gets more complex, - we'll have to look at how others have done similar things - (e.g. Perl 5 and Zsh 3.1), to avoid botching it up. */ - -#include -#include "lisp.h" -#include "buffer.h" -#include "sysdll.h" - -DEFUN ("dll-open", Fdll_open, 1, 1, "FShared object: ", /* -Load LIBRARY as a shared object file. - -After the LIBRARY is dynamically linked with the executable, the -`emacs_initialize' function will be called without arguments. It -should define all the symbols, subr's and variables the module -introduces. - -After this point, any lisp symbols defined in the shared object are -available for use. -*/ - (library)) -{ - /* This function can GC */ - dll_handle *handle; - void (*function) (void); - CONST char *filename; - - CHECK_STRING (library); - library = Fexpand_file_name (library, Qnil); - - GET_C_CHARPTR_EXT_FILENAME_DATA_ALLOCA (XSTRING_DATA (library), filename); - - handle = (dll_handle *) dll_open (filename); - if (handle == NULL) - { - signal_error (Qerror, - list3 (build_translated_string ("Cannot load shared library"), - library, build_translated_string (dll_error (handle)))); - } - - /* #### Perhaps emacs_initialize() should return a Lisp_Object, so - we can return it? */ - - function = (void (*)(void)) dll_function (handle, "emacs_initialize"); - if (!function) - signal_simple_error ("Shared library does not define `emacs_initialize'", - library); - (*function) (); - - return Qnil; -} - -void syms_of_dll () -{ - DEFSUBR (Fdll_open); -} diff --git a/src/file-coding.c b/src/file-coding.c index 8fd5a91..daae138 100644 --- a/src/file-coding.c +++ b/src/file-coding.c @@ -55,7 +55,7 @@ int coding_category_by_priority[CODING_CATEGORY_LAST + 1]; Lisp_Object Qcoding_system_p; -Lisp_Object Qno_conversion, Qccl, Qiso2022; +Lisp_Object Qraw_text, Qno_conversion, Qccl, Qiso2022; /* Qinternal in general.c */ Lisp_Object Qmnemonic, Qeol_type; @@ -1531,7 +1531,7 @@ coding_system_from_mask (int mask) } } if (NILP (retval)) - retval = Fget_coding_system (Qno_conversion); + retval = Fget_coding_system (Qraw_text); return retval; } else @@ -1553,7 +1553,7 @@ coding_system_from_mask (int mask) if (cat >= 0) return coding_category_system[cat]; else - return Fget_coding_system (Qno_conversion); + return Fget_coding_system (Qraw_text); } } @@ -5447,6 +5447,7 @@ syms_of_file_coding (void) #endif /* MULE */ defsymbol (&Qcoding_system_p, "coding-system-p"); defsymbol (&Qno_conversion, "no-conversion"); + defsymbol (&Qraw_text, "raw-text"); #ifdef MULE defsymbol (&Qbig5, "big5"); defsymbol (&Qshift_jis, "shift-jis"); @@ -5643,15 +5644,22 @@ complex_vars_of_file_coding (void) DEFINE_CODESYS_PROP (CODESYS_PROP_CCL, Qdecode); #endif /* MULE */ /* Need to create this here or we're really screwed. */ - Fmake_coding_system (Qno_conversion, Qno_conversion, build_string ("No conversion"), - list2 (Qmnemonic, build_string ("Noconv"))); + Fmake_coding_system + (Qraw_text, Qno_conversion, + build_string ("Raw text, which means it converts only line-break-codes."), + list2 (Qmnemonic, build_string ("Raw"))); - Fcopy_coding_system (Fcoding_system_property (Qno_conversion, Qeol_lf), - Qbinary); + Fmake_coding_system + (Qbinary, Qno_conversion, + build_string ("Binary, which means it does not convert anything."), + list4 (Qeol_type, Qlf, + Qmnemonic, build_string ("Binary"))); + + Fdefine_coding_system_alias (Qno_conversion, Qraw_text); /* Need this for bootstrapping */ coding_category_system[CODING_CATEGORY_NO_CONVERSION] = - Fget_coding_system (Qno_conversion); + Fget_coding_system (Qraw_text); #ifdef MULE { diff --git a/src/file-coding.h b/src/file-coding.h index 38d591b..19fc60e 100644 --- a/src/file-coding.h +++ b/src/file-coding.h @@ -258,6 +258,7 @@ extern Lisp_Object Qforce_g0_on_output, Qforce_g1_on_output; extern Lisp_Object Qforce_g2_on_output, Qforce_g3_on_output; extern Lisp_Object Qinput_charset_conversion, Qiso2022, Qlf, Qlock_shift; extern Lisp_Object Qmnemonic, Qno_ascii_cntl, Qno_ascii_eol, Qno_conversion; +extern Lisp_Object Qraw_text; extern Lisp_Object Qno_iso6429, Qoutput_charset_conversion; extern Lisp_Object Qpost_read_conversion, Qpre_write_conversion, Qseven; extern Lisp_Object Qshift_jis, Qshort, Vcoding_system_for_read; diff --git a/src/mule-coding.c b/src/mule-coding.c deleted file mode 100644 index 635b381..0000000 --- a/src/mule-coding.c +++ /dev/null @@ -1,4815 +0,0 @@ -/* Code conversion functions. - Copyright (C) 1991, 1995 Free Software Foundation, Inc. - Copyright (C) 1995 Sun Microsystems, Inc. - -This file is part of XEmacs. - -XEmacs is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -XEmacs is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with XEmacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* Synched up with: Mule 2.3. Not in FSF. */ - -/* Rewritten by Ben Wing . */ - -#if 0 /* while file-coding not split up */ - -#include -#include "lisp.h" - -#include "buffer.h" -#include "elhash.h" -#include "insdel.h" -#include "lstream.h" -#include "mule-ccl.h" -#include "mule-coding.h" - -Lisp_Object Qbuffer_file_coding_system, Qcoding_system_error; - -Lisp_Object Vkeyboard_coding_system; -Lisp_Object Vterminal_coding_system; -Lisp_Object Vcoding_system_for_read; -Lisp_Object Vcoding_system_for_write; -Lisp_Object Vfile_name_coding_system; - -/* Table of symbols identifying each coding category. */ -Lisp_Object coding_category_symbol[CODING_CATEGORY_LAST + 1]; - -/* Coding system currently associated with each coding category. */ -Lisp_Object coding_category_system[CODING_CATEGORY_LAST + 1]; - -/* Table of all coding categories in decreasing order of priority. - This describes a permutation of the possible coding categories. */ -int coding_category_by_priority[CODING_CATEGORY_LAST + 1]; - -Lisp_Object Qcoding_system_p; - -Lisp_Object Qbig5, Qshift_jis, Qno_conversion, Qccl, Qiso2022; -/* Qinternal in general.c */ - -Lisp_Object Qmnemonic, Qeol_type; -Lisp_Object Qcr, Qcrlf, Qlf; -Lisp_Object Qeol_cr, Qeol_crlf, Qeol_lf; -Lisp_Object Qpost_read_conversion; -Lisp_Object Qpre_write_conversion; - -Lisp_Object Qcharset_g0, Qcharset_g1, Qcharset_g2, Qcharset_g3; -Lisp_Object Qforce_g0_on_output, Qforce_g1_on_output; -Lisp_Object Qforce_g2_on_output, Qforce_g3_on_output; -Lisp_Object Qshort, Qno_ascii_eol, Qno_ascii_cntl, Qseven, Qlock_shift; -Lisp_Object Qno_iso6429, Qescape_quoted; -Lisp_Object Qinput_charset_conversion, Qoutput_charset_conversion; - -Lisp_Object Qencode, Qdecode; - -Lisp_Object Qctext; - -Lisp_Object Vcoding_system_hash_table; - -int enable_multibyte_characters; - -/* Additional information used by the ISO2022 decoder and detector. */ -struct iso2022_decoder -{ - /* CHARSET holds the character sets currently assigned to the G0 - through G3 variables. It is initialized from the array - INITIAL_CHARSET in CODESYS. */ - Lisp_Object charset[4]; - - /* Which registers are currently invoked into the left (GL) and - right (GR) halves of the 8-bit encoding space? */ - int register_left, register_right; - - /* ISO_ESC holds a value indicating part of an escape sequence - that has already been seen. */ - enum iso_esc_flag esc; - - /* This records the bytes we've seen so far in an escape sequence, - in case the sequence is invalid (we spit out the bytes unchanged). */ - unsigned char esc_bytes[8]; - - /* Index for next byte to store in ISO escape sequence. */ - int esc_bytes_index; - - /* Stuff seen so far when composing a string. */ - unsigned_char_dynarr *composite_chars; - - /* If we saw an invalid designation sequence for a particular - register, we flag it here and switch to ASCII. The next time we - see a valid designation for this register, we turn off the flag - and do the designation normally, but pretend the sequence was - invalid. The effect of all this is that (most of the time) the - escape sequences for both the switch to the unknown charset, and - the switch back to the known charset, get inserted literally into - the buffer and saved out as such. The hope is that we can - preserve the escape sequences so that the resulting written out - file makes sense. If we don't do any of this, the designation - to the invalid charset will be preserved but that switch back - to the known charset will probably get eaten because it was - the same charset that was already present in the register. */ - unsigned char invalid_designated[4]; - - /* We try to do similar things as above for direction-switching - sequences. If we encountered a direction switch while an - invalid designation was present, or an invalid designation - just after a direction switch (i.e. no valid designation - encountered yet), we insert the direction-switch escape - sequence literally into the output stream, and later on - insert the corresponding direction-restoring escape sequence - literally also. */ - unsigned int switched_dir_and_no_valid_charset_yet :1; - unsigned int invalid_switch_dir :1; - - /* Tells the decoder to output the escape sequence literally - even though it was valid. Used in the games we play to - avoid lossage when we encounter invalid designations. */ - unsigned int output_literally :1; - /* We encountered a direction switch followed by an invalid - designation. We didn't output the direction switch - literally because we didn't know about the invalid designation; - but we have to do so now. */ - unsigned int output_direction_sequence :1; -}; - -EXFUN (Fcopy_coding_system, 2); -struct detection_state; -static int detect_coding_sjis (struct detection_state *st, - CONST unsigned char *src, - unsigned int n); -static void decode_coding_sjis (Lstream *decoding, - CONST unsigned char *src, - unsigned_char_dynarr *dst, - unsigned int n); -static void encode_coding_sjis (Lstream *encoding, - CONST unsigned char *src, - unsigned_char_dynarr *dst, - unsigned int n); -static int detect_coding_big5 (struct detection_state *st, - CONST unsigned char *src, - unsigned int n); -static void decode_coding_big5 (Lstream *decoding, - CONST unsigned char *src, - unsigned_char_dynarr *dst, unsigned int n); -static void encode_coding_big5 (Lstream *encoding, - CONST unsigned char *src, - unsigned_char_dynarr *dst, unsigned int n); -static int postprocess_iso2022_mask (int mask); -static void reset_iso2022 (Lisp_Object coding_system, - struct iso2022_decoder *iso); -static int detect_coding_iso2022 (struct detection_state *st, - CONST unsigned char *src, - unsigned int n); -static void decode_coding_iso2022 (Lstream *decoding, - CONST unsigned char *src, - unsigned_char_dynarr *dst, unsigned int n); -static void encode_coding_iso2022 (Lstream *encoding, - CONST unsigned char *src, - unsigned_char_dynarr *dst, unsigned int n); -static void decode_coding_no_conversion (Lstream *decoding, - CONST unsigned char *src, - unsigned_char_dynarr *dst, - unsigned int n); -static void encode_coding_no_conversion (Lstream *encoding, - CONST unsigned char *src, - unsigned_char_dynarr *dst, - unsigned int n); -static void mule_decode (Lstream *decoding, CONST unsigned char *src, - unsigned_char_dynarr *dst, unsigned int n); -static void mule_encode (Lstream *encoding, CONST unsigned char *src, - unsigned_char_dynarr *dst, unsigned int n); - -typedef struct codesys_prop codesys_prop; -struct codesys_prop -{ - Lisp_Object sym; - int prop_type; -}; - -typedef struct -{ - Dynarr_declare (codesys_prop); -} codesys_prop_dynarr; - -codesys_prop_dynarr *the_codesys_prop_dynarr; - -enum codesys_prop_enum -{ - CODESYS_PROP_ALL_OK, - CODESYS_PROP_ISO2022, - CODESYS_PROP_CCL -}; - - -/************************************************************************/ -/* Coding system functions */ -/************************************************************************/ - -static Lisp_Object -mark_coding_system (Lisp_Object obj, void (*markobj) (Lisp_Object)) -{ - struct Lisp_Coding_System *codesys = XCODING_SYSTEM (obj); - - markobj (CODING_SYSTEM_NAME (codesys)); - markobj (CODING_SYSTEM_DOC_STRING (codesys)); - markobj (CODING_SYSTEM_MNEMONIC (codesys)); - markobj (CODING_SYSTEM_EOL_LF (codesys)); - markobj (CODING_SYSTEM_EOL_CRLF (codesys)); - markobj (CODING_SYSTEM_EOL_CR (codesys)); - - switch (CODING_SYSTEM_TYPE (codesys)) - { - int i; - case CODESYS_ISO2022: - for (i = 0; i < 4; i++) - markobj (CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, i)); - if (codesys->iso2022.input_conv) - { - for (i = 0; i < Dynarr_length (codesys->iso2022.input_conv); i++) - { - struct charset_conversion_spec *ccs = - Dynarr_atp (codesys->iso2022.input_conv, i); - markobj (ccs->from_charset); - markobj (ccs->to_charset); - } - } - if (codesys->iso2022.output_conv) - { - for (i = 0; i < Dynarr_length (codesys->iso2022.output_conv); i++) - { - struct charset_conversion_spec *ccs = - Dynarr_atp (codesys->iso2022.output_conv, i); - markobj (ccs->from_charset); - markobj (ccs->to_charset); - } - } - break; - - case CODESYS_CCL: - markobj (CODING_SYSTEM_CCL_DECODE (codesys)); - markobj (CODING_SYSTEM_CCL_ENCODE (codesys)); - break; - default: - break; - } - - markobj (CODING_SYSTEM_PRE_WRITE_CONVERSION (codesys)); - return CODING_SYSTEM_POST_READ_CONVERSION (codesys); -} - -static void -print_coding_system (Lisp_Object obj, Lisp_Object printcharfun, - int escapeflag) -{ - struct Lisp_Coding_System *c = XCODING_SYSTEM (obj); - if (print_readably) - error ("printing unreadable object #", - c->header.uid); - - write_c_string ("#name, printcharfun, 1); - write_c_string (">", printcharfun); -} - -static void -finalize_coding_system (void *header, int for_disksave) -{ - struct Lisp_Coding_System *c = (struct Lisp_Coding_System *) header; - /* Since coding systems never go away, this function is not - necessary. But it would be necessary if we changed things - so that coding systems could go away. */ - if (!for_disksave) /* see comment in lstream.c */ - { - switch (CODING_SYSTEM_TYPE (c)) - { - case CODESYS_ISO2022: - if (c->iso2022.input_conv) - { - Dynarr_free (c->iso2022.input_conv); - c->iso2022.input_conv = 0; - } - if (c->iso2022.output_conv) - { - Dynarr_free (c->iso2022.output_conv); - c->iso2022.output_conv = 0; - } - break; - - default: - break; - } - } -} - -DEFINE_LRECORD_IMPLEMENTATION ("coding-system", coding_system, - mark_coding_system, print_coding_system, - finalize_coding_system, - 0, 0, struct Lisp_Coding_System); - -static enum eol_type -symbol_to_eol_type (Lisp_Object symbol) -{ - CHECK_SYMBOL (symbol); - if (NILP (symbol)) return EOL_AUTODETECT; - if (EQ (symbol, Qlf)) return EOL_LF; - if (EQ (symbol, Qcrlf)) return EOL_CRLF; - if (EQ (symbol, Qcr)) return EOL_CR; - - signal_simple_error ("Unrecognized eol type", symbol); - return EOL_AUTODETECT; /* not reached */ -} - -static Lisp_Object -eol_type_to_symbol (enum eol_type type) -{ - switch (type) - { - default: abort (); - case EOL_LF: return Qlf; - case EOL_CRLF: return Qcrlf; - case EOL_CR: return Qcr; - case EOL_AUTODETECT: return Qnil; - } -} - -static void -setup_eol_coding_systems (struct Lisp_Coding_System *codesys) -{ - Lisp_Object codesys_obj; - int len = string_length (XSYMBOL (CODING_SYSTEM_NAME (codesys))->name); - char *codesys_name = (char *) alloca (len + 7); - Lisp_Object codesys_name_sym, sub_codesys_obj; - - /* kludge */ - - XSETCODING_SYSTEM (codesys_obj, codesys); - - memcpy (codesys_name, - string_data (XSYMBOL (CODING_SYSTEM_NAME (codesys))->name), len); - -#define DEFINE_SUB_CODESYS(op_sys, Type) do { \ - strcpy (codesys_name + len, "-" op_sys); \ - codesys_name_sym = intern (codesys_name); \ - sub_codesys_obj = Fcopy_coding_system (codesys_obj, codesys_name_sym); \ - XCODING_SYSTEM_EOL_TYPE (sub_codesys_obj) = Type; \ - CODING_SYSTEM_##Type (codesys) = sub_codesys_obj; \ -} while (0) - - DEFINE_SUB_CODESYS("unix", EOL_LF); - DEFINE_SUB_CODESYS("dos", EOL_CRLF); - DEFINE_SUB_CODESYS("mac", EOL_CR); -} - -DEFUN ("coding-system-p", Fcoding_system_p, 1, 1, 0, /* -Return t if OBJECT is a coding system. -A coding system is an object that defines how text containing multiple -character sets is encoded into a stream of (typically 8-bit) bytes. -The coding system is used to decode the stream into a series of -characters (which may be from multiple charsets) when the text is read -from a file or process, and is used to encode the text back into the -same format when it is written out to a file or process. - -For example, many ISO2022-compliant coding systems (such as Compound -Text, which is used for inter-client data under the X Window System) -use escape sequences to switch between different charsets -- Japanese -Kanji, for example, is invoked with "ESC $ ( B"; ASCII is invoked -with "ESC ( B"; and Cyrillic is invoked with "ESC - L". See -`make-coding-system' for more information. - -Coding systems are normally identified using a symbol, and the -symbol is accepted in place of the actual coding system object whenever -a coding system is called for. (This is similar to how faces work.) -*/ - (object)) -{ - return CODING_SYSTEMP (object) ? Qt : Qnil; -} - -DEFUN ("find-coding-system", Ffind_coding_system, 1, 1, 0, /* -Retrieve the coding system of the given name. - -If CODING-SYSTEM-OR-NAME is a coding-system object, it is simply -returned. Otherwise, CODING-SYSTEM-OR-NAME should be a symbol. -If there is no such coding system, nil is returned. Otherwise the -associated coding system object is returned. -*/ - (coding_system_or_name)) -{ - if (NILP (coding_system_or_name)) - coding_system_or_name = Qbinary; - if (CODING_SYSTEMP (coding_system_or_name)) - return coding_system_or_name; - CHECK_SYMBOL (coding_system_or_name); - - return Fgethash (coding_system_or_name, Vcoding_system_hash_table, Qnil); -} - -DEFUN ("get-coding-system", Fget_coding_system, 1, 1, 0, /* -Retrieve the coding system of the given name. -Same as `find-coding-system' except that if there is no such -coding system, an error is signaled instead of returning nil. -*/ - (name)) -{ - Lisp_Object coding_system = Ffind_coding_system (name); - - if (NILP (coding_system)) - signal_simple_error ("No such coding system", name); - return coding_system; -} - -/* We store the coding systems in hash tables with the names as the key and the - actual coding system object as the value. Occasionally we need to use them - in a list format. These routines provide us with that. */ -struct coding_system_list_closure -{ - Lisp_Object *coding_system_list; -}; - -static int -add_coding_system_to_list_mapper (CONST void *hash_key, void *hash_contents, - void *coding_system_list_closure) -{ - /* This function can GC */ - Lisp_Object key, contents; - Lisp_Object *coding_system_list; - struct coding_system_list_closure *cscl = - (struct coding_system_list_closure *) coding_system_list_closure; - CVOID_TO_LISP (key, hash_key); - VOID_TO_LISP (contents, hash_contents); - coding_system_list = cscl->coding_system_list; - - *coding_system_list = Fcons (XCODING_SYSTEM (contents)->name, - *coding_system_list); - return 0; -} - -DEFUN ("coding-system-list", Fcoding_system_list, 0, 0, 0, /* -Return a list of the names of all defined coding systems. -*/ - ()) -{ - Lisp_Object coding_system_list = Qnil; - struct gcpro gcpro1; - struct coding_system_list_closure coding_system_list_closure; - - GCPRO1 (coding_system_list); - coding_system_list_closure.coding_system_list = &coding_system_list; - elisp_maphash (add_coding_system_to_list_mapper, Vcoding_system_hash_table, - &coding_system_list_closure); - UNGCPRO; - - return coding_system_list; -} - -DEFUN ("coding-system-name", Fcoding_system_name, 1, 1, 0, /* -Return the name of the given coding system. -*/ - (coding_system)) -{ - coding_system = Fget_coding_system (coding_system); - return XCODING_SYSTEM_NAME (coding_system); -} - -static struct Lisp_Coding_System * -allocate_coding_system (enum coding_system_type type, Lisp_Object name) -{ - struct Lisp_Coding_System *codesys = - alloc_lcrecord_type (struct Lisp_Coding_System, lrecord_coding_system); - - zero_lcrecord (codesys); - CODING_SYSTEM_PRE_WRITE_CONVERSION (codesys) = Qnil; - CODING_SYSTEM_POST_READ_CONVERSION (codesys) = Qnil; - CODING_SYSTEM_EOL_TYPE (codesys) = EOL_AUTODETECT; - CODING_SYSTEM_EOL_CRLF (codesys) = Qnil; - CODING_SYSTEM_EOL_CR (codesys) = Qnil; - CODING_SYSTEM_EOL_LF (codesys) = Qnil; - CODING_SYSTEM_TYPE (codesys) = type; - - if (type == CODESYS_ISO2022) - { - int i; - for (i = 0; i < 4; i++) - CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, i) = Qnil; - } - else if (type == CODESYS_CCL) - { - CODING_SYSTEM_CCL_DECODE (codesys) = Qnil; - CODING_SYSTEM_CCL_ENCODE (codesys) = Qnil; - } - - CODING_SYSTEM_NAME (codesys) = name; - - return codesys; -} - -/* Given a list of charset conversion specs as specified in a Lisp - program, parse it into STORE_HERE. */ - -static void -parse_charset_conversion_specs (charset_conversion_spec_dynarr *store_here, - Lisp_Object spec_list) -{ - Lisp_Object rest; - - EXTERNAL_LIST_LOOP (rest, spec_list) - { - Lisp_Object car = XCAR (rest); - Lisp_Object from, to; - struct charset_conversion_spec spec; - - if (!CONSP (car) || !CONSP (XCDR (car)) || !NILP (XCDR (XCDR (car)))) - signal_simple_error ("Invalid charset conversion spec", car); - from = Fget_charset (XCAR (car)); - to = Fget_charset (XCAR (XCDR (car))); - if (XCHARSET_TYPE (from) != XCHARSET_TYPE (to)) - signal_simple_error_2 - ("Attempted conversion between different charset types", - from, to); - spec.from_charset = from; - spec.to_charset = to; - - Dynarr_add (store_here, spec); - } -} - -/* Given a dynarr LOAD_HERE of internally-stored charset conversion - specs, return the equivalent as the Lisp programmer would see it. - - If LOAD_HERE is 0, return Qnil. */ - -static Lisp_Object -unparse_charset_conversion_specs (charset_conversion_spec_dynarr *load_here) -{ - int i; - Lisp_Object result = Qnil; - - if (!load_here) - return Qnil; - for (i = 0; i < Dynarr_length (load_here); i++) - { - struct charset_conversion_spec *ccs = - Dynarr_atp (load_here, i); - result = Fcons (list2 (ccs->from_charset, ccs->to_charset), result); - } - - return Fnreverse (result); -} - -DEFUN ("make-coding-system", Fmake_coding_system, 2, 4, 0, /* -Register symbol NAME as a coding system. - -TYPE describes the conversion method used and should be one of - -nil or 'undecided - Automatic conversion. XEmacs attempts to detect the coding system - used in the file. -'no-conversion - No conversion. Use this for binary files and such. On output, - graphic characters that are not in ASCII or Latin-1 will be - replaced by a ?. (For a no-conversion-encoded buffer, these - characters will only be present if you explicitly insert them.) -'shift-jis - Shift-JIS (a Japanese encoding commonly used in PC operating systems). -'iso2022 - Any ISO2022-compliant encoding. Among other things, this includes - JIS (the Japanese encoding commonly used for e-mail), EUC (the - standard Unix encoding for Japanese and other languages), and - Compound Text (the encoding used in X11). You can specify more - specific information about the conversion with the FLAGS argument. -'big5 - Big5 (the encoding commonly used for Taiwanese). -'ccl - The conversion is performed using a user-written pseudo-code - program. CCL (Code Conversion Language) is the name of this - pseudo-code. -'internal - Write out or read in the raw contents of the memory representing - the buffer's text. This is primarily useful for debugging - purposes, and is only enabled when XEmacs has been compiled with - DEBUG_XEMACS defined (via the --debug configure option). - WARNING: Reading in a file using 'internal conversion can result - in an internal inconsistency in the memory representing a - buffer's text, which will produce unpredictable results and may - cause XEmacs to crash. Under normal circumstances you should - never use 'internal conversion. - -DOC-STRING is a string describing the coding system. - -PROPS is a property list, describing the specific nature of the -character set. Recognized properties are: - -'mnemonic - String to be displayed in the modeline when this coding system is - active. - -'eol-type - End-of-line conversion to be used. It should be one of - - nil - Automatically detect the end-of-line type (LF, CRLF, - or CR). Also generate subsidiary coding systems named - `NAME-unix', `NAME-dos', and `NAME-mac', that are - identical to this coding system but have an EOL-TYPE - value of 'lf, 'crlf, and 'cr, respectively. - 'lf - The end of a line is marked externally using ASCII LF. - Since this is also the way that XEmacs represents an - end-of-line internally, specifying this option results - in no end-of-line conversion. This is the standard - format for Unix text files. - 'crlf - The end of a line is marked externally using ASCII - CRLF. This is the standard format for MS-DOS text - files. - 'cr - The end of a line is marked externally using ASCII CR. - This is the standard format for Macintosh text files. - t - Automatically detect the end-of-line type but do not - generate subsidiary coding systems. (This value is - converted to nil when stored internally, and - `coding-system-property' will return nil.) - -'post-read-conversion - Function called after a file has been read in, to perform the - decoding. Called with two arguments, BEG and END, denoting - a region of the current buffer to be decoded. - -'pre-write-conversion - Function called before a file is written out, to perform the - encoding. Called with two arguments, BEG and END, denoting - a region of the current buffer to be encoded. - - -The following additional properties are recognized if TYPE is 'iso2022: - -'charset-g0 -'charset-g1 -'charset-g2 -'charset-g3 - The character set initially designated to the G0 - G3 registers. - The value should be one of - - -- A charset object (designate that character set) - -- nil (do not ever use this register) - -- t (no character set is initially designated to - the register, but may be later on; this automatically - sets the corresponding `force-g*-on-output' property) - -'force-g0-on-output -'force-g1-on-output -'force-g2-on-output -'force-g2-on-output - If non-nil, send an explicit designation sequence on output before - using the specified register. - -'short - If non-nil, use the short forms "ESC $ @", "ESC $ A", and - "ESC $ B" on output in place of the full designation sequences - "ESC $ ( @", "ESC $ ( A", and "ESC $ ( B". - -'no-ascii-eol - If non-nil, don't designate ASCII to G0 at each end of line on output. - Setting this to non-nil also suppresses other state-resetting that - normally happens at the end of a line. - -'no-ascii-cntl - If non-nil, don't designate ASCII to G0 before control chars on output. - -'seven - If non-nil, use 7-bit environment on output. Otherwise, use 8-bit - environment. - -'lock-shift - If non-nil, use locking-shift (SO/SI) instead of single-shift - or designation by escape sequence. - -'no-iso6429 - If non-nil, don't use ISO6429's direction specification. - -'escape-quoted - If non-nil, literal control characters that are the same as - the beginning of a recognized ISO2022 or ISO6429 escape sequence - (in particular, ESC (0x1B), SO (0x0E), SI (0x0F), SS2 (0x8E), - SS3 (0x8F), and CSI (0x9B)) are "quoted" with an escape character - so that they can be properly distinguished from an escape sequence. - (Note that doing this results in a non-portable encoding.) This - encoding flag is used for byte-compiled files. Note that ESC - is a good choice for a quoting character because there are no - escape sequences whose second byte is a character from the Control-0 - or Control-1 character sets; this is explicitly disallowed by the - ISO2022 standard. - -'input-charset-conversion - A list of conversion specifications, specifying conversion of - characters in one charset to another when decoding is performed. - Each specification is a list of two elements: the source charset, - and the destination charset. - -'output-charset-conversion - A list of conversion specifications, specifying conversion of - characters in one charset to another when encoding is performed. - The form of each specification is the same as for - 'input-charset-conversion. - - -The following additional properties are recognized (and required) -if TYPE is 'ccl: - -'decode - CCL program used for decoding (converting to internal format). - -'encode - CCL program used for encoding (converting to external format). -*/ - (name, type, doc_string, props)) -{ - struct Lisp_Coding_System *codesys; - Lisp_Object rest, key, value; - enum coding_system_type ty; - int need_to_setup_eol_systems = 1; - - /* Convert type to constant */ - if (NILP (type) || EQ (type, Qundecided)) - { ty = CODESYS_AUTODETECT; } - else if (EQ (type, Qshift_jis)) { ty = CODESYS_SHIFT_JIS; } - else if (EQ (type, Qiso2022)) { ty = CODESYS_ISO2022; } - else if (EQ (type, Qbig5)) { ty = CODESYS_BIG5; } - else if (EQ (type, Qccl)) { ty = CODESYS_CCL; } - else if (EQ (type, Qno_conversion)) { ty = CODESYS_NO_CONVERSION; } -#ifdef DEBUG_XEMACS - else if (EQ (type, Qinternal)) { ty = CODESYS_INTERNAL; } -#endif - else - signal_simple_error ("Invalid coding system type", type); - - CHECK_SYMBOL (name); - - codesys = allocate_coding_system (ty, name); - - if (NILP (doc_string)) - doc_string = build_string (""); - else - CHECK_STRING (doc_string); - CODING_SYSTEM_DOC_STRING (codesys) = doc_string; - - EXTERNAL_PROPERTY_LIST_LOOP (rest, key, value, props) - { - if (EQ (key, Qmnemonic)) - { - if (!NILP (value)) - CHECK_STRING (value); - CODING_SYSTEM_MNEMONIC (codesys) = value; - } - - else if (EQ (key, Qeol_type)) - { - need_to_setup_eol_systems = NILP (value); - if (EQ (value, Qt)) - value = Qnil; - CODING_SYSTEM_EOL_TYPE (codesys) = symbol_to_eol_type (value); - } - - else if (EQ (key, Qpost_read_conversion)) CODING_SYSTEM_POST_READ_CONVERSION (codesys) = value; - else if (EQ (key, Qpre_write_conversion)) CODING_SYSTEM_PRE_WRITE_CONVERSION (codesys) = value; - else if (ty == CODESYS_ISO2022) - { -#define FROB_INITIAL_CHARSET(charset_num) \ - CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, charset_num) = \ - ((EQ (value, Qt) || EQ (value, Qnil)) ? value : Fget_charset (value)) - - if (EQ (key, Qcharset_g0)) FROB_INITIAL_CHARSET (0); - else if (EQ (key, Qcharset_g1)) FROB_INITIAL_CHARSET (1); - else if (EQ (key, Qcharset_g2)) FROB_INITIAL_CHARSET (2); - else if (EQ (key, Qcharset_g3)) FROB_INITIAL_CHARSET (3); - -#define FROB_FORCE_CHARSET(charset_num) \ - CODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT (codesys, charset_num) = !NILP (value) - - else if (EQ (key, Qforce_g0_on_output)) FROB_FORCE_CHARSET (0); - else if (EQ (key, Qforce_g1_on_output)) FROB_FORCE_CHARSET (1); - else if (EQ (key, Qforce_g2_on_output)) FROB_FORCE_CHARSET (2); - else if (EQ (key, Qforce_g3_on_output)) FROB_FORCE_CHARSET (3); - -#define FROB_BOOLEAN_PROPERTY(prop) \ - CODING_SYSTEM_ISO2022_##prop (codesys) = !NILP (value) - - else if (EQ (key, Qshort)) FROB_BOOLEAN_PROPERTY (SHORT); - else if (EQ (key, Qno_ascii_eol)) FROB_BOOLEAN_PROPERTY (NO_ASCII_EOL); - else if (EQ (key, Qno_ascii_cntl)) FROB_BOOLEAN_PROPERTY (NO_ASCII_CNTL); - else if (EQ (key, Qseven)) FROB_BOOLEAN_PROPERTY (SEVEN); - else if (EQ (key, Qlock_shift)) FROB_BOOLEAN_PROPERTY (LOCK_SHIFT); - else if (EQ (key, Qno_iso6429)) FROB_BOOLEAN_PROPERTY (NO_ISO6429); - else if (EQ (key, Qescape_quoted)) FROB_BOOLEAN_PROPERTY (ESCAPE_QUOTED); - - else if (EQ (key, Qinput_charset_conversion)) - { - codesys->iso2022.input_conv = - Dynarr_new (charset_conversion_spec); - parse_charset_conversion_specs (codesys->iso2022.input_conv, - value); - } - else if (EQ (key, Qoutput_charset_conversion)) - { - codesys->iso2022.output_conv = - Dynarr_new (charset_conversion_spec); - parse_charset_conversion_specs (codesys->iso2022.output_conv, - value); - } - else - signal_simple_error ("Unrecognized property", key); - } - else if (EQ (type, Qccl)) - { - if (EQ (key, Qdecode)) - { - CHECK_VECTOR (value); - CODING_SYSTEM_CCL_DECODE (codesys) = value; - } - else if (EQ (key, Qencode)) - { - CHECK_VECTOR (value); - CODING_SYSTEM_CCL_ENCODE (codesys) = value; - } - else - signal_simple_error ("Unrecognized property", key); - } - else - signal_simple_error ("Unrecognized property", key); - } - - if (need_to_setup_eol_systems) - setup_eol_coding_systems (codesys); - - { - Lisp_Object codesys_obj; - XSETCODING_SYSTEM (codesys_obj, codesys); - Fputhash (name, codesys_obj, Vcoding_system_hash_table); - return codesys_obj; - } -} - -DEFUN ("copy-coding-system", Fcopy_coding_system, 2, 2, 0, /* -Copy OLD-CODING-SYSTEM to NEW-NAME. -If NEW-NAME does not name an existing coding system, a new one will -be created. -*/ - (old_coding_system, new_name)) -{ - Lisp_Object new_coding_system; - old_coding_system = Fget_coding_system (old_coding_system); - new_coding_system = Ffind_coding_system (new_name); - if (NILP (new_coding_system)) - { - XSETCODING_SYSTEM (new_coding_system, - allocate_coding_system - (XCODING_SYSTEM_TYPE (old_coding_system), - new_name)); - Fputhash (new_name, new_coding_system, Vcoding_system_hash_table); - } - - { - struct Lisp_Coding_System *to = XCODING_SYSTEM (new_coding_system); - struct Lisp_Coding_System *from = XCODING_SYSTEM (old_coding_system); - memcpy (((char *) to ) + sizeof (to->header), - ((char *) from) + sizeof (from->header), - sizeof (*from) - sizeof (from->header)); - to->name = new_name; - } - return new_coding_system; -} - -static Lisp_Object -subsidiary_coding_system (Lisp_Object coding_system, enum eol_type type) -{ - struct Lisp_Coding_System *cs = XCODING_SYSTEM (coding_system); - Lisp_Object new_coding_system; - - if (CODING_SYSTEM_EOL_TYPE (cs) != EOL_AUTODETECT) - return coding_system; - - switch (type) - { - case EOL_AUTODETECT: return coding_system; - case EOL_LF: new_coding_system = CODING_SYSTEM_EOL_LF (cs); break; - case EOL_CR: new_coding_system = CODING_SYSTEM_EOL_CR (cs); break; - case EOL_CRLF: new_coding_system = CODING_SYSTEM_EOL_CRLF (cs); break; - default: abort (); - } - - return NILP (new_coding_system) ? coding_system : new_coding_system; -} - -DEFUN ("subsidiary-coding-system", Fsubsidiary_coding_system, 2, 2, 0, /* -Return the subsidiary coding system of CODING-SYSTEM with eol type EOL-TYPE. -*/ - (coding_system, eol_type)) -{ - coding_system = Fget_coding_system (coding_system); - - return subsidiary_coding_system (coding_system, - symbol_to_eol_type (eol_type)); -} - - -/************************************************************************/ -/* Coding system accessors */ -/************************************************************************/ - -DEFUN ("coding-system-doc-string", Fcoding_system_doc_string, 1, 1, 0, /* -Return the doc string for CODING-SYSTEM. -*/ - (coding_system)) -{ - coding_system = Fget_coding_system (coding_system); - return XCODING_SYSTEM_DOC_STRING (coding_system); -} - -DEFUN ("coding-system-type", Fcoding_system_type, 1, 1, 0, /* -Return the type of CODING-SYSTEM. -*/ - (coding_system)) -{ - switch (XCODING_SYSTEM_TYPE (Fget_coding_system (coding_system))) - { - case CODESYS_AUTODETECT: return Qundecided; - case CODESYS_SHIFT_JIS: return Qshift_jis; - case CODESYS_ISO2022: return Qiso2022; - case CODESYS_BIG5: return Qbig5; - case CODESYS_CCL: return Qccl; - case CODESYS_NO_CONVERSION: return Qno_conversion; -#ifdef DEBUG_XEMACS - case CODESYS_INTERNAL: return Qinternal; -#endif - default: - abort (); - } - - return Qnil; /* not reached */ -} - -static -Lisp_Object coding_system_charset (Lisp_Object coding_system, int gnum) -{ - Lisp_Object cs - = XCODING_SYSTEM_ISO2022_INITIAL_CHARSET (coding_system, gnum); - - return CHARSETP (cs) ? XCHARSET_NAME (cs) : Qnil; -} - -DEFUN ("coding-system-charset", Fcoding_system_charset, 2, 2, 0, /* -Return initial charset of CODING-SYSTEM designated to GNUM. -GNUM allows 0 .. 3. -*/ - (coding_system, gnum)) -{ - coding_system = Fget_coding_system (coding_system); - CHECK_INT (gnum); - - return coding_system_charset (coding_system, XINT (gnum)); -} - -DEFUN ("coding-system-property", Fcoding_system_property, 2, 2, 0, /* -Return the PROP property of CODING-SYSTEM. -*/ - (coding_system, prop)) -{ - int i, ok = 0; - enum coding_system_type type; - - coding_system = Fget_coding_system (coding_system); - CHECK_SYMBOL (prop); - type = XCODING_SYSTEM_TYPE (coding_system); - - for (i = 0; !ok && i < Dynarr_length (the_codesys_prop_dynarr); i++) - if (EQ (Dynarr_at (the_codesys_prop_dynarr, i).sym, prop)) - { - ok = 1; - switch (Dynarr_at (the_codesys_prop_dynarr, i).prop_type) - { - case CODESYS_PROP_ALL_OK: - break; - - case CODESYS_PROP_ISO2022: - if (type != CODESYS_ISO2022) - signal_simple_error - ("Property only valid in ISO2022 coding systems", - prop); - break; - - case CODESYS_PROP_CCL: - if (type != CODESYS_CCL) - signal_simple_error - ("Property only valid in CCL coding systems", - prop); - break; - - default: - abort (); - } - } - - if (!ok) - signal_simple_error ("Unrecognized property", prop); - - if (EQ (prop, Qname)) - return XCODING_SYSTEM_NAME (coding_system); - else if (EQ (prop, Qtype)) - return Fcoding_system_type (coding_system); - else if (EQ (prop, Qdoc_string)) - return XCODING_SYSTEM_DOC_STRING (coding_system); - else if (EQ (prop, Qmnemonic)) - return XCODING_SYSTEM_MNEMONIC (coding_system); - else if (EQ (prop, Qeol_type)) - return eol_type_to_symbol (XCODING_SYSTEM_EOL_TYPE (coding_system)); - else if (EQ (prop, Qeol_lf)) - return XCODING_SYSTEM_EOL_LF (coding_system); - else if (EQ (prop, Qeol_crlf)) - return XCODING_SYSTEM_EOL_CRLF (coding_system); - else if (EQ (prop, Qeol_cr)) - return XCODING_SYSTEM_EOL_CR (coding_system); - else if (EQ (prop, Qpost_read_conversion)) - return XCODING_SYSTEM_POST_READ_CONVERSION (coding_system); - else if (EQ (prop, Qpre_write_conversion)) - return XCODING_SYSTEM_PRE_WRITE_CONVERSION (coding_system); - else if (type == CODESYS_ISO2022) - { - if (EQ (prop, Qcharset_g0)) - return coding_system_charset (coding_system, 0); - else if (EQ (prop, Qcharset_g1)) - return coding_system_charset (coding_system, 1); - else if (EQ (prop, Qcharset_g2)) - return coding_system_charset (coding_system, 2); - else if (EQ (prop, Qcharset_g3)) - return coding_system_charset (coding_system, 3); - -#define FORCE_CHARSET(charset_num) \ - (XCODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT \ - (coding_system, charset_num) ? Qt : Qnil) - - else if (EQ (prop, Qforce_g0_on_output)) return FORCE_CHARSET (0); - else if (EQ (prop, Qforce_g1_on_output)) return FORCE_CHARSET (1); - else if (EQ (prop, Qforce_g2_on_output)) return FORCE_CHARSET (2); - else if (EQ (prop, Qforce_g3_on_output)) return FORCE_CHARSET (3); - -#define LISP_BOOLEAN(prop) \ - (XCODING_SYSTEM_ISO2022_##prop (coding_system) ? Qt : Qnil) - - else if (EQ (prop, Qshort)) return LISP_BOOLEAN (SHORT); - else if (EQ (prop, Qno_ascii_eol)) return LISP_BOOLEAN (NO_ASCII_EOL); - else if (EQ (prop, Qno_ascii_cntl)) return LISP_BOOLEAN (NO_ASCII_CNTL); - else if (EQ (prop, Qseven)) return LISP_BOOLEAN (SEVEN); - else if (EQ (prop, Qlock_shift)) return LISP_BOOLEAN (LOCK_SHIFT); - else if (EQ (prop, Qno_iso6429)) return LISP_BOOLEAN (NO_ISO6429); - else if (EQ (prop, Qescape_quoted)) return LISP_BOOLEAN (ESCAPE_QUOTED); - - else if (EQ (prop, Qinput_charset_conversion)) - return - unparse_charset_conversion_specs - (XCODING_SYSTEM (coding_system)->iso2022.input_conv); - else if (EQ (prop, Qoutput_charset_conversion)) - return - unparse_charset_conversion_specs - (XCODING_SYSTEM (coding_system)->iso2022.output_conv); - else - abort (); - } - else if (type == CODESYS_CCL) - { - if (EQ (prop, Qdecode)) - return XCODING_SYSTEM_CCL_DECODE (coding_system); - else if (EQ (prop, Qencode)) - return XCODING_SYSTEM_CCL_ENCODE (coding_system); - else - abort (); - } - else - abort (); - - return Qnil; /* not reached */ -} - - -/************************************************************************/ -/* Coding category functions */ -/************************************************************************/ - -static int -decode_coding_category (Lisp_Object symbol) -{ - int i; - - CHECK_SYMBOL (symbol); - for (i = 0; i <= CODING_CATEGORY_LAST; i++) - if (EQ (coding_category_symbol[i], symbol)) - return i; - - signal_simple_error ("Unrecognized coding category", symbol); - return 0; /* not reached */ -} - -DEFUN ("coding-category-list", Fcoding_category_list, 0, 0, 0, /* -Return a list of all recognized coding categories. -*/ - ()) -{ - int i; - Lisp_Object list = Qnil; - - for (i = CODING_CATEGORY_LAST; i >= 0; i--) - list = Fcons (coding_category_symbol[i], list); - return list; -} - -DEFUN ("set-coding-priority-list", Fset_coding_priority_list, 1, 1, 0, /* -Change the priority order of the coding categories. -LIST should be list of coding categories, in descending order of -priority. Unspecified coding categories will be lower in priority -than all specified ones, in the same relative order they were in -previously. -*/ - (list)) -{ - int category_to_priority[CODING_CATEGORY_LAST + 1]; - int i, j; - Lisp_Object rest; - - /* First generate a list that maps coding categories to priorities. */ - - for (i = 0; i <= CODING_CATEGORY_LAST; i++) - category_to_priority[i] = -1; - - /* Highest priority comes from the specified list. */ - i = 0; - EXTERNAL_LIST_LOOP (rest, list) - { - int cat = decode_coding_category (XCAR (rest)); - - if (category_to_priority[cat] >= 0) - signal_simple_error ("Duplicate coding category in list", XCAR (rest)); - category_to_priority[cat] = i++; - } - - /* Now go through the existing categories by priority to retrieve - the categories not yet specified and preserve their priority - order. */ - for (j = 0; j <= CODING_CATEGORY_LAST; j++) - { - int cat = coding_category_by_priority[j]; - if (category_to_priority[cat] < 0) - category_to_priority[cat] = i++; - } - - /* Now we need to construct the inverse of the mapping we just - constructed. */ - - for (i = 0; i <= CODING_CATEGORY_LAST; i++) - coding_category_by_priority[category_to_priority[i]] = i; - - /* Phew! That was confusing. */ - return Qnil; -} - -DEFUN ("coding-priority-list", Fcoding_priority_list, 0, 0, 0, /* -Return a list of coding categories in descending order of priority. -*/ - ()) -{ - int i; - Lisp_Object list = Qnil; - - for (i = CODING_CATEGORY_LAST; i >= 0; i--) - list = Fcons (coding_category_symbol[coding_category_by_priority[i]], - list); - return list; -} - -DEFUN ("set-coding-category-system", Fset_coding_category_system, 2, 2, 0, /* -Change the coding system associated with a coding category. -*/ - (coding_category, coding_system)) -{ - int cat = decode_coding_category (coding_category); - - coding_system = Fget_coding_system (coding_system); - coding_category_system[cat] = coding_system; - return Qnil; -} - -DEFUN ("coding-category-system", Fcoding_category_system, 1, 1, 0, /* -Return the coding system associated with a coding category. -*/ - (coding_category)) -{ - int cat = decode_coding_category (coding_category); - Lisp_Object sys = coding_category_system[cat]; - - if (!NILP (sys)) - return XCODING_SYSTEM_NAME (sys); - return Qnil; -} - - -/************************************************************************/ -/* Detecting the encoding of data */ -/************************************************************************/ - -struct detection_state -{ - enum eol_type eol_type; - int seen_non_ascii; - int mask; - - struct - { - int mask; - int in_second_byte; - } - big5; - - struct - { - int mask; - int in_second_byte; - } - shift_jis; - - struct - { - int mask; - int initted; - struct iso2022_decoder iso; - unsigned int flags; - int high_byte_count; - unsigned int saw_single_shift:1; - } - iso2022; - - struct - { - int seen_anything; - int just_saw_cr; - } - eol; -}; - -static int -acceptable_control_char_p (int c) -{ - switch (c) - { - /* Allow and ignore control characters that you might - reasonably see in a text file */ - case '\r': - case '\n': - case '\t': - case 7: /* bell */ - case 8: /* backspace */ - case 11: /* vertical tab */ - case 12: /* form feed */ - case 26: /* MS-DOS C-z junk */ - case 31: /* '^_' -- for info */ - return 1; - default: - return 0; - } -} - -static int -mask_has_at_most_one_bit_p (int mask) -{ - /* Perhaps the only thing useful you learn from intensive Microsoft - technical interviews */ - return (mask & (mask - 1)) == 0; -} - -static enum eol_type -detect_eol_type (struct detection_state *st, CONST unsigned char *src, - unsigned int n) -{ - int c; - - while (n--) - { - c = *src++; - if (c == '\r') - st->eol.just_saw_cr = 1; - else - { - if (c == '\n') - { - if (st->eol.just_saw_cr) - return EOL_CRLF; - else if (st->eol.seen_anything) - return EOL_LF; - } - else if (st->eol.just_saw_cr) - return EOL_CR; - st->eol.just_saw_cr = 0; - } - st->eol.seen_anything = 1; - } - - return EOL_AUTODETECT; -} - -/* Attempt to determine the encoding and EOL type of the given text. - Before calling this function for the first type, you must initialize - st->eol_type as appropriate and initialize st->mask to ~0. - - st->eol_type holds the determined EOL type, or EOL_AUTODETECT if - not yet known. - - st->mask holds the determined coding category mask, or ~0 if only - ASCII has been seen so far. - - Returns: - - 0 == st->eol_type is EOL_AUTODETECT and/or more than coding category - is present in st->mask - 1 == definitive answers are here for both st->eol_type and st->mask -*/ - -static int -detect_coding_type (struct detection_state *st, CONST unsigned char *src, - unsigned int n, int just_do_eol) -{ - int c; - - if (st->eol_type == EOL_AUTODETECT) - st->eol_type = detect_eol_type (st, src, n); - - if (just_do_eol) - return st->eol_type != EOL_AUTODETECT; - - if (!st->seen_non_ascii) - { - for (; n; n--, src++) - { - c = *src; - if ((c < 0x20 && !acceptable_control_char_p (c)) || c >= 0x80) - { - st->seen_non_ascii = 1; - st->shift_jis.mask = ~0; - st->big5.mask = ~0; - st->iso2022.mask = ~0; - break; - } - } - } - - if (!n) - return 0; - - if (!mask_has_at_most_one_bit_p (st->iso2022.mask)) - st->iso2022.mask = detect_coding_iso2022 (st, src, n); - if (!mask_has_at_most_one_bit_p (st->shift_jis.mask)) - st->shift_jis.mask = detect_coding_sjis (st, src, n); - if (!mask_has_at_most_one_bit_p (st->big5.mask)) - st->big5.mask = detect_coding_big5 (st, src, n); - - st->mask = st->iso2022.mask | st->shift_jis.mask | st->big5.mask; - - { - int retval = mask_has_at_most_one_bit_p (st->mask); - st->mask |= CODING_CATEGORY_NO_CONVERSION_MASK; - return retval && st->eol_type != EOL_AUTODETECT; - } -} - -static Lisp_Object -coding_system_from_mask (int mask) -{ - if (mask == ~0) - { - /* If the file was entirely or basically ASCII, use the - default value of `buffer-file-coding-system'. */ - Lisp_Object retval = - XBUFFER (Vbuffer_defaults)->buffer_file_coding_system; - if (!NILP (retval)) - { - retval = Ffind_coding_system (retval); - if (NILP (retval)) - { - warn_when_safe - (Qbad_variable, Qwarning, - "Invalid `default-buffer-file-coding-system', set to nil"); - XBUFFER (Vbuffer_defaults)->buffer_file_coding_system = Qnil; - } - } - if (NILP (retval)) - retval = Fget_coding_system (Qno_conversion); - return retval; - } - else - { - int i; - int cat = -1; - - mask = postprocess_iso2022_mask (mask); - - /* Look through the coding categories by priority and find - the first one that is allowed. */ - for (i = 0; i <= CODING_CATEGORY_LAST; i++) - { - cat = coding_category_by_priority[i]; - if ((mask & (1 << cat)) && - !NILP (coding_category_system[cat])) - break; - } - if (cat >= 0) - return coding_category_system[cat]; - else - return Fget_coding_system (Qno_conversion); - } -} - -/* Given a seekable read stream and potential coding system and EOL type - as specified, do any autodetection that is called for. If the - coding system and/or EOL type are not autodetect, they will be left - alone; but this function will never return an autodetect coding system - or EOL type. - - This function does not automatically fetch subsidiary coding systems; - that should be unnecessary with the explicit eol-type argument. */ - -void -determine_real_coding_system (Lstream *stream, Lisp_Object *codesys_in_out, - enum eol_type *eol_type_in_out) -{ - struct detection_state decst; - - if (*eol_type_in_out == EOL_AUTODETECT) - *eol_type_in_out = XCODING_SYSTEM_EOL_TYPE (*codesys_in_out); - - xzero (decst); - decst.eol_type = *eol_type_in_out; - decst.mask = ~0; - - /* If autodetection is called for, do it now. */ - if (XCODING_SYSTEM_TYPE (*codesys_in_out) == CODESYS_AUTODETECT || - *eol_type_in_out == EOL_AUTODETECT) - { - - while (1) - { - unsigned char random_buffer[4096]; - int nread; - - nread = Lstream_read (stream, random_buffer, sizeof (random_buffer)); - if (!nread) - break; - if (detect_coding_type (&decst, random_buffer, nread, - XCODING_SYSTEM_TYPE (*codesys_in_out) != - CODESYS_AUTODETECT)) - break; - } - - *eol_type_in_out = decst.eol_type; - if (XCODING_SYSTEM_TYPE (*codesys_in_out) == CODESYS_AUTODETECT) - *codesys_in_out = coding_system_from_mask (decst.mask); - } - - /* If we absolutely can't determine the EOL type, just assume LF. */ - if (*eol_type_in_out == EOL_AUTODETECT) - *eol_type_in_out = EOL_LF; - - Lstream_rewind (stream); -} - -DEFUN ("detect-coding-region", Fdetect_coding_region, 2, 3, 0, /* -Detect coding system of the text in the region between START and END. -Returned a list of possible coding systems ordered by priority. -If only ASCII characters are found, it returns 'undecided or one of -its subsidiary coding systems according to a detected end-of-line -type. Optional arg BUFFER defaults to the current buffer. -*/ - (start, end, buffer)) -{ - Lisp_Object val = Qnil; - struct buffer *buf = decode_buffer (buffer, 0); - Bufpos b, e; - Lisp_Object instream, lb_instream; - Lstream *istr, *lb_istr; - struct detection_state decst; - struct gcpro gcpro1, gcpro2; - - get_buffer_range_char (buf, start, end, &b, &e, 0); - lb_instream = make_lisp_buffer_input_stream (buf, b, e, 0); - lb_istr = XLSTREAM (lb_instream); - instream = make_encoding_input_stream (lb_istr, Fget_coding_system (Qbinary)); - istr = XLSTREAM (instream); - GCPRO2 (instream, lb_instream); - xzero (decst); - decst.eol_type = EOL_AUTODETECT; - decst.mask = ~0; - while (1) - { - unsigned char random_buffer[4096]; - int nread = Lstream_read (istr, random_buffer, sizeof (random_buffer)); - - if (!nread) - break; - if (detect_coding_type (&decst, random_buffer, nread, 0)) - break; - } - - if (decst.mask == ~0) - val = subsidiary_coding_system (Fget_coding_system (Qundecided), - decst.eol_type); - else - { - int i; - - val = Qnil; - - decst.mask = postprocess_iso2022_mask (decst.mask); - - for (i = CODING_CATEGORY_LAST; i >= 0; i--) - { - int sys = coding_category_by_priority[i]; - if (decst.mask & (1 << sys)) - { - Lisp_Object codesys = coding_category_system[sys]; - if (!NILP (codesys)) - codesys = subsidiary_coding_system (codesys, decst.eol_type); - val = Fcons (codesys, val); - } - } - } - Lstream_close (istr); - UNGCPRO; - Lstream_delete (istr); - Lstream_delete (lb_istr); - return val; -} - - -/************************************************************************/ -/* Converting to internal Mule format ("decoding") */ -/************************************************************************/ - -/* A decoding stream is a stream used for decoding text (i.e. - converting from some external format to internal format). - The decoding-stream object keeps track of the actual coding - stream, the stream that is at the other end, and data that - needs to be persistent across the lifetime of the stream. */ - -/* Handle the EOL stuff related to just-read-in character C. - EOL_TYPE is the EOL type of the coding stream. - FLAGS is the current value of FLAGS in the coding stream, and may - be modified by this macro. (The macro only looks at the - CODING_STATE_CR flag.) DST is the Dynarr to which the decoded - bytes are to be written. You need to also define a local goto - label "label_continue_loop" that is at the end of the main - character-reading loop. - - If C is a CR character, then this macro handles it entirely and - jumps to label_continue_loop. Otherwise, this macro does not add - anything to DST, and continues normally. You should continue - processing C normally after this macro. */ - -#define DECODE_HANDLE_EOL_TYPE(eol_type, c, flags, dst) \ -do { \ - if (c == '\r') \ - { \ - if (eol_type == EOL_CR) \ - Dynarr_add (dst, '\n'); \ - else if (eol_type != EOL_CRLF || flags & CODING_STATE_CR) \ - Dynarr_add (dst, c); \ - else \ - flags |= CODING_STATE_CR; \ - goto label_continue_loop; \ - } \ - else if (flags & CODING_STATE_CR) \ - { /* eol_type == CODING_SYSTEM_EOL_CRLF */ \ - if (c != '\n') \ - Dynarr_add (dst, '\r'); \ - flags &= ~CODING_STATE_CR; \ - } \ -} while (0) - -/* C should be a binary character in the range 0 - 255; convert - to internal format and add to Dynarr DST. */ - -#define DECODE_ADD_BINARY_CHAR(c, dst) \ -do { \ - if (BYTE_ASCII_P (c)) \ - Dynarr_add (dst, c); \ - else if (BYTE_C1_P (c)) \ - { \ - Dynarr_add (dst, LEADING_BYTE_CONTROL_1); \ - Dynarr_add (dst, c + 0x20); \ - } \ - else \ - { \ - Dynarr_add (dst, LEADING_BYTE_LATIN_ISO8859_1); \ - Dynarr_add (dst, c); \ - } \ -} while (0) - -#define DECODE_OUTPUT_PARTIAL_CHAR(ch) \ -do { \ - if (ch) \ - { \ - DECODE_ADD_BINARY_CHAR (ch, dst); \ - ch = 0; \ - } \ -} while (0) - -#define DECODE_HANDLE_END_OF_CONVERSION(flags, ch, dst) \ -do { \ - DECODE_OUTPUT_PARTIAL_CHAR (ch); \ - if ((flags & CODING_STATE_END) && \ - (flags & CODING_STATE_CR)) \ - Dynarr_add (dst, '\r'); \ -} while (0) - -#define DECODING_STREAM_DATA(stream) LSTREAM_TYPE_DATA (stream, decoding) - -struct decoding_stream -{ - /* Coding system that governs the conversion. */ - struct Lisp_Coding_System *codesys; - - /* Stream that we read the encoded data from or - write the decoded data to. */ - Lstream *other_end; - - /* If we are reading, then we can return only a fixed amount of - data, so if the conversion resulted in too much data, we store it - here for retrieval the next time around. */ - unsigned_char_dynarr *runoff; - - /* FLAGS holds flags indicating the current state of the decoding. - Some of these flags are dependent on the coding system. */ - unsigned int flags; - - /* CH holds a partially built-up character. Since we only deal - with one- and two-byte characters at the moment, we only use - this to store the first byte of a two-byte character. */ - unsigned int ch; - - /* EOL_TYPE specifies the type of end-of-line conversion that - currently applies. We need to keep this separate from the - EOL type stored in CODESYS because the latter might indicate - automatic EOL-type detection while the former will always - indicate a particular EOL type. */ - enum eol_type eol_type; - - /* Additional ISO2022 information. We define the structure above - because it's also needed by the detection routines. */ - struct iso2022_decoder iso2022; - - /* Additional information (the state of the running CCL program) - used by the CCL decoder. */ - struct ccl_program ccl; - - struct detection_state decst; -}; - -static int decoding_reader (Lstream *stream, unsigned char *data, size_t size); -static int decoding_writer (Lstream *stream, CONST unsigned char *data, size_t size); -static int decoding_rewinder (Lstream *stream); -static int decoding_seekable_p (Lstream *stream); -static int decoding_flusher (Lstream *stream); -static int decoding_closer (Lstream *stream); -static Lisp_Object decoding_marker (Lisp_Object stream, - void (*markobj) (Lisp_Object)); - -DEFINE_LSTREAM_IMPLEMENTATION ("decoding", lstream_decoding, - sizeof (struct decoding_stream)); - -static Lisp_Object -decoding_marker (Lisp_Object stream, void (*markobj) (Lisp_Object)) -{ - Lstream *str = DECODING_STREAM_DATA (XLSTREAM (stream))->other_end; - Lisp_Object str_obj; - - /* We do not need to mark the coding systems or charsets stored - within the stream because they are stored in a global list - and automatically marked. */ - - XSETLSTREAM (str_obj, str); - markobj (str_obj); - if (str->imp->marker) - return (str->imp->marker) (str_obj, markobj); - else - return Qnil; -} - -/* Read SIZE bytes of data and store it into DATA. We are a decoding stream - so we read data from the other end, decode it, and store it into DATA. */ - -static int -decoding_reader (Lstream *stream, unsigned char *data, size_t size) -{ - struct decoding_stream *str = DECODING_STREAM_DATA (stream); - unsigned char *orig_data = data; - int read_size; - int error_occurred = 0; - - /* We need to interface to mule_decode(), which expects to take some - amount of data and store the result into a Dynarr. We have - mule_decode() store into str->runoff, and take data from there - as necessary. */ - - /* We loop until we have enough data, reading chunks from the other - end and decoding it. */ - while (1) - { - /* Take data from the runoff if we can. Make sure to take at - most SIZE bytes, and delete the data from the runoff. */ - if (Dynarr_length (str->runoff) > 0) - { - size_t chunk = min (size, (size_t) Dynarr_length (str->runoff)); - memcpy (data, Dynarr_atp (str->runoff, 0), chunk); - Dynarr_delete_many (str->runoff, 0, chunk); - data += chunk; - size -= chunk; - } - - if (size == 0) - break; /* No more room for data */ - - if (str->flags & CODING_STATE_END) - /* This means that on the previous iteration, we hit the EOF on - the other end. We loop once more so that mule_decode() can - output any final stuff it may be holding, or any "go back - to a sane state" escape sequences. (This latter makes sense - during encoding.) */ - break; - - /* Exhausted the runoff, so get some more. DATA has at least - SIZE bytes left of storage in it, so it's OK to read directly - into it. (We'll be overwriting above, after we've decoded it - into the runoff.) */ - read_size = Lstream_read (str->other_end, data, size); - if (read_size < 0) - { - error_occurred = 1; - break; - } - if (read_size == 0) - /* There might be some more end data produced in the translation. - See the comment above. */ - str->flags |= CODING_STATE_END; - mule_decode (stream, data, str->runoff, read_size); - } - - if (data - orig_data == 0) - return error_occurred ? -1 : 0; - else - return data - orig_data; -} - -static int -decoding_writer (Lstream *stream, CONST unsigned char *data, size_t size) -{ - struct decoding_stream *str = DECODING_STREAM_DATA (stream); - int retval; - - /* Decode all our data into the runoff, and then attempt to write - it all out to the other end. Remove whatever chunk we succeeded - in writing. */ - mule_decode (stream, data, str->runoff, size); - retval = Lstream_write (str->other_end, Dynarr_atp (str->runoff, 0), - Dynarr_length (str->runoff)); - if (retval > 0) - Dynarr_delete_many (str->runoff, 0, retval); - /* Do NOT return retval. The return value indicates how much - of the incoming data was written, not how many bytes were - written. */ - return size; -} - -static void -reset_decoding_stream (struct decoding_stream *str) -{ - if (CODING_SYSTEM_TYPE (str->codesys) == CODESYS_ISO2022) - { - Lisp_Object coding_system; - XSETCODING_SYSTEM (coding_system, str->codesys); - reset_iso2022 (coding_system, &str->iso2022); - } - else if (CODING_SYSTEM_TYPE (str->codesys) == CODESYS_CCL) - { - setup_ccl_program (&str->ccl, CODING_SYSTEM_CCL_DECODE (str->codesys)); - } - - str->flags = str->ch = 0; -} - -static int -decoding_rewinder (Lstream *stream) -{ - struct decoding_stream *str = DECODING_STREAM_DATA (stream); - reset_decoding_stream (str); - Dynarr_reset (str->runoff); - return Lstream_rewind (str->other_end); -} - -static int -decoding_seekable_p (Lstream *stream) -{ - struct decoding_stream *str = DECODING_STREAM_DATA (stream); - return Lstream_seekable_p (str->other_end); -} - -static int -decoding_flusher (Lstream *stream) -{ - struct decoding_stream *str = DECODING_STREAM_DATA (stream); - return Lstream_flush (str->other_end); -} - -static int -decoding_closer (Lstream *stream) -{ - struct decoding_stream *str = DECODING_STREAM_DATA (stream); - if (stream->flags & LSTREAM_FL_WRITE) - { - str->flags |= CODING_STATE_END; - decoding_writer (stream, 0, 0); - } - Dynarr_free (str->runoff); - if (str->iso2022.composite_chars) - Dynarr_free (str->iso2022.composite_chars); - return Lstream_close (str->other_end); -} - -Lisp_Object -decoding_stream_coding_system (Lstream *stream) -{ - Lisp_Object coding_system; - struct decoding_stream *str = DECODING_STREAM_DATA (stream); - - XSETCODING_SYSTEM (coding_system, str->codesys); - return subsidiary_coding_system (coding_system, str->eol_type); -} - -void -set_decoding_stream_coding_system (Lstream *lstr, Lisp_Object codesys) -{ - struct Lisp_Coding_System *cs = XCODING_SYSTEM (codesys); - struct decoding_stream *str = DECODING_STREAM_DATA (lstr); - str->codesys = cs; - if (CODING_SYSTEM_EOL_TYPE (cs) != EOL_AUTODETECT) - str->eol_type = CODING_SYSTEM_EOL_TYPE (cs); - reset_decoding_stream (str); -} - -/* WARNING WARNING WARNING WARNING!!!!! If you open up a decoding - stream for writing, no automatic code detection will be performed. - The reason for this is that automatic code detection requires a - seekable input. Things will also fail if you open a decoding - stream for reading using a non-fully-specified coding system and - a non-seekable input stream. */ - -static Lisp_Object -make_decoding_stream_1 (Lstream *stream, Lisp_Object codesys, - CONST char *mode) -{ - Lstream *lstr = Lstream_new (lstream_decoding, mode); - struct decoding_stream *str = DECODING_STREAM_DATA (lstr); - Lisp_Object obj; - - xzero (*str); - str->other_end = stream; - str->runoff = (unsigned_char_dynarr *) Dynarr_new (unsigned_char); - str->eol_type = EOL_AUTODETECT; - if (!strcmp (mode, "r") - && Lstream_seekable_p (stream)) - /* We can determine the coding system now. */ - determine_real_coding_system (stream, &codesys, &str->eol_type); - set_decoding_stream_coding_system (lstr, codesys); - str->decst.eol_type = str->eol_type; - str->decst.mask = ~0; - XSETLSTREAM (obj, lstr); - return obj; -} - -Lisp_Object -make_decoding_input_stream (Lstream *stream, Lisp_Object codesys) -{ - return make_decoding_stream_1 (stream, codesys, "r"); -} - -Lisp_Object -make_decoding_output_stream (Lstream *stream, Lisp_Object codesys) -{ - return make_decoding_stream_1 (stream, codesys, "w"); -} - -/* Note: the decode_coding_* functions all take the same - arguments as mule_decode(), which is to say some SRC data of - size N, which is to be stored into dynamic array DST. - DECODING is the stream within which the decoding is - taking place, but no data is actually read from or - written to that stream; that is handled in decoding_reader() - or decoding_writer(). This allows the same functions to - be used for both reading and writing. */ - -static void -mule_decode (Lstream *decoding, CONST unsigned char *src, - unsigned_char_dynarr *dst, unsigned int n) -{ - struct decoding_stream *str = DECODING_STREAM_DATA (decoding); - - /* If necessary, do encoding-detection now. We do this when - we're a writing stream or a non-seekable reading stream, - meaning that we can't just process the whole input, - rewind, and start over. */ - - if (CODING_SYSTEM_TYPE (str->codesys) == CODESYS_AUTODETECT || - str->eol_type == EOL_AUTODETECT) - { - Lisp_Object codesys; - - XSETCODING_SYSTEM (codesys, str->codesys); - detect_coding_type (&str->decst, src, n, - CODING_SYSTEM_TYPE (str->codesys) != - CODESYS_AUTODETECT); - if (CODING_SYSTEM_TYPE (str->codesys) == CODESYS_AUTODETECT && - str->decst.mask != ~0) - /* #### This is cheesy. What we really ought to do is - buffer up a certain amount of data so as to get a - less random result. */ - codesys = coding_system_from_mask (str->decst.mask); - str->eol_type = str->decst.eol_type; - if (XCODING_SYSTEM (codesys) != str->codesys) - { - /* Preserve the CODING_STATE_END flag in case it was set. - If we erase it, bad things might happen. */ - int was_end = str->flags & CODING_STATE_END; - set_decoding_stream_coding_system (decoding, codesys); - if (was_end) - str->flags |= CODING_STATE_END; - } - } - - switch (CODING_SYSTEM_TYPE (str->codesys)) - { -#ifdef DEBUG_XEMACS - case CODESYS_INTERNAL: - Dynarr_add_many (dst, src, n); - break; -#endif - case CODESYS_AUTODETECT: - /* If we got this far and still haven't decided on the coding - system, then do no conversion. */ - case CODESYS_NO_CONVERSION: - decode_coding_no_conversion (decoding, src, dst, n); - break; - case CODESYS_SHIFT_JIS: - decode_coding_sjis (decoding, src, dst, n); - break; - case CODESYS_BIG5: - decode_coding_big5 (decoding, src, dst, n); - break; - case CODESYS_CCL: - ccl_driver (&str->ccl, src, dst, n, 0); - break; - case CODESYS_ISO2022: - decode_coding_iso2022 (decoding, src, dst, n); - break; - default: - abort (); - } -} - -DEFUN ("decode-coding-region", Fdecode_coding_region, 3, 4, 0, /* -Decode the text between START and END which is encoded in CODING-SYSTEM. -This is useful if you've read in encoded text from a file without decoding -it (e.g. you read in a JIS-formatted file but used the `binary' or -`no-conversion' coding system, so that it shows up as "^[$B! [ENCODE AS BINARY] - ------> [DECODE AS SPECIFIED] - ------> [BUFFER] - */ - - while (1) - { - char tempbuf[1024]; /* some random amount */ - Bufpos newpos, even_newer_pos; - Bufpos oldpos = lisp_buffer_stream_startpos (istr); - int size_in_bytes = Lstream_read (istr, tempbuf, sizeof (tempbuf)); - - if (!size_in_bytes) - break; - newpos = lisp_buffer_stream_startpos (istr); - Lstream_write (ostr, tempbuf, size_in_bytes); - even_newer_pos = lisp_buffer_stream_startpos (istr); - buffer_delete_range (buf, even_newer_pos - (newpos - oldpos), - even_newer_pos, 0); - } - Lstream_close (istr); - Lstream_close (ostr); - UNGCPRO; - Lstream_delete (istr); - Lstream_delete (ostr); - Lstream_delete (XLSTREAM (de_outstream)); - Lstream_delete (XLSTREAM (lb_outstream)); - return Qnil; -} - - -/************************************************************************/ -/* Converting to an external encoding ("encoding") */ -/************************************************************************/ - -/* An encoding stream is an output stream. When you create the - stream, you specify the coding system that governs the encoding - and another stream that the resulting encoded data is to be - sent to, and then start sending data to it. */ - -#define ENCODING_STREAM_DATA(stream) LSTREAM_TYPE_DATA (stream, encoding) - -struct encoding_stream -{ - /* Coding system that governs the conversion. */ - struct Lisp_Coding_System *codesys; - - /* Stream that we read the encoded data from or - write the decoded data to. */ - Lstream *other_end; - - /* If we are reading, then we can return only a fixed amount of - data, so if the conversion resulted in too much data, we store it - here for retrieval the next time around. */ - unsigned_char_dynarr *runoff; - - /* FLAGS holds flags indicating the current state of the encoding. - Some of these flags are dependent on the coding system. */ - unsigned int flags; - - /* CH holds a partially built-up character. Since we only deal - with one- and two-byte characters at the moment, we only use - this to store the first byte of a two-byte character. */ - unsigned int ch; - - /* Additional information used by the ISO2022 encoder. */ - struct - { - /* CHARSET holds the character sets currently assigned to the G0 - through G3 registers. It is initialized from the array - INITIAL_CHARSET in CODESYS. */ - Lisp_Object charset[4]; - - /* Which registers are currently invoked into the left (GL) and - right (GR) halves of the 8-bit encoding space? */ - int register_left, register_right; - - /* Whether we need to explicitly designate the charset in the - G? register before using it. It is initialized from the - array FORCE_CHARSET_ON_OUTPUT in CODESYS. */ - unsigned char force_charset_on_output[4]; - - /* Other state variables that need to be preserved across - invocations. */ - Lisp_Object current_charset; - int current_half; - int current_char_boundary; - } iso2022; - - /* Additional information (the state of the running CCL program) - used by the CCL encoder. */ - struct ccl_program ccl; -}; - -static int encoding_reader (Lstream *stream, unsigned char *data, size_t size); -static int encoding_writer (Lstream *stream, CONST unsigned char *data, - size_t size); -static int encoding_rewinder (Lstream *stream); -static int encoding_seekable_p (Lstream *stream); -static int encoding_flusher (Lstream *stream); -static int encoding_closer (Lstream *stream); -static Lisp_Object encoding_marker (Lisp_Object stream, - void (*markobj) (Lisp_Object)); - -DEFINE_LSTREAM_IMPLEMENTATION ("encoding", lstream_encoding, - sizeof (struct encoding_stream)); - -static Lisp_Object -encoding_marker (Lisp_Object stream, void (*markobj) (Lisp_Object)) -{ - Lstream *str = ENCODING_STREAM_DATA (XLSTREAM (stream))->other_end; - Lisp_Object str_obj; - - /* We do not need to mark the coding systems or charsets stored - within the stream because they are stored in a global list - and automatically marked. */ - - XSETLSTREAM (str_obj, str); - markobj (str_obj); - if (str->imp->marker) - return (str->imp->marker) (str_obj, markobj); - else - return Qnil; -} - -/* Read SIZE bytes of data and store it into DATA. We are a encoding stream - so we read data from the other end, encode it, and store it into DATA. */ - -static int -encoding_reader (Lstream *stream, unsigned char *data, size_t size) -{ - struct encoding_stream *str = ENCODING_STREAM_DATA (stream); - unsigned char *orig_data = data; - int read_size; - int error_occurred = 0; - - /* We need to interface to mule_encode(), which expects to take some - amount of data and store the result into a Dynarr. We have - mule_encode() store into str->runoff, and take data from there - as necessary. */ - - /* We loop until we have enough data, reading chunks from the other - end and encoding it. */ - while (1) - { - /* Take data from the runoff if we can. Make sure to take at - most SIZE bytes, and delete the data from the runoff. */ - if (Dynarr_length (str->runoff) > 0) - { - int chunk = min ((int) size, Dynarr_length (str->runoff)); - memcpy (data, Dynarr_atp (str->runoff, 0), chunk); - Dynarr_delete_many (str->runoff, 0, chunk); - data += chunk; - size -= chunk; - } - - if (size == 0) - break; /* No more room for data */ - - if (str->flags & CODING_STATE_END) - /* This means that on the previous iteration, we hit the EOF on - the other end. We loop once more so that mule_encode() can - output any final stuff it may be holding, or any "go back - to a sane state" escape sequences. (This latter makes sense - during encoding.) */ - break; - - /* Exhausted the runoff, so get some more. DATA at least SIZE bytes - left of storage in it, so it's OK to read directly into it. - (We'll be overwriting above, after we've encoded it into the - runoff.) */ - read_size = Lstream_read (str->other_end, data, size); - if (read_size < 0) - { - error_occurred = 1; - break; - } - if (read_size == 0) - /* There might be some more end data produced in the translation. - See the comment above. */ - str->flags |= CODING_STATE_END; - mule_encode (stream, data, str->runoff, read_size); - } - - if (data == orig_data) - return error_occurred ? -1 : 0; - else - return data - orig_data; -} - -static int -encoding_writer (Lstream *stream, CONST unsigned char *data, size_t size) -{ - struct encoding_stream *str = ENCODING_STREAM_DATA (stream); - int retval; - - /* Encode all our data into the runoff, and then attempt to write - it all out to the other end. Remove whatever chunk we succeeded - in writing. */ - mule_encode (stream, data, str->runoff, size); - retval = Lstream_write (str->other_end, Dynarr_atp (str->runoff, 0), - Dynarr_length (str->runoff)); - if (retval > 0) - Dynarr_delete_many (str->runoff, 0, retval); - /* Do NOT return retval. The return value indicates how much - of the incoming data was written, not how many bytes were - written. */ - return size; -} - -static void -reset_encoding_stream (struct encoding_stream *str) -{ - switch (CODING_SYSTEM_TYPE (str->codesys)) - { - case CODESYS_ISO2022: - { - int i; - - for (i = 0; i < 4; i++) - { - str->iso2022.charset[i] = - CODING_SYSTEM_ISO2022_INITIAL_CHARSET (str->codesys, i); - str->iso2022.force_charset_on_output[i] = - CODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT (str->codesys, i); - } - str->iso2022.register_left = 0; - str->iso2022.register_right = 1; - str->iso2022.current_charset = Qnil; - str->iso2022.current_half = 0; - str->iso2022.current_char_boundary = 1; - break; - } - case CODESYS_CCL: - setup_ccl_program (&str->ccl, CODING_SYSTEM_CCL_ENCODE (str->codesys)); - break; - default: - break; - } - - str->flags = str->ch = 0; -} - -static int -encoding_rewinder (Lstream *stream) -{ - struct encoding_stream *str = ENCODING_STREAM_DATA (stream); - reset_encoding_stream (str); - Dynarr_reset (str->runoff); - return Lstream_rewind (str->other_end); -} - -static int -encoding_seekable_p (Lstream *stream) -{ - struct encoding_stream *str = ENCODING_STREAM_DATA (stream); - return Lstream_seekable_p (str->other_end); -} - -static int -encoding_flusher (Lstream *stream) -{ - struct encoding_stream *str = ENCODING_STREAM_DATA (stream); - return Lstream_flush (str->other_end); -} - -static int -encoding_closer (Lstream *stream) -{ - struct encoding_stream *str = ENCODING_STREAM_DATA (stream); - if (stream->flags & LSTREAM_FL_WRITE) - { - str->flags |= CODING_STATE_END; - encoding_writer (stream, 0, 0); - } - Dynarr_free (str->runoff); - return Lstream_close (str->other_end); -} - -Lisp_Object -encoding_stream_coding_system (Lstream *stream) -{ - Lisp_Object coding_system; - struct encoding_stream *str = ENCODING_STREAM_DATA (stream); - - XSETCODING_SYSTEM (coding_system, str->codesys); - return coding_system; -} - -void -set_encoding_stream_coding_system (Lstream *lstr, Lisp_Object codesys) -{ - struct Lisp_Coding_System *cs = XCODING_SYSTEM (codesys); - struct encoding_stream *str = ENCODING_STREAM_DATA (lstr); - str->codesys = cs; - reset_encoding_stream (str); -} - -static Lisp_Object -make_encoding_stream_1 (Lstream *stream, Lisp_Object codesys, - CONST char *mode) -{ - Lstream *lstr = Lstream_new (lstream_encoding, mode); - struct encoding_stream *str = ENCODING_STREAM_DATA (lstr); - Lisp_Object obj; - - xzero (*str); - str->runoff = Dynarr_new (unsigned_char); - str->other_end = stream; - set_encoding_stream_coding_system (lstr, codesys); - XSETLSTREAM (obj, lstr); - return obj; -} - -Lisp_Object -make_encoding_input_stream (Lstream *stream, Lisp_Object codesys) -{ - return make_encoding_stream_1 (stream, codesys, "r"); -} - -Lisp_Object -make_encoding_output_stream (Lstream *stream, Lisp_Object codesys) -{ - return make_encoding_stream_1 (stream, codesys, "w"); -} - -/* Convert N bytes of internally-formatted data stored in SRC to an - external format, according to the encoding stream ENCODING. - Store the encoded data into DST. */ - -static void -mule_encode (Lstream *encoding, CONST unsigned char *src, - unsigned_char_dynarr *dst, unsigned int n) -{ - struct encoding_stream *str = ENCODING_STREAM_DATA (encoding); - - switch (CODING_SYSTEM_TYPE (str->codesys)) - { -#ifdef DEBUG_XEMACS - case CODESYS_INTERNAL: - Dynarr_add_many (dst, src, n); - break; -#endif - case CODESYS_AUTODETECT: - /* If we got this far and still haven't decided on the coding - system, then do no conversion. */ - case CODESYS_NO_CONVERSION: - encode_coding_no_conversion (encoding, src, dst, n); - break; - case CODESYS_SHIFT_JIS: - encode_coding_sjis (encoding, src, dst, n); - break; - case CODESYS_BIG5: - encode_coding_big5 (encoding, src, dst, n); - break; - case CODESYS_CCL: - ccl_driver (&str->ccl, src, dst, n, 0); - break; - case CODESYS_ISO2022: - encode_coding_iso2022 (encoding, src, dst, n); - break; - default: - abort (); - } -} - -DEFUN ("encode-coding-region", Fencode_coding_region, 3, 4, 0, /* -Encode the text between START and END using CODING-SYSTEM. -This will, for example, convert Japanese characters into stuff such as -"^[$B! [ENCODE AS SPECIFIED] - ------> [DECODE AS BINARY] - ------> [BUFFER] - */ - while (1) - { - char tempbuf[1024]; /* some random amount */ - Bufpos newpos, even_newer_pos; - Bufpos oldpos = lisp_buffer_stream_startpos (istr); - int size_in_bytes = Lstream_read (istr, tempbuf, sizeof (tempbuf)); - - if (!size_in_bytes) - break; - newpos = lisp_buffer_stream_startpos (istr); - Lstream_write (ostr, tempbuf, size_in_bytes); - even_newer_pos = lisp_buffer_stream_startpos (istr); - buffer_delete_range (buf, even_newer_pos - (newpos - oldpos), - even_newer_pos, 0); - } - - { - Charcount retlen = - lisp_buffer_stream_startpos (XLSTREAM (instream)) - b; - Lstream_close (istr); - Lstream_close (ostr); - UNGCPRO; - Lstream_delete (istr); - Lstream_delete (ostr); - Lstream_delete (XLSTREAM (de_outstream)); - Lstream_delete (XLSTREAM (lb_outstream)); - return make_int (retlen); - } -} - - -/************************************************************************/ -/* Shift-JIS methods */ -/************************************************************************/ - -/* Shift-JIS is a coding system encoding three character sets: ASCII, right - half of JISX0201-Kana, and JISX0208. An ASCII character is encoded - as is. A character of JISX0201-Kana (TYPE94 character set) is - encoded by "position-code + 0x80". A character of JISX0208 - (TYPE94x94 character set) is encoded in 2-byte but two - position-codes are divided and shifted so that it fit in the range - below. - - --- CODE RANGE of Shift-JIS --- - (character set) (range) - ASCII 0x00 .. 0x7F - JISX0201-Kana 0xA0 .. 0xDF - JISX0208 (1st byte) 0x80 .. 0x9F and 0xE0 .. 0xEF - (2nd byte) 0x40 .. 0x7E and 0x80 .. 0xFC - ------------------------------- - -*/ - -/* Is this the first byte of a Shift-JIS two-byte char? */ - -#define BYTE_SJIS_TWO_BYTE_1_P(c) \ - (((c) >= 0x81 && (c) <= 0x9F) || ((c) >= 0xE0 && (c) <= 0xEF)) - -/* Is this the second byte of a Shift-JIS two-byte char? */ - -#define BYTE_SJIS_TWO_BYTE_2_P(c) \ - (((c) >= 0x40 && (c) <= 0x7E) || ((c) >= 0x80 && (c) <= 0xFC)) - -#define BYTE_SJIS_KATAKANA_P(c) \ - ((c) >= 0xA1 && (c) <= 0xDF) - -static int -detect_coding_sjis (struct detection_state *st, CONST unsigned char *src, - unsigned int n) -{ - int c; - - while (n--) - { - c = *src++; - if (c == ISO_CODE_ESC || c == ISO_CODE_SI || c == ISO_CODE_SO) - return 0; - if (st->shift_jis.in_second_byte) - { - st->shift_jis.in_second_byte = 0; - if (c < 0x40) - return 0; - } - else if ((c >= 0x80 && c < 0xA0) || c >= 0xE0) - st->shift_jis.in_second_byte = 1; - } - return CODING_CATEGORY_SHIFT_JIS_MASK; -} - -/* Convert Shift-JIS data to internal format. */ - -static void -decode_coding_sjis (Lstream *decoding, CONST unsigned char *src, - unsigned_char_dynarr *dst, unsigned int n) -{ - unsigned char c; - unsigned int flags, ch; - enum eol_type eol_type; - struct decoding_stream *str = DECODING_STREAM_DATA (decoding); - - CODING_STREAM_DECOMPOSE (str, flags, ch); - eol_type = str->eol_type; - - while (n--) - { - c = *src++; - - if (ch) - { - /* Previous character was first byte of Shift-JIS Kanji char. */ - if (BYTE_SJIS_TWO_BYTE_2_P (c)) - { - unsigned char e1, e2; - - Dynarr_add (dst, LEADING_BYTE_JAPANESE_JISX0208); - DECODE_SJIS (ch, c, e1, e2); - Dynarr_add (dst, e1); - Dynarr_add (dst, e2); - } - else - { - DECODE_ADD_BINARY_CHAR (ch, dst); - DECODE_ADD_BINARY_CHAR (c, dst); - } - ch = 0; - } - else - { - DECODE_HANDLE_EOL_TYPE (eol_type, c, flags, dst); - if (BYTE_SJIS_TWO_BYTE_1_P (c)) - ch = c; - else if (BYTE_SJIS_KATAKANA_P (c)) - { - Dynarr_add (dst, LEADING_BYTE_KATAKANA_JISX0201); - Dynarr_add (dst, c); - } - else - DECODE_ADD_BINARY_CHAR (c, dst); - } - label_continue_loop:; - } - - DECODE_HANDLE_END_OF_CONVERSION (flags, ch, dst); - - CODING_STREAM_COMPOSE (str, flags, ch); -} - -/* Convert internally-formatted data to Shift-JIS. */ - -static void -encode_coding_sjis (Lstream *encoding, CONST unsigned char *src, - unsigned_char_dynarr *dst, unsigned int n) -{ - unsigned char c; - struct encoding_stream *str = ENCODING_STREAM_DATA (encoding); - unsigned int flags, ch; - enum eol_type eol_type; - - CODING_STREAM_DECOMPOSE (str, flags, ch); - eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys); - - while (n--) - { - c = *src++; - if (c == '\n') - { - if (eol_type != EOL_LF && eol_type != EOL_AUTODETECT) - Dynarr_add (dst, '\r'); - if (eol_type != EOL_CR) - Dynarr_add (dst, '\n'); - ch = 0; - } - else if (BYTE_ASCII_P (c)) - { - Dynarr_add (dst, c); - ch = 0; - } - else if (BUFBYTE_LEADING_BYTE_P (c)) - ch = (c == LEADING_BYTE_KATAKANA_JISX0201 || - c == LEADING_BYTE_JAPANESE_JISX0208_1978 || - c == LEADING_BYTE_JAPANESE_JISX0208) ? c : 0; - else if (ch) - { - if (ch == LEADING_BYTE_KATAKANA_JISX0201) - { - Dynarr_add (dst, c); - ch = 0; - } - else if (ch == LEADING_BYTE_JAPANESE_JISX0208_1978 || - ch == LEADING_BYTE_JAPANESE_JISX0208) - ch = c; - else - { - unsigned char j1, j2; - ENCODE_SJIS (ch, c, j1, j2); - Dynarr_add (dst, j1); - Dynarr_add (dst, j2); - ch = 0; - } - } - } - - CODING_STREAM_COMPOSE (str, flags, ch); -} - -DEFUN ("decode-shift-jis-char", Fdecode_shift_jis_char, 1, 1, 0, /* -Decode a JISX0208 character of Shift-JIS coding-system. -CODE is the character code in Shift-JIS as a cons of type bytes. -Return the corresponding character. -*/ - (code)) -{ - unsigned char c1, c2, s1, s2; - - CHECK_CONS (code); - CHECK_INT (XCAR (code)); - CHECK_INT (XCDR (code)); - s1 = XINT (XCAR (code)); - s2 = XINT (XCDR (code)); - if (BYTE_SJIS_TWO_BYTE_1_P (s1) && - BYTE_SJIS_TWO_BYTE_2_P (s2)) - { - DECODE_SJIS (s1, s2, c1, c2); - return make_char (MAKE_CHAR (Vcharset_japanese_jisx0208, - c1 & 0x7F, c2 & 0x7F)); - } - else - return Qnil; -} - -DEFUN ("encode-shift-jis-char", Fencode_shift_jis_char, 1, 1, 0, /* -Encode a JISX0208 character CHAR to SHIFT-JIS coding-system. -Return the corresponding character code in SHIFT-JIS as a cons of two bytes. -*/ - (ch)) -{ - Lisp_Object charset; - int c1, c2, s1, s2; - - CHECK_CHAR_COERCE_INT (ch); - BREAKUP_CHAR (XCHAR (ch), charset, c1, c2); - if (EQ (charset, Vcharset_japanese_jisx0208)) - { - ENCODE_SJIS (c1 | 0x80, c2 | 0x80, s1, s2); - return Fcons (make_int (s1), make_int (s2)); - } - else - return Qnil; -} - - -/************************************************************************/ -/* Big5 methods */ -/************************************************************************/ - -/* BIG5 is a coding system encoding two character sets: ASCII and - Big5. An ASCII character is encoded as is. Big5 is a two-byte - character set and is encoded in two-byte. - - --- CODE RANGE of BIG5 --- - (character set) (range) - ASCII 0x00 .. 0x7F - Big5 (1st byte) 0xA1 .. 0xFE - (2nd byte) 0x40 .. 0x7E and 0xA1 .. 0xFE - -------------------------- - - Since the number of characters in Big5 is larger than maximum - characters in Emacs' charset (96x96), it can't be handled as one - charset. So, in Emacs, Big5 is divided into two: `charset-big5-1' - and `charset-big5-2'. Both s are TYPE94x94. The former - contains frequently used characters and the latter contains less - frequently used characters. */ - -#define BYTE_BIG5_TWO_BYTE_1_P(c) \ - ((c) >= 0xA1 && (c) <= 0xFE) - -/* Is this the second byte of a Shift-JIS two-byte char? */ - -#define BYTE_BIG5_TWO_BYTE_2_P(c) \ - (((c) >= 0x40 && (c) <= 0x7E) || ((c) >= 0xA1 && (c) <= 0xFE)) - -/* Number of Big5 characters which have the same code in 1st byte. */ - -#define BIG5_SAME_ROW (0xFF - 0xA1 + 0x7F - 0x40) - -/* Code conversion macros. These are macros because they are used in - inner loops during code conversion. - - Note that temporary variables in macros introduce the classic - dynamic-scoping problems with variable names. We use capital- - lettered variables in the assumption that XEmacs does not use - capital letters in variables except in a very formalized way - (e.g. Qstring). */ - -/* Convert Big5 code (b1, b2) into its internal string representation - (lb, c1, c2). */ - -/* There is a much simpler way to split the Big5 charset into two. - For the moment I'm going to leave the algorithm as-is because it - claims to separate out the most-used characters into a single - charset, which perhaps will lead to optimizations in various - places. - - The way the algorithm works is something like this: - - Big5 can be viewed as a 94x157 charset, where the row is - encoded into the bytes 0xA1 .. 0xFE and the column is encoded - into the bytes 0x40 .. 0x7E and 0xA1 .. 0xFE. As for frequency, - the split between low and high column numbers is apparently - meaningless; ascending rows produce less and less frequent chars. - Therefore, we assign the lower half of rows (0xA1 .. 0xC8) to - the first charset, and the upper half (0xC9 .. 0xFE) to the - second. To do the conversion, we convert the character into - a single number where 0 .. 156 is the first row, 157 .. 313 - is the second, etc. That way, the characters are ordered by - decreasing frequency. Then we just chop the space in two - and coerce the result into a 94x94 space. - */ - -#define DECODE_BIG5(b1, b2, lb, c1, c2) do \ -{ \ - int B1 = b1, B2 = b2; \ - unsigned int I \ - = (B1 - 0xA1) * BIG5_SAME_ROW + B2 - (B2 < 0x7F ? 0x40 : 0x62); \ - \ - if (B1 < 0xC9) \ - { \ - lb = LEADING_BYTE_CHINESE_BIG5_1; \ - } \ - else \ - { \ - lb = LEADING_BYTE_CHINESE_BIG5_2; \ - I -= (BIG5_SAME_ROW) * (0xC9 - 0xA1); \ - } \ - c1 = I / (0xFF - 0xA1) + 0xA1; \ - c2 = I % (0xFF - 0xA1) + 0xA1; \ -} while (0) - -/* Convert the internal string representation of a Big5 character - (lb, c1, c2) into Big5 code (b1, b2). */ - -#define ENCODE_BIG5(lb, c1, c2, b1, b2) do \ -{ \ - unsigned int I = ((c1) - 0xA1) * (0xFF - 0xA1) + ((c2) - 0xA1); \ - \ - if (lb == LEADING_BYTE_CHINESE_BIG5_2) \ - { \ - I += BIG5_SAME_ROW * (0xC9 - 0xA1); \ - } \ - b1 = I / BIG5_SAME_ROW + 0xA1; \ - b2 = I % BIG5_SAME_ROW; \ - b2 += b2 < 0x3F ? 0x40 : 0x62; \ -} while (0) - -static int -detect_coding_big5 (struct detection_state *st, CONST unsigned char *src, - unsigned int n) -{ - int c; - - while (n--) - { - c = *src++; - if (c == ISO_CODE_ESC || c == ISO_CODE_SI || c == ISO_CODE_SO || - (c >= 0x80 && c <= 0xA0)) - return 0; - if (st->big5.in_second_byte) - { - st->big5.in_second_byte = 0; - if (c < 0x40 || (c >= 0x80 && c <= 0xA0)) - return 0; - } - else if (c >= 0xA1) - st->big5.in_second_byte = 1; - } - return CODING_CATEGORY_BIG5_MASK; -} - -/* Convert Big5 data to internal format. */ - -static void -decode_coding_big5 (Lstream *decoding, CONST unsigned char *src, - unsigned_char_dynarr *dst, unsigned int n) -{ - unsigned char c; - unsigned int flags, ch; - enum eol_type eol_type; - struct decoding_stream *str = DECODING_STREAM_DATA (decoding); - - CODING_STREAM_DECOMPOSE (str, flags, ch); - eol_type = str->eol_type; - - while (n--) - { - c = *src++; - if (ch) - { - /* Previous character was first byte of Big5 char. */ - if (BYTE_BIG5_TWO_BYTE_2_P (c)) - { - unsigned char b1, b2, b3; - DECODE_BIG5 (ch, c, b1, b2, b3); - Dynarr_add (dst, b1); - Dynarr_add (dst, b2); - Dynarr_add (dst, b3); - } - else - { - DECODE_ADD_BINARY_CHAR (ch, dst); - DECODE_ADD_BINARY_CHAR (c, dst); - } - ch = 0; - } - else - { - DECODE_HANDLE_EOL_TYPE (eol_type, c, flags, dst); - if (BYTE_BIG5_TWO_BYTE_1_P (c)) - ch = c; - else - DECODE_ADD_BINARY_CHAR (c, dst); - } - label_continue_loop:; - } - - DECODE_HANDLE_END_OF_CONVERSION (flags, ch, dst); - - CODING_STREAM_COMPOSE (str, flags, ch); -} - -/* Convert internally-formatted data to Big5. */ - -static void -encode_coding_big5 (Lstream *encoding, CONST unsigned char *src, - unsigned_char_dynarr *dst, unsigned int n) -{ - unsigned char c; - struct encoding_stream *str = ENCODING_STREAM_DATA (encoding); - unsigned int flags, ch; - enum eol_type eol_type; - - CODING_STREAM_DECOMPOSE (str, flags, ch); - eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys); - - while (n--) - { - c = *src++; - if (c == '\n') - { - if (eol_type != EOL_LF && eol_type != EOL_AUTODETECT) - Dynarr_add (dst, '\r'); - if (eol_type != EOL_CR) - Dynarr_add (dst, '\n'); - } - else if (BYTE_ASCII_P (c)) - { - /* ASCII. */ - Dynarr_add (dst, c); - } - else if (BUFBYTE_LEADING_BYTE_P (c)) - { - if (c == LEADING_BYTE_CHINESE_BIG5_1 || - c == LEADING_BYTE_CHINESE_BIG5_2) - { - /* A recognized leading byte. */ - ch = c; - continue; /* not done with this character. */ - } - /* otherwise just ignore this character. */ - } - else if (ch == LEADING_BYTE_CHINESE_BIG5_1 || - ch == LEADING_BYTE_CHINESE_BIG5_2) - { - /* Previous char was a recognized leading byte. */ - ch = (ch << 8) | c; - continue; /* not done with this character. */ - } - else if (ch) - { - /* Encountering second byte of a Big5 character. */ - unsigned char b1, b2; - - ENCODE_BIG5 (ch >> 8, ch & 0xFF, c, b1, b2); - Dynarr_add (dst, b1); - Dynarr_add (dst, b2); - } - - ch = 0; - } - - CODING_STREAM_COMPOSE (str, flags, ch); -} - - -DEFUN ("decode-big5-char", Fdecode_big5_char, 1, 1, 0, /* -Decode a Big5 character CODE of BIG5 coding-system. -CODE is the character code in BIG5, a cons of two integers. -Return the corresponding character. -*/ - (code)) -{ - unsigned char c1, c2, b1, b2; - - CHECK_CONS (code); - CHECK_INT (XCAR (code)); - CHECK_INT (XCDR (code)); - b1 = XINT (XCAR (code)); - b2 = XINT (XCDR (code)); - if (BYTE_BIG5_TWO_BYTE_1_P (b1) && - BYTE_BIG5_TWO_BYTE_2_P (b2)) - { - int leading_byte; - Lisp_Object charset; - DECODE_BIG5 (b1, b2, leading_byte, c1, c2); - charset = CHARSET_BY_LEADING_BYTE (leading_byte); - return make_char (MAKE_CHAR (charset, c1 & 0x7F, c2 & 0x7F)); - } - else - return Qnil; -} - -DEFUN ("encode-big5-char", Fencode_big5_char, 1, 1, 0, /* -Encode the Big5 character CH to BIG5 coding-system. -Return the corresponding character code in Big5. -*/ - (ch)) -{ - Lisp_Object charset; - int c1, c2, b1, b2; - - CHECK_CHAR_COERCE_INT (ch); - BREAKUP_CHAR (XCHAR (ch), charset, c1, c2); - if (EQ (charset, Vcharset_chinese_big5_1) || - EQ (charset, Vcharset_chinese_big5_2)) - { - ENCODE_BIG5 (XCHARSET_LEADING_BYTE (charset), c1 | 0x80, c2 | 0x80, - b1, b2); - return Fcons (make_int (b1), make_int (b2)); - } - else - return Qnil; -} - - -/************************************************************************/ -/* ISO2022 methods */ -/************************************************************************/ - -/* The following note describes the coding system ISO2022 briefly. - Since the intention of this note is to help understanding of the - programs in this file, some parts are NOT ACCURATE or OVERLY - SIMPLIFIED. For thorough understanding, please refer to the - original document of ISO2022. - - ISO2022 provides many mechanisms to encode several character sets - in 7-bit and 8-bit environments. If one chooses 7-bit environment, - all text is encoded by codes of less than 128. This may make the - encoded text a little bit longer, but the text get more stability - to pass through several gateways (some of them strip off MSB). - - There are two kind of character sets: control character set and - graphic character set. The former contains control characters such - as `newline' and `escape' to provide control functions (control - functions are provided also by escape sequence). The latter - contains graphic characters such as 'A' and '-'. Emacs recognizes - two control character sets and many graphic character sets. - - Graphic character sets are classified into one of four types, - according to the dimension and number of characters in the set: - TYPE94, TYPE96, TYPE94x94, and TYPE96x96. In addition, each - character set is assigned an identification byte, unique for each - type, called "final character" (denoted as hereafter). The - of each character set is decided by ECMA(*) when it is registered - in ISO. Code range of is 0x30..0x7F (0x30..0x3F are for - private use only). - - Note (*): ECMA = European Computer Manufacturers Association - - Here are examples of graphic character set [NAME()]: - o TYPE94 -- ASCII('B'), right-half-of-JISX0201('I'), ... - o TYPE96 -- right-half-of-ISO8859-1('A'), ... - o TYPE94x94 -- GB2312('A'), JISX0208('B'), ... - o TYPE96x96 -- none for the moment - - A code area (1byte=8bits) is divided into 4 areas, C0, GL, C1, and GR. - C0 [0x00..0x1F] -- control character plane 0 - GL [0x20..0x7F] -- graphic character plane 0 - C1 [0x80..0x9F] -- control character plane 1 - GR [0xA0..0xFF] -- graphic character plane 1 - - A control character set is directly designated and invoked to C0 or - C1 by an escape sequence. The most common case is that: - - ISO646's control character set is designated/invoked to C0, and - - ISO6429's control character set is designated/invoked to C1, - and usually these designations/invocations are omitted in encoded - text. In a 7-bit environment, only C0 can be used, and a control - character for C1 is encoded by an appropriate escape sequence to - fit into the environment. All control characters for C1 are - defined to have corresponding escape sequences. - - A graphic character set is at first designated to one of four - graphic registers (G0 through G3), then these graphic registers are - invoked to GL or GR. These designations and invocations can be - done independently. The most common case is that G0 is invoked to - GL, G1 is invoked to GR, and ASCII is designated to G0. Usually - these invocations and designations are omitted in encoded text. - In a 7-bit environment, only GL can be used. - - When a graphic character set of TYPE94 or TYPE94x94 is invoked to - GL, codes 0x20 and 0x7F of the GL area work as control characters - SPACE and DEL respectively, and code 0xA0 and 0xFF of GR area - should not be used. - - There are two ways of invocation: locking-shift and single-shift. - With locking-shift, the invocation lasts until the next different - invocation, whereas with single-shift, the invocation works only - for the following character and doesn't affect locking-shift. - Invocations are done by the following control characters or escape - sequences. - - ---------------------------------------------------------------------- - abbrev function cntrl escape seq description - ---------------------------------------------------------------------- - SI/LS0 (shift-in) 0x0F none invoke G0 into GL - SO/LS1 (shift-out) 0x0E none invoke G1 into GL - LS1R (locking-shift-1 right) none ESC '~' invoke G1 into GR - LS2 (locking-shift-2) none ESC 'n' invoke G2 into GL - LS2R (locking-shift-2 right) none ESC '}' invoke G2 into GR - LS3 (locking-shift-3) none ESC 'o' invoke G3 into GL - LS3R (locking-shift 3 right) none ESC '|' invoke G3 into GR - SS2 (single-shift-2) 0x8E ESC 'N' invoke G2 for one char - SS3 (single-shift-3) 0x8F ESC 'O' invoke G3 for one char - ---------------------------------------------------------------------- - The first four are for locking-shift. Control characters for these - functions are defined by macros ISO_CODE_XXX in `coding.h'. - - Designations are done by the following escape sequences. - ---------------------------------------------------------------------- - escape sequence description - ---------------------------------------------------------------------- - ESC '(' designate TYPE94 to G0 - ESC ')' designate TYPE94 to G1 - ESC '*' designate TYPE94 to G2 - ESC '+' designate TYPE94 to G3 - ESC ',' designate TYPE96 to G0 (*) - ESC '-' designate TYPE96 to G1 - ESC '.' designate TYPE96 to G2 - ESC '/' designate TYPE96 to G3 - ESC '$' '(' designate TYPE94x94 to G0 (**) - ESC '$' ')' designate TYPE94x94 to G1 - ESC '$' '*' designate TYPE94x94 to G2 - ESC '$' '+' designate TYPE94x94 to G3 - ESC '$' ',' designate TYPE96x96 to G0 (*) - ESC '$' '-' designate TYPE96x96 to G1 - ESC '$' '.' designate TYPE96x96 to G2 - ESC '$' '/' designate TYPE96x96 to G3 - ---------------------------------------------------------------------- - In this list, "TYPE94" means a graphic character set of type TYPE94 - and final character , and etc. - - Note (*): Although these designations are not allowed in ISO2022, - Emacs accepts them on decoding, and produces them on encoding - TYPE96 or TYPE96x96 character set in a coding system which is - characterized as 7-bit environment, non-locking-shift, and - non-single-shift. - - Note (**): If is '@', 'A', or 'B', the intermediate character - '(' can be omitted. We call this as "short-form" here after. - - Now you may notice that there are a lot of ways for encoding the - same multilingual text in ISO2022. Actually, there exist many - coding systems such as Compound Text (used in X's inter client - communication, ISO-2022-JP (used in Japanese internet), ISO-2022-KR - (used in Korean internet), EUC (Extended UNIX Code, used in Asian - localized platforms), and all of these are variants of ISO2022. - - In addition to the above, Emacs handles two more kinds of escape - sequences: ISO6429's direction specification and Emacs' private - sequence for specifying character composition. - - ISO6429's direction specification takes the following format: - o CSI ']' -- end of the current direction - o CSI '0' ']' -- end of the current direction - o CSI '1' ']' -- start of left-to-right text - o CSI '2' ']' -- start of right-to-left text - The control character CSI (0x9B: control sequence introducer) is - abbreviated to the escape sequence ESC '[' in 7-bit environment. - - Character composition specification takes the following format: - o ESC '0' -- start character composition - o ESC '1' -- end character composition - Since these are not standard escape sequences of any ISO, the use - of them for these meanings is restricted to Emacs only. */ - -static void -reset_iso2022 (Lisp_Object coding_system, struct iso2022_decoder *iso) -{ - int i; - - for (i = 0; i < 4; i++) - { - if (!NILP (coding_system)) - iso->charset[i] = - XCODING_SYSTEM_ISO2022_INITIAL_CHARSET (coding_system, i); - else - iso->charset[i] = Qt; - iso->invalid_designated[i] = 0; - } - iso->esc = ISO_ESC_NOTHING; - iso->esc_bytes_index = 0; - iso->register_left = 0; - iso->register_right = 1; - iso->switched_dir_and_no_valid_charset_yet = 0; - iso->invalid_switch_dir = 0; - iso->output_direction_sequence = 0; - iso->output_literally = 0; - if (iso->composite_chars) - Dynarr_reset (iso->composite_chars); -} - -static int -fit_to_be_escape_quoted (unsigned char c) -{ - switch (c) - { - case ISO_CODE_ESC: - case ISO_CODE_CSI: - case ISO_CODE_SS2: - case ISO_CODE_SS3: - case ISO_CODE_SO: - case ISO_CODE_SI: - return 1; - - default: - return 0; - } -} - -/* Parse one byte of an ISO2022 escape sequence. - If the result is an invalid escape sequence, return 0 and - do not change anything in STR. Otherwise, if the result is - an incomplete escape sequence, update ISO2022.ESC and - ISO2022.ESC_BYTES and return -1. Otherwise, update - all the state variables (but not ISO2022.ESC_BYTES) and - return 1. - - If CHECK_INVALID_CHARSETS is non-zero, check for designation - or invocation of an invalid character set and treat that as - an unrecognized escape sequence. */ - -static int -parse_iso2022_esc (Lisp_Object codesys, struct iso2022_decoder *iso, - unsigned char c, unsigned int *flags, - int check_invalid_charsets) -{ - /* (1) If we're at the end of a designation sequence, CS is the - charset being designated and REG is the register to designate - it to. - - (2) If we're at the end of a locking-shift sequence, REG is - the register to invoke and HALF (0 == left, 1 == right) is - the half to invoke it into. - - (3) If we're at the end of a single-shift sequence, REG is - the register to invoke. */ - Lisp_Object cs = Qnil; - int reg, half; - - /* NOTE: This code does goto's all over the fucking place. - The reason for this is that we're basically implementing - a state machine here, and hierarchical languages like C - don't really provide a clean way of doing this. */ - - if (! (*flags & CODING_STATE_ESCAPE)) - /* At beginning of escape sequence; we need to reset our - escape-state variables. */ - iso->esc = ISO_ESC_NOTHING; - - iso->output_literally = 0; - iso->output_direction_sequence = 0; - - switch (iso->esc) - { - case ISO_ESC_NOTHING: - iso->esc_bytes_index = 0; - switch (c) - { - case ISO_CODE_ESC: /* Start escape sequence */ - *flags |= CODING_STATE_ESCAPE; - iso->esc = ISO_ESC; - goto not_done; - - case ISO_CODE_CSI: /* ISO6429 (specifying directionality) */ - *flags |= CODING_STATE_ESCAPE; - iso->esc = ISO_ESC_5_11; - goto not_done; - - case ISO_CODE_SO: /* locking shift 1 */ - reg = 1; half = 0; - goto locking_shift; - case ISO_CODE_SI: /* locking shift 0 */ - reg = 0; half = 0; - goto locking_shift; - - case ISO_CODE_SS2: /* single shift */ - reg = 2; - goto single_shift; - case ISO_CODE_SS3: /* single shift */ - reg = 3; - goto single_shift; - - default: /* Other control characters */ - return 0; - } - - case ISO_ESC: - switch (c) - { - /**** single shift ****/ - - case 'N': /* single shift 2 */ - reg = 2; - goto single_shift; - case 'O': /* single shift 3 */ - reg = 3; - goto single_shift; - - /**** locking shift ****/ - - case '~': /* locking shift 1 right */ - reg = 1; half = 1; - goto locking_shift; - case 'n': /* locking shift 2 */ - reg = 2; half = 0; - goto locking_shift; - case '}': /* locking shift 2 right */ - reg = 2; half = 1; - goto locking_shift; - case 'o': /* locking shift 3 */ - reg = 3; half = 0; - goto locking_shift; - case '|': /* locking shift 3 right */ - reg = 3; half = 1; - goto locking_shift; - - /**** composite ****/ - - case '0': - iso->esc = ISO_ESC_START_COMPOSITE; - *flags = (*flags & CODING_STATE_ISO2022_LOCK) | - CODING_STATE_COMPOSITE; - return 1; - - case '1': - iso->esc = ISO_ESC_END_COMPOSITE; - *flags = (*flags & CODING_STATE_ISO2022_LOCK) & - ~CODING_STATE_COMPOSITE; - return 1; - - /**** directionality ****/ - - case '[': - iso->esc = ISO_ESC_5_11; - goto not_done; - - /**** designation ****/ - - case '$': /* multibyte charset prefix */ - iso->esc = ISO_ESC_2_4; - goto not_done; - - default: - if (0x28 <= c && c <= 0x2F) - { - iso->esc = (enum iso_esc_flag) (c - 0x28 + ISO_ESC_2_8); - goto not_done; - } - - /* This function is called with CODESYS equal to nil when - doing coding-system detection. */ - if (!NILP (codesys) - && XCODING_SYSTEM_ISO2022_ESCAPE_QUOTED (codesys) - && fit_to_be_escape_quoted (c)) - { - iso->esc = ISO_ESC_LITERAL; - *flags &= CODING_STATE_ISO2022_LOCK; - return 1; - } - - /* bzzzt! */ - return 0; - } - - - - /**** directionality ****/ - - case ISO_ESC_5_11: /* ISO6429 direction control */ - if (c == ']') - { - *flags &= (CODING_STATE_ISO2022_LOCK & ~CODING_STATE_R2L); - goto directionality; - } - if (c == '0') iso->esc = ISO_ESC_5_11_0; - else if (c == '1') iso->esc = ISO_ESC_5_11_1; - else if (c == '2') iso->esc = ISO_ESC_5_11_2; - else return 0; - goto not_done; - - case ISO_ESC_5_11_0: - if (c == ']') - { - *flags &= (CODING_STATE_ISO2022_LOCK & ~CODING_STATE_R2L); - goto directionality; - } - return 0; - - case ISO_ESC_5_11_1: - if (c == ']') - { - *flags = (CODING_STATE_ISO2022_LOCK & ~CODING_STATE_R2L); - goto directionality; - } - return 0; - - case ISO_ESC_5_11_2: - if (c == ']') - { - *flags = (*flags & CODING_STATE_ISO2022_LOCK) | CODING_STATE_R2L; - goto directionality; - } - return 0; - - directionality: - iso->esc = ISO_ESC_DIRECTIONALITY; - /* Various junk here to attempt to preserve the direction sequences - literally in the text if they would otherwise be swallowed due - to invalid designations that don't show up as actual charset - changes in the text. */ - if (iso->invalid_switch_dir) - { - /* We already inserted a direction switch literally into the - text. We assume (#### this may not be right) that the - next direction switch is the one going the other way, - and we need to output that literally as well. */ - iso->output_literally = 1; - iso->invalid_switch_dir = 0; - } - else - { - int jj; - - /* If we are in the thrall of an invalid designation, - then stick the directionality sequence literally into the - output stream so it ends up in the original text again. */ - for (jj = 0; jj < 4; jj++) - if (iso->invalid_designated[jj]) - break; - if (jj < 4) - { - iso->output_literally = 1; - iso->invalid_switch_dir = 1; - } - else - /* Indicate that we haven't yet seen a valid designation, - so that if a switch-dir is directly followed by an - invalid designation, both get inserted literally. */ - iso->switched_dir_and_no_valid_charset_yet = 1; - } - return 1; - - - /**** designation ****/ - - case ISO_ESC_2_4: - if (0x28 <= c && c <= 0x2F) - { - iso->esc = (enum iso_esc_flag) (c - 0x28 + ISO_ESC_2_4_8); - goto not_done; - } - if (0x40 <= c && c <= 0x42) - { - cs = CHARSET_BY_ATTRIBUTES (CHARSET_TYPE_94X94, c, - *flags & CODING_STATE_R2L ? - CHARSET_RIGHT_TO_LEFT : - CHARSET_LEFT_TO_RIGHT); - reg = 0; - goto designated; - } - return 0; - - default: - { - int type =-1; - - if (c < '0' || c > '~') - return 0; /* bad final byte */ - - if (iso->esc >= ISO_ESC_2_8 && - iso->esc <= ISO_ESC_2_15) - { - type = ((iso->esc >= ISO_ESC_2_12) ? - CHARSET_TYPE_96 : CHARSET_TYPE_94); - reg = (iso->esc - ISO_ESC_2_8) & 3; - } - else if (iso->esc >= ISO_ESC_2_4_8 && - iso->esc <= ISO_ESC_2_4_15) - { - type = ((iso->esc >= ISO_ESC_2_4_12) ? - CHARSET_TYPE_96X96 : CHARSET_TYPE_94X94); - reg = (iso->esc - ISO_ESC_2_4_8) & 3; - } - else - { - /* Can this ever be reached? -slb */ - abort(); - } - - cs = CHARSET_BY_ATTRIBUTES (type, c, - *flags & CODING_STATE_R2L ? - CHARSET_RIGHT_TO_LEFT : - CHARSET_LEFT_TO_RIGHT); - goto designated; - } - } - - not_done: - iso->esc_bytes[iso->esc_bytes_index++] = (unsigned char) c; - return -1; - - single_shift: - if (check_invalid_charsets && !CHARSETP (iso->charset[reg])) - /* can't invoke something that ain't there. */ - return 0; - iso->esc = ISO_ESC_SINGLE_SHIFT; - *flags &= CODING_STATE_ISO2022_LOCK; - if (reg == 2) - *flags |= CODING_STATE_SS2; - else - *flags |= CODING_STATE_SS3; - return 1; - - locking_shift: - if (check_invalid_charsets && - !CHARSETP (iso->charset[reg])) - /* can't invoke something that ain't there. */ - return 0; - if (half) - iso->register_right = reg; - else - iso->register_left = reg; - *flags &= CODING_STATE_ISO2022_LOCK; - iso->esc = ISO_ESC_LOCKING_SHIFT; - return 1; - - designated: - if (NILP (cs) && check_invalid_charsets) - { - iso->invalid_designated[reg] = 1; - iso->charset[reg] = Vcharset_ascii; - iso->esc = ISO_ESC_DESIGNATE; - *flags &= CODING_STATE_ISO2022_LOCK; - iso->output_literally = 1; - if (iso->switched_dir_and_no_valid_charset_yet) - { - /* We encountered a switch-direction followed by an - invalid designation. Ensure that the switch-direction - gets outputted; otherwise it will probably get eaten - when the text is written out again. */ - iso->switched_dir_and_no_valid_charset_yet = 0; - iso->output_direction_sequence = 1; - /* And make sure that the switch-dir going the other - way gets outputted, as well. */ - iso->invalid_switch_dir = 1; - } - return 1; - } - /* This function is called with CODESYS equal to nil when - doing coding-system detection. */ - if (!NILP (codesys)) - { - charset_conversion_spec_dynarr *dyn = - XCODING_SYSTEM (codesys)->iso2022.input_conv; - - if (dyn) - { - int i; - - for (i = 0; i < Dynarr_length (dyn); i++) - { - struct charset_conversion_spec *spec = Dynarr_atp (dyn, i); - if (EQ (cs, spec->from_charset)) - cs = spec->to_charset; - } - } - } - - iso->charset[reg] = cs; - iso->esc = ISO_ESC_DESIGNATE; - *flags &= CODING_STATE_ISO2022_LOCK; - if (iso->invalid_designated[reg]) - { - iso->invalid_designated[reg] = 0; - iso->output_literally = 1; - } - if (iso->switched_dir_and_no_valid_charset_yet) - iso->switched_dir_and_no_valid_charset_yet = 0; - return 1; -} - -static int -detect_coding_iso2022 (struct detection_state *st, CONST unsigned char *src, - unsigned int n) -{ - int c; - int mask; - - /* #### There are serious deficiencies in the recognition mechanism - here. This needs to be much smarter if it's going to cut it. */ - - if (!st->iso2022.initted) - { - reset_iso2022 (Qnil, &st->iso2022.iso); - st->iso2022.mask = (CODING_CATEGORY_ISO_7_MASK | - CODING_CATEGORY_ISO_8_DESIGNATE_MASK | - CODING_CATEGORY_ISO_8_1_MASK | - CODING_CATEGORY_ISO_8_2_MASK | - CODING_CATEGORY_ISO_LOCK_SHIFT_MASK); - st->iso2022.flags = 0; - st->iso2022.high_byte_count = 0; - st->iso2022.saw_single_shift = 0; - st->iso2022.initted = 1; - } - - mask = st->iso2022.mask; - - while (n--) - { - c = *src++; - if (c >= 0xA0) - { - mask &= ~CODING_CATEGORY_ISO_7_MASK; - st->iso2022.high_byte_count++; - } - else - { - if (st->iso2022.high_byte_count && !st->iso2022.saw_single_shift) - { - if (st->iso2022.high_byte_count & 1) - /* odd number of high bytes; assume not iso-8-2 */ - mask &= ~CODING_CATEGORY_ISO_8_2_MASK; - } - st->iso2022.high_byte_count = 0; - st->iso2022.saw_single_shift = 0; - if (c > 0x80) - mask &= ~CODING_CATEGORY_ISO_7_MASK; - } - if (!(st->iso2022.flags & CODING_STATE_ESCAPE) - && (BYTE_C0_P (c) || BYTE_C1_P (c))) - { /* control chars */ - switch (c) - { - /* Allow and ignore control characters that you might - reasonably see in a text file */ - case '\r': - case '\n': - case '\t': - case 7: /* bell */ - case 8: /* backspace */ - case 11: /* vertical tab */ - case 12: /* form feed */ - case 26: /* MS-DOS C-z junk */ - case 31: /* '^_' -- for info */ - goto label_continue_loop; - - default: - break; - } - } - - if ((st->iso2022.flags & CODING_STATE_ESCAPE) || BYTE_C0_P (c) - || BYTE_C1_P (c)) - { - if (parse_iso2022_esc (Qnil, &st->iso2022.iso, c, - &st->iso2022.flags, 0)) - { - switch (st->iso2022.iso.esc) - { - case ISO_ESC_DESIGNATE: - mask &= ~CODING_CATEGORY_ISO_8_1_MASK; - mask &= ~CODING_CATEGORY_ISO_8_2_MASK; - break; - case ISO_ESC_LOCKING_SHIFT: - mask = CODING_CATEGORY_ISO_LOCK_SHIFT_MASK; - goto ran_out_of_chars; - case ISO_ESC_SINGLE_SHIFT: - mask &= ~CODING_CATEGORY_ISO_8_DESIGNATE_MASK; - st->iso2022.saw_single_shift = 1; - break; - default: - break; - } - } - else - { - mask = 0; - goto ran_out_of_chars; - } - } - label_continue_loop:; - } - - ran_out_of_chars: - - return mask; -} - -static int -postprocess_iso2022_mask (int mask) -{ - /* #### kind of cheesy */ - /* If seven-bit ISO is allowed, then assume that the encoding is - entirely seven-bit and turn off the eight-bit ones. */ - if (mask & CODING_CATEGORY_ISO_7_MASK) - mask &= ~ (CODING_CATEGORY_ISO_8_DESIGNATE_MASK | - CODING_CATEGORY_ISO_8_1_MASK | - CODING_CATEGORY_ISO_8_2_MASK); - return mask; -} - -/* If FLAGS is a null pointer or specifies right-to-left motion, - output a switch-dir-to-left-to-right sequence to DST. - Also update FLAGS if it is not a null pointer. - If INTERNAL_P is set, we are outputting in internal format and - need to handle the CSI differently. */ - -static void -restore_left_to_right_direction (struct Lisp_Coding_System *codesys, - unsigned_char_dynarr *dst, - unsigned int *flags, - int internal_p) -{ - if (!flags || (*flags & CODING_STATE_R2L)) - { - if (CODING_SYSTEM_ISO2022_SEVEN (codesys)) - { - Dynarr_add (dst, ISO_CODE_ESC); - Dynarr_add (dst, '['); - } - else if (internal_p) - DECODE_ADD_BINARY_CHAR (ISO_CODE_CSI, dst); - else - Dynarr_add (dst, ISO_CODE_CSI); - Dynarr_add (dst, '0'); - Dynarr_add (dst, ']'); - if (flags) - *flags &= ~CODING_STATE_R2L; - } -} - -/* If FLAGS is a null pointer or specifies a direction different from - DIRECTION (which should be either CHARSET_RIGHT_TO_LEFT or - CHARSET_LEFT_TO_RIGHT), output the appropriate switch-dir escape - sequence to DST. Also update FLAGS if it is not a null pointer. - If INTERNAL_P is set, we are outputting in internal format and - need to handle the CSI differently. */ - -static void -ensure_correct_direction (int direction, struct Lisp_Coding_System *codesys, - unsigned_char_dynarr *dst, unsigned int *flags, - int internal_p) -{ - if ((!flags || (*flags & CODING_STATE_R2L)) && - direction == CHARSET_LEFT_TO_RIGHT) - restore_left_to_right_direction (codesys, dst, flags, internal_p); - else if (!CODING_SYSTEM_ISO2022_NO_ISO6429 (codesys) - && (!flags || !(*flags & CODING_STATE_R2L)) && - direction == CHARSET_RIGHT_TO_LEFT) - { - if (CODING_SYSTEM_ISO2022_SEVEN (codesys)) - { - Dynarr_add (dst, ISO_CODE_ESC); - Dynarr_add (dst, '['); - } - else if (internal_p) - DECODE_ADD_BINARY_CHAR (ISO_CODE_CSI, dst); - else - Dynarr_add (dst, ISO_CODE_CSI); - Dynarr_add (dst, '2'); - Dynarr_add (dst, ']'); - if (flags) - *flags |= CODING_STATE_R2L; - } -} - -/* Convert ISO2022-format data to internal format. */ - -static void -decode_coding_iso2022 (Lstream *decoding, CONST unsigned char *src, - unsigned_char_dynarr *dst, unsigned int n) -{ - unsigned char c; - unsigned int flags, ch; - enum eol_type eol_type; - struct decoding_stream *str = DECODING_STREAM_DATA (decoding); - Lisp_Object coding_system; - unsigned_char_dynarr *real_dst = dst; - - CODING_STREAM_DECOMPOSE (str, flags, ch); - eol_type = str->eol_type; - XSETCODING_SYSTEM (coding_system, str->codesys); - - if (flags & CODING_STATE_COMPOSITE) - dst = str->iso2022.composite_chars; - - while (n--) - { - c = *src++; - if (flags & CODING_STATE_ESCAPE) - { /* Within ESC sequence */ - int retval = parse_iso2022_esc (coding_system, &str->iso2022, - c, &flags, 1); - - if (retval) - { - switch (str->iso2022.esc) - { - case ISO_ESC_START_COMPOSITE: - if (str->iso2022.composite_chars) - Dynarr_reset (str->iso2022.composite_chars); - else - str->iso2022.composite_chars = Dynarr_new (unsigned_char); - dst = str->iso2022.composite_chars; - break; - case ISO_ESC_END_COMPOSITE: - { - Bufbyte comstr[MAX_EMCHAR_LEN]; - Bytecount len; - Emchar emch = lookup_composite_char (Dynarr_atp (dst, 0), - Dynarr_length (dst)); - dst = real_dst; - len = set_charptr_emchar (comstr, emch); - Dynarr_add_many (dst, comstr, len); - break; - } - - case ISO_ESC_LITERAL: - DECODE_ADD_BINARY_CHAR (c, dst); - break; - - default: - /* Everything else handled already */ - break; - } - } - - /* Attempted error recovery. */ - if (str->iso2022.output_direction_sequence) - ensure_correct_direction (flags & CODING_STATE_R2L ? - CHARSET_RIGHT_TO_LEFT : - CHARSET_LEFT_TO_RIGHT, - str->codesys, dst, 0, 1); - /* More error recovery. */ - if (!retval || str->iso2022.output_literally) - { - /* Output the (possibly invalid) sequence */ - int i; - for (i = 0; i < str->iso2022.esc_bytes_index; i++) - DECODE_ADD_BINARY_CHAR (str->iso2022.esc_bytes[i], dst); - flags &= CODING_STATE_ISO2022_LOCK; - if (!retval) - n++, src--;/* Repeat the loop with the same character. */ - else - { - /* No sense in reprocessing the final byte of the - escape sequence; it could mess things up anyway. - Just add it now. */ - DECODE_ADD_BINARY_CHAR (c, dst); - } - } - ch = 0; - } - else if (BYTE_C0_P (c) || BYTE_C1_P (c)) - { /* Control characters */ - - /***** Error-handling *****/ - - /* If we were in the middle of a character, dump out the - partial character. */ - DECODE_OUTPUT_PARTIAL_CHAR (ch); - - /* If we just saw a single-shift character, dump it out. - This may dump out the wrong sort of single-shift character, - but least it will give an indication that something went - wrong. */ - if (flags & CODING_STATE_SS2) - { - DECODE_ADD_BINARY_CHAR (ISO_CODE_SS2, dst); - flags &= ~CODING_STATE_SS2; - } - if (flags & CODING_STATE_SS3) - { - DECODE_ADD_BINARY_CHAR (ISO_CODE_SS3, dst); - flags &= ~CODING_STATE_SS3; - } - - /***** Now handle the control characters. *****/ - - /* Handle CR/LF */ - DECODE_HANDLE_EOL_TYPE (eol_type, c, flags, dst); - - flags &= CODING_STATE_ISO2022_LOCK; - - if (!parse_iso2022_esc (coding_system, &str->iso2022, c, &flags, 1)) - DECODE_ADD_BINARY_CHAR (c, dst); - } - else - { /* Graphic characters */ - Lisp_Object charset; - int lb; - int reg; - - DECODE_HANDLE_EOL_TYPE (eol_type, c, flags, dst); - - /* Now determine the charset. */ - reg = ((flags & CODING_STATE_SS2) ? 2 - : (flags & CODING_STATE_SS3) ? 3 - : !BYTE_ASCII_P (c) ? str->iso2022.register_right - : str->iso2022.register_left); - charset = str->iso2022.charset[reg]; - - /* Error checking: */ - if (NILP (charset) || str->iso2022.invalid_designated[reg] - || (((c & 0x7F) == ' ' || (c & 0x7F) == ISO_CODE_DEL) - && XCHARSET_CHARS (charset) == 94)) - /* Mrmph. We are trying to invoke a register that has no - or an invalid charset in it, or trying to add a character - outside the range of the charset. Insert that char literally - to preserve it for the output. */ - { - DECODE_OUTPUT_PARTIAL_CHAR (ch); - DECODE_ADD_BINARY_CHAR (c, dst); - } - - else - { - /* Things are probably hunky-dorey. */ - - /* Fetch reverse charset, maybe. */ - if (((flags & CODING_STATE_R2L) && - XCHARSET_DIRECTION (charset) == CHARSET_LEFT_TO_RIGHT) - || - (!(flags & CODING_STATE_R2L) && - XCHARSET_DIRECTION (charset) == CHARSET_RIGHT_TO_LEFT)) - { - Lisp_Object new_charset = - XCHARSET_REVERSE_DIRECTION_CHARSET (charset); - if (!NILP (new_charset)) - charset = new_charset; - } - - lb = XCHARSET_LEADING_BYTE (charset); - switch (XCHARSET_REP_BYTES (charset)) - { - case 1: /* ASCII */ - DECODE_OUTPUT_PARTIAL_CHAR (ch); - Dynarr_add (dst, c & 0x7F); - break; - - case 2: /* one-byte official */ - DECODE_OUTPUT_PARTIAL_CHAR (ch); - Dynarr_add (dst, lb); - Dynarr_add (dst, c | 0x80); - break; - - case 3: /* one-byte private or two-byte official */ - if (XCHARSET_PRIVATE_P (charset)) - { - DECODE_OUTPUT_PARTIAL_CHAR (ch); - Dynarr_add (dst, PRE_LEADING_BYTE_PRIVATE_1); - Dynarr_add (dst, lb); - Dynarr_add (dst, c | 0x80); - } - else - { - if (ch) - { - Dynarr_add (dst, lb); - Dynarr_add (dst, ch | 0x80); - Dynarr_add (dst, c | 0x80); - ch = 0; - } - else - ch = c; - } - break; - - default: /* two-byte private */ - if (ch) - { - Dynarr_add (dst, PRE_LEADING_BYTE_PRIVATE_2); - Dynarr_add (dst, lb); - Dynarr_add (dst, ch | 0x80); - Dynarr_add (dst, c | 0x80); - ch = 0; - } - else - ch = c; - } - } - - if (!ch) - flags &= CODING_STATE_ISO2022_LOCK; - } - - label_continue_loop:; - } - - if (flags & CODING_STATE_END) - DECODE_OUTPUT_PARTIAL_CHAR (ch); - - CODING_STREAM_COMPOSE (str, flags, ch); -} - - -/***** ISO2022 encoder *****/ - -/* Designate CHARSET into register REG. */ - -static void -iso2022_designate (Lisp_Object charset, unsigned char reg, - struct encoding_stream *str, unsigned_char_dynarr *dst) -{ - CONST char *inter94 = "()*+", *inter96= ",-./"; - unsigned int type; - unsigned char final; - Lisp_Object old_charset = str->iso2022.charset[reg]; - - str->iso2022.charset[reg] = charset; - if (!CHARSETP (charset)) - /* charset might be an initial nil or t. */ - return; - type = XCHARSET_TYPE (charset); - final = XCHARSET_FINAL (charset); - if (!str->iso2022.force_charset_on_output[reg] && - CHARSETP (old_charset) && - XCHARSET_TYPE (old_charset) == type && - XCHARSET_FINAL (old_charset) == final) - return; - - str->iso2022.force_charset_on_output[reg] = 0; - - { - charset_conversion_spec_dynarr *dyn = - str->codesys->iso2022.output_conv; - - if (dyn) - { - int i; - - for (i = 0; i < Dynarr_length (dyn); i++) - { - struct charset_conversion_spec *spec = Dynarr_atp (dyn, i); - if (EQ (charset, spec->from_charset)) - charset = spec->to_charset; - } - } - } - - Dynarr_add (dst, ISO_CODE_ESC); - switch (type) - { - case CHARSET_TYPE_94: - Dynarr_add (dst, inter94[reg]); - break; - case CHARSET_TYPE_96: - Dynarr_add (dst, inter96[reg]); - break; - case CHARSET_TYPE_94X94: - Dynarr_add (dst, '$'); - if (reg != 0 - || !(CODING_SYSTEM_ISO2022_SHORT (str->codesys)) - || final < '@' - || final > 'B') - Dynarr_add (dst, inter94[reg]); - break; - case CHARSET_TYPE_96X96: - Dynarr_add (dst, '$'); - Dynarr_add (dst, inter96[reg]); - break; - } - Dynarr_add (dst, final); -} - -static void -ensure_normal_shift (struct encoding_stream *str, unsigned_char_dynarr *dst) -{ - if (str->iso2022.register_left != 0) - { - Dynarr_add (dst, ISO_CODE_SI); - str->iso2022.register_left = 0; - } -} - -static void -ensure_shift_out (struct encoding_stream *str, unsigned_char_dynarr *dst) -{ - if (str->iso2022.register_left != 1) - { - Dynarr_add (dst, ISO_CODE_SO); - str->iso2022.register_left = 1; - } -} - -/* Convert internally-formatted data to ISO2022 format. */ - -static void -encode_coding_iso2022 (Lstream *encoding, CONST unsigned char *src, - unsigned_char_dynarr *dst, unsigned int n) -{ - unsigned char charmask, c; - unsigned int flags, ch; - enum eol_type eol_type; - unsigned char char_boundary; - struct encoding_stream *str = ENCODING_STREAM_DATA (encoding); - struct Lisp_Coding_System *codesys = str->codesys; - int i; - Lisp_Object charset; - int half; - - /* flags for handling composite chars. We do a little switcharoo - on the source while we're outputting the composite char. */ - unsigned int saved_n = 0; - CONST unsigned char *saved_src = NULL; - int in_composite = 0; - - CODING_STREAM_DECOMPOSE (str, flags, ch); - eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys); - char_boundary = str->iso2022.current_char_boundary; - charset = str->iso2022.current_charset; - half = str->iso2022.current_half; - - back_to_square_n: - while (n--) - { - c = *src++; - - if (BYTE_ASCII_P (c)) - { /* Processing ASCII character */ - ch = 0; - - restore_left_to_right_direction (codesys, dst, &flags, 0); - - /* Make sure G0 contains ASCII */ - if ((c > ' ' && c < ISO_CODE_DEL) || - !CODING_SYSTEM_ISO2022_NO_ASCII_CNTL (codesys)) - { - ensure_normal_shift (str, dst); - iso2022_designate (Vcharset_ascii, 0, str, dst); - } - - /* If necessary, restore everything to the default state - at end-of-line */ - if (c == '\n' && - !(CODING_SYSTEM_ISO2022_NO_ASCII_EOL (codesys))) - { - restore_left_to_right_direction (codesys, dst, &flags, 0); - - ensure_normal_shift (str, dst); - - for (i = 0; i < 4; i++) - { - Lisp_Object initial_charset = - CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, i); - iso2022_designate (initial_charset, i, str, dst); - } - } - if (c == '\n') - { - if (eol_type != EOL_LF && eol_type != EOL_AUTODETECT) - Dynarr_add (dst, '\r'); - if (eol_type != EOL_CR) - Dynarr_add (dst, c); - } - else - { - if (CODING_SYSTEM_ISO2022_ESCAPE_QUOTED (codesys) - && fit_to_be_escape_quoted (c)) - Dynarr_add (dst, ISO_CODE_ESC); - Dynarr_add (dst, c); - } - char_boundary = 1; - } - - else if (BUFBYTE_LEADING_BYTE_P (c) || BUFBYTE_LEADING_BYTE_P (ch)) - { /* Processing Leading Byte */ - ch = 0; - charset = CHARSET_BY_LEADING_BYTE (c); - if (LEADING_BYTE_PREFIX_P(c)) - ch = c; - else if (!EQ (charset, Vcharset_control_1) - && !EQ (charset, Vcharset_composite)) - { - int reg; - - ensure_correct_direction (XCHARSET_DIRECTION (charset), - codesys, dst, &flags, 0); - - /* Now determine which register to use. */ - reg = -1; - for (i = 0; i < 4; i++) - { - if (EQ (charset, str->iso2022.charset[i]) || - EQ (charset, - CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, i))) - { - reg = i; - break; - } - } - - if (reg == -1) - { - if (XCHARSET_GRAPHIC (charset) != 0) - { - if (!NILP (str->iso2022.charset[1]) && - (!CODING_SYSTEM_ISO2022_SEVEN (codesys) || - CODING_SYSTEM_ISO2022_LOCK_SHIFT (codesys))) - reg = 1; - else if (!NILP (str->iso2022.charset[2])) - reg = 2; - else if (!NILP (str->iso2022.charset[3])) - reg = 3; - else - reg = 0; - } - else - reg = 0; - } - - iso2022_designate (charset, reg, str, dst); - - /* Now invoke that register. */ - switch (reg) - { - case 0: - ensure_normal_shift (str, dst); - half = 0; - break; - - case 1: - if (CODING_SYSTEM_ISO2022_SEVEN (codesys)) - { - ensure_shift_out (str, dst); - half = 0; - } - else - half = 1; - break; - - case 2: - if (CODING_SYSTEM_ISO2022_SEVEN (str->codesys)) - { - Dynarr_add (dst, ISO_CODE_ESC); - Dynarr_add (dst, 'N'); - half = 0; - } - else - { - Dynarr_add (dst, ISO_CODE_SS2); - half = 1; - } - break; - - case 3: - if (CODING_SYSTEM_ISO2022_SEVEN (str->codesys)) - { - Dynarr_add (dst, ISO_CODE_ESC); - Dynarr_add (dst, 'O'); - half = 0; - } - else - { - Dynarr_add (dst, ISO_CODE_SS3); - half = 1; - } - break; - - default: - abort (); - } - } - char_boundary = 0; - } - else - { /* Processing Non-ASCII character */ - charmask = (half == 0 ? 0x7F : 0xFF); - char_boundary = 1; - if (EQ (charset, Vcharset_control_1)) - { - if (CODING_SYSTEM_ISO2022_ESCAPE_QUOTED (codesys) - && fit_to_be_escape_quoted (c)) - Dynarr_add (dst, ISO_CODE_ESC); - /* you asked for it ... */ - Dynarr_add (dst, c - 0x20); - } - else - { - switch (XCHARSET_REP_BYTES (charset)) - { - case 2: - Dynarr_add (dst, c & charmask); - break; - case 3: - if (XCHARSET_PRIVATE_P (charset)) - { - Dynarr_add (dst, c & charmask); - ch = 0; - } - else if (ch) - { - if (EQ (charset, Vcharset_composite)) - { - if (in_composite) - { - /* #### Bother! We don't know how to - handle this yet. */ - Dynarr_add (dst, '~'); - } - else - { - Emchar emch = MAKE_CHAR (Vcharset_composite, - ch & 0x7F, c & 0x7F); - Lisp_Object lstr = composite_char_string (emch); - saved_n = n; - saved_src = src; - in_composite = 1; - src = XSTRING_DATA (lstr); - n = XSTRING_LENGTH (lstr); - Dynarr_add (dst, ISO_CODE_ESC); - Dynarr_add (dst, '0'); /* start composing */ - } - } - else - { - Dynarr_add (dst, ch & charmask); - Dynarr_add (dst, c & charmask); - } - ch = 0; - } - else - { - ch = c; - char_boundary = 0; - } - break; - case 4: - if (ch) - { - Dynarr_add (dst, ch & charmask); - Dynarr_add (dst, c & charmask); - ch = 0; - } - else - { - ch = c; - char_boundary = 0; - } - break; - default: - abort (); - } - } - } - } - - if (in_composite) - { - n = saved_n; - src = saved_src; - in_composite = 0; - Dynarr_add (dst, ISO_CODE_ESC); - Dynarr_add (dst, '1'); /* end composing */ - goto back_to_square_n; /* Wheeeeeeeee ..... */ - } - - if (char_boundary && flags & CODING_STATE_END) - { - restore_left_to_right_direction (codesys, dst, &flags, 0); - ensure_normal_shift (str, dst); - for (i = 0; i < 4; i++) - { - Lisp_Object initial_charset = - CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, i); - iso2022_designate (initial_charset, i, str, dst); - } - } - - CODING_STREAM_COMPOSE (str, flags, ch); - str->iso2022.current_char_boundary = char_boundary; - str->iso2022.current_charset = charset; - str->iso2022.current_half = half; - - /* Verbum caro factum est! */ -} - - -/************************************************************************/ -/* No-conversion methods */ -/************************************************************************/ - -/* This is used when reading in "binary" files -- i.e. files that may - contain all 256 possible byte values and that are not to be - interpreted as being in any particular decoding. */ -static void -decode_coding_no_conversion (Lstream *decoding, CONST unsigned char *src, - unsigned_char_dynarr *dst, unsigned int n) -{ - unsigned char c; - unsigned int flags, ch; - enum eol_type eol_type; - struct decoding_stream *str = DECODING_STREAM_DATA (decoding); - - CODING_STREAM_DECOMPOSE (str, flags, ch); - eol_type = str->eol_type; - - while (n--) - { - c = *src++; - - DECODE_HANDLE_EOL_TYPE (eol_type, c, flags, dst); - DECODE_ADD_BINARY_CHAR (c, dst); - label_continue_loop:; - } - - DECODE_HANDLE_END_OF_CONVERSION (flags, ch, dst); - - CODING_STREAM_COMPOSE (str, flags, ch); -} - -static void -encode_coding_no_conversion (Lstream *encoding, CONST unsigned char *src, - unsigned_char_dynarr *dst, unsigned int n) -{ - unsigned char c; - struct encoding_stream *str = ENCODING_STREAM_DATA (encoding); - unsigned int flags, ch; - enum eol_type eol_type; - - CODING_STREAM_DECOMPOSE (str, flags, ch); - eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys); - - while (n--) - { - c = *src++; - if (c == '\n') - { - if (eol_type != EOL_LF && eol_type != EOL_AUTODETECT) - Dynarr_add (dst, '\r'); - if (eol_type != EOL_CR) - Dynarr_add (dst, '\n'); - ch = 0; - } - else if (BYTE_ASCII_P (c)) - { - assert (ch == 0); - Dynarr_add (dst, c); - } - else if (BUFBYTE_LEADING_BYTE_P (c)) - { - assert (ch == 0); - if (c == LEADING_BYTE_LATIN_ISO8859_1 || - c == LEADING_BYTE_CONTROL_1) - ch = c; - else - Dynarr_add (dst, '~'); /* untranslatable character */ - } - else - { - if (ch == LEADING_BYTE_LATIN_ISO8859_1) - Dynarr_add (dst, c); - else if (ch == LEADING_BYTE_CONTROL_1) - { - assert (c < 0xC0); - Dynarr_add (dst, c - 0x20); - } - /* else it should be the second or third byte of an - untranslatable character, so ignore it */ - ch = 0; - } - } - - CODING_STREAM_COMPOSE (str, flags, ch); -} - - -/************************************************************************/ -/* Simple internal/external functions */ -/************************************************************************/ - -static Extbyte_dynarr *conversion_out_dynarr; -static Bufbyte_dynarr *conversion_in_dynarr; - -/* Determine coding system from coding format */ - -/* #### not correct for all values of `fmt'! */ -static Lisp_Object -external_data_format_to_coding_system (enum external_data_format fmt) -{ - switch (fmt) - { - case FORMAT_FILENAME: - case FORMAT_TERMINAL: - if (EQ (Vfile_name_coding_system, Qnil) || - EQ (Vfile_name_coding_system, Qbinary)) - return Qnil; - else - return Fget_coding_system (Vfile_name_coding_system); - case FORMAT_CTEXT: - return Fget_coding_system (Qctext); - default: - return Qnil; - } -} - -CONST Extbyte * -convert_to_external_format (CONST Bufbyte *ptr, - Bytecount len, - Extcount *len_out, - enum external_data_format fmt) -{ - Lisp_Object coding_system = external_data_format_to_coding_system (fmt); - - if (!conversion_out_dynarr) - conversion_out_dynarr = Dynarr_new (Extbyte); - else - Dynarr_reset (conversion_out_dynarr); - - if (NILP (coding_system)) - { - CONST Bufbyte *end = ptr + len; - - for (; ptr < end;) - { - Bufbyte c = - (BYTE_ASCII_P (*ptr)) ? *ptr : - (*ptr == LEADING_BYTE_CONTROL_1) ? (*(ptr+1) - 0x20) : - (*ptr == LEADING_BYTE_LATIN_ISO8859_1) ? (*(ptr+1)) : - '~'; - - Dynarr_add (conversion_out_dynarr, (Extbyte) c); - INC_CHARPTR (ptr); - } - -#ifdef ERROR_CHECK_BUFPOS - assert (ptr == end); -#endif - } - else - { - Lisp_Object instream, outstream, da_outstream; - Lstream *istr, *ostr; - struct gcpro gcpro1, gcpro2, gcpro3; - char tempbuf[1024]; /* some random amount */ - - instream = make_fixed_buffer_input_stream ((unsigned char *) ptr, len); - da_outstream = make_dynarr_output_stream - ((unsigned_char_dynarr *) conversion_out_dynarr); - outstream = - make_encoding_output_stream (XLSTREAM (da_outstream), coding_system); - istr = XLSTREAM (instream); - ostr = XLSTREAM (outstream); - GCPRO3 (instream, outstream, da_outstream); - while (1) - { - int size_in_bytes = Lstream_read (istr, tempbuf, sizeof (tempbuf)); - if (!size_in_bytes) - break; - Lstream_write (ostr, tempbuf, size_in_bytes); - } - Lstream_close (istr); - Lstream_close (ostr); - UNGCPRO; - Lstream_delete (istr); - Lstream_delete (ostr); - Lstream_delete (XLSTREAM (da_outstream)); - } - - *len_out = Dynarr_length (conversion_out_dynarr); - Dynarr_add (conversion_out_dynarr, 0); /* remember to zero-terminate! */ - return Dynarr_atp (conversion_out_dynarr, 0); -} - -CONST Bufbyte * -convert_from_external_format (CONST Extbyte *ptr, - Extcount len, - Bytecount *len_out, - enum external_data_format fmt) -{ - Lisp_Object coding_system = external_data_format_to_coding_system (fmt); - - if (!conversion_in_dynarr) - conversion_in_dynarr = Dynarr_new (Bufbyte); - else - Dynarr_reset (conversion_in_dynarr); - - if (NILP (coding_system)) - { - CONST Extbyte *end = ptr + len; - for (; ptr < end; ptr++) - { - Extbyte c = *ptr; - DECODE_ADD_BINARY_CHAR (c, conversion_in_dynarr); - } - } - else - { - Lisp_Object instream, outstream, da_outstream; - Lstream *istr, *ostr; - struct gcpro gcpro1, gcpro2, gcpro3; - char tempbuf[1024]; /* some random amount */ - - instream = make_fixed_buffer_input_stream ((unsigned char *) ptr, len); - da_outstream = make_dynarr_output_stream - ((unsigned_char_dynarr *) conversion_in_dynarr); - outstream = - make_decoding_output_stream (XLSTREAM (da_outstream), coding_system); - istr = XLSTREAM (instream); - ostr = XLSTREAM (outstream); - GCPRO3 (instream, outstream, da_outstream); - while (1) - { - int size_in_bytes = Lstream_read (istr, tempbuf, sizeof (tempbuf)); - if (!size_in_bytes) - break; - Lstream_write (ostr, tempbuf, size_in_bytes); - } - Lstream_close (istr); - Lstream_close (ostr); - UNGCPRO; - Lstream_delete (istr); - Lstream_delete (ostr); - Lstream_delete (XLSTREAM (da_outstream)); - } - - *len_out = Dynarr_length (conversion_in_dynarr); - Dynarr_add (conversion_in_dynarr, 0); /* remember to zero-terminate! */ - return Dynarr_atp (conversion_in_dynarr, 0); -} - - -/************************************************************************/ -/* Initialization */ -/************************************************************************/ - -void -syms_of_mule_coding (void) -{ - defsymbol (&Qbuffer_file_coding_system, "buffer-file-coding-system"); - deferror (&Qcoding_system_error, "coding-system-error", - "Coding-system error", Qio_error); - - DEFSUBR (Fcoding_system_p); - DEFSUBR (Ffind_coding_system); - DEFSUBR (Fget_coding_system); - DEFSUBR (Fcoding_system_list); - DEFSUBR (Fcoding_system_name); - DEFSUBR (Fmake_coding_system); - DEFSUBR (Fcopy_coding_system); - DEFSUBR (Fsubsidiary_coding_system); - - DEFSUBR (Fcoding_system_type); - DEFSUBR (Fcoding_system_doc_string); - DEFSUBR (Fcoding_system_charset); - DEFSUBR (Fcoding_system_property); - - DEFSUBR (Fcoding_category_list); - DEFSUBR (Fset_coding_priority_list); - DEFSUBR (Fcoding_priority_list); - DEFSUBR (Fset_coding_category_system); - DEFSUBR (Fcoding_category_system); - - DEFSUBR (Fdetect_coding_region); - DEFSUBR (Fdecode_coding_region); - DEFSUBR (Fencode_coding_region); - DEFSUBR (Fdecode_shift_jis_char); - DEFSUBR (Fencode_shift_jis_char); - DEFSUBR (Fdecode_big5_char); - DEFSUBR (Fencode_big5_char); - - defsymbol (&Qcoding_system_p, "coding-system-p"); - - defsymbol (&Qbig5, "big5"); - defsymbol (&Qshift_jis, "shift-jis"); - defsymbol (&Qno_conversion, "no-conversion"); - defsymbol (&Qccl, "ccl"); - defsymbol (&Qiso2022, "iso2022"); - - defsymbol (&Qmnemonic, "mnemonic"); - defsymbol (&Qeol_type, "eol-type"); - defsymbol (&Qpost_read_conversion, "post-read-conversion"); - defsymbol (&Qpre_write_conversion, "pre-write-conversion"); - - defsymbol (&Qcr, "cr"); - defsymbol (&Qlf, "lf"); - defsymbol (&Qcrlf, "crlf"); - defsymbol (&Qeol_cr, "eol-cr"); - defsymbol (&Qeol_lf, "eol-lf"); - defsymbol (&Qeol_crlf, "eol-crlf"); - - defsymbol (&Qcharset_g0, "charset-g0"); - defsymbol (&Qcharset_g1, "charset-g1"); - defsymbol (&Qcharset_g2, "charset-g2"); - defsymbol (&Qcharset_g3, "charset-g3"); - defsymbol (&Qforce_g0_on_output, "force-g0-on-output"); - defsymbol (&Qforce_g1_on_output, "force-g1-on-output"); - defsymbol (&Qforce_g2_on_output, "force-g2-on-output"); - defsymbol (&Qforce_g3_on_output, "force-g3-on-output"); - defsymbol (&Qshort, "short"); - defsymbol (&Qno_ascii_eol, "no-ascii-eol"); - defsymbol (&Qno_ascii_cntl, "no-ascii-cntl"); - defsymbol (&Qseven, "seven"); - defsymbol (&Qlock_shift, "lock-shift"); - defsymbol (&Qno_iso6429, "no-iso6429"); - defsymbol (&Qescape_quoted, "escape-quoted"); - defsymbol (&Qinput_charset_conversion, "input-charset-conversion"); - defsymbol (&Qoutput_charset_conversion, "output-charset-conversion"); - - defsymbol (&Qencode, "encode"); - defsymbol (&Qdecode, "decode"); - - defsymbol (&Qctext, "ctext"); - - defsymbol (&coding_category_symbol[CODING_CATEGORY_SHIFT_JIS], - "shift-jis"); - defsymbol (&coding_category_symbol[CODING_CATEGORY_ISO_7], - "iso-7"); - defsymbol (&coding_category_symbol[CODING_CATEGORY_ISO_8_DESIGNATE], - "iso-8-designate"); - defsymbol (&coding_category_symbol[CODING_CATEGORY_ISO_8_1], - "iso-8-1"); - defsymbol (&coding_category_symbol[CODING_CATEGORY_ISO_8_2], - "iso-8-2"); - defsymbol (&coding_category_symbol[CODING_CATEGORY_ISO_LOCK_SHIFT], - "iso-lock-shift"); - defsymbol (&coding_category_symbol[CODING_CATEGORY_BIG5], - "big5"); - defsymbol (&coding_category_symbol[CODING_CATEGORY_NO_CONVERSION], - "no-conversion"); -} - -void -lstream_type_create_mule_coding (void) -{ - LSTREAM_HAS_METHOD (decoding, reader); - LSTREAM_HAS_METHOD (decoding, writer); - LSTREAM_HAS_METHOD (decoding, rewinder); - LSTREAM_HAS_METHOD (decoding, seekable_p); - LSTREAM_HAS_METHOD (decoding, flusher); - LSTREAM_HAS_METHOD (decoding, closer); - LSTREAM_HAS_METHOD (decoding, marker); - - LSTREAM_HAS_METHOD (encoding, reader); - LSTREAM_HAS_METHOD (encoding, writer); - LSTREAM_HAS_METHOD (encoding, rewinder); - LSTREAM_HAS_METHOD (encoding, seekable_p); - LSTREAM_HAS_METHOD (encoding, flusher); - LSTREAM_HAS_METHOD (encoding, closer); - LSTREAM_HAS_METHOD (encoding, marker); -} - -void -vars_of_mule_coding (void) -{ - int i; - - /* Initialize to something reasonable ... */ - for (i = 0; i <= CODING_CATEGORY_LAST; i++) - { - coding_category_system[i] = Qnil; - coding_category_by_priority[i] = i; - } - - DEFVAR_LISP ("keyboard-coding-system", &Vkeyboard_coding_system /* -Coding system used for TTY keyboard input. -Not used under a windowing system. -*/ ); - Vkeyboard_coding_system = Qnil; - - DEFVAR_LISP ("terminal-coding-system", &Vterminal_coding_system /* -Coding system used for TTY display output. -Not used under a windowing system. -*/ ); - Vterminal_coding_system = Qnil; - - DEFVAR_LISP ("coding-system-for-read", &Vcoding_system_for_read /* -Overriding coding system used when writing a file or process. -You should *bind* this, not set it. If this is non-nil, it specifies -the coding system that will be used when a file or process is read -in, and overrides `buffer-file-coding-system-for-read', -`insert-file-contents-pre-hook', etc. Use those variables instead of -this one for permanent changes to the environment. -*/ ); - Vcoding_system_for_read = Qnil; - - DEFVAR_LISP ("coding-system-for-write", - &Vcoding_system_for_write /* -Overriding coding system used when writing a file or process. -You should *bind* this, not set it. If this is non-nil, it specifies -the coding system that will be used when a file or process is wrote -in, and overrides `buffer-file-coding-system', -`write-region-pre-hook', etc. Use those variables instead of this one -for permanent changes to the environment. -*/ ); - Vcoding_system_for_write = Qnil; - - DEFVAR_LISP ("file-name-coding-system", &Vfile_name_coding_system /* -Coding system used to convert pathnames when accessing files. -*/ ); - Vfile_name_coding_system = Qnil; - - DEFVAR_BOOL ("enable-multibyte-characters", &enable_multibyte_characters /* -Non-nil means the buffer contents are regarded as multi-byte form -of characters, not a binary code. This affects the display, file I/O, -and behaviors of various editing commands. - -Setting this to nil does not do anything. -*/ ); - enable_multibyte_characters = 1; -} - -void -complex_vars_of_mule_coding (void) -{ - staticpro (&Vcoding_system_hash_table); - Vcoding_system_hash_table = - make_lisp_hash_table (50, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ); - - the_codesys_prop_dynarr = Dynarr_new (codesys_prop); - -#define DEFINE_CODESYS_PROP(Prop_Type, Sym) do \ -{ \ - struct codesys_prop csp; \ - csp.sym = (Sym); \ - csp.prop_type = (Prop_Type); \ - Dynarr_add (the_codesys_prop_dynarr, csp); \ -} while (0) - - DEFINE_CODESYS_PROP (CODESYS_PROP_ALL_OK, Qmnemonic); - DEFINE_CODESYS_PROP (CODESYS_PROP_ALL_OK, Qeol_type); - DEFINE_CODESYS_PROP (CODESYS_PROP_ALL_OK, Qeol_cr); - DEFINE_CODESYS_PROP (CODESYS_PROP_ALL_OK, Qeol_crlf); - DEFINE_CODESYS_PROP (CODESYS_PROP_ALL_OK, Qeol_lf); - DEFINE_CODESYS_PROP (CODESYS_PROP_ALL_OK, Qpost_read_conversion); - DEFINE_CODESYS_PROP (CODESYS_PROP_ALL_OK, Qpre_write_conversion); - - DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qcharset_g0); - DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qcharset_g1); - DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qcharset_g2); - DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qcharset_g3); - DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qforce_g0_on_output); - DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qforce_g1_on_output); - DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qforce_g2_on_output); - DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qforce_g3_on_output); - DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qshort); - DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qno_ascii_eol); - DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qno_ascii_cntl); - DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qseven); - DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qlock_shift); - DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qno_iso6429); - DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qescape_quoted); - DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qinput_charset_conversion); - DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qoutput_charset_conversion); - - DEFINE_CODESYS_PROP (CODESYS_PROP_CCL, Qencode); - DEFINE_CODESYS_PROP (CODESYS_PROP_CCL, Qdecode); - - /* Need to create this here or we're really screwed. */ - Fmake_coding_system (Qno_conversion, Qno_conversion, build_string ("No conversion"), - list2 (Qmnemonic, build_string ("Noconv"))); - - Fcopy_coding_system (Fcoding_system_property (Qno_conversion, Qeol_lf), - Qbinary); - - /* Need this for bootstrapping */ - coding_category_system[CODING_CATEGORY_NO_CONVERSION] = - Fget_coding_system (Qno_conversion); -} - -#endif diff --git a/src/mule-coding.h b/src/mule-coding.h deleted file mode 100644 index 7c631d9..0000000 --- a/src/mule-coding.h +++ /dev/null @@ -1,450 +0,0 @@ -/* Header for code conversion stuff - Copyright (C) 1991, 1995 Free Software Foundation, Inc. - Copyright (C) 1995 Sun Microsystems, Inc. - -This file is part of XEmacs. - -XEmacs is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -XEmacs is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with XEmacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* Synched up with: Mule 2.3. Not in FSF. */ - -/* 91.10.09 written by K.Handa */ -/* Rewritten by Ben Wing . */ - -#ifndef _XEMACS_MULE_CODING_H_ -#define _XEMACS_MULE_CODING_H_ - -struct decoding_stream; -struct encoding_stream; - -/* Coding system types. These go into the TYPE field of a - struct Lisp_Coding_System. */ - -enum coding_system_type -{ - CODESYS_AUTODETECT, /* Automatic conversion. */ - CODESYS_SHIFT_JIS, /* Shift-JIS; Hankaku (half-width) KANA - is also supported. */ - CODESYS_ISO2022, /* Any ISO2022-compliant coding system. - Includes JIS, EUC, CTEXT */ - CODESYS_BIG5, /* BIG5 (used for Taiwanese). */ - CODESYS_CCL, /* Converter written in CCL. */ - CODESYS_NO_CONVERSION /* "No conversion"; used for binary files. - We use quotes because there really - is some conversion being applied, - but it appears to the user as if - the text is read in without conversion. */ -#ifdef DEBUG_XEMACS - ,CODESYS_INTERNAL /* Raw (internally-formatted) data. */ -#endif -}; - -enum eol_type -{ - EOL_AUTODETECT, - EOL_LF, - EOL_CRLF, - EOL_CR -}; - -typedef struct charset_conversion_spec charset_conversion_spec; -struct charset_conversion_spec -{ - Lisp_Object from_charset; - Lisp_Object to_charset; -}; - -typedef struct -{ - Dynarr_declare (charset_conversion_spec); -} charset_conversion_spec_dynarr; - -struct Lisp_Coding_System -{ - struct lcrecord_header header; - - /* Name and doc string of this coding system. */ - Lisp_Object name, doc_string; - - /* This is the major type of the coding system -- one of Big5, ISO2022, - Shift-JIS, etc. See the constants above. */ - enum coding_system_type type; - - /* Mnemonic string displayed in the modeline when this coding - system is active for a particular buffer. */ - Lisp_Object mnemonic; - - Lisp_Object post_read_conversion, pre_write_conversion; - - enum eol_type eol_type; - - /* Subsidiary coding systems that specify a particular type of EOL - marking, rather than autodetecting it. These will only be non-nil - if (eol_type == EOL_AUTODETECT). */ - Lisp_Object eol_lf, eol_crlf, eol_cr; - - struct - { - /* What are the charsets to be initially designated to G0, G1, - G2, G3? If t, no charset is initially designated. If nil, - no charset is initially designated and no charset is allowed - to be designated. */ - Lisp_Object initial_charset[4]; - - /* If true, a designation escape sequence needs to be sent on output - for the charset in G[0-3] before that charset is used. */ - unsigned char force_charset_on_output[4]; - - charset_conversion_spec_dynarr *input_conv; - charset_conversion_spec_dynarr *output_conv; - - unsigned int shoort :1; /* C makes you speak Dutch */ - unsigned int no_ascii_eol :1; - unsigned int no_ascii_cntl :1; - unsigned int seven :1; - unsigned int lock_shift :1; - unsigned int no_iso6429 :1; - unsigned int escape_quoted :1; - } iso2022; - - struct - { - /* For a CCL coding system, these specify the CCL programs used for - decoding (input) and encoding (output). */ - Lisp_Object decode, encode; - } ccl; -}; - -DECLARE_LRECORD (coding_system, struct Lisp_Coding_System); -#define XCODING_SYSTEM(x) XRECORD (x, coding_system, struct Lisp_Coding_System) -#define XSETCODING_SYSTEM(x, p) XSETRECORD (x, p, coding_system) -#define CODING_SYSTEMP(x) RECORDP (x, coding_system) -#define GC_CODING_SYSTEMP(x) GC_RECORDP (x, coding_system) -#define CHECK_CODING_SYSTEM(x) CHECK_RECORD (x, coding_system) -#define CONCHECK_CODING_SYSTEM(x) CONCHECK_RECORD (x, coding_system) - -#define CODING_SYSTEM_NAME(codesys) ((codesys)->name) -#define CODING_SYSTEM_DOC_STRING(codesys) ((codesys)->doc_string) -#define CODING_SYSTEM_TYPE(codesys) ((codesys)->type) -#define CODING_SYSTEM_MNEMONIC(codesys) ((codesys)->mnemonic) -#define CODING_SYSTEM_POST_READ_CONVERSION(codesys) \ - ((codesys)->post_read_conversion) -#define CODING_SYSTEM_PRE_WRITE_CONVERSION(codesys) \ - ((codesys)->pre_write_conversion) -#define CODING_SYSTEM_EOL_TYPE(codesys) ((codesys)->eol_type) -#define CODING_SYSTEM_EOL_LF(codesys) ((codesys)->eol_lf) -#define CODING_SYSTEM_EOL_CRLF(codesys) ((codesys)->eol_crlf) -#define CODING_SYSTEM_EOL_CR(codesys) ((codesys)->eol_cr) -#define CODING_SYSTEM_ISO2022_INITIAL_CHARSET(codesys, g) \ - ((codesys)->iso2022.initial_charset[g]) -#define CODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT(codesys, g) \ - ((codesys)->iso2022.force_charset_on_output[g]) -#define CODING_SYSTEM_ISO2022_SHORT(codesys) ((codesys)->iso2022.shoort) -#define CODING_SYSTEM_ISO2022_NO_ASCII_EOL(codesys) \ - ((codesys)->iso2022.no_ascii_eol) -#define CODING_SYSTEM_ISO2022_NO_ASCII_CNTL(codesys) \ - ((codesys)->iso2022.no_ascii_cntl) -#define CODING_SYSTEM_ISO2022_SEVEN(codesys) ((codesys)->iso2022.seven) -#define CODING_SYSTEM_ISO2022_LOCK_SHIFT(codesys) \ - ((codesys)->iso2022.lock_shift) -#define CODING_SYSTEM_ISO2022_NO_ISO6429(codesys) \ - ((codesys)->iso2022.no_iso6429) -#define CODING_SYSTEM_ISO2022_ESCAPE_QUOTED(codesys) \ - ((codesys)->iso2022.escape_quoted) -#define CODING_SYSTEM_CCL_DECODE(codesys) ((codesys)->ccl.decode) -#define CODING_SYSTEM_CCL_ENCODE(codesys) ((codesys)->ccl.encode) - -#define XCODING_SYSTEM_NAME(codesys) \ - CODING_SYSTEM_NAME (XCODING_SYSTEM (codesys)) -#define XCODING_SYSTEM_DOC_STRING(codesys) \ - CODING_SYSTEM_DOC_STRING (XCODING_SYSTEM (codesys)) -#define XCODING_SYSTEM_TYPE(codesys) \ - CODING_SYSTEM_TYPE (XCODING_SYSTEM (codesys)) -#define XCODING_SYSTEM_MNEMONIC(codesys) \ - CODING_SYSTEM_MNEMONIC (XCODING_SYSTEM (codesys)) -#define XCODING_SYSTEM_POST_READ_CONVERSION(codesys) \ - CODING_SYSTEM_POST_READ_CONVERSION (XCODING_SYSTEM (codesys)) -#define XCODING_SYSTEM_PRE_WRITE_CONVERSION(codesys) \ - CODING_SYSTEM_PRE_WRITE_CONVERSION (XCODING_SYSTEM (codesys)) -#define XCODING_SYSTEM_EOL_TYPE(codesys) \ - CODING_SYSTEM_EOL_TYPE (XCODING_SYSTEM (codesys)) -#define XCODING_SYSTEM_EOL_LF(codesys) \ - CODING_SYSTEM_EOL_LF (XCODING_SYSTEM (codesys)) -#define XCODING_SYSTEM_EOL_CRLF(codesys) \ - CODING_SYSTEM_EOL_CRLF (XCODING_SYSTEM (codesys)) -#define XCODING_SYSTEM_EOL_CR(codesys) \ - CODING_SYSTEM_EOL_CR (XCODING_SYSTEM (codesys)) -#define XCODING_SYSTEM_ISO2022_INITIAL_CHARSET(codesys, g) \ - CODING_SYSTEM_ISO2022_INITIAL_CHARSET (XCODING_SYSTEM (codesys), g) -#define XCODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT(codesys, g) \ - CODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT (XCODING_SYSTEM (codesys), g) -#define XCODING_SYSTEM_ISO2022_SHORT(codesys) \ - CODING_SYSTEM_ISO2022_SHORT (XCODING_SYSTEM (codesys)) -#define XCODING_SYSTEM_ISO2022_NO_ASCII_EOL(codesys) \ - CODING_SYSTEM_ISO2022_NO_ASCII_EOL (XCODING_SYSTEM (codesys)) -#define XCODING_SYSTEM_ISO2022_NO_ASCII_CNTL(codesys) \ - CODING_SYSTEM_ISO2022_NO_ASCII_CNTL (XCODING_SYSTEM (codesys)) -#define XCODING_SYSTEM_ISO2022_SEVEN(codesys) \ - CODING_SYSTEM_ISO2022_SEVEN (XCODING_SYSTEM (codesys)) -#define XCODING_SYSTEM_ISO2022_LOCK_SHIFT(codesys) \ - CODING_SYSTEM_ISO2022_LOCK_SHIFT (XCODING_SYSTEM (codesys)) -#define XCODING_SYSTEM_ISO2022_NO_ISO6429(codesys) \ - CODING_SYSTEM_ISO2022_NO_ISO6429 (XCODING_SYSTEM (codesys)) -#define XCODING_SYSTEM_ISO2022_ESCAPE_QUOTED(codesys) \ - CODING_SYSTEM_ISO2022_ESCAPE_QUOTED (XCODING_SYSTEM (codesys)) -#define XCODING_SYSTEM_CCL_DECODE(codesys) \ - CODING_SYSTEM_CCL_DECODE (XCODING_SYSTEM (codesys)) -#define XCODING_SYSTEM_CCL_ENCODE(codesys) \ - CODING_SYSTEM_CCL_ENCODE (XCODING_SYSTEM (codesys)) - -extern Lisp_Object Qbuffer_file_coding_system, Qcoding_system_error; - -extern Lisp_Object Vkeyboard_coding_system; -extern Lisp_Object Vterminal_coding_system; -extern Lisp_Object Vcoding_system_for_read; -extern Lisp_Object Vcoding_system_for_write; -extern Lisp_Object Vpathname_coding_system; - -extern Lisp_Object Qescape_quoted; - -/* Flags indicating current state while converting code. */ - -/* Used by everyone. */ - -#define CODING_STATE_END (1 << 0) /* If set, this is the last chunk of - data being processed. When this - is finished, output any necessary - terminating control characters, - escape sequences, etc. */ -#define CODING_STATE_CR (1 << 1) /* If set, we just saw a CR. */ - - -/* Used by Big 5 on output. */ - -#define CODING_STATE_BIG5_1 (1 << 2) /* If set, we just encountered - LEADING_BYTE_BIG5_1. */ -#define CODING_STATE_BIG5_2 (1 << 3) /* If set, we just encountered - LEADING_BYTE_BIG5_2. */ - - -/* Used by ISO2022 on input and output. */ - -#define CODING_STATE_R2L (1 << 4) /* If set, the current - directionality is right-to-left. - Otherwise, it's left-to-right. */ - - -/* Used by ISO2022 on input. */ - -#define CODING_STATE_ESCAPE (1 << 5) /* If set, we're currently parsing - an escape sequence and the upper - 16 bits should be looked at to - indicate what partial escape - sequence we've seen so far. - Otherwise, we're running - through actual text. */ -#define CODING_STATE_SS2 (1 << 6) /* If set, G2 is invoked into GL, but - only for the next character. */ -#define CODING_STATE_SS3 (1 << 7) /* If set, G3 is invoked into GL, - but only for the next character. - If both CODING_STATE_SS2 and - CODING_STATE_SS3 are set, - CODING_STATE_SS2 overrides; but - this probably indicates an error - in the text encoding. */ -#define CODING_STATE_COMPOSITE (1 << 8) /* If set, we're currently processing - a composite character (i.e. a - character constructed by - overstriking two or more - characters). */ - - -/* CODING_STATE_ISO2022_LOCK is the mask of flags that remain on until - explicitly turned off when in the ISO2022 encoder/decoder. Other flags are - turned off at the end of processing each character or escape sequence. */ -# define CODING_STATE_ISO2022_LOCK \ - (CODING_STATE_END | CODING_STATE_COMPOSITE | CODING_STATE_R2L) -#define CODING_STATE_BIG5_LOCK \ - CODING_STATE_END - -/* Flags indicating what we've seen so far when parsing an - ISO2022 escape sequence. */ -enum iso_esc_flag -{ - /* Partial sequences */ - ISO_ESC_NOTHING, /* Nothing has been seen. */ - ISO_ESC, /* We've seen ESC. */ - ISO_ESC_2_4, /* We've seen ESC $. This indicates - that we're designating a multi-byte, rather - than a single-byte, character set. */ - ISO_ESC_2_8, /* We've seen ESC 0x28, i.e. ESC (. - This means designate a 94-character - character set into G0. */ - ISO_ESC_2_9, /* We've seen ESC 0x29 -- designate a - 94-character character set into G1. */ - ISO_ESC_2_10, /* We've seen ESC 0x2A. */ - ISO_ESC_2_11, /* We've seen ESC 0x2B. */ - ISO_ESC_2_12, /* We've seen ESC 0x2C -- designate a - 96-character character set into G0. - (This is not ISO2022-standard. - The following 96-character - control sequences are standard, - though.) */ - ISO_ESC_2_13, /* We've seen ESC 0x2D -- designate a - 96-character character set into G1. - */ - ISO_ESC_2_14, /* We've seen ESC 0x2E. */ - ISO_ESC_2_15, /* We've seen ESC 0x2F. */ - ISO_ESC_2_4_8, /* We've seen ESC $ 0x28 -- designate - a 94^N character set into G0. */ - ISO_ESC_2_4_9, /* We've seen ESC $ 0x29. */ - ISO_ESC_2_4_10, /* We've seen ESC $ 0x2A. */ - ISO_ESC_2_4_11, /* We've seen ESC $ 0x2B. */ - ISO_ESC_2_4_12, /* We've seen ESC $ 0x2C. */ - ISO_ESC_2_4_13, /* We've seen ESC $ 0x2D. */ - ISO_ESC_2_4_14, /* We've seen ESC $ 0x2E. */ - ISO_ESC_2_4_15, /* We've seen ESC $ 0x2F. */ - ISO_ESC_5_11, /* We've seen ESC [ or 0x9B. This - starts a directionality-control - sequence. The next character - must be 0, 1, 2, or ]. */ - ISO_ESC_5_11_0, /* We've seen 0x9B 0. The next - character must be ]. */ - ISO_ESC_5_11_1, /* We've seen 0x9B 1. The next - character must be ]. */ - ISO_ESC_5_11_2, /* We've seen 0x9B 2. The next - character must be ]. */ - - /* Full sequences. */ - ISO_ESC_START_COMPOSITE, /* Private usage for START COMPOSING */ - ISO_ESC_END_COMPOSITE, /* Private usage for END COMPOSING */ - ISO_ESC_SINGLE_SHIFT, /* We've seen a complete single-shift sequence. */ - ISO_ESC_LOCKING_SHIFT,/* We've seen a complete locking-shift sequence. */ - ISO_ESC_DESIGNATE, /* We've seen a complete designation sequence. */ - ISO_ESC_DIRECTIONALITY,/* We've seen a complete ISO6429 directionality - sequence. */ - ISO_ESC_LITERAL /* We've seen a literal character ala - escape-quoting. */ -}; - -/* Macros to define code of control characters for ISO2022's functions. */ - /* code */ /* function */ -#define ISO_CODE_LF 0x0A /* line-feed */ -#define ISO_CODE_CR 0x0D /* carriage-return */ -#define ISO_CODE_SO 0x0E /* shift-out */ -#define ISO_CODE_SI 0x0F /* shift-in */ -#define ISO_CODE_ESC 0x1B /* escape */ -#define ISO_CODE_DEL 0x7F /* delete */ -#define ISO_CODE_SS2 0x8E /* single-shift-2 */ -#define ISO_CODE_SS3 0x8F /* single-shift-3 */ -#define ISO_CODE_CSI 0x9B /* control-sequence-introduce */ - -/* Macros to access an encoding stream or decoding stream */ - -#define CODING_STREAM_DECOMPOSE(str, flags, ch) \ -do { \ - flags = (str)->flags; \ - ch = (str)->ch; \ -} while (0) - -#define CODING_STREAM_COMPOSE(str, flags, ch) \ -do { \ - (str)->flags = flags; \ - (str)->ch = ch; \ -} while (0) - - -/* For detecting the encoding of text */ -enum coding_category_type -{ - CODING_CATEGORY_SHIFT_JIS, - CODING_CATEGORY_ISO_7, /* ISO2022 system using only seven-bit bytes, - no locking shift */ - CODING_CATEGORY_ISO_8_DESIGNATE, /* ISO2022 system using eight-bit bytes, - no locking shift, no single shift, - using designation to switch charsets */ - CODING_CATEGORY_ISO_8_1, /* ISO2022 system using eight-bit bytes, - no locking shift, no designation sequences, - one-dimension characters in the upper half. */ - CODING_CATEGORY_ISO_8_2, /* ISO2022 system using eight-bit bytes, - no locking shift, no designation sequences, - two-dimension characters in the upper half. */ - CODING_CATEGORY_ISO_LOCK_SHIFT, /* ISO2022 system using locking shift */ - CODING_CATEGORY_BIG5, - CODING_CATEGORY_NO_CONVERSION -}; - -#define CODING_CATEGORY_LAST CODING_CATEGORY_NO_CONVERSION - -#define CODING_CATEGORY_SHIFT_JIS_MASK \ - (1 << CODING_CATEGORY_SHIFT_JIS) -#define CODING_CATEGORY_ISO_7_MASK \ - (1 << CODING_CATEGORY_ISO_7) -#define CODING_CATEGORY_ISO_8_DESIGNATE_MASK \ - (1 << CODING_CATEGORY_ISO_8_DESIGNATE) -#define CODING_CATEGORY_ISO_8_1_MASK \ - (1 << CODING_CATEGORY_ISO_8_1) -#define CODING_CATEGORY_ISO_8_2_MASK \ - (1 << CODING_CATEGORY_ISO_8_2) -#define CODING_CATEGORY_ISO_LOCK_SHIFT_MASK \ - (1 << CODING_CATEGORY_ISO_LOCK_SHIFT) -#define CODING_CATEGORY_BIG5_MASK \ - (1 << CODING_CATEGORY_BIG5) -#define CODING_CATEGORY_NO_CONVERSION_MASK \ - (1 << CODING_CATEGORY_NO_CONVERSION) -#define CODING_CATEGORY_NOT_FINISHED_MASK \ - (1 << 30) - -/* Convert shift-JIS code (sj1, sj2) into internal string - representation (c1, c2). (The leading byte is assumed.) */ - -#define DECODE_SJIS(sj1, sj2, c1, c2) \ -do { \ - int I1 = sj1, I2 = sj2; \ - if (I2 >= 0x9f) \ - c1 = (I1 << 1) - ((I1 >= 0xe0) ? 0xe0 : 0x60), \ - c2 = I2 + 2; \ - else \ - c1 = (I1 << 1) - ((I1 >= 0xe0) ? 0xe1 : 0x61), \ - c2 = I2 + ((I2 >= 0x7f) ? 0x60 : 0x61); \ -} while (0) - -/* Convert the internal string representation of a Shift-JIS character - (c1, c2) into Shift-JIS code (sj1, sj2). The leading byte is - assumed. */ - -#define ENCODE_SJIS(c1, c2, sj1, sj2) \ -do { \ - int I1 = c1, I2 = c2; \ - if (I1 & 1) \ - sj1 = (I1 >> 1) + ((I1 < 0xdf) ? 0x31 : 0x71), \ - sj2 = I2 - ((I2 >= 0xe0) ? 0x60 : 0x61); \ - else \ - sj1 = (I1 >> 1) + ((I1 < 0xdf) ? 0x30 : 0x70), \ - sj2 = I2 - 2; \ -} while (0) - -Lisp_Object make_decoding_input_stream (Lstream *stream, Lisp_Object codesys); -Lisp_Object make_encoding_input_stream (Lstream *stream, Lisp_Object codesys); -Lisp_Object make_decoding_output_stream (Lstream *stream, Lisp_Object codesys); -Lisp_Object make_encoding_output_stream (Lstream *stream, Lisp_Object codesys); -Lisp_Object decoding_stream_coding_system (Lstream *stream); -Lisp_Object encoding_stream_coding_system (Lstream *stream); -void set_decoding_stream_coding_system (Lstream *stream, Lisp_Object codesys); -void set_encoding_stream_coding_system (Lstream *stream, Lisp_Object codesys); -void determine_real_coding_system (Lstream *stream, Lisp_Object *codesys_in_out, - enum eol_type *eol_type_in_out); -#endif /* _XEMACS_MULE_CODING_H_ */ diff --git a/src/pure.c b/src/pure.c deleted file mode 100644 index 0d15775..0000000 --- a/src/pure.c +++ /dev/null @@ -1,36 +0,0 @@ -/* This file is part of XEmacs. - -XEmacs is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -XEmacs is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with XEmacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* Synched up with: FSF 19.30. Split out of alloc.c. */ - -#include -#include "lisp.h" -#include "puresize.h" - -/* Moved from puresize.h to here so alloc.c does not get recompiled */ - -# include -#define PURESIZE ((RAW_PURESIZE) + (PURESIZE_ADJUSTMENT)) - -size_t -get_PURESIZE (void) -{ - return PURESIZE; -} - -/* Force linker to put it into data space! */ -EMACS_INT pure[PURESIZE / sizeof (EMACS_INT)] = { (EMACS_INT) 0}; diff --git a/src/puresize.h b/src/puresize.h deleted file mode 100644 index b9cd89e..0000000 --- a/src/puresize.h +++ /dev/null @@ -1,172 +0,0 @@ -/* Definition of PURESIZE. - Copyright (C) 1986, 1988, 1992, 1993, 1994 Free Software Foundation, Inc. - Copyright (C) 1995, 1996 Ben Wing. - -This file is part of XEmacs. - -XEmacs is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -XEmacs is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with XEmacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* Synched up with: Not in FSF. */ - -#ifndef PURESIZE_H -#define PURESIZE_H - -/* If RAW_PURESIZE is already defined then the user overrode it at - configure time. */ -#ifndef RAW_PURESIZE - -/* Basic amount of purespace to use, in the absence of extra - things configured in. */ - - -/* This computation is Barbra Streisand, BS -#if (LONGBITS == 64) -# define BASE_PURESIZE 938000 -#else -# define BASE_PURESIZE 563000 -#endif -*/ - -#define BASE_PURESIZE 1400000 - -/* If any particular systems need to change the base puresize, they - should define SYSTEM_PURESIZE_EXTRA. Note that this can be - negative as well as positive. - - Do NOT define PURESIZE or any other values. This allows the - other values to shift while still keeping things in sync. */ - -#ifndef SYSTEM_PURESIZE_EXTRA -# define SYSTEM_PURESIZE_EXTRA 0 -#endif - -/* Extra amount of purespace needed for menubars. */ - -#ifdef HAVE_DIALOGS -# if (LONGBITS == 64) -# define DIALOG_PURESIZE_EXTRA 43000 -# else -# define DIALOG_PURESIZE_EXTRA 1800 -# endif -#else -# define DIALOG_PURESIZE_EXTRA 0 -#endif - -#ifdef HAVE_MENUBARS -# if (LONGBITS == 64) -# define MENUBAR_PURESIZE_EXTRA 43000 -# else -# define MENUBAR_PURESIZE_EXTRA 36000 -# endif -#else -# define MENUBAR_PURESIZE_EXTRA 0 -#endif - -#ifdef HAVE_SCROLLBARS -# if (LONGBITS == 64) -# define SCROLLBAR_PURESIZE_EXTRA 4000 -# else -# define SCROLLBAR_PURESIZE_EXTRA 1800 -# endif -#else -# define SCROLLBAR_PURESIZE_EXTRA 0 -#endif - -#ifdef HAVE_TOOLBARS -# if (LONGBITS == 64) -# define TOOLBAR_PURESIZE_EXTRA 4000 -# else -# define TOOLBAR_PURESIZE_EXTRA 8400 -# endif -#else -# define TOOLBAR_PURESIZE_EXTRA 0 -#endif - -/* Extra amount of purespace needed for X11, separate from menubars - and scrollbars. */ - -#ifdef HAVE_X_WINDOWS -# if (LONGBITS == 64) -# define X11_PURESIZE_EXTRA 95000 -# else -# define X11_PURESIZE_EXTRA 68000 -# endif -#else -# define X11_PURESIZE_EXTRA 0 -#endif - -/* Extra amount of purespace needed for Mule. */ - -#ifdef MULE -#ifdef HAVE_CANNA -# define MULE_PURESIZE_CANNA 5000 -#else -# define MULE_PURESIZE_CANNA 0 -#endif -#ifdef HAVE_WNN -# define MULE_PURESIZE_WNN 5000 -#else -# define MULE_PURESIZE_WNN 0 -#endif -# if (LONGBITS == 64) -# define MULE_PURESIZE_EXTRA 99000+MULE_PURESIZE_CANNA+MULE_PURESIZE_WNN -# else -# define MULE_PURESIZE_EXTRA 78000+MULE_PURESIZE_CANNA+MULE_PURESIZE_WNN -# endif -#else -# define MULE_PURESIZE_EXTRA 0 -#endif - -/* Extra amount of purespace needed for Tooltalk. */ - -#ifdef TOOLTALK -# if (LONGBITS == 64) -# define TOOLTALK_PURESIZE_EXTRA 100000 -# else -# define TOOLTALK_PURESIZE_EXTRA 8300 -# endif -#else -# define TOOLTALK_PURESIZE_EXTRA 0 -#endif - -/* Extra amount of purespace needed for Sunpro builds. */ - -#ifdef SUNPRO -#define SUNPRO_PURESIZE_EXTRA 95000 -#else -# define SUNPRO_PURESIZE_EXTRA 0 -#endif - -#define RAW_PURESIZE ((BASE_PURESIZE) + \ - (DIALOG_PURESIZE_EXTRA) + \ - (MENUBAR_PURESIZE_EXTRA) + \ - (SCROLLBAR_PURESIZE_EXTRA) + \ - (TOOLBAR_PURESIZE_EXTRA) + \ - (X11_PURESIZE_EXTRA) + \ - (SYSTEM_PURESIZE_EXTRA) + \ - (MULE_PURESIZE_EXTRA) + \ - (TOOLTALK_PURESIZE_EXTRA) + \ - (SUNPRO_PURESIZE_EXTRA)) - -#endif /* !RAW_PURESIZE */ - -# include -#define PURESIZE ((RAW_PURESIZE) + (PURESIZE_ADJUSTMENT)) -#define get_PURESIZE() PURESIZE - -extern EMACS_INT pure[]; - -#endif /* PURESIZE_H */ diff --git a/src/xselect.c b/src/xselect.c deleted file mode 100644 index 8dada0a..0000000 --- a/src/xselect.c +++ /dev/null @@ -1,2144 +0,0 @@ -/* X Selection processing for XEmacs - Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. - -This file is part of XEmacs. - -XEmacs is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -XEmacs is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with XEmacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* Synched up with: Not synched with FSF. */ - -/* Rewritten by jwz */ - -#include -#include "lisp.h" - -#include "buffer.h" -#include "console-x.h" -#include "objects-x.h" - -#include "frame.h" -#include "opaque.h" -#include "systime.h" - -int lisp_to_time (Lisp_Object, time_t *); -Lisp_Object time_to_lisp (time_t); - -#ifdef LWLIB_USES_MOTIF -# define MOTIF_CLIPBOARDS -#endif - -#ifdef MOTIF_CLIPBOARDS -# include -static void hack_motif_clipboard_selection (Atom selection_atom, - Lisp_Object selection_value, - Time thyme, Display *display, - Window selecting_window, - Bool owned_p); -#endif - -#define CUT_BUFFER_SUPPORT - -Lisp_Object QPRIMARY, QSECONDARY, QSTRING, QINTEGER, QCLIPBOARD, QTIMESTAMP, - QTEXT, QDELETE, QMULTIPLE, QINCR, QEMACS_TMP, QTARGETS, QATOM, QNULL, - QATOM_PAIR, QCOMPOUND_TEXT; - -#ifdef CUT_BUFFER_SUPPORT -Lisp_Object QCUT_BUFFER0, QCUT_BUFFER1, QCUT_BUFFER2, QCUT_BUFFER3, - QCUT_BUFFER4, QCUT_BUFFER5, QCUT_BUFFER6, QCUT_BUFFER7; -#endif - -Lisp_Object Vx_lost_selection_hooks; -Lisp_Object Vx_sent_selection_hooks; - -/* If this is a smaller number than the max-request-size of the display, - emacs will use INCR selection transfer when the selection is larger - than this. The max-request-size is usually around 64k, so if you want - emacs to use incremental selection transfers when the selection is - smaller than that, set this. I added this mostly for debugging the - incremental transfer stuff, but it might improve server performance. - */ -#define MAX_SELECTION_QUANTUM 0xFFFFFF - -#define SELECTION_QUANTUM(dpy) ((XMaxRequestSize (dpy) << 2) - 100) - -/* This is an association list whose elements are of the form - ( selection-name selection-value selection-timestamp ) - selection-name is a lisp symbol, whose name is the name of an X Atom. - selection-value is the value that emacs owns for that selection. - It may be any kind of Lisp object. - selection-timestamp is the time at which emacs began owning this selection, - as a cons of two 16-bit numbers (making a 32 bit time). - If there is an entry in this alist, then it can be assumed that emacs owns - that selection. - The only (eq) parts of this list that are visible from elisp are the - selection-values. - */ -Lisp_Object Vselection_alist; - -/* This is an alist whose CARs are selection-types (whose names are the same - as the names of X Atoms) and whose CDRs are the names of Lisp functions to - call to convert the given Emacs selection value to a string representing - the given selection type. This is for elisp-level extension of the emacs - selection handling. - */ -Lisp_Object Vselection_converter_alist; - -/* "Selection owner couldn't convert selection" */ -Lisp_Object Qselection_conversion_error; - -/* If the selection owner takes too long to reply to a selection request, - we give up on it. This is in seconds (0 = no timeout). - */ -int x_selection_timeout; - - -/* Utility functions */ - -static void lisp_data_to_selection_data (struct device *, - Lisp_Object obj, - unsigned char **data_ret, - Atom *type_ret, - unsigned int *size_ret, - int *format_ret); -static Lisp_Object selection_data_to_lisp_data (struct device *, - unsigned char *data, - size_t size, - Atom type, - int format); -static Lisp_Object x_get_window_property_as_lisp_data (Display *, - Window, - Atom property, - Lisp_Object target_type, - Atom selection_atom); - -static int expect_property_change (Display *, Window, Atom prop, int state); -static void wait_for_property_change (long); -static void unexpect_property_change (int); -static int waiting_for_other_props_on_window (Display *, Window); - -/* This converts a Lisp symbol to a server Atom, avoiding a server - roundtrip whenever possible. - */ -static Atom -symbol_to_x_atom (struct device *d, Lisp_Object sym, int only_if_exists) -{ - Display *display = DEVICE_X_DISPLAY (d); - - if (NILP (sym)) return XA_PRIMARY; - if (EQ (sym, Qt)) return XA_SECONDARY; - if (EQ (sym, QPRIMARY)) return XA_PRIMARY; - if (EQ (sym, QSECONDARY)) return XA_SECONDARY; - if (EQ (sym, QSTRING)) return XA_STRING; - if (EQ (sym, QINTEGER)) return XA_INTEGER; - if (EQ (sym, QATOM)) return XA_ATOM; - if (EQ (sym, QCLIPBOARD)) return DEVICE_XATOM_CLIPBOARD (d); - if (EQ (sym, QTIMESTAMP)) return DEVICE_XATOM_TIMESTAMP (d); - if (EQ (sym, QTEXT)) return DEVICE_XATOM_TEXT (d); - if (EQ (sym, QDELETE)) return DEVICE_XATOM_DELETE (d); - if (EQ (sym, QMULTIPLE)) return DEVICE_XATOM_MULTIPLE (d); - if (EQ (sym, QINCR)) return DEVICE_XATOM_INCR (d); - if (EQ (sym, QEMACS_TMP)) return DEVICE_XATOM_EMACS_TMP (d); - if (EQ (sym, QTARGETS)) return DEVICE_XATOM_TARGETS (d); - if (EQ (sym, QNULL)) return DEVICE_XATOM_NULL (d); - if (EQ (sym, QATOM_PAIR)) return DEVICE_XATOM_ATOM_PAIR (d); - if (EQ (sym, QCOMPOUND_TEXT)) return DEVICE_XATOM_COMPOUND_TEXT (d); - -#ifdef CUT_BUFFER_SUPPORT - if (EQ (sym, QCUT_BUFFER0)) return XA_CUT_BUFFER0; - if (EQ (sym, QCUT_BUFFER1)) return XA_CUT_BUFFER1; - if (EQ (sym, QCUT_BUFFER2)) return XA_CUT_BUFFER2; - if (EQ (sym, QCUT_BUFFER3)) return XA_CUT_BUFFER3; - if (EQ (sym, QCUT_BUFFER4)) return XA_CUT_BUFFER4; - if (EQ (sym, QCUT_BUFFER5)) return XA_CUT_BUFFER5; - if (EQ (sym, QCUT_BUFFER6)) return XA_CUT_BUFFER6; - if (EQ (sym, QCUT_BUFFER7)) return XA_CUT_BUFFER7; -#endif /* CUT_BUFFER_SUPPORT */ - - { - CONST char *nameext; - GET_C_STRING_CTEXT_DATA_ALLOCA (Fsymbol_name (sym), nameext); - return XInternAtom (display, nameext, only_if_exists ? True : False); - } -} - - -/* This converts a server Atom to a Lisp symbol, avoiding server roundtrips - and calls to intern whenever possible. - */ -static Lisp_Object -x_atom_to_symbol (struct device *d, Atom atom) -{ - Display *display = DEVICE_X_DISPLAY (d); - - if (! atom) return Qnil; - if (atom == XA_PRIMARY) return QPRIMARY; - if (atom == XA_SECONDARY) return QSECONDARY; - if (atom == XA_STRING) return QSTRING; - if (atom == XA_INTEGER) return QINTEGER; - if (atom == XA_ATOM) return QATOM; - if (atom == DEVICE_XATOM_CLIPBOARD (d)) return QCLIPBOARD; - if (atom == DEVICE_XATOM_TIMESTAMP (d)) return QTIMESTAMP; - if (atom == DEVICE_XATOM_TEXT (d)) return QTEXT; - if (atom == DEVICE_XATOM_DELETE (d)) return QDELETE; - if (atom == DEVICE_XATOM_MULTIPLE (d)) return QMULTIPLE; - if (atom == DEVICE_XATOM_INCR (d)) return QINCR; - if (atom == DEVICE_XATOM_EMACS_TMP (d)) return QEMACS_TMP; - if (atom == DEVICE_XATOM_TARGETS (d)) return QTARGETS; - if (atom == DEVICE_XATOM_NULL (d)) return QNULL; - if (atom == DEVICE_XATOM_ATOM_PAIR (d)) return QATOM_PAIR; - if (atom == DEVICE_XATOM_COMPOUND_TEXT (d)) return QCOMPOUND_TEXT; - -#ifdef CUT_BUFFER_SUPPORT - if (atom == XA_CUT_BUFFER0) return QCUT_BUFFER0; - if (atom == XA_CUT_BUFFER1) return QCUT_BUFFER1; - if (atom == XA_CUT_BUFFER2) return QCUT_BUFFER2; - if (atom == XA_CUT_BUFFER3) return QCUT_BUFFER3; - if (atom == XA_CUT_BUFFER4) return QCUT_BUFFER4; - if (atom == XA_CUT_BUFFER5) return QCUT_BUFFER5; - if (atom == XA_CUT_BUFFER6) return QCUT_BUFFER6; - if (atom == XA_CUT_BUFFER7) return QCUT_BUFFER7; -#endif - - { - Lisp_Object newsym; - CONST Bufbyte *intstr; - char *str = XGetAtomName (display, atom); - - if (! str) return Qnil; - - GET_C_CHARPTR_INT_CTEXT_DATA_ALLOCA (str, intstr); - newsym = intern ((char *) intstr); - XFree (str); - return newsym; - } -} - - -/* Do protocol to assert ourself as a selection owner. - Update the Vselection_alist so that we can reply to later requests for - our selection. - */ -static void -x_own_selection (Lisp_Object selection_name, Lisp_Object selection_value) -{ - struct device *d = decode_x_device (Qnil); - Display *display = DEVICE_X_DISPLAY (d); - struct frame *sel_frame = selected_frame (); - Window selecting_window = XtWindow (FRAME_X_TEXT_WIDGET (sel_frame)); - /* Use the time of the last-read mouse or keyboard event. - For selection purposes, we use this as a sleazy way of knowing what the - current time is in server-time. This assumes that the most recently read - mouse or keyboard event has something to do with the assertion of the - selection, which is probably true. - */ - Time thyme = DEVICE_X_MOUSE_TIMESTAMP (d); - Atom selection_atom; - - CHECK_SYMBOL (selection_name); - selection_atom = symbol_to_x_atom (d, selection_name, 0); - - XSetSelectionOwner (display, selection_atom, selecting_window, thyme); - - /* Now update the local cache */ - { - /* We do NOT use time_to_lisp() here any more, like we used to. - That assumed equivalence of time_t and Time, which is not - necessarily the case (e.g. under OSF on the Alphas, where - Time is a 64-bit quantity and time_t is a 32-bit quantity). - - Opaque pointers are the clean way to go here. - */ - Lisp_Object selection_time = make_opaque (sizeof (thyme), (void *) &thyme); - Lisp_Object selection_data = list3 (selection_name, - selection_value, - selection_time); - Lisp_Object prev_value = assq_no_quit (selection_name, Vselection_alist); - Vselection_alist = Fcons (selection_data, Vselection_alist); - - /* If we already owned the selection, remove the old selection data. - Perhaps we should destructively modify it instead. - Don't use Fdelq() as that may QUIT;. - */ - if (!NILP (prev_value)) - { - Lisp_Object rest; /* we know it's not the CAR, so it's easy. */ - for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest)) - if (EQ (prev_value, Fcar (XCDR (rest)))) - { - XCDR (rest) = Fcdr (XCDR (rest)); - break; - } - } -#ifdef MOTIF_CLIPBOARDS - hack_motif_clipboard_selection (selection_atom, selection_value, - thyme, display, selecting_window, - !NILP (prev_value)); -#endif - } -} - - -#ifdef MOTIF_CLIPBOARDS /* Bend over baby. Take it and like it. */ - -# ifdef MOTIF_INCREMENTAL_CLIPBOARDS_WORK -static void motif_clipboard_cb (); -# endif - -static void -hack_motif_clipboard_selection (Atom selection_atom, - Lisp_Object selection_value, - Time thyme, - Display *display, - Window selecting_window, - Bool owned_p) -{ - struct device *d = get_device_from_display (display); - /* Those Motif wankers can't be bothered to follow the ICCCM, and do - their own non-Xlib non-Xt clipboard processing. So we have to do - this so that linked-in Motif widgets don't get themselves wedged. - */ - if (selection_atom == DEVICE_XATOM_CLIPBOARD (d) - && STRINGP (selection_value) - - /* If we already own the clipboard, don't own it again in the Motif - way. This might lose in some subtle way, since the timestamp won't - be current, but owning the selection on the Motif way does a - SHITLOAD of X protocol, and it makes killing text be incredibly - slow when using an X terminal. ARRRRGGGHHH!!!! - */ - /* No, this is no good, because then Motif text fields don't bother - to look up the new value, and you can't Copy from a buffer, Paste - into a text field, then Copy something else from the buffer and - paste it into the text field -- it pastes the first thing again. */ -/* && !owned_p */ - ) - { -#ifdef MOTIF_INCREMENTAL_CLIPBOARDS_WORK - Widget widget = FRAME_X_TEXT_WIDGET (selected_frame()); -#endif - long itemid; -#if XmVersion >= 1002 - long dataid; -#else - int dataid; /* 1.2 wants long, but 1.1.5 wants int... */ -#endif - XmString fmh; - String encoding = "STRING"; - CONST Extbyte *data = XSTRING_DATA (selection_value); - Extcount bytes = XSTRING_LENGTH (selection_value); - -#ifdef MULE - { - enum { ASCII, LATIN_1, WORLD } chartypes = ASCII; - CONST Bufbyte *ptr = data, *end = ptr + bytes; - /* Optimize for the common ASCII case */ - while (ptr <= end) - { - if (BYTE_ASCII_P (*ptr)) - { - ptr++; - continue; - } - - if ((*ptr) == LEADING_BYTE_LATIN_ISO8859_1 || - (*ptr) == LEADING_BYTE_CONTROL_1) - { - chartypes = LATIN_1; - ptr += 2; - continue; - } - - chartypes = WORLD; - break; - } - - if (chartypes == LATIN_1) - GET_STRING_BINARY_DATA_ALLOCA (selection_value, data, bytes); - else if (chartypes == WORLD) - { - GET_STRING_CTEXT_DATA_ALLOCA (selection_value, data, bytes); - encoding = "COMPOUND_TEXT"; - } - } -#endif /* MULE */ - - fmh = XmStringCreateLtoR ("Clipboard", XmSTRING_DEFAULT_CHARSET); - while (ClipboardSuccess != - XmClipboardStartCopy (display, selecting_window, fmh, thyme, -#ifdef MOTIF_INCREMENTAL_CLIPBOARDS_WORK - widget, motif_clipboard_cb, -#else - 0, NULL, -#endif - &itemid)) - ; - XmStringFree (fmh); - while (ClipboardSuccess != - XmClipboardCopy (display, selecting_window, itemid, encoding, -#ifdef MOTIF_INCREMENTAL_CLIPBOARDS_WORK - /* O'Reilly examples say size can be 0, - but this clearly is not the case. */ - 0, bytes, (int) selecting_window, /* private id */ -#else /* !MOTIF_INCREMENTAL_CLIPBOARDS_WORK */ - (XtPointer) data, bytes, 0, -#endif /* !MOTIF_INCREMENTAL_CLIPBOARDS_WORK */ - &dataid)) - ; - while (ClipboardSuccess != - XmClipboardEndCopy (display, selecting_window, itemid)) - ; - } -} - -# ifdef MOTIF_INCREMENTAL_CLIPBOARDS_WORK -/* I tried to treat the clipboard like a real selection, and not send - the data until it was requested, but it looks like that just doesn't - work at all unless the selection owner and requestor are in different - processes. From reading the Motif source, it looks like they never - even considered having two widgets in the same application transfer - data between each other using "by-name" clipboard values. What a - bunch of fuckups. - */ -static void -motif_clipboard_cb (Widget widget, int *data_id, int *private_id, int *reason) -{ - switch (*reason) - { - case XmCR_CLIPBOARD_DATA_REQUEST: - { - Display *dpy = XtDisplay (widget); - Window window = (Window) *private_id; - Lisp_Object selection = assq_no_quit (QCLIPBOARD, Vselection_alist); - if (NILP (selection)) abort (); - selection = XCDR (selection); - if (!STRINGP (selection)) abort (); - XmClipboardCopyByName (dpy, window, *data_id, - (char *) XSTRING_DATA (selection), - XSTRING_LENGTH (selection) + 1, - 0); - } - break; - case XmCR_CLIPBOARD_DATA_DELETE: - default: - /* don't need to free anything */ - break; - } -} -# endif /* MOTIF_INCREMENTAL_CLIPBOARDS_WORK */ -#endif /* MOTIF_CLIPBOARDS */ - - -/* Given a selection-name and desired type, this looks up our local copy of - the selection value and converts it to the type. It returns nil or a - string. This calls random elisp code, and may signal or gc. - */ -static Lisp_Object -x_get_local_selection (Lisp_Object selection_symbol, Lisp_Object target_type) -{ - /* This function can GC */ - Lisp_Object local_value = assq_no_quit (selection_symbol, Vselection_alist); - Lisp_Object handler_fn, value, check; - - if (NILP (local_value)) return Qnil; - - /* TIMESTAMP and MULTIPLE are special cases 'cause that's easiest. */ - if (EQ (target_type, QTIMESTAMP)) - { - handler_fn = Qnil; - value = XCAR (XCDR (XCDR (local_value))); - } - -#if 0 /* #### MULTIPLE doesn't work yet */ - else if (CONSP (target_type) && - XCAR (target_type) == QMULTIPLE) - { - Lisp_Object pairs = XCDR (target_type); - int len = XVECTOR_LENGTH (pairs); - int i; - /* If the target is MULTIPLE, then target_type looks like - (MULTIPLE . [[SELECTION1 TARGET1] [SELECTION2 TARGET2] ... ]) - We modify the second element of each pair in the vector and - return it as [[SELECTION1 ] [SELECTION2 ] ... ] - */ - for (i = 0; i < len; i++) - { - Lisp_Object pair = XVECTOR_DATA (pairs) [i]; - XVECTOR_DATA (pair) [1] = - x_get_local_selection (XVECTOR_DATA (pair) [0], - XVECTOR_DATA (pair) [1]); - } - return pairs; - } -#endif - else - { - CHECK_SYMBOL (target_type); - handler_fn = Fcdr (Fassq (target_type, Vselection_converter_alist)); - if (NILP (handler_fn)) return Qnil; - value = call3 (handler_fn, - selection_symbol, target_type, - XCAR (XCDR (local_value))); - } - - /* This lets the selection function to return (TYPE . VALUE). For example, - when the selected type is LINE_NUMBER, the returned type is SPAN, not - INTEGER. - */ - check = value; - if (CONSP (value) && SYMBOLP (XCAR (value))) - check = XCDR (value); - - /* Strings, vectors, and symbols are converted to selection data format in - the obvious way. Integers are converted to 16 bit quantities if they're - small enough, otherwise 32 bits are used. - */ - if (STRINGP (check) || - VECTORP (check) || - SYMBOLP (check) || - INTP (check) || - CHARP (check) || - NILP (value)) - return value; - - /* (N . M) or (N M) get turned into a 32 bit quantity. So if you want to - always return a small quantity as 32 bits, your converter routine needs - to return a cons. - */ - else if (CONSP (check) && - INTP (XCAR (check)) && - (INTP (XCDR (check)) || - (CONSP (XCDR (check)) && - INTP (XCAR (XCDR (check))) && - NILP (XCDR (XCDR (check)))))) - return value; - /* Otherwise the lisp converter function returned something unrecognized. - */ - else - signal_error (Qerror, - list3 (build_string - ("unrecognized selection-conversion type"), - handler_fn, - value)); - - return Qnil; /* suppress compiler warning */ -} - - - -/* Send a SelectionNotify event to the requestor with property=None, meaning - we were unable to do what they wanted. - */ -static void -x_decline_selection_request (XSelectionRequestEvent *event) -{ - XSelectionEvent reply; - reply.type = SelectionNotify; - reply.display = event->display; - reply.requestor = event->requestor; - reply.selection = event->selection; - reply.time = event->time; - reply.target = event->target; - reply.property = None; - - XSendEvent (reply.display, reply.requestor, False, 0L, (XEvent *) &reply); - XFlush (reply.display); -} - - -/* Used as an unwind-protect clause so that, if a selection-converter signals - an error, we tell the requestor that we were unable to do what they wanted - before we throw to top-level or go into the debugger or whatever. - */ -static Lisp_Object -x_selection_request_lisp_error (Lisp_Object closure) -{ - XSelectionRequestEvent *event = (XSelectionRequestEvent *) - get_opaque_ptr (closure); - - free_opaque_ptr (closure); - if (event->type == 0) /* we set this to mean "completed normally" */ - return Qnil; - x_decline_selection_request (event); - return Qnil; -} - - -/* Convert our selection to the requested type, and put that data where the - requestor wants it. Then tell them whether we've succeeded. - */ -static void -x_reply_selection_request (XSelectionRequestEvent *event, int format, - unsigned char *data, int size, Atom type) -{ - /* This function can GC */ - XSelectionEvent reply; - Display *display = event->display; - struct device *d = get_device_from_display (display); - Window window = event->requestor; - int bytes_remaining; - int format_bytes = format/8; - int max_bytes = SELECTION_QUANTUM (display); - if (max_bytes > MAX_SELECTION_QUANTUM) max_bytes = MAX_SELECTION_QUANTUM; - - reply.type = SelectionNotify; - reply.display = display; - reply.requestor = window; - reply.selection = event->selection; - reply.time = event->time; - reply.target = event->target; - reply.property = (event->property == None ? event->target : event->property); - - /* #### XChangeProperty can generate BadAlloc, and we must handle it! */ - - /* Store the data on the requested property. - If the selection is large, only store the first N bytes of it. - */ - bytes_remaining = size * format_bytes; - if (bytes_remaining <= max_bytes) - { - /* Send all the data at once, with minimal handshaking. */ -#if 0 - stderr_out ("\nStoring all %d\n", bytes_remaining); -#endif - XChangeProperty (display, window, reply.property, type, format, - PropModeReplace, data, size); - /* At this point, the selection was successfully stored; ack it. */ - XSendEvent (display, window, False, 0L, (XEvent *) &reply); - XFlush (display); - } - else - { - /* Send an INCR selection. */ - int prop_id; - - if (x_window_to_frame (d, window)) /* #### debug */ - error ("attempt to transfer an INCR to ourself!"); -#if 0 - stderr_out ("\nINCR %d\n", bytes_remaining); -#endif - prop_id = expect_property_change (display, window, reply.property, - PropertyDelete); - - XChangeProperty (display, window, reply.property, DEVICE_XATOM_INCR (d), - 32, PropModeReplace, (unsigned char *) - &bytes_remaining, 1); - XSelectInput (display, window, PropertyChangeMask); - /* Tell 'em the INCR data is there... */ - XSendEvent (display, window, False, 0L, (XEvent *) &reply); - XFlush (display); - - /* First, wait for the requestor to ack by deleting the property. - This can run random lisp code (process handlers) or signal. - */ - wait_for_property_change (prop_id); - - while (bytes_remaining) - { - int i = ((bytes_remaining < max_bytes) - ? bytes_remaining - : max_bytes); - prop_id = expect_property_change (display, window, reply.property, - PropertyDelete); -#if 0 - stderr_out (" INCR adding %d\n", i); -#endif - /* Append the next chunk of data to the property. */ - XChangeProperty (display, window, reply.property, type, format, - PropModeAppend, data, i / format_bytes); - bytes_remaining -= i; - data += i; - - /* Now wait for the requestor to ack this chunk by deleting the - property. This can run random lisp code or signal. - */ - wait_for_property_change (prop_id); - } - /* Now write a zero-length chunk to the property to tell the requestor - that we're done. */ -#if 0 - stderr_out (" INCR done\n"); -#endif - if (! waiting_for_other_props_on_window (display, window)) - XSelectInput (display, window, 0L); - - XChangeProperty (display, window, reply.property, type, format, - PropModeReplace, data, 0); - } -} - - - -/* Called from the event-loop in response to a SelectionRequest event. - */ -void -x_handle_selection_request (XSelectionRequestEvent *event) -{ - /* This function can GC */ - struct gcpro gcpro1, gcpro2, gcpro3; - Lisp_Object local_selection_data = Qnil; - Lisp_Object selection_symbol; - Lisp_Object target_symbol = Qnil; - Lisp_Object converted_selection = Qnil; - Time local_selection_time; - Lisp_Object successful_p = Qnil; - int count; - struct device *d = get_device_from_display (event->display); - - GCPRO3 (local_selection_data, converted_selection, target_symbol); - - selection_symbol = x_atom_to_symbol (d, event->selection); - - local_selection_data = assq_no_quit (selection_symbol, Vselection_alist); - -#if 0 - /* This list isn't user-visible, so it can't "go bad." */ - assert (CONSP (local_selection_data)); - assert (CONSP (XCDR (local_selection_data))); - assert (CONSP (XCDR (XCDR (local_selection_data)))); - assert (NILP (XCDR (XCDR (XCDR (local_selection_data))))); - assert (CONSP (XCAR (XCDR (XCDR (local_selection_data))))); - assert (INTP (XCAR (XCAR (XCDR (XCDR (local_selection_data)))))); - assert (INTP (XCDR (XCAR (XCDR (XCDR (local_selection_data)))))); -#endif - - if (NILP (local_selection_data)) - { - /* Someone asked for the selection, but we don't have it any more. */ - x_decline_selection_request (event); - goto DONE_LABEL; - } - - local_selection_time = - * (Time *) XOPAQUE_DATA (XCAR (XCDR (XCDR (local_selection_data)))); - - if (event->time != CurrentTime && - local_selection_time > event->time) - { - /* Someone asked for the selection, and we have one, but not the one - they're looking for. */ - x_decline_selection_request (event); - goto DONE_LABEL; - } - - count = specpdl_depth (); - record_unwind_protect (x_selection_request_lisp_error, - make_opaque_ptr (event)); - target_symbol = x_atom_to_symbol (d, event->target); - -#if 0 /* #### MULTIPLE doesn't work yet */ - if (EQ (target_symbol, QMULTIPLE)) - target_symbol = fetch_multiple_target (event); -#endif - - /* Convert lisp objects back into binary data */ - - converted_selection = - x_get_local_selection (selection_symbol, target_symbol); - - if (! NILP (converted_selection)) - { - unsigned char *data; - unsigned int size; - int format; - Atom type; - lisp_data_to_selection_data (d, converted_selection, - &data, &type, &size, &format); - - x_reply_selection_request (event, format, data, size, type); - successful_p = Qt; - /* Tell x_selection_request_lisp_error() it's cool. */ - event->type = 0; - xfree (data); - } - unbind_to (count, Qnil); - - DONE_LABEL: - - UNGCPRO; - - /* Let random lisp code notice that the selection has been asked for. */ - { - Lisp_Object rest; - Lisp_Object val = Vx_sent_selection_hooks; - if (!UNBOUNDP (val) && !NILP (val)) - { - if (CONSP (val) && !EQ (XCAR (val), Qlambda)) - for (rest = val; !NILP (rest); rest = Fcdr (rest)) - call3 (Fcar(rest), selection_symbol, target_symbol, - successful_p); - else - call3 (val, selection_symbol, target_symbol, - successful_p); - } - } -} - - -/* Called from the event-loop in response to a SelectionClear event. - */ -void -x_handle_selection_clear (XSelectionClearEvent *event) -{ - Display *display = event->display; - struct device *d = get_device_from_display (display); - Atom selection = event->selection; - Time changed_owner_time = event->time; - - Lisp_Object selection_symbol, local_selection_data; - Time local_selection_time; - - selection_symbol = x_atom_to_symbol (d, selection); - - local_selection_data = assq_no_quit (selection_symbol, Vselection_alist); - - /* Well, we already believe that we don't own it, so that's just fine. */ - if (NILP (local_selection_data)) return; - - local_selection_time = - * (Time *) XOPAQUE_DATA (XCAR (XCDR (XCDR (local_selection_data)))); - - /* This SelectionClear is for a selection that we no longer own, so we can - disregard it. (That is, we have reasserted the selection since this - request was generated.) - */ - if (changed_owner_time != CurrentTime && - local_selection_time > changed_owner_time) - return; - - /* Otherwise, we're really honest and truly being told to drop it. - Don't use Fdelq() as that may QUIT;. - */ - if (EQ (local_selection_data, Fcar (Vselection_alist))) - Vselection_alist = Fcdr (Vselection_alist); - else - { - Lisp_Object rest; - for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest)) - if (EQ (local_selection_data, Fcar (XCDR (rest)))) - { - XCDR (rest) = Fcdr (XCDR (rest)); - break; - } - } - - /* Let random lisp code notice that the selection has been stolen. - */ - { - Lisp_Object rest; - Lisp_Object val = Vx_lost_selection_hooks; - if (!UNBOUNDP (val) && !NILP (val)) - { - if (CONSP (val) && !EQ (XCAR (val), Qlambda)) - for (rest = val; !NILP (rest); rest = Fcdr (rest)) - call1 (Fcar (rest), selection_symbol); - else - call1 (val, selection_symbol); - } - } -} - - -/* This stuff is so that INCR selections are reentrant (that is, so we can - be servicing multiple INCR selection requests simultaneously). I haven't - actually tested that yet. - */ - -static int prop_location_tick; - -static struct prop_location { - int tick; - Display *display; - Window window; - Atom property; - int desired_state; - struct prop_location *next; -} *for_whom_the_bell_tolls; - - -static int -property_deleted_p (void *tick) -{ - struct prop_location *rest = for_whom_the_bell_tolls; - while (rest) - if (rest->tick == (long) tick) - return 0; - else - rest = rest->next; - return 1; -} - -static int -waiting_for_other_props_on_window (Display *display, Window window) -{ - struct prop_location *rest = for_whom_the_bell_tolls; - while (rest) - if (rest->display == display && rest->window == window) - return 1; - else - rest = rest->next; - return 0; -} - - -static int -expect_property_change (Display *display, Window window, - Atom property, int state) -{ - struct prop_location *pl = xnew (struct prop_location); - pl->tick = ++prop_location_tick; - pl->display = display; - pl->window = window; - pl->property = property; - pl->desired_state = state; - pl->next = for_whom_the_bell_tolls; - for_whom_the_bell_tolls = pl; - return pl->tick; -} - -static void -unexpect_property_change (int tick) -{ - struct prop_location *prev = 0, *rest = for_whom_the_bell_tolls; - while (rest) - { - if (rest->tick == tick) - { - if (prev) - prev->next = rest->next; - else - for_whom_the_bell_tolls = rest->next; - xfree (rest); - return; - } - prev = rest; - rest = rest->next; - } -} - -static void -wait_for_property_change (long tick) -{ - /* This function can GC */ - wait_delaying_user_input (property_deleted_p, (void *) tick); -} - - -/* Called from the event-loop in response to a PropertyNotify event. - */ -void -x_handle_property_notify (XPropertyEvent *event) -{ - struct prop_location *prev = 0, *rest = for_whom_the_bell_tolls; - while (rest) - { - if (rest->property == event->atom && - rest->window == event->window && - rest->display == event->display && - rest->desired_state == event->state) - { -#if 0 - stderr_out ("Saw expected prop-%s on %s\n", - (event->state == PropertyDelete ? "delete" : "change"), - (char *) string_data (XSYMBOL (x_atom_to_symbol (get_device_from_display (event->display), event->atom))->name); -#endif - if (prev) - prev->next = rest->next; - else - for_whom_the_bell_tolls = rest->next; - xfree (rest); - return; - } - prev = rest; - rest = rest->next; - } -#if 0 - stderr_out ("Saw UNexpected prop-%s on %s\n", - (event->state == PropertyDelete ? "delete" : "change"), - (char *) string_data (XSYMBOL (x_atom_to_symbol (get_device_from_display (event->display), event->atom))->name)); -#endif -} - - - -#if 0 /* #### MULTIPLE doesn't work yet */ - -static Lisp_Object -fetch_multiple_target (XSelectionRequestEvent *event) -{ - /* This function can GC */ - Display *display = event->display; - Window window = event->requestor; - Atom target = event->target; - Atom selection_atom = event->selection; - int result; - - return - Fcons (QMULTIPLE, - x_get_window_property_as_lisp_data (display, window, target, - QMULTIPLE, - selection_atom)); -} - -static Lisp_Object -copy_multiple_data (Lisp_Object obj) -{ - Lisp_Object vec; - int i; - int len; - if (CONSP (obj)) - return Fcons (XCAR (obj), copy_multiple_data (XCDR (obj))); - - CHECK_VECTOR (obj); - len = XVECTOR_LENGTH (obj); - vec = make_vector (len, Qnil); - for (i = 0; i < len; i++) - { - Lisp_Object vec2 = XVECTOR_DATA (obj) [i]; - CHECK_VECTOR (vec2); - if (XVECTOR_LENGTH (vec2) != 2) - signal_error (Qerror, list2 (build_string - ("vectors must be of length 2"), - vec2)); - XVECTOR_DATA (vec) [i] = make_vector (2, Qnil); - XVECTOR_DATA (XVECTOR_DATA (vec) [i]) [0] = XVECTOR_DATA (vec2) [0]; - XVECTOR_DATA (XVECTOR_DATA (vec) [i]) [1] = XVECTOR_DATA (vec2) [1]; - } - return vec; -} - -#endif /* 0 */ - - -static Window reading_selection_reply; -static Atom reading_which_selection; -static int selection_reply_timed_out; - -static int -selection_reply_done (void *ignore) -{ - return !reading_selection_reply; -} - -static Lisp_Object Qx_selection_reply_timeout_internal; - -DEFUN ("x-selection-reply-timeout-internal", Fx_selection_reply_timeout_internal, - 1, 1, 0, /* -*/ - (arg)) -{ - selection_reply_timed_out = 1; - reading_selection_reply = 0; - return Qnil; -} - - -/* Do protocol to read selection-data from the server. - Converts this to lisp data and returns it. - */ -static Lisp_Object -x_get_foreign_selection (Lisp_Object selection_symbol, Lisp_Object target_type) -{ - /* This function can GC */ - struct device *d = decode_x_device (Qnil); - Display *display = DEVICE_X_DISPLAY (d); - struct frame *sel_frame = selected_frame (); - Window requestor_window = XtWindow (FRAME_X_TEXT_WIDGET (sel_frame)); - Time requestor_time = DEVICE_X_MOUSE_TIMESTAMP (d); - Atom target_property = DEVICE_XATOM_EMACS_TMP (d); - Atom selection_atom = symbol_to_x_atom (d, selection_symbol, 0); - int speccount; - Atom type_atom = symbol_to_x_atom (d, (CONSP (target_type) ? - XCAR (target_type) : target_type), 0); - - XConvertSelection (display, selection_atom, type_atom, target_property, - requestor_window, requestor_time); - - /* Block until the reply has been read. */ - reading_selection_reply = requestor_window; - reading_which_selection = selection_atom; - selection_reply_timed_out = 0; - - speccount = specpdl_depth (); - - /* add a timeout handler */ - if (x_selection_timeout > 0) - { - Lisp_Object id = Fadd_timeout (make_int (x_selection_timeout), - Qx_selection_reply_timeout_internal, - Qnil, Qnil); - record_unwind_protect (Fdisable_timeout, id); - } - - /* This is ^Gable */ - wait_delaying_user_input (selection_reply_done, 0); - - if (selection_reply_timed_out) - error ("timed out waiting for reply from selection owner"); - - unbind_to (speccount, Qnil); - - /* otherwise, the selection is waiting for us on the requested property. */ - return - x_get_window_property_as_lisp_data (display, requestor_window, - target_property, target_type, - selection_atom); -} - - -static void -x_get_window_property (Display *display, Window window, Atom property, - unsigned char **data_ret, int *bytes_ret, - Atom *actual_type_ret, int *actual_format_ret, - unsigned long *actual_size_ret, int delete_p) -{ - int total_size; - unsigned long bytes_remaining; - int offset = 0; - unsigned char *tmp_data = 0; - int result; - int buffer_size = SELECTION_QUANTUM (display); - if (buffer_size > MAX_SELECTION_QUANTUM) buffer_size = MAX_SELECTION_QUANTUM; - - /* First probe the thing to find out how big it is. */ - result = XGetWindowProperty (display, window, property, - 0, 0, False, AnyPropertyType, - actual_type_ret, actual_format_ret, - actual_size_ret, - &bytes_remaining, &tmp_data); - if (result != Success) - { - *data_ret = 0; - *bytes_ret = 0; - return; - } - XFree ((char *) tmp_data); - - if (*actual_type_ret == None || *actual_format_ret == 0) - { - if (delete_p) XDeleteProperty (display, window, property); - *data_ret = 0; - *bytes_ret = 0; - return; - } - - total_size = bytes_remaining + 1; - *data_ret = (unsigned char *) xmalloc (total_size); - - /* Now read, until we've gotten it all. */ - while (bytes_remaining) - { -#if 0 - int last = bytes_remaining; -#endif - result = - XGetWindowProperty (display, window, property, - offset/4, buffer_size/4, - (delete_p ? True : False), - AnyPropertyType, - actual_type_ret, actual_format_ret, - actual_size_ret, &bytes_remaining, &tmp_data); -#if 0 - stderr_out ("<< read %d\n", last-bytes_remaining); -#endif - /* If this doesn't return Success at this point, it means that - some clod deleted the selection while we were in the midst of - reading it. Deal with that, I guess.... - */ - if (result != Success) break; - *actual_size_ret *= *actual_format_ret / 8; - memcpy ((*data_ret) + offset, tmp_data, *actual_size_ret); - offset += *actual_size_ret; - XFree ((char *) tmp_data); - } - *bytes_ret = offset; -} - - -static void -receive_incremental_selection (Display *display, Window window, Atom property, - /* this one is for error messages only */ - Lisp_Object target_type, - unsigned int min_size_bytes, - unsigned char **data_ret, int *size_bytes_ret, - Atom *type_ret, int *format_ret, - unsigned long *size_ret) -{ - /* This function can GC */ - int offset = 0; - int prop_id; - *size_bytes_ret = min_size_bytes; - *data_ret = (unsigned char *) xmalloc (*size_bytes_ret); -#if 0 - stderr_out ("\nread INCR %d\n", min_size_bytes); -#endif - /* At this point, we have read an INCR property, and deleted it (which - is how we ack its receipt: the sending window will be selecting - PropertyNotify events on our window to notice this). - - Now, we must loop, waiting for the sending window to put a value on - that property, then reading the property, then deleting it to ack. - We are done when the sender places a property of length 0. - */ - prop_id = expect_property_change (display, window, property, - PropertyNewValue); - while (1) - { - unsigned char *tmp_data; - int tmp_size_bytes; - wait_for_property_change (prop_id); - /* expect it again immediately, because x_get_window_property may - .. no it won't, I don't get it. - .. Ok, I get it now, the Xt code that implements INCR is broken. - */ - prop_id = expect_property_change (display, window, property, - PropertyNewValue); - x_get_window_property (display, window, property, - &tmp_data, &tmp_size_bytes, - type_ret, format_ret, size_ret, 1); - - if (tmp_size_bytes == 0) /* we're done */ - { -#if 0 - stderr_out (" read INCR done\n"); -#endif - unexpect_property_change (prop_id); - if (tmp_data) xfree (tmp_data); - break; - } -#if 0 - stderr_out (" read INCR %d\n", tmp_size_bytes); -#endif - if (*size_bytes_ret < offset + tmp_size_bytes) - { -#if 0 - stderr_out (" read INCR realloc %d -> %d\n", - *size_bytes_ret, offset + tmp_size_bytes); -#endif - *size_bytes_ret = offset + tmp_size_bytes; - *data_ret = (unsigned char *) xrealloc (*data_ret, *size_bytes_ret); - } - memcpy ((*data_ret) + offset, tmp_data, tmp_size_bytes); - offset += tmp_size_bytes; - xfree (tmp_data); - } -} - - -static Lisp_Object -x_get_window_property_as_lisp_data (Display *display, - Window window, - Atom property, - /* next two for error messages only */ - Lisp_Object target_type, - Atom selection_atom) -{ - /* This function can GC */ - Atom actual_type; - int actual_format; - unsigned long actual_size; - unsigned char *data = NULL; - int bytes = 0; - Lisp_Object val; - struct device *d = get_device_from_display (display); - - x_get_window_property (display, window, property, &data, &bytes, - &actual_type, &actual_format, &actual_size, 1); - if (! data) - { - if (XGetSelectionOwner (display, selection_atom)) - /* there is a selection owner */ - signal_error - (Qselection_conversion_error, - Fcons (build_string ("selection owner couldn't convert"), - Fcons (x_atom_to_symbol (d, selection_atom), - actual_type ? - list2 (target_type, x_atom_to_symbol (d, actual_type)) : - list1 (target_type)))); - else - signal_error (Qerror, - list2 (build_string ("no selection"), - x_atom_to_symbol (d, selection_atom))); - } - - if (actual_type == DEVICE_XATOM_INCR (d)) - { - /* Ok, that data wasn't *the* data, it was just the beginning. */ - - unsigned int min_size_bytes = * ((unsigned int *) data); - xfree (data); - receive_incremental_selection (display, window, property, target_type, - min_size_bytes, &data, &bytes, - &actual_type, &actual_format, - &actual_size); - } - - /* It's been read. Now convert it to a lisp object in some semi-rational - manner. */ - val = selection_data_to_lisp_data (d, data, bytes, - actual_type, actual_format); - - xfree (data); - return val; -} - -/* These functions convert from the selection data read from the server into - something that we can use from elisp, and vice versa. - - Type: Format: Size: Elisp Type: - ----- ------- ----- ----------- - * 8 * String - ATOM 32 1 Symbol - ATOM 32 > 1 Vector of Symbols - * 16 1 Integer - * 16 > 1 Vector of Integers - * 32 1 if <=16 bits: Integer - if > 16 bits: Cons of top16, bot16 - * 32 > 1 Vector of the above - - When converting a Lisp number to C, it is assumed to be of format 16 if - it is an integer, and of format 32 if it is a cons of two integers. - - When converting a vector of numbers from Elisp to C, it is assumed to be - of format 16 if every element in the vector is an integer, and is assumed - to be of format 32 if any element is a cons of two integers. - - When converting an object to C, it may be of the form (SYMBOL . ) - where SYMBOL is what we should claim that the type is. Format and - representation are as above. - - NOTE: Under Mule, when someone shoves us a string without a type, we - set the type to 'COMPOUND_TEXT and automatically convert to Compound - Text. If the string has a type, we assume that the user wants the - data sent as-is so we just do "binary" conversion. - */ - - -static Lisp_Object -selection_data_to_lisp_data (struct device *d, - unsigned char *data, - size_t size, - Atom type, - int format) -{ - if (type == DEVICE_XATOM_NULL (d)) - return QNULL; - - /* Convert any 8-bit data to a string, for compactness. */ - else if (format == 8) - return make_ext_string (data, size, - type == DEVICE_XATOM_TEXT (d) || - type == DEVICE_XATOM_COMPOUND_TEXT (d) - ? FORMAT_CTEXT : FORMAT_BINARY); - - /* Convert a single atom to a Lisp Symbol. - Convert a set of atoms to a vector of symbols. */ - else if (type == XA_ATOM) - { - if (size == sizeof (Atom)) - return x_atom_to_symbol (d, *((Atom *) data)); - else - { - int i; - int len = size / sizeof (Atom); - Lisp_Object v = Fmake_vector (make_int (len), Qzero); - for (i = 0; i < len; i++) - Faset (v, make_int (i), x_atom_to_symbol (d, ((Atom *) data) [i])); - return v; - } - } - - /* Convert a single 16 or small 32 bit number to a Lisp Int. - If the number is > 16 bits, convert it to a cons of integers, - 16 bits in each half. - */ - else if (format == 32 && size == sizeof (long)) - return word_to_lisp (((unsigned long *) data) [0]); - else if (format == 16 && size == sizeof (short)) - return make_int ((int) (((unsigned short *) data) [0])); - - /* Convert any other kind of data to a vector of numbers, represented - as above (as an integer, or a cons of two 16 bit integers). - - #### Perhaps we should return the actual type to lisp as well. - - (x-get-selection-internal 'PRIMARY 'LINE_NUMBER) - ==> [4 4] - - and perhaps it should be - - (x-get-selection-internal 'PRIMARY 'LINE_NUMBER) - ==> (SPAN . [4 4]) - - Right now the fact that the return type was SPAN is discarded before - lisp code gets to see it. - */ - else if (format == 16) - { - int i; - Lisp_Object v = make_vector (size / 4, Qzero); - for (i = 0; i < (int) size / 4; i++) - { - int j = (int) ((unsigned short *) data) [i]; - Faset (v, make_int (i), make_int (j)); - } - return v; - } - else - { - int i; - Lisp_Object v = make_vector (size / 4, Qzero); - for (i = 0; i < (int) size / 4; i++) - { - unsigned long j = ((unsigned long *) data) [i]; - Faset (v, make_int (i), word_to_lisp (j)); - } - return v; - } -} - - -static void -lisp_data_to_selection_data (struct device *d, - Lisp_Object obj, - unsigned char **data_ret, - Atom *type_ret, - unsigned int *size_ret, - int *format_ret) -{ - Lisp_Object type = Qnil; - - if (CONSP (obj) && SYMBOLP (XCAR (obj))) - { - type = XCAR (obj); - obj = XCDR (obj); - if (CONSP (obj) && NILP (XCDR (obj))) - obj = XCAR (obj); - } - - if (EQ (obj, QNULL) || (EQ (type, QNULL))) - { /* This is not the same as declining */ - *format_ret = 32; - *size_ret = 0; - *data_ret = 0; - type = QNULL; - } - else if (STRINGP (obj)) - { - CONST Extbyte *extval; - Extcount extvallen; - - if (NILP (type)) - GET_STRING_CTEXT_DATA_ALLOCA (obj, extval, extvallen); - else - GET_STRING_BINARY_DATA_ALLOCA (obj, extval, extvallen); - *format_ret = 8; - *size_ret = extvallen; - *data_ret = (unsigned char *) xmalloc (*size_ret); - memcpy (*data_ret, extval, *size_ret); -#ifdef MULE - if (NILP (type)) type = QCOMPOUND_TEXT; -#else - if (NILP (type)) type = QSTRING; -#endif - } - else if (CHARP (obj)) - { - Bufbyte buf[MAX_EMCHAR_LEN]; - Bytecount len; - CONST Extbyte *extval; - Extcount extvallen; - - *format_ret = 8; - len = set_charptr_emchar (buf, XCHAR (obj)); - GET_CHARPTR_EXT_CTEXT_DATA_ALLOCA (buf, len, extval, extvallen); - *size_ret = extvallen; - *data_ret = (unsigned char *) xmalloc (*size_ret); - memcpy (*data_ret, extval, *size_ret); -#ifdef MULE - if (NILP (type)) type = QCOMPOUND_TEXT; -#else - if (NILP (type)) type = QSTRING; -#endif - } - else if (SYMBOLP (obj)) - { - *format_ret = 32; - *size_ret = 1; - *data_ret = (unsigned char *) xmalloc (sizeof (Atom) + 1); - (*data_ret) [sizeof (Atom)] = 0; - (*(Atom **) data_ret) [0] = symbol_to_x_atom (d, obj, 0); - if (NILP (type)) type = QATOM; - } - else if (INTP (obj) && - XINT (obj) <= 0x7FFF && - XINT (obj) >= -0x8000) - { - *format_ret = 16; - *size_ret = 1; - *data_ret = (unsigned char *) xmalloc (sizeof (short) + 1); - (*data_ret) [sizeof (short)] = 0; - (*(short **) data_ret) [0] = (short) XINT (obj); - if (NILP (type)) type = QINTEGER; - } - else if (INTP (obj) || CONSP (obj)) - { - *format_ret = 32; - *size_ret = 1; - *data_ret = (unsigned char *) xmalloc (sizeof (long) + 1); - (*data_ret) [sizeof (long)] = 0; - (*(unsigned long **) data_ret) [0] = lisp_to_word (obj); - if (NILP (type)) type = QINTEGER; - } - else if (VECTORP (obj)) - { - /* Lisp Vectors may represent a set of ATOMs; - a set of 16 or 32 bit INTEGERs; - or a set of ATOM_PAIRs (represented as [[A1 A2] [A3 A4] ...] - */ - int i; - - if (SYMBOLP (XVECTOR_DATA (obj) [0])) - /* This vector is an ATOM set */ - { - if (NILP (type)) type = QATOM; - *size_ret = XVECTOR_LENGTH (obj); - *format_ret = 32; - *data_ret = (unsigned char *) xmalloc ((*size_ret) * sizeof (Atom)); - for (i = 0; i < (int) (*size_ret); i++) - if (SYMBOLP (XVECTOR_DATA (obj) [i])) - (*(Atom **) data_ret) [i] = - symbol_to_x_atom (d, XVECTOR_DATA (obj) [i], 0); - else - signal_error (Qerror, /* Qselection_error */ - list2 (build_string - ("all elements of the vector must be of the same type"), - obj)); - } -#if 0 /* #### MULTIPLE doesn't work yet */ - else if (VECTORP (XVECTOR_DATA (obj) [0])) - /* This vector is an ATOM_PAIR set */ - { - if (NILP (type)) type = QATOM_PAIR; - *size_ret = XVECTOR_LENGTH (obj); - *format_ret = 32; - *data_ret = (unsigned char *) - xmalloc ((*size_ret) * sizeof (Atom) * 2); - for (i = 0; i < *size_ret; i++) - if (VECTORP (XVECTOR_DATA (obj) [i])) - { - Lisp_Object pair = XVECTOR_DATA (obj) [i]; - if (XVECTOR_LENGTH (pair) != 2) - signal_error (Qerror, - list2 (build_string - ("elements of the vector must be vectors of exactly two elements"), - pair)); - - (*(Atom **) data_ret) [i * 2] = - symbol_to_x_atom (d, XVECTOR_DATA (pair) [0], 0); - (*(Atom **) data_ret) [(i * 2) + 1] = - symbol_to_x_atom (d, XVECTOR_DATA (pair) [1], 0); - } - else - signal_error (Qerror, - list2 (build_string - ("all elements of the vector must be of the same type"), - obj)); - } -#endif - else - /* This vector is an INTEGER set, or something like it */ - { - *size_ret = XVECTOR_LENGTH (obj); - if (NILP (type)) type = QINTEGER; - *format_ret = 16; - for (i = 0; i < (int) (*size_ret); i++) - if (CONSP (XVECTOR_DATA (obj) [i])) - *format_ret = 32; - else if (!INTP (XVECTOR_DATA (obj) [i])) - signal_error (Qerror, /* Qselection_error */ - list2 (build_string - ("all elements of the vector must be integers or conses of integers"), - obj)); - - *data_ret = (unsigned char *) xmalloc (*size_ret * (*format_ret/8)); - for (i = 0; i < (int) (*size_ret); i++) - if (*format_ret == 32) - (*((unsigned long **) data_ret)) [i] = - lisp_to_word (XVECTOR_DATA (obj) [i]); - else - (*((unsigned short **) data_ret)) [i] = - (unsigned short) lisp_to_word (XVECTOR_DATA (obj) [i]); - } - } - else - signal_error (Qerror, /* Qselection_error */ - list2 (build_string ("unrecognized selection data"), - obj)); - - *type_ret = symbol_to_x_atom (d, type, 0); -} - -static Lisp_Object -clean_local_selection_data (Lisp_Object obj) -{ - if (CONSP (obj) && - INTP (XCAR (obj)) && - CONSP (XCDR (obj)) && - INTP (XCAR (XCDR (obj))) && - NILP (XCDR (XCDR (obj)))) - obj = Fcons (XCAR (obj), XCDR (obj)); - - if (CONSP (obj) && - INTP (XCAR (obj)) && - INTP (XCDR (obj))) - { - if (XINT (XCAR (obj)) == 0) - return XCDR (obj); - if (XINT (XCAR (obj)) == -1) - return make_int (- XINT (XCDR (obj))); - } - if (VECTORP (obj)) - { - int i; - int len = XVECTOR_LENGTH (obj); - Lisp_Object copy; - if (len == 1) - return clean_local_selection_data (XVECTOR_DATA (obj) [0]); - copy = make_vector (len, Qnil); - for (i = 0; i < len; i++) - XVECTOR_DATA (copy) [i] = - clean_local_selection_data (XVECTOR_DATA (obj) [i]); - return copy; - } - return obj; -} - - -/* Called from the event loop to handle SelectionNotify events. - I don't think this needs to be reentrant. - */ -void -x_handle_selection_notify (XSelectionEvent *event) -{ - if (! reading_selection_reply) - message ("received an unexpected SelectionNotify event"); - else if (event->requestor != reading_selection_reply) - message ("received a SelectionNotify event for the wrong window"); - else if (event->selection != reading_which_selection) - message ("received the wrong selection type in SelectionNotify!"); - else - reading_selection_reply = 0; /* we're done now. */ -} - - -DEFUN ("x-own-selection-internal", Fx_own_selection_internal, 2, 2, 0, /* -Assert an X selection of the given TYPE with the given VALUE. -TYPE is a symbol, typically PRIMARY, SECONDARY, or CLIPBOARD. -VALUE is typically a string, or a cons of two markers, but may be -anything that the functions on selection-converter-alist know about. -*/ - (selection_name, selection_value)) -{ - CHECK_SYMBOL (selection_name); - if (NILP (selection_value)) error ("selection-value may not be nil."); - x_own_selection (selection_name, selection_value); - return selection_value; -} - - -/* Request the selection value from the owner. If we are the owner, - simply return our selection value. If we are not the owner, this - will block until all of the data has arrived. - */ -DEFUN ("x-get-selection-internal", Fx_get_selection_internal, 2, 2, 0, /* -Return text selected from some X window. -SELECTION_SYMBOL is a symbol, typically PRIMARY, SECONDARY, or CLIPBOARD. -TARGET_TYPE is the type of data desired, typically STRING or COMPOUND_TEXT. -Under Mule, if the resultant data comes back as 8-bit data in type -TEXT or COMPOUND_TEXT, it will be decoded as Compound Text. -*/ - (selection_symbol, target_type)) -{ - /* This function can GC */ - Lisp_Object val = Qnil; - struct gcpro gcpro1, gcpro2; - GCPRO2 (target_type, val); /* we store newly consed data into these */ - CHECK_SYMBOL (selection_symbol); - -#if 0 /* #### MULTIPLE doesn't work yet */ - if (CONSP (target_type) && - XCAR (target_type) == QMULTIPLE) - { - CHECK_VECTOR (XCDR (target_type)); - /* So we don't destructively modify this... */ - target_type = copy_multiple_data (target_type); - } - else -#endif - CHECK_SYMBOL (target_type); - - val = x_get_local_selection (selection_symbol, target_type); - - if (NILP (val)) - { - val = x_get_foreign_selection (selection_symbol, target_type); - } - else - { - if (CONSP (val) && SYMBOLP (XCAR (val))) - { - val = XCDR (val); - if (CONSP (val) && NILP (XCDR (val))) - val = XCAR (val); - } - val = clean_local_selection_data (val); - } - UNGCPRO; - return val; -} - -DEFUN ("x-disown-selection-internal", Fx_disown_selection_internal, 1, 2, 0, /* -If we own the named selection, then disown it (make there be no selection). -*/ - (selection, timeval)) -{ - struct device *d = decode_x_device (Qnil); - Display *display = DEVICE_X_DISPLAY (d); - Time timestamp; - Atom selection_atom; - XSelectionClearEvent event; - - CHECK_SYMBOL (selection); - if (NILP (timeval)) - timestamp = DEVICE_X_MOUSE_TIMESTAMP (d); - else - { - /* #### This is bogus. See the comment above about problems - on OSF/1 and DEC Alphas. Yet another reason why it sucks - to have the implementation (i.e. cons of two 16-bit - integers) exposed. */ - time_t the_time; - lisp_to_time (timeval, &the_time); - timestamp = (Time) the_time; - } - - if (NILP (assq_no_quit (selection, Vselection_alist))) - return Qnil; /* Don't disown the selection when we're not the owner. */ - - selection_atom = symbol_to_x_atom (d, selection, 0); - - XSetSelectionOwner (display, selection_atom, None, timestamp); - - /* It doesn't seem to be guaranteed that a SelectionClear event will be - generated for a window which owns the selection when that window sets - the selection owner to None. The NCD server does, the MIT Sun4 server - doesn't. So we synthesize one; this means we might get two, but - that's ok, because the second one won't have any effect. - */ - event.display = display; - event.selection = selection_atom; - event.time = timestamp; - x_handle_selection_clear (&event); - - return Qt; -} - - -DEFUN ("x-selection-owner-p", Fx_selection_owner_p, 0, 1, 0, /* -Return t if current emacs process owns the given X Selection. -The arg should be the name of the selection in question, typically one of -the symbols PRIMARY, SECONDARY, or CLIPBOARD. (For convenience, the symbol -nil is the same as PRIMARY, and t is the same as SECONDARY.) -*/ - (selection)) -{ - CHECK_SYMBOL (selection); - if (EQ (selection, Qnil)) selection = QPRIMARY; - else if (EQ (selection, Qt)) selection = QSECONDARY; - - return NILP (Fassq (selection, Vselection_alist)) ? Qnil : Qt; -} - -DEFUN ("x-selection-exists-p", Fx_selection_exists_p, 0, 1, 0, /* -Whether there is an owner for the given X Selection. -The arg should be the name of the selection in question, typically one of -the symbols PRIMARY, SECONDARY, or CLIPBOARD. (For convenience, the symbol -nil is the same as PRIMARY, and t is the same as SECONDARY.) -*/ - (selection)) -{ - struct device *d = decode_x_device (Qnil); - Display *dpy = DEVICE_X_DISPLAY (d); - CHECK_SYMBOL (selection); - if (!NILP (Fx_selection_owner_p (selection))) - return Qt; - return XGetSelectionOwner (dpy, symbol_to_x_atom (d, selection, 0)) != None ? - Qt : Qnil; -} - - -#ifdef CUT_BUFFER_SUPPORT - -static int cut_buffers_initialized; /* Whether we're sure they all exist */ - -/* Ensure that all 8 cut buffers exist. ICCCM says we gotta... */ -static void -initialize_cut_buffers (Display *display, Window window) -{ - static unsigned CONST char * CONST data = (unsigned CONST char *) ""; -#define FROB(atom) XChangeProperty (display, window, atom, XA_STRING, 8, \ - PropModeAppend, data, 0) - FROB (XA_CUT_BUFFER0); - FROB (XA_CUT_BUFFER1); - FROB (XA_CUT_BUFFER2); - FROB (XA_CUT_BUFFER3); - FROB (XA_CUT_BUFFER4); - FROB (XA_CUT_BUFFER5); - FROB (XA_CUT_BUFFER6); - FROB (XA_CUT_BUFFER7); -#undef FROB - cut_buffers_initialized = 1; -} - -#define CHECK_CUTBUFFER(symbol) \ - { CHECK_SYMBOL (symbol); \ - if (!EQ((symbol),QCUT_BUFFER0) && !EQ((symbol),QCUT_BUFFER1) && \ - !EQ((symbol),QCUT_BUFFER2) && !EQ((symbol),QCUT_BUFFER3) && \ - !EQ((symbol),QCUT_BUFFER4) && !EQ((symbol),QCUT_BUFFER5) && \ - !EQ((symbol),QCUT_BUFFER6) && !EQ((symbol),QCUT_BUFFER7)) \ - signal_error (Qerror, list2 (build_string ("Doesn't name a cutbuffer"), \ - (symbol))); \ - } - -DEFUN ("x-get-cutbuffer-internal", Fx_get_cutbuffer_internal, 1, 1, 0, /* -Return the value of the named CUTBUFFER (typically CUT_BUFFER0). -*/ - (cutbuffer)) -{ - struct device *d = decode_x_device (Qnil); - Display *display = DEVICE_X_DISPLAY (d); - Window window = RootWindow (display, 0); /* Cutbuffers are on frame 0 */ - Atom cut_buffer_atom; - unsigned char *data; - int bytes; - Atom type; - int format; - unsigned long size; - Lisp_Object ret; - - CHECK_CUTBUFFER (cutbuffer); - cut_buffer_atom = symbol_to_x_atom (d, cutbuffer, 0); - - x_get_window_property (display, window, cut_buffer_atom, &data, &bytes, - &type, &format, &size, 0); - if (!data) return Qnil; - - if (format != 8 || type != XA_STRING) - signal_simple_error_2 ("Cut buffer doesn't contain 8-bit STRING data", - x_atom_to_symbol (d, type), - make_int (format)); - - /* We cheat - if the string contains an ESC character, that's - technically not allowed in a STRING, so we assume it's - COMPOUND_TEXT that we stored there ourselves earlier, - in x-store-cutbuffer-internal */ - ret = (bytes ? - make_ext_string (data, bytes, - memchr (data, 0x1b, bytes) ? - FORMAT_CTEXT : FORMAT_BINARY) - : Qnil); - xfree (data); - return ret; -} - - -DEFUN ("x-store-cutbuffer-internal", Fx_store_cutbuffer_internal, 2, 2, 0, /* -Set the value of the named CUTBUFFER (typically CUT_BUFFER0) to STRING. -*/ - (cutbuffer, string)) -{ - struct device *d = decode_x_device (Qnil); - Display *display = DEVICE_X_DISPLAY (d); - Window window = RootWindow (display, 0); /* Cutbuffers are on frame 0 */ - Atom cut_buffer_atom; - CONST Extbyte *data = XSTRING_DATA (string); - Extcount bytes = XSTRING_LENGTH (string); - Extcount bytes_remaining; - int max_bytes = SELECTION_QUANTUM (display); -#ifdef MULE - CONST Bufbyte *ptr, *end; - enum { ASCII, LATIN_1, WORLD } chartypes = ASCII; -#endif - - if (max_bytes > MAX_SELECTION_QUANTUM) - max_bytes = MAX_SELECTION_QUANTUM; - - CHECK_CUTBUFFER (cutbuffer); - CHECK_STRING (string); - cut_buffer_atom = symbol_to_x_atom (d, cutbuffer, 0); - - if (! cut_buffers_initialized) - initialize_cut_buffers (display, window); - - /* We use the STRING encoding (Latin-1 only) if we can, else COMPOUND_TEXT. - We cheat and use type = `STRING' even when using COMPOUND_TEXT. - The ICCCM requires that this be so, and other clients assume it, - as we do ourselves in initialize_cut_buffers. */ - -#ifdef MULE - /* Optimize for the common ASCII case */ - for (ptr = data, end = ptr + bytes; ptr <= end; ) - { - if (BYTE_ASCII_P (*ptr)) - { - ptr++; - continue; - } - - if ((*ptr) == LEADING_BYTE_LATIN_ISO8859_1 || - (*ptr) == LEADING_BYTE_CONTROL_1) - { - chartypes = LATIN_1; - ptr += 2; - continue; - } - - chartypes = WORLD; - break; - } - - if (chartypes == LATIN_1) - GET_STRING_BINARY_DATA_ALLOCA (string, data, bytes); - else if (chartypes == WORLD) - GET_STRING_CTEXT_DATA_ALLOCA (string, data, bytes); -#endif /* MULE */ - - bytes_remaining = bytes; - - while (bytes_remaining) - { - int chunk = bytes_remaining < max_bytes ? bytes_remaining : max_bytes; - XChangeProperty (display, window, cut_buffer_atom, XA_STRING, 8, - (bytes_remaining == bytes - ? PropModeReplace : PropModeAppend), - data, chunk); - data += chunk; - bytes_remaining -= chunk; - } - return string; -} - - -DEFUN ("x-rotate-cutbuffers-internal", Fx_rotate_cutbuffers_internal, 1, 1, 0, /* -Rotate the values of the cutbuffers by the given number of steps; -positive means move values forward, negative means backward. -*/ - (n)) -{ - struct device *d = decode_x_device (Qnil); - Display *display = DEVICE_X_DISPLAY (d); - Window window = RootWindow (display, 0); /* Cutbuffers are on frame 0 */ - Atom props [8]; - - CHECK_INT (n); - if (XINT (n) == 0) - return n; - if (! cut_buffers_initialized) - initialize_cut_buffers (display, window); - props[0] = XA_CUT_BUFFER0; - props[1] = XA_CUT_BUFFER1; - props[2] = XA_CUT_BUFFER2; - props[3] = XA_CUT_BUFFER3; - props[4] = XA_CUT_BUFFER4; - props[5] = XA_CUT_BUFFER5; - props[6] = XA_CUT_BUFFER6; - props[7] = XA_CUT_BUFFER7; - XRotateWindowProperties (display, window, props, 8, XINT (n)); - return n; -} - -#endif /* CUT_BUFFER_SUPPORT */ - - - -/************************************************************************/ -/* initialization */ -/************************************************************************/ - -void -syms_of_xselect (void) -{ - DEFSUBR (Fx_get_selection_internal); - DEFSUBR (Fx_own_selection_internal); - DEFSUBR (Fx_disown_selection_internal); - DEFSUBR (Fx_selection_owner_p); - DEFSUBR (Fx_selection_exists_p); - -#ifdef CUT_BUFFER_SUPPORT - DEFSUBR (Fx_get_cutbuffer_internal); - DEFSUBR (Fx_store_cutbuffer_internal); - DEFSUBR (Fx_rotate_cutbuffers_internal); -#endif /* CUT_BUFFER_SUPPORT */ - - /* Unfortunately, timeout handlers must be lisp functions. */ - defsymbol (&Qx_selection_reply_timeout_internal, - "x-selection-reply-timeout-internal"); - DEFSUBR (Fx_selection_reply_timeout_internal); - - defsymbol (&QPRIMARY, "PRIMARY"); - defsymbol (&QSECONDARY, "SECONDARY"); - defsymbol (&QSTRING, "STRING"); - defsymbol (&QINTEGER, "INTEGER"); - defsymbol (&QCLIPBOARD, "CLIPBOARD"); - defsymbol (&QTIMESTAMP, "TIMESTAMP"); - defsymbol (&QTEXT, "TEXT"); - defsymbol (&QDELETE, "DELETE"); - defsymbol (&QMULTIPLE, "MULTIPLE"); - defsymbol (&QINCR, "INCR"); - defsymbol (&QEMACS_TMP, "_EMACS_TMP_"); - defsymbol (&QTARGETS, "TARGETS"); - defsymbol (&QATOM, "ATOM"); - defsymbol (&QATOM_PAIR, "ATOM_PAIR"); - defsymbol (&QCOMPOUND_TEXT, "COMPOUND_TEXT"); - defsymbol (&QNULL, "NULL"); - -#ifdef CUT_BUFFER_SUPPORT - defsymbol (&QCUT_BUFFER0, "CUT_BUFFER0"); - defsymbol (&QCUT_BUFFER1, "CUT_BUFFER1"); - defsymbol (&QCUT_BUFFER2, "CUT_BUFFER2"); - defsymbol (&QCUT_BUFFER3, "CUT_BUFFER3"); - defsymbol (&QCUT_BUFFER4, "CUT_BUFFER4"); - defsymbol (&QCUT_BUFFER5, "CUT_BUFFER5"); - defsymbol (&QCUT_BUFFER6, "CUT_BUFFER6"); - defsymbol (&QCUT_BUFFER7, "CUT_BUFFER7"); -#endif /* CUT_BUFFER_SUPPORT */ - - deferror (&Qselection_conversion_error, - "selection-conversion-error", - "selection-conversion error", Qio_error); -} - -void -vars_of_xselect (void) -{ -#ifdef CUT_BUFFER_SUPPORT - cut_buffers_initialized = 0; - Fprovide (intern ("cut-buffer")); -#endif - - reading_selection_reply = 0; - reading_which_selection = 0; - selection_reply_timed_out = 0; - for_whom_the_bell_tolls = 0; - prop_location_tick = 0; - - Vselection_alist = Qnil; - staticpro (&Vselection_alist); - - DEFVAR_LISP ("selection-converter-alist", &Vselection_converter_alist /* -An alist associating selection-types (such as STRING and TIMESTAMP) with -functions. These functions will be called with three args: the name of the -selection (typically PRIMARY, SECONDARY, or CLIPBOARD); a desired type to -which the selection should be converted; and the local selection value - (whatever had been passed to `x-own-selection'). These functions should -return the value to send to the X server, which should be one of: - --- nil (the conversion could not be done) --- a cons of a symbol and any of the following values; the symbol - explicitly specifies the type that will be sent. --- a string (If the type is not specified, then if Mule support exists, - the string will be converted to Compound Text and sent in - the 'COMPOUND_TEXT format; otherwise (no Mule support), - the string will be left as-is and sent in the 'STRING - format. If the type is specified, the string will be - left as-is (or converted to binary format under Mule). - In all cases, 8-bit data it sent.) --- a character (With Mule support, will be converted to Compound Text - whether or not a type is specified. If a type is not - specified, a type of 'STRING or 'COMPOUND_TEXT will be - sent, as for strings.) --- the symbol 'NULL (Indicates that there is no meaningful return value. - Empty 32-bit data with a type of 'NULL will be sent.) --- a symbol (Will be converted into an atom. If the type is not specified, - a type of 'ATOM will be sent.) --- an integer (Will be converted into a 16-bit or 32-bit integer depending - on the value. If the type is not specified, a type of - 'INTEGER will be sent.) --- a cons (HIGH . LOW) of integers (Will be converted into a 32-bit integer. - If the type is not specified, a type of - 'INTEGER will be sent.) --- a vector of symbols (Will be converted into a list of atoms. If the type - is not specified, a type of 'ATOM will be sent.) --- a vector of integers (Will be converted into a list of 16-bit integers. - If the type is not specified, a type of 'INTEGER - will be sent.) --- a vector of integers and/or conses (HIGH . LOW) of integers - (Will be converted into a list of 16-bit integers. - If the type is not specified, a type of 'INTEGER - will be sent.) -*/ ); - Vselection_converter_alist = Qnil; - - DEFVAR_LISP ("x-lost-selection-hooks", &Vx_lost_selection_hooks /* -A function or functions to be called after the X server has notified us -that we have lost the selection. The function(s) will be called with one -argument, a symbol naming the selection (typically PRIMARY, SECONDARY, or -CLIPBOARD). -*/ ); - Vx_lost_selection_hooks = Qunbound; - - DEFVAR_LISP ("x-sent-selection-hooks", &Vx_sent_selection_hooks /* -A function or functions to be called after we have responded to some -other client's request for the value of a selection that we own. The -function(s) will be called with four arguments: - - the name of the selection (typically PRIMARY, SECONDARY, or CLIPBOARD); - - the name of the selection-type which we were requested to convert the - selection into before sending (for example, STRING or LENGTH); - - and whether we successfully transmitted the selection. -We might have failed (and declined the request) for any number of reasons, -including being asked for a selection that we no longer own, or being asked -to convert into a type that we don't know about or that is inappropriate. -This hook doesn't let you change the behavior of emacs's selection replies, -it merely informs you that they have happened. -*/ ); - Vx_sent_selection_hooks = Qunbound; - - DEFVAR_INT ("x-selection-timeout", &x_selection_timeout /* -If the selection owner doesn't reply in this many seconds, we give up. -A value of 0 means wait as long as necessary. This is initialized from the -\"*selectionTimeout\" resource (which is expressed in milliseconds). -*/ ); - x_selection_timeout = 0; -} - -void -Xatoms_of_xselect (struct device *d) -{ - Display *D = DEVICE_X_DISPLAY (d); - - /* Non-predefined atoms that we might end up using a lot */ - DEVICE_XATOM_CLIPBOARD (d) = XInternAtom (D, "CLIPBOARD", False); - DEVICE_XATOM_TIMESTAMP (d) = XInternAtom (D, "TIMESTAMP", False); - DEVICE_XATOM_TEXT (d) = XInternAtom (D, "TEXT", False); - DEVICE_XATOM_DELETE (d) = XInternAtom (D, "DELETE", False); - DEVICE_XATOM_MULTIPLE (d) = XInternAtom (D, "MULTIPLE", False); - DEVICE_XATOM_INCR (d) = XInternAtom (D, "INCR", False); - DEVICE_XATOM_TARGETS (d) = XInternAtom (D, "TARGETS", False); - DEVICE_XATOM_NULL (d) = XInternAtom (D, "NULL", False); - DEVICE_XATOM_ATOM_PAIR (d) = XInternAtom (D, "ATOM_PAIR", False); - DEVICE_XATOM_COMPOUND_TEXT (d) = XInternAtom (D, "COMPOUND_TEXT", False); - DEVICE_XATOM_EMACS_TMP (d) = XInternAtom (D, "_EMACS_TMP_", False); -} diff --git a/tests/basic-lisp.el b/tests/basic-lisp.el deleted file mode 100644 index 07a2676..0000000 --- a/tests/basic-lisp.el +++ /dev/null @@ -1,89 +0,0 @@ -;;; Test basic Lisp functionality - -;;(when (not (boundp 'foo)) (setq foo 1)) -;;(incf foo) -;;(print foo) - -(let ((my-vector [1 2 3 4]) - (my-bit-vector (bit-vector 1 0 1 0)) - (my-string "1234") - (my-list '(1 2 3 4))) - - ;;(Assert (fooooo)) ;; Generate Other failure - ;;(Assert (eq 1 2)) ;; Generate Assertion failure - - (Assert (eq (elt my-vector 0) 1)) - (Assert (eq (elt my-bit-vector 0) 1)) - (Assert (eq (elt my-string 0) ?1)) - (Assert (eq (elt my-list 0) 1)) - - (Assert (eq 4 (length my-vector))) - (Assert (eq 4 (length my-bit-vector))) - (Assert (eq 4 (length my-string))) - - (fillarray my-vector 5) - (fillarray my-bit-vector 1) - (fillarray my-string ?5) - - (Assert (eq 4 (length my-vector))) - (Assert (eq 4 (length my-bit-vector))) - (Assert (eq 4 (length my-string))) - - (Assert (eq (elt my-vector 0) 5)) - (Assert (eq (elt my-bit-vector 0) 1)) - (Assert (eq (elt my-string 0) ?5)) - - (Assert (eq (elt my-vector 3) 5)) - (Assert (eq (elt my-bit-vector 3) 1)) - (Assert (eq (elt my-string 3) ?5)) - - (fillarray my-bit-vector 0) - (Assert (eq 4 (length my-bit-vector))) - (Assert (eq (elt my-bit-vector 2) 0)) - - ;; Test nconc - (let ((x (list 0 1 2))) - (Assert (eq (nconc) nil)) - (Assert (eq (nconc nil) nil)) - (Assert (eq (nconc nil x) x)) - (Assert (eq (nconc x nil) x)) - (let ((y (nconc x nil (list 3 4 5) nil))) - (Assert (eq (length y) 6)) - (Assert (eq (nth 3 y) 3)) - )) - ) - -;;; Old cruft -;;;(run-tests) - -;(defmacro Assert (assertion) -; `(condition-case error -; (progn -; (assert ,assertion) -; (princ (format "Assertion passed: %S" (quote ,assertion))) -; (terpri) -; (incf Assert-successes)) -; (cl-assertion-failed -; (princ (format "Assertion failed: %S" (quote ,assertion))) -; (terpri) -; (incf Assert-failures)) -; (t (princ (format "Test harness error: %S" error)) -; (terpri) -; (incf Harness-failures) -; ))) - - -;(defun run-tests () -; (with-output-to-temp-buffer "*Test-Log*" -; (let ((Assert-successes 0) -; (Assert-failures 0) -; (Harness-failures 0)) -; (basic-lisp-test) -; (byte-compile 'basic-lisp-test) -; (basic-lisp-test) -; (print (format "%d successes, %d assertion failures, %d harness failures" -; Assert-successes -; Assert-failures -; Harness-failures))))) - -;(defun the-test () diff --git a/tests/database.el b/tests/database.el deleted file mode 100644 index bc133df..0000000 --- a/tests/database.el +++ /dev/null @@ -1,29 +0,0 @@ -;;; Test database functionality - -(defun test-database (db) - (Assert (databasep db)) - (put-database "key1" "val1" db) - (Assert (equal "val1" (get-database "key1" db))) - (remove-database "key1" db) - (Assert (equal nil (get-database "key1" db))) - (close-database db) - (Assert (not (database-live-p db))) - (Assert (databasep db)) - (let ((filename (database-file-name db))) - (loop for fn in (list filename (concat filename ".db")) do - (when (file-exists-p fn) - (delete-file fn)))) - ) - -(let ((filename (expand-file-name "test-emacs" (temp-directory)))) - - (when (featurep 'dbm) - (let ((db (open-database filename 'dbm))) - (test-database db))) - - (princ "\n") - - (when (featurep 'berkeley-db) - (let ((db (open-database filename 'berkeley-db))) - (test-database db))) - ) diff --git a/tests/test-emacs.el b/tests/test-emacs.el deleted file mode 100644 index bd34433..0000000 --- a/tests/test-emacs.el +++ /dev/null @@ -1,219 +0,0 @@ -;; test-emacs.el --- Run Emacs Lisp test suites. - -;;; Copyright (C) 1998 Free Software Foundation, Inc. - -;; Author: Martin Buchholz -;; Keywords: testing - -;; This file is part of XEmacs. - -;; XEmacs is free software; you can redistribute it and/or modify it -;; under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; XEmacs is distributed in the hope that it will be useful, but -;; WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. - -;;; Synched up with: Not in FSF - -(defvar test-emacs-verbose - (and (not noninteractive) (> (device-baud-rate) search-slow-speed)) - "*Non-nil means print messages describing progress of emacs-tester.") - -(defvar test-emacs-current-file nil) - -(defvar emacs-lisp-file-regexp (purecopy "\\.el$") - "*Regexp which matches Emacs Lisp source files.") - -(defun test-emacs-test-file (filename) - "Test a file of Lisp code named FILENAME. -The output file's name is made by appending `c' to the end of FILENAME." - ;; (interactive "fTest file: ") - (interactive - (let ((file buffer-file-name) - (file-name nil) - (file-dir nil)) - (and file - (eq (cdr (assq 'major-mode (buffer-local-variables))) - 'emacs-lisp-mode) - (setq file-name (file-name-nondirectory file) - file-dir (file-name-directory file))) - (list (read-file-name "Test file: " file-dir nil nil file-name)))) - ;; Expand now so we get the current buffer's defaults - (setq filename (expand-file-name filename)) - - ;; If we're testing a file that's in a buffer and is modified, offer - ;; to save it first. - (or noninteractive - (let ((b (get-file-buffer (expand-file-name filename)))) - (if (and b (buffer-modified-p b) - (y-or-n-p (format "save buffer %s first? " (buffer-name b)))) - (save-excursion (set-buffer b) (save-buffer))))) - - (if (or noninteractive test-emacs-verbose) - (message "Testing %s..." filename)) - (let ((test-emacs-current-file filename) - input-buffer) - (save-excursion - (setq input-buffer (get-buffer-create " *Test Input*")) - (set-buffer input-buffer) - (erase-buffer) - (insert-file-contents filename) - ;; Run hooks including the uncompression hook. - ;; If they change the file name, then change it for the output also. - (let ((buffer-file-name filename) - (default-major-mode 'emacs-lisp-mode) - (enable-local-eval nil)) - (normal-mode) - (setq filename buffer-file-name))) - (test-emacs-from-buffer input-buffer filename) - (kill-buffer input-buffer) - )) - -(defun test-emacs-read-from-buffer (buffer) - "Read forms from BUFFER, and turn it into a lambda test form." - (let ((body nil)) - (goto-char (point-min) buffer) - (condition-case nil - (while t - (setq body (cons (read inbuffer) body))) - (error nil)) - `(lambda () - (defvar passes) - (defvar assertion-failures) - (defvar other-failures) - ,@(nreverse body)))) - -(defun test-emacs-from-buffer (inbuffer filename) - "Run tests in buffer INBUFFER, visiting FILENAME." - (let ((passes 0) - (assertion-failures 0) - (other-failures 0)) - (with-output-to-temp-buffer "*Test-Log*" - (defmacro Assert (assertion) - `(condition-case error - (progn - (assert ,assertion) - (princ (format "PASS: %S" (quote ,assertion))) - (terpri) - (incf passes)) - (cl-assertion-failed - (princ (format "Assertion failed: %S" (quote ,assertion))) - (terpri) - (incf assertion-failures)) - (t (princ "Error during test execution:\n\t") - (display-error error nil) - (terpri) - (incf other-failures) - ))) - - (princ "Testing Interpreted Lisp\n\n") - (funcall (test-emacs-read-from-buffer inbuffer)) - (princ "\nTesting Compiled Lisp\n\n") - (funcall (byte-compile (test-emacs-read-from-buffer inbuffer))) - (princ (format - "\nSUMMARY: %d passes, %d assertion failures, %d other failures\n" - passes - assertion-failures - other-failures)) - (let* ((total (+ passes assertion-failures other-failures)) - (basename (file-name-nondirectory filename)) - (summary-msg - (if (> total 0) - (format "%s: %d of %d (%d%%) tests successful." - basename passes total (/ (* 100 passes) total)) - (format "%s: No tests run" basename)))) - (message "%s" summary-msg)) - (fmakunbound 'Assert)))) - -(defvar test-emacs-results-point-max nil) -(defmacro displaying-emacs-test-results (&rest body) - `(let ((test-emacs-results-point-max test-emacs-results-point-max)) - ;; Log the file name. - (test-emacs-log-file) - ;; Record how much is logged now. - ;; We will display the log buffer if anything more is logged - ;; before the end of BODY. - (or test-emacs-results-point-max - (save-excursion - (set-buffer (get-buffer-create "*Test-Log*")) - (setq test-emacs-results-point-max (point-max)))) - (unwind-protect - (condition-case error-info - (progn ,@body) - (error - (test-emacs-report-error error-info))) - (save-excursion - ;; If there were compilation warnings, display them. - (set-buffer "*Test-Log*") - (if (= test-emacs-results-point-max (point-max)) - nil - (if temp-buffer-show-function - (let ((show-buffer (get-buffer-create "*Test-Log-Show*"))) - (save-excursion - (set-buffer show-buffer) - (setq buffer-read-only nil) - (erase-buffer)) - (copy-to-buffer show-buffer - (save-excursion - (goto-char test-emacs-results-point-max) - (forward-line -1) - (point)) - (point-max)) - (funcall temp-buffer-show-function show-buffer)) - (select-window - (prog1 (selected-window) - (select-window (display-buffer (current-buffer))) - (goto-char test-emacs-results-point-max) - (recenter 1))))))))) - -(defun batch-test-emacs-1 (file) - (condition-case err - (progn (test-emacs-test-file file) t) - (error - (princ ">>Error occurred processing ") - (princ file) - (princ ": ") - (display-error err nil) - (terpri) - nil))) - -(defun batch-test-emacs () - "Run `test-emacs' on the files remaining on the command line. -Use this from the command line, with `-batch'; -it won't work in an interactive Emacs. -Each file is processed even if an error occurred previously. -For example, invoke \"xemacs -batch -f batch-test-emacs tests/*.el\"" - ;; command-line-args-left is what is left of the command line (from - ;; startup.el) - (defvar command-line-args-left) ;Avoid 'free variable' warning - (if (not noninteractive) - (error "`batch-test-emacs' is to be used only with -batch")) - (let ((error nil) - (debug-issue-ebola-notices 0)) - (loop for file in command-line-args-left - do - (if (file-directory-p (expand-file-name file)) - (let ((files (directory-files file)) - source) - (while files - (if (and (string-match emacs-lisp-file-regexp (car files)) - (not (auto-save-file-name-p (car files))) - (setq source (expand-file-name - (car files) - file)) - (if (null (batch-test-emacs-1 source)) - (setq error t))) - (setq files (cdr files))))) - (if (null (batch-test-emacs-1 file)) - (setq error t)))) - (message "Done") - (kill-emacs (if error 1 0))))