Commits

Anonymous committed 4c02b93

initial package source

Comments (0)

Files changed (65)

+install-sh
+mkinstalldirs
+missing
+Makefile.in
+Makefile
+aclocal.m4
+configure
+config.log
+config.status
+config.cache
+Copyright (C) 1998-2003 Daiki Ueno
+Copyright (C) 1989 Tor Lillqvist
+
+Riece is mainly written by Daiki Ueno <ueno@unixuser.org>.
+
+The development of Riece has started to redesign the Liece IRC client.
+Liece is based on Irchat (version 3.01) which has been distributed
+under GNU General Public License version 1 or later.  Liece was mainly
+written by the same author of Riece.  Tor Lillqvist <tml@iki.fi> is
+the original author of Irchat.  See doc/irchat-copyright.el for the
+original copyright statement of Irchat.
+
+Riece has code borrowed from other elisp packages such as Gnus,
+Emacs-w3m, ECB, and SEMI.  I would like to thank the developers of
+these packages.
+
+Other authors:
+
+TAKAHASHI Kaoru  <kaoru@kaisei.org>
+OHASHI Akira  <bg66@koka-in.org>
+Yoichi NAKAYAMA  <yoichi@geiin.org>
+2003-10-24  Daiki Ueno  <ueno@unixuser.org>
+
+	* Riece: Version 0.1.5 released.
+	* configure.ac: Bump up version to 0.1.5.
+
+2003-10-19  Daiki Ueno  <ueno@unixuser.org>
+
+	* Riece: Version 0.1.4 released.
+	* configure.ac: Bump up version to 0.1.4.
+
+2003-10-13  Daiki Ueno  <ueno@unixuser.org>
+
+	* Riece: Version 0.1.3 released.
+	* configure.ac: Bump up version to 0.1.3.
+
+2003-10-05  Daiki Ueno  <ueno@unixuser.org>
+
+	* Riece: Version 0.1.2 released.
+	* configure.ac: Bump up version to 0.1.2.
+
+2003-08-30  Daiki Ueno  <ueno@unixuser.org>
+
+	* Riece: Version 0.1.1 released.
+	* configure.ac: Bump up version to 0.1.1.
+
+2003-08-25  Daiki Ueno  <ueno@unixuser.org>
+
+	* Riece: Version 0.1.0 released.
+	* configure.ac: Bump up version to 0.1.0.
+
+2003-08-03  Daiki Ueno  <ueno@unixuser.org>
+
+	* Riece: Version 0.0.4 released.
+	* configure.ac: Bump up version to 0.0.4.
+
+2003-06-02  Daiki Ueno  <ueno@unixuser.org>
+
+	* Riece: Version 0.0.3 released.
+	* configure.ac: Bump up version to 0.0.3.
+
+	* Makefile.am (SUBDIRS): Add doc.
+
+2003-06-01  Daiki Ueno  <ueno@unixuser.org>
+
+	* configure.ac: Simplified.
+	* Makefile.am (SUBDIRS): Remove dcc.
+
+2003-05-30  Daiki Ueno  <ueno@unixuser.org>
+
+	* Riece: Version 0.0.2 released.
+	* configure.ac: Bump up version to 0.0.2.
+
+	* INSTALL-CVS: New file.
+	* Makefile.am (EXTRA_DIST): Add INSTALL-CVS.
+
+2003-05-29  Daiki Ueno  <ueno@unixuser.org>
+
+	* Makefile.am (AUTOMAKE_OPTIONS): Add "no-dependencies".
+
+2003-05-29  Daiki Ueno  <ueno@unixuser.org>
+
+	* Riece: Version 0.0.1 released.
+
+Development of Riece uses CVS, Concurrent Versions System.
+Latest developing version is available at CVS.
+
+(0) logging in to anonymous CVS server.
+
+  % cvs -d :pserver:anonymous@cvs.m17n.org:/cvs/root login
+
+  CVS password: [CR] # NULL string
+
+(1) checkout modules
+
+  % cvs -d :pserver:anonymous@cvs.m17n.org:/cvs/root checkout riece
+
+Specify revision tag in front of the module name.
+
+(2) bootstrapping
+
+  % autoreconf -f -i
+
+You will need newer versions of autoconf & automake.
+SUBDIRS = lisp doc
+EXTRA_DIST = INSTALL-CVS
+AUTOMAKE_OPTIONS = no-dependencies
+
+install-package package:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@) \
+	done
Empty file added.
+* What's this?
+
+Riece is an IRC client for Emacs.  The development has started to
+redesign the Liece IRC client.
+
+Riece provides the following features:
+
+- Several IRC servers may be used at the same time.
+- Essential features can be built upon the extension framework (called
+  "add-on") capable of dependency tracking.
+- Installation is easy.  Riece doesn't depend on other packages.
+- Setup is easy.  Automatically save/restore the configuration.
+- Riece uses separate windows to display users, channels, and
+  dialogues.  The user can select the window layout.
+- Step-by-step instructions (currently written in Japanese) are included.
+- Mostly compliant with RFC 2812.
+
+* Directory tree
+
+This package contains following directories:
+
+lisp/ - Emacs Lisp files.
+doc/  - Documentation files.
+
+* Requirements
+
+- Emacs 20.7 or later / XEmacs 21.4 or later
+- Ruby 1.6 or later (optional)
+
+* Installation
+
+$ ./configure
+$ sudo make install
+
+If you are using XEmacs and want to install as a package, supply
+"--with-xemacs" option to the configure script and use
+"install-package" target instead of "install".
+
+* Bug reports
+
+If you write bug reports and/or suggestions for improvement, 
+please send them to the Liece Mailing List.
+
+This mailing list is also for other general discussions (about
+future enhancements, customization, etc). To join the Liece ML,
+send an e-mail to:
+
+     liece-ctl@unixuser.org
+
+with the message body, 
+
+     subscribe Your Name
+AC_DEFUN(AC_DEFINE_GNUS_PRODUCT_NAME,
+ [echo $ac_n "defining gnus product name... $ac_c"
+  AC_CACHE_VAL(EMACS_cv_GNUS_PRODUCT_NAME,[EMACS_cv_GNUS_PRODUCT_NAME=$1])
+  GNUS_PRODUCT_NAME=${EMACS_cv_GNUS_PRODUCT_NAME}
+  AC_MSG_RESULT(${GNUS_PRODUCT_NAME})
+  AC_SUBST(GNUS_PRODUCT_NAME)])
+
+AC_DEFUN(AC_CHECK_EMACS,
+ [dnl Check for Emacsen.
+
+  dnl Apparently, if you run a shell window in Emacs, it sets the EMACS
+  dnl environment variable to 't'.  Lets undo the damage.
+  test "$EMACS" = t && EMACS=
+
+  dnl Ignore cache.
+  unset ac_cv_prog_EMACS; unset ac_cv_prog_XEMACS;
+
+  AC_ARG_WITH(emacs,
+   [  --with-emacs=EMACS      compile with EMACS [EMACS=emacs, mule...]],
+   [if test "$withval" = yes -o -z "$withval"; then
+      AC_CHECK_PROGS(EMACS, emacs xemacs mule, emacs)
+    else
+      AC_CHECK_PROG(EMACS, $withval, $withval, emacs)
+    fi])
+  AC_ARG_WITH(xemacs,
+   [  --with-xemacs=XEMACS    compile with XEMACS [XEMACS=xemacs]],
+   [if test "$withval" = yes -o -z "$withval"; then
+      AC_CHECK_PROG(XEMACS, xemacs, xemacs, xemacs)
+    else
+      AC_CHECK_PROG(XEMACS, $withval, $withval, xemacs)
+    fi
+    EMACS=$XEMACS],
+   [XEMACS=xemacs
+    test -z "$EMACS" && AC_CHECK_PROGS(EMACS, emacs xemacs mule, emacs)])
+  AC_SUBST(EMACS)
+  AC_SUBST(XEMACS)])
+
+AC_DEFUN(AC_EMACS_LISP, [
+elisp="$2"
+if test -z "$3"; then
+	AC_MSG_CHECKING(for $1)
+fi
+AC_CACHE_VAL(EMACS_cv_SYS_$1,[
+	OUTPUT=./conftest-$$
+	echo ${EMACS}' -batch -eval '\''(let ((x '${elisp}')) (write-region (if (stringp x) (princ x) (prin1-to-string x)) nil "'${OUTPUT}'" nil 5))'\' >& AC_FD_CC 2>&1
+	eval ${EMACS}' -batch -eval '\''(let ((x '${elisp}')) (write-region (if (stringp x) (princ x) (prin1-to-string x)) nil "'${OUTPUT}'" nil 5))'\' >& AC_FD_CC 2>&1
+	retval=`cat ${OUTPUT}`
+	echo "=> ${retval}" >& AC_FD_CC 2>&1
+	rm -f ${OUTPUT}
+	EMACS_cv_SYS_$1=$retval
+])
+$1=${EMACS_cv_SYS_$1}
+if test -z "$3"; then
+	AC_MSG_RESULT($$1)
+fi
+])
+
+AC_DEFUN(AC_CHECK_EMACS_FLAVOR,
+ [AC_MSG_CHECKING([what a flavor does $EMACS have])
+
+  dnl Ignore cache.
+  unset EMACS_cv_SYS_flavor;
+
+  AC_EMACS_LISP(flavor,
+    (cond ((featurep (quote xemacs)) \"XEmacs\")\
+          ((boundp (quote MULE)) \"MULE\")\
+          (t \"FSF Emacs\")),
+    "noecho")
+  case $EMACS_cv_SYS_flavor in
+  XEmacs)
+    EMACS_FLAVOR=xemacs;;
+  MULE)
+    EMACS_FLAVOR=mule;;
+  *)
+    EMACS_FLAVOR=emacs;;
+  esac
+  AC_MSG_RESULT($EMACS_cv_SYS_flavor)])
+
+AC_DEFUN(AC_PATH_LISPDIR, [
+  AC_CHECK_EMACS_FLAVOR
+  if test "$prefix" = NONE; then
+	AC_MSG_CHECKING([prefix for your Emacs])
+	AC_EMACS_LISP(prefix,(expand-file-name \"..\" invocation-directory),"noecho")
+	prefix=${EMACS_cv_SYS_prefix}
+	AC_MSG_RESULT($prefix)
+  fi
+  AC_ARG_WITH(lispdir,
+    [  --with-lispdir=DIR      Where to install lisp files
+                          (for XEmacs package, use --with-packagedir instead)],
+    lispdir=${withval})
+  AC_MSG_CHECKING([where lisp files should go])
+  if test -z "$lispdir"; then
+    dnl Set default value
+    theprefix=$prefix
+    if test "$theprefix" = NONE; then
+	theprefix=$ac_default_prefix
+    fi
+    lispdir="\$(datadir)/${EMACS_FLAVOR}/site-lisp/${GNUS_PRODUCT_NAME}"
+    for thedir in share lib; do
+	potential=
+	if test -d ${theprefix}/${thedir}/${EMACS_FLAVOR}/site-lisp; then
+	   lispdir="\$(prefix)/${thedir}/${EMACS_FLAVOR}/site-lisp/${GNUS_PRODUCT_NAME}"
+	   break
+	fi
+    done
+  fi
+  if test ${EMACS_FLAVOR} = xemacs; then
+    AC_MSG_RESULT([$lispdir
+         (it will be ignored when \"make install-package[[-ja]]\" is done)])
+  else
+    AC_MSG_RESULT([$lispdir])
+  fi
+  AC_SUBST(lispdir)
+])
+
+AC_DEFUN(AC_PATH_ETCDIR, [
+  AC_ARG_WITH(etcdir,[  --with-etcdir=DIR       Where to install etc files], etcdir=${withval})
+  AC_MSG_CHECKING([where etc files should go])
+  if test -z "$etcdir"; then
+    dnl Set default value
+    etcdir="\$(lispdir)/../etc"
+  fi
+  AC_MSG_RESULT($etcdir)
+  AC_SUBST(etcdir)
+])
+
+dnl
+dnl Check whether a function exists in a library
+dnl All '_' characters in the first argument are converted to '-'
+dnl
+AC_DEFUN(AC_EMACS_CHECK_LIB, [
+if test -z "$3"; then
+	AC_MSG_CHECKING(for $2 in $1)
+fi
+library=`echo $1 | tr _ -`
+AC_EMACS_LISP($1,(progn (fmakunbound (quote $2)) (condition-case nil (progn (require (quote $library)) (fboundp (quote $2))) (error (prog1 nil (message \"$library not found\"))))),"noecho")
+if test "${EMACS_cv_SYS_$1}" = nil; then
+	EMACS_cv_SYS_$1=no
+fi
+if test "${EMACS_cv_SYS_$1}" = t; then
+	EMACS_cv_SYS_$1=yes
+fi
+HAVE_$1=${EMACS_cv_SYS_$1}
+AC_SUBST(HAVE_$1)
+if test -z "$3"; then
+	AC_MSG_RESULT($HAVE_$1)
+fi
+])
+
+dnl
+dnl Perform sanity checking and try to locate the W3 package
+dnl
+AC_DEFUN(AC_CHECK_W3, [
+AC_MSG_CHECKING(for acceptable W3 version)
+
+dnl Ignore cache.
+unset EMACS_cv_ACCEPTABLE_W3;
+unset EMACS_cv_SYS_w3_dir;
+unset EMACS_cv_SYS_w3_forms;
+
+AC_CACHE_VAL(EMACS_cv_ACCEPTABLE_W3,[
+AC_EMACS_CHECK_LIB(w3_forms, w3-form-encode-xwfu,"noecho")
+if test "${HAVE_w3_forms}" = yes; then
+	EMACS_cv_ACCEPTABLE_W3=yes
+else
+	EMACS_cv_ACCEPTABLE_W3=
+fi
+
+if test "${EMACS_cv_ACCEPTABLE_W3}" = yes; then
+	AC_EMACS_LISP(w3_dir,(file-name-directory (locate-library \"w3-forms\")),"noecho")
+	EMACS_cv_ACCEPTABLE_W3=$EMACS_cv_SYS_w3_dir
+fi
+])
+   AC_ARG_WITH(w3,[  --with-w3=DIR           Specify where to find the w3 package], [ EMACS_cv_ACCEPTABLE_W3=`( cd $withval && pwd || echo "$withval" ) 2> /dev/null` ])
+   W3=${EMACS_cv_ACCEPTABLE_W3}
+   AC_SUBST(W3)
+   if test -z "${EMACS_cv_ACCEPTABLE_W3}"; then
+	AC_MSG_RESULT(not found)
+   else
+	AC_MSG_RESULT(${W3})
+   fi
+])
+
+dnl
+dnl Perform sanity checking and try to locate the W3 package
+dnl
+AC_DEFUN(AC_CHECK_URL, [
+AC_MSG_CHECKING(for acceptable URL version)
+
+dnl Ignore cache.
+unset EMACS_cv_ACCEPTABLE_URL;
+unset EMACS_cv_SYS_url_dir;
+unset EMACS_cv_SYS_url;
+
+AC_CACHE_VAL(EMACS_cv_ACCEPTABLE_URL,[
+AC_EMACS_CHECK_LIB(url, url-retrieve, "noecho")
+if test "${HAVE_url}" = yes; then
+	EMACS_cv_ACCEPTABLE_URL=yes
+else
+	EMACS_cv_ACCEPTABLE_URL=
+fi
+
+if test "${EMACS_cv_ACCEPTABLE_URL}" = yes; then
+	AC_EMACS_LISP(url_dir,(file-name-directory (locate-library \"url\")),"noecho")
+	EMACS_cv_ACCEPTABLE_URL=$EMACS_cv_SYS_url_dir
+fi
+])
+   AC_ARG_WITH(url,[  --with-url=DIR          Specify where to find the url package], [ EMACS_cv_ACCEPTABLE_URL=`( cd $withval && pwd || echo "$withval" ) 2> /dev/null` ])
+   URL=${EMACS_cv_ACCEPTABLE_URL}
+   AC_SUBST(URL)
+   if test -z "${EMACS_cv_ACCEPTABLE_URL}"; then
+	AC_MSG_RESULT(not found)
+   else
+	AC_MSG_RESULT("${URL}")
+   fi
+])
+
+dnl
+dnl Perform checking available fonts: Adobe Bembo, Adobe Futura and 
+dnl Bitstream Courier.
+dnl
+
+AC_DEFUN(GNUS_CHECK_FONTS, [
+test "$LATEX" = t && LATEX=
+test "$LATEX" || AC_PATH_PROGS(LATEX, latex, no)
+AC_MSG_CHECKING(for available fonts)
+AC_ARG_WITH(fonts,[  --with-fonts            Assume all fonts required are available],[USE_FONTS="$withval"])
+WITH_FONTS_bembo='%'
+WITHOUT_FONTS_bembo=
+WITH_FONTS_pfu='%'
+WITHOUT_FONTS_pfu=
+WITH_FONTS_bcr='%'
+WITHOUT_FONTS_bcr=
+if test -z "${USE_FONTS}"; then
+  if test "${LATEX}" = no; then
+	:
+  else
+    OUTPUT=./conftest-$$
+    echo '\nonstopmode\documentclass{article}\usepackage{bembo}\begin{document}\end{document}' > ${OUTPUT}
+    if ${LATEX} ${OUTPUT} </dev/null >& AC_FD_CC 2>&1  ; then  
+      if test -z "${USE_FONTS}"; then
+	USE_FONTS="Adobe Bembo"
+      else
+	USE_FONTS="${USE_FONTS}, Adobe Bembo"
+      fi
+      WITH_FONTS_bembo=
+      WITHOUT_FONTS_bembo='%'
+    fi
+    echo '\nonstopmode\documentclass{article}\begin{document}{\fontfamily{pfu}\fontsize{10pt}{10}\selectfont test}\end{document}' > ${OUTPUT}
+    if retval=`${LATEX} ${OUTPUT} </dev/null 2>& AC_FD_CC`; then
+      if echo "$retval" | grep 'Some font shapes were not available' >& AC_FD_CC 2>&1  ; then  
+	:
+      else
+        if test -z "${USE_FONTS}"; then
+	  USE_FONTS="Adobe Futura"
+        else
+	  USE_FONTS="${USE_FONTS}, Adobe Futura"
+        fi
+        WITH_FONTS_pfu=
+        WITHOUT_FONTS_pfu='%'
+      fi
+    fi
+    echo '\nonstopmode\documentclass{article}\begin{document}{\fontfamily{bcr}\fontsize{10pt}{10}\selectfont test}\end{document}' > ${OUTPUT}
+    if retval=`${LATEX} ${OUTPUT} </dev/null 2>& AC_FD_CC`; then
+      if echo "$retval" | grep 'Some font shapes were not available' >& AC_FD_CC 2>&1  ; then  
+	:
+      else
+        if test -z "${USE_FONTS}"; then
+	  USE_FONTS="Bitstream Courier"
+        else
+	  USE_FONTS="${USE_FONTS}, Bitstream Courier"
+        fi
+        WITH_FONTS_bcr=
+        WITHOUT_FONTS_bcr='%'
+      fi
+    fi
+    rm -f ${OUTPUT} ${OUTPUT}.aux ${OUTPUT}.log ${OUTPUT}.dvi
+  fi
+elif test "${USE_FONTS}" = yes ; then
+  WITH_FONTS_bembo=
+  WITHOUT_FONTS_bembo='%'
+  WITH_FONTS_pfu=
+  WITHOUT_FONTS_pfu='%'
+  WITH_FONTS_bcr=
+  WITHOUT_FONTS_bcr='%'
+fi
+AC_SUBST(WITH_FONTS_bembo)
+AC_SUBST(WITHOUT_FONTS_bembo)
+AC_SUBST(WITH_FONTS_pfu)
+AC_SUBST(WITHOUT_FONTS_pfu)
+AC_SUBST(WITH_FONTS_bcr)
+AC_SUBST(WITHOUT_FONTS_bcr)
+if test -z "${USE_FONTS}" ; then
+  USE_FONTS=no
+fi
+USE_FONTS=`echo "${USE_FONTS}" | sed 's/,\([[^,]]*\)$/ and\1/'`
+AC_MSG_RESULT("${USE_FONTS}")
+if test "${USE_FONTS}" = yes ; then
+  USE_FONTS='Set in Adobe Bembo, Adobe Futura and Bitstream Courier.'
+elif test "${USE_FONTS}" = no ; then
+  USE_FONTS=''
+else
+  USE_FONTS="Set in ${USE_FONTS}."
+fi
+AC_SUBST(USE_FONTS)
+])
+
+AC_DEFUN(AC_EXAMINE_PACKAGEDIR,
+ [dnl Examine PACKAGEDIR.
+  AC_EMACS_LISP(PACKAGEDIR,
+    (let (package-dir)\
+      (if (boundp (quote early-packages))\
+	  (let ((dirs (delq nil (append (if early-package-load-path\
+					    early-packages)\
+					(if late-package-load-path\
+					    late-packages)\
+					(if last-package-load-path\
+					    last-packages)))))\
+	    (while (and dirs (not package-dir))\
+	      (if (file-directory-p (car dirs))\
+		  (setq package-dir (car dirs)\
+			dirs (cdr dirs))))))\
+      (or package-dir \"\")),
+    "noecho")])
+
+AC_DEFUN(AC_PATH_PACKAGEDIR,
+ [dnl Check for PACKAGEDIR.
+  if test ${EMACS_FLAVOR} = xemacs; then
+    AC_MSG_CHECKING([where the XEmacs package is])
+    AC_ARG_WITH(packagedir,
+      [  --with-packagedir=DIR   package DIR for XEmacs],
+      [if test "$withval" != yes -a -n "$withval"; then
+	PACKAGEDIR=$withval
+      else
+	AC_EXAMINE_PACKAGEDIR
+      fi],
+      AC_EXAMINE_PACKAGEDIR)
+    if test -z "$PACKAGEDIR"; then
+      AC_MSG_RESULT(not found)
+    else
+      AC_MSG_RESULT($PACKAGEDIR)
+    fi
+  else
+    PACKAGEDIR=
+  fi
+  AC_SUBST(PACKAGEDIR)])
+
+AC_DEFUN(AC_ADD_LOAD_PATH,
+ [dnl Check for additional load path.
+  AC_ARG_WITH(addpath,
+   [  --with-addpath=PATH     search Emacs-Lisp libraries with PATH
+                          use colons to separate directory names],
+   [if test "$withval" != yes -a -n "$withval"; then
+      AC_MSG_CHECKING([where to find the additional elisp libraries])
+      ADDITIONAL_LOAD_PATH=$withval
+      AC_MSG_RESULT($ADDITIONAL_LOAD_PATH)
+    fi],
+    ADDITIONAL_LOAD_PATH=)
+  AC_SUBST(ADDITIONAL_LOAD_PATH)])
+AC_INIT(configure.ac)
+AC_PREREQ(2.50)
+AM_INIT_AUTOMAKE(riece, 0.1.5)
+
+AC_ISC_POSIX
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+
+AC_CHECK_EMACS
+AC_PATH_LISPDIR
+AC_PATH_PACKAGEDIR
+
+AC_OUTPUT(Makefile \
+lisp/Makefile
+doc/Makefile)
+EXTRA_DIST = texinfo.tex infohack.el ptexinfmt.el irchat-copyright.el
+
+info_TEXINFOS = riece-ja.texi
+riece_ja_TEXINFOS = fdl.texi
+
+package: all
+	$(MAKE) EMACS=$(XEMACS)
+
+install-package: package
+	$(MAKE) infodir=$(PACKAGEDIR)/info install
+
+%-ja.info: %-ja.texi
+	$(EMACS) -batch -q -no-site-file -l ./infohack.el -f batch-makeinfo $<
+
+@node GNU Free Documentation License
+@appendixsec GNU Free Documentation License
+
+@cindex FDL, GNU Free Documentation License
+@center Version 1.1, March 2000
+
+@display
+Copyright @copyright{} 2000 Free Software Foundation, Inc.
+59 Temple Place, Suite 330, Boston, MA  02111-1307, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+@end display
+
+@enumerate 0
+@item
+PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+written document @dfn{free} in the sense of freedom: to assure everyone
+the effective freedom to copy and redistribute it, with or without
+modifying it, either commercially or noncommercially.  Secondarily,
+this License preserves for the author and publisher a way to get
+credit for their work, while not being considered responsible for
+modifications made by others.
+
+This License is a kind of ``copyleft'', which means that derivative
+works of the document must themselves be free in the same sense.  It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does.  But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book.  We recommend this License
+principally for works whose purpose is instruction or reference.
+
+@item
+APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work that contains a
+notice placed by the copyright holder saying it can be distributed
+under the terms of this License.  The ``Document'', below, refers to any
+such manual or work.  Any member of the public is a licensee, and is
+addressed as ``you''.
+
+A ``Modified Version'' of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A ``Secondary Section'' is a named appendix or a front-matter section of
+the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall subject
+(or to related matters) and contains nothing that could fall directly
+within that overall subject.  (For example, if the Document is in part a
+textbook of mathematics, a Secondary Section may not explain any
+mathematics.)  The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The ``Invariant Sections'' are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License.
+
+The ``Cover Texts'' are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License.
+
+A ``Transparent'' copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, whose contents can be viewed and edited directly and
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters.  A copy made in an otherwise Transparent file
+format whose markup has been designed to thwart or discourage
+subsequent modification by readers is not Transparent.  A copy that is
+not ``Transparent'' is called ``Opaque''.
+
+Examples of suitable formats for Transparent copies include plain
+@sc{ascii} without markup, Texinfo input format, La@TeX{} input format,
+@acronym{SGML} or @acronym{XML} using a publicly available
+@acronym{DTD}, and standard-conforming simple @acronym{HTML} designed
+for human modification.  Opaque formats include PostScript,
+@acronym{PDF}, proprietary formats that can be read and edited only by
+proprietary word processors, @acronym{SGML} or @acronym{XML} for which
+the @acronym{DTD} and/or processing tools are not generally available,
+and the machine-generated @acronym{HTML} produced by some word
+processors for output purposes only.
+
+The ``Title Page'' means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page.  For works in
+formats which do not have any title page as such, ``Title Page'' means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+
+@item
+VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no other
+conditions whatsoever to those of this License.  You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute.  However, you may accept
+compensation in exchange for copies.  If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+
+@item
+COPYING IN QUANTITY
+
+If you publish printed copies of the Document numbering more than 100,
+and the Document's license notice requires Cover Texts, you must enclose
+the copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover.  Both covers must also clearly and legibly identify
+you as the publisher of these copies.  The front cover must present
+the full title with all words of the title equally prominent and
+visible.  You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a publicly-accessible computer-network location containing a complete
+Transparent copy of the Document, free of added material, which the
+general network-using public has access to download anonymously at no
+charge using public-standard network protocols.  If you use the latter
+option, you must take reasonably prudent steps, when you begin
+distribution of Opaque copies in quantity, to ensure that this
+Transparent copy will remain thus accessible at the stated location
+until at least one year after the last time you distribute an Opaque
+copy (directly or through your agents or retailers) of that edition to
+the public.
+
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to give
+them a chance to provide you with an updated version of the Document.
+
+@item
+MODIFICATIONS
+
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it.  In addition, you must do these things in the Modified Version:
+
+@enumerate A
+@item
+Use in the Title Page (and on the covers, if any) a title distinct
+from that of the Document, and from those of previous versions
+(which should, if there were any, be listed in the History section
+of the Document).  You may use the same title as a previous version
+if the original publisher of that version gives permission.
+
+@item
+List on the Title Page, as authors, one or more persons or entities
+responsible for authorship of the modifications in the Modified
+Version, together with at least five of the principal authors of the
+Document (all of its principal authors, if it has less than five).
+
+@item
+State on the Title page the name of the publisher of the
+Modified Version, as the publisher.
+
+@item
+Preserve all the copyright notices of the Document.
+
+@item
+Add an appropriate copyright notice for your modifications
+adjacent to the other copyright notices.
+
+@item
+Include, immediately after the copyright notices, a license notice
+giving the public permission to use the Modified Version under the
+terms of this License, in the form shown in the Addendum below.
+
+@item
+Preserve in that license notice the full lists of Invariant Sections
+and required Cover Texts given in the Document's license notice.
+
+@item
+Include an unaltered copy of this License.
+
+@item
+Preserve the section entitled ``History'', and its title, and add to
+it an item stating at least the title, year, new authors, and
+publisher of the Modified Version as given on the Title Page.  If
+there is no section entitled ``History'' in the Document, create one
+stating the title, year, authors, and publisher of the Document as
+given on its Title Page, then add an item describing the Modified
+Version as stated in the previous sentence.
+
+@item
+Preserve the network location, if any, given in the Document for
+public access to a Transparent copy of the Document, and likewise
+the network locations given in the Document for previous versions
+it was based on.  These may be placed in the ``History'' section.
+You may omit a network location for a work that was published at
+least four years before the Document itself, or if the original
+publisher of the version it refers to gives permission.
+
+@item
+In any section entitled ``Acknowledgments'' or ``Dedications'',
+preserve the section's title, and preserve in the section all the
+substance and tone of each of the contributor acknowledgments
+and/or dedications given therein.
+
+@item
+Preserve all the Invariant Sections of the Document,
+unaltered in their text and in their titles.  Section numbers
+or the equivalent are not considered part of the section titles.
+
+@item
+Delete any section entitled ``Endorsements''.  Such a section
+may not be included in the Modified Version.
+
+@item
+Do not retitle any existing section as ``Endorsements''
+or to conflict in title with any Invariant Section.
+@end enumerate
+
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant.  To do this, add their titles to the
+list of Invariant Sections in the Modified Version's license notice.
+These titles must be distinct from any other section titles.
+
+You may add a section entitled ``Endorsements'', provided it contains
+nothing but endorsements of your Modified Version by various
+parties---for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version.  Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity.  If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+
+@item
+COMBINING DOCUMENTS
+
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice.
+
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy.  If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections entitled ``History''
+in the various original documents, forming one section entitled
+``History''; likewise combine any sections entitled ``Acknowledgments'',
+and any sections entitled ``Dedications''.  You must delete all sections
+entitled ``Endorsements.''
+
+@item
+COLLECTIONS OF DOCUMENTS
+
+You may make a collection consisting of the Document and other documents
+released under this License, and replace the individual copies of this
+License in the various documents with a single copy that is included in
+the collection, provided that you follow the rules of this License for
+verbatim copying of each of the documents in all other respects.
+
+You may extract a single document from such a collection, and distribute
+it individually under this License, provided you insert a copy of this
+License into the extracted document, and follow this License in all
+other respects regarding verbatim copying of that document.
+
+@item
+AGGREGATION WITH INDEPENDENT WORKS
+
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, does not as a whole count as a Modified Version
+of the Document, provided no compilation copyright is claimed for the
+compilation.  Such a compilation is called an ``aggregate'', and this
+License does not apply to the other self-contained works thus compiled
+with the Document, on account of their being thus compiled, if they
+are not themselves derivative works of the Document.
+
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one quarter
+of the entire aggregate, the Document's Cover Texts may be placed on
+covers that surround only the Document within the aggregate.
+Otherwise they must appear on covers around the whole aggregate.
+
+@item
+TRANSLATION
+
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections.  You may include a
+translation of this License provided that you also include the
+original English version of this License.  In case of a disagreement
+between the translation and the original English version of this
+License, the original English version will prevail.
+
+@item
+TERMINATION
+
+You may not copy, modify, sublicense, or distribute the Document except
+as expressly provided for under this License.  Any other attempt to
+copy, modify, sublicense or distribute the Document is void, and will
+automatically terminate your rights under this License.  However,
+parties who have received copies, or rights, from you under this
+License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+@item
+FUTURE REVISIONS OF THIS LICENSE
+
+The Free Software Foundation may publish new, revised versions
+of the GNU Free Documentation License from time to time.  Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.  See
+@uref{http://www.gnu.org/copyleft/}.
+
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License ``or any later version'' applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation.  If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation.
+@end enumerate
+
+@page
+@appendixsubsec ADDENDUM: How to use this License for your documents
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+
+@smallexample
+@group
+  Copyright (C)  @var{year}  @var{your name}.
+  Permission is granted to copy, distribute and/or modify this document
+  under the terms of the GNU Free Documentation License, Version 1.1
+  or any later version published by the Free Software Foundation;
+  with the Invariant Sections being @var{list their titles}, with the
+  Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}.
+  A copy of the license is included in the section entitled ``GNU
+  Free Documentation License''.
+@end group
+@end smallexample
+
+If you have no Invariant Sections, write ``with no Invariant Sections''
+instead of saying which ones are invariant.  If you have no
+Front-Cover Texts, write ``no Front-Cover Texts'' instead of
+``Front-Cover Texts being @var{list}''; likewise for Back-Cover Texts.
+
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.
+
+@c Local Variables:
+@c ispell-local-pdict: "ispell-dict"
+@c End:
+
+;;; infohack.el --- a hack to format info file.
+;; Copyright (C)  2001  Free Software Foundation, Inc.
+
+;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
+;; Keywords: info
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;;; Code:
+
+;(let ((default-directory (expand-file-name "../lisp/"))
+;      (features (cons 'w3-forms (copy-sequence features))))
+;  ;; Adjust `load-path' for APEL.
+;  (load-file "dgnushack.el"))
+(load-file (expand-file-name "ptexinfmt.el" "./"))
+
+(defun infohack-remove-unsupported ()
+  (goto-char (point-min))
+  (while (re-search-forward "@\\(end \\)?ifnottex" nil t)
+    (replace-match ""))
+  (goto-char (point-min))
+  (while (search-forward "\n@iflatex\n" nil t)
+    (delete-region (1+ (match-beginning 0))
+		   (search-forward "\n@end iflatex\n"))))
+
+(defun infohack (file)
+  (let ((dest-directory default-directory)
+	(max-lisp-eval-depth (max max-lisp-eval-depth 600))
+	coding-system)
+    (find-file file)
+    (setq buffer-read-only nil)
+    (setq coding-system (if (boundp 'buffer-file-coding-system)
+			    buffer-file-coding-system
+			  file-coding-system))
+    (infohack-remove-unsupported)
+    (texinfo-every-node-update)
+    (texinfo-format-buffer t) ;; Don't save any file.
+    (setq default-directory dest-directory)
+    (setq buffer-file-name
+	  (expand-file-name (file-name-nondirectory buffer-file-name)
+			    default-directory))
+    (setq buffer-file-coding-system coding-system
+	  file-coding-system coding-system)
+    (if (> (buffer-size) 100000)
+	(Info-split))
+    (save-buffer)))
+
+(eval-and-compile
+  (when (string-match "windows-nt\\|os/2\\|emx\\|cygwin"
+                      (symbol-name system-type))
+    (defun subst-char-in-region (START END FROMCHAR TOCHAR &optional NOUNDO)
+      "From START to END, replace FROMCHAR with TOCHAR each time it occurs.
+If optional arg NOUNDO is non-nil, don't record this change for undo
+and don't mark the buffer as really changed.
+Both characters must have the same length of multi-byte form."
+      (let ((original-buffer-undo-list buffer-undo-list)
+            (modified (buffer-modified-p)))
+        (if NOUNDO
+            (setq buffer-undo-list t))
+        (goto-char START)
+        (let ((from (char-to-string FROMCHAR))
+              (to (char-to-string TOCHAR)))
+          (while (search-forward from END t)
+            (replace-match to t t)))
+        (if NOUNDO
+            (progn (setq buffer-undo-list original-buffer-undo-list)
+                   (set-buffer-modidifed-p modified)))))))
+
+(defun batch-makeinfo ()
+  "Emacs makeinfo in batch mode."
+  (infohack-texi-format (car command-line-args-left)
+			(car (cdr command-line-args-left)))
+  (setq command-line-args-left nil))
+
+
+(defun infohack-texi-format (file &optional addsuffix)
+  (let ((auto-save-default nil)
+	(find-file-run-dired nil)
+	coding-system-for-write
+	output-coding-system
+	(error 0))
+    (condition-case err
+	(progn
+	  (find-file file)
+	  (setq buffer-read-only nil)
+	  (buffer-disable-undo (current-buffer))
+	  (if (boundp 'MULE)
+	      (setq output-coding-system file-coding-system)
+	    (setq coding-system-for-write buffer-file-coding-system))
+	  ;; Remove ignored areas first.
+	  (while (re-search-forward "^@ignore[\t\r ]*$" nil t)
+	    (delete-region (match-beginning 0)
+			   (if (re-search-forward
+				"^@end[\t ]+ignore[\t\r ]*$" nil t)
+			       (1+ (match-end 0))
+			     (point-max))))
+	  (infohack-remove-unsupported)
+	  (goto-char (point-min))
+	  ;; Add suffix if it is needed.
+	  (when (and addsuffix
+		     (re-search-forward "^@setfilename[\t ]+\\([^\t\n ]+\\)"
+					nil t)
+		     (not (string-match "\\.info$" (match-string 1))))
+	    (insert ".info")
+	    (goto-char (point-min)))
+	  ;; process @include before updating node
+	  ;; This might produce some problem if we use @lowersection or
+	  ;; such.
+	  (let ((input-directory default-directory)
+		(texinfo-command-end))
+	    (while (re-search-forward "^@include" nil t)
+	      (setq texinfo-command-end (point))
+	      (let ((filename (concat input-directory
+				      (texinfo-parse-line-arg))))
+		(re-search-backward "^@include")
+		(delete-region (point) (save-excursion
+					 (forward-line 1)
+					 (point)))
+		(message "Reading included file: %s" filename)
+		(save-excursion
+		  (save-restriction
+		    (narrow-to-region
+		     (point) (+ (point)
+				(car (cdr (insert-file-contents filename)))))
+		    (goto-char (point-min))
+		    ;; Remove `@setfilename' line from included file,
+		    ;; if any, so @setfilename command not duplicated.
+		    (if (re-search-forward "^@setfilename"
+					   (save-excursion
+					     (forward-line 100)
+					     (point))
+					   t)
+			(progn
+			  (beginning-of-line)
+			  (delete-region (point) (save-excursion
+						   (forward-line 1)
+						   (point))))))))))
+	  (texinfo-mode)
+	  (texinfo-every-node-update)
+	  (set-buffer-modified-p nil)
+	  (message "texinfo formatting %s..." file)
+	  (texinfo-format-buffer nil)
+	  (if (buffer-modified-p)
+	      (progn (message "Saving modified %s" (buffer-file-name))
+		     (save-buffer))))
+      (error
+       (message ">> Error: %s" (prin1-to-string err))
+       (message ">>  point at")
+       (let ((s (buffer-substring (point) (min (+ (point) 100) (point-max))))
+	     (tem 0))
+	 (while (setq tem (string-match "\n+" s tem))
+	   (setq s (concat (substring s 0 (match-beginning 0))
+			   "\n>>  "
+			   (substring s (match-end 0)))
+		 tem (1+ tem)))
+	 (message ">>  %s" s))
+       (setq error 1)))
+    (kill-emacs error)))
+
+;;; infohack.el ends here

doc/irchat-copyright.el

+;;;  -*- emacs-lisp -*-
+;;;
+;;;  $Id$
+;;;
+(defvar irchat-copyright "
+    $Id$
+    Internet Relay CHAT interface for GNU Emacs
+    Copyright (C) 1989 Tor Lillqvist
+ 
+    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 1, 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; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  
+    Author's email address is <tml@hemuli.atk.vtt.fi>
+  
+    Following people have made major improvements to irchat. Also there
+    are numerous people who have given suggestions and improvements. If 
+    you think your name should be included here, give us a note...
+	   Kai Kein�nen		<kmk@iki.fi>
+	   Markku J�rvinen	<mta@cc.tut.fi>
+	   Jukka Partanen      	<jtp@iki.fi>
+	   Kim Nyberg          	<kny@iki.fi>
+	   Tero T. Mononen     	<tmo@iki.fi>
+
+    You can ftp the latest version from cs.hut.fi:/pub/irchat
+
+    There is a mailing list, irchat@cc.tut.fi for those interested
+    in developments in irchat. Mail irchat-request@cc.tut.fi if you
+    are interested in joining.
+
+    Current team is:
+	   Janne Liimatainen	<jsl@iki.fi>
+	   Tero T. Mononen     	<tmo@iki.fi>
+	   Kim Nyberg          	<kny@iki.fi>
+           Tomi Ollila          <too@iki.fi>
+	   Jukka Partanen      	<jtp@iki.fi>
+	   Timo J. Rinne	<tri@iki.fi>
+" "Basically GPL")
+
+;;;
+;;;  $Log$
+;;;  Revision 1.1  2003/10/22 20:07:07  ueno
+;;;  (EXTRA_DIST) Add irchat-copyright.el.
+;;;
+;;;  Revision 3.2  1997/02/27 10:19:14  jsl
+;;;  changed irchat-nickname to irchat-real-nickname
+;;;  users should only change irchat-nickname
+;;;
+;;;Revision 3.1  1997/02/24  16:00:02  tri
+;;;Promoted revision to 3.1.
+;;;
+;;;  Revision 1.2  1997/02/13 09:10:47  tri
+;;;  Added Domo to "current" team.
+;;;
+;;;  Revision 1.1  1996/12/19 14:54:48  tri
+;;;  Initial revision
+;;;
+;;;  Revision 0.1.1  1995/01/15  11:43:37  tmo
+;;;  Initial revision
+;;; 
+;;;  Revision 0.1.2  1993/07/13  11:56:52  tmo
+;;;  	made this file to be defvar
+;;; 
+;;;  Revision 0.1.2  1993/07/13  11:56:52  tmo
+;;;  	made this file to be defvar
+;;; 
+;;;  Revision 0.1.1  1993/07/10  13:23:50  tmo
+;;;  Initial revision
+;;; 
+;;; ptexinfmt.el -- portable Texinfo formatter.
+
+;; Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993,
+;;               1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+;; Copyright (C) 1999 Yoshiki Hayashi <yoshiki@xemacs.org>
+;; Copyright (C) 2000, 2001, 2002 TAKAHASHI Kaoru <kaoru@kaisei.org>
+
+;; Author: TAKAHASHI Kaoru <kaoru@kaisei.org>
+;;	Yoshiki Hayashi <yoshiki@xemacs.org>
+;;	Katsumi Yamaoka <yamaoka@jpl.org>
+;; Maintainer: TAKAHASHI Kaoru <kaoru@kaisei.org>
+;; Created: 7 Jul 2000
+;; Keywords: maint, tex, docs, emulation, compatibility
+
+;; 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.
+
+;;; Commentary:
+
+;; Original code: Yoshiki Hayashi <yoshiki@xemacs.org>
+;;	makeinfo.el (gnujdoc project)
+
+;; Support texinfmt.el 2.32 or later.
+
+;; Modified by Yamaoka not to use APEL functions.
+
+;;; Code:
+
+(require 'backquote)
+(require 'texinfmt)
+
+;;; Broken
+(defvar ptexinfmt-disable-broken-notice-flag t
+  "If non-nil disable notice, when call `ptexinfmt-broken-facility'.
+This is last argument in `ptexinfmt-broken-facility'.")
+
+(put 'ptexinfmt-broken-facility 'lisp-indent-function 'defun)
+(defmacro ptexinfmt-broken-facility (facility docstring assertion
+					      &optional dummy)
+  "Declare a symbol FACILITY is broken if ASSERTION is nil.
+DOCSTRING will be printed if ASSERTION is nil and
+`ptexinfmt-disable-broken-notice-flag' is nil."
+  (` (let ((facility '(, facility))
+	   (docstring (, docstring))
+	   (assertion (eval '(, assertion))))
+       (put facility 'broken (not assertion))
+       (if assertion
+	   nil
+	 (put facility 'broken-docstring docstring)
+	 (if ptexinfmt-disable-broken-notice-flag
+	     nil
+	   (message "BROKEN FACILITY DETECTED: %s" docstring))))))
+
+(put 'ptexinfmt-defun-if-broken 'lisp-indent-function 'defun)
+(defmacro ptexinfmt-defun-if-broken (&rest args)
+  "Redefine a function just like `defun' if it is considered broken."
+  (let ((name (list 'quote (car args))))
+    (setq args (cdr args))
+    (` (prog1
+	   (, name)
+	 (if (get (, name) 'broken)
+	     (defalias (, name)
+	       (function (lambda (,@ args)))))))))
+
+(put 'ptexinfmt-defun-if-void 'lisp-indent-function 'defun)
+(defmacro ptexinfmt-defun-if-void (&rest args)
+  "Define a function just like `defun' unless it is already defined."
+  (let ((name (list 'quote (car args))))
+    (setq args (cdr args))
+    (` (prog1
+	   (, name)
+	 (if (fboundp (, name))
+	     nil
+	   (defalias (, name)
+	     (function (lambda (,@ args)))))))))
+
+(put 'ptexinfmt-defvar-if-void 'lisp-indent-function 'defun)
+(defmacro ptexinfmt-defvar-if-void (&rest args)
+  "Define a variable just like `defvar' unless it is already defined."
+  (let ((name (car args)))
+    (setq args (cdr args))
+    (` (prog1
+	   (defvar (, name))
+	 (if (boundp '(, name))
+	     nil
+	   (defvar (, name) (,@ args)))))))
+
+;; sort -fd
+(ptexinfmt-broken-facility texinfo-format-printindex
+  "Can't sort on Mule for Windows."
+  (if (and (memq system-type '(windows-nt ms-dos))
+;;; I don't know version threshold.
+;;;	   (string< texinfmt-version "2.37 of 24 May 1997")
+	   (boundp 'MULE) (not (featurep 'meadow))) ; Mule for Windows
+      nil
+    t))
+
+;; @var
+(ptexinfmt-broken-facility texinfo-format-var
+  "Don't perse @var argument."
+  (condition-case nil
+      (with-temp-buffer
+	(let (texinfo-enclosure-list texinfo-alias-list)
+	  (texinfo-mode)
+	  (insert "@var{@asis{foo}}\n")
+	  (texinfo-format-expand-region (point-min) (point-max))
+	  t))
+    (error nil)))
+
+;; @xref
+(ptexinfmt-broken-facility texinfo-format-xref
+  "Can't format @xref, 1st argument is empty."
+  (condition-case nil
+      (with-temp-buffer
+	(let (texinfo-enclosure-list texinfo-alias-list)
+	  (texinfo-mode)
+	  (insert "@xref{, xref, , file}\n")
+	  (texinfo-format-expand-region (point-min) (point-max))
+	  t))
+    (error nil)))
+
+;; @uref
+(ptexinfmt-broken-facility texinfo-format-uref
+  "Parse twice @uref argument."
+  (condition-case nil
+      (with-temp-buffer
+	(let (texinfo-enclosure-list texinfo-alias-list)
+	  (texinfo-mode)
+	  (insert "@uref{mailto:foo@@noncommand.example.com}\n")
+	  (texinfo-format-expand-region (point-min) (point-max))
+	  t))
+    (error nil)))
+
+;; @multitable
+(ptexinfmt-broken-facility texinfo-multitable-widths
+  "`texinfo-multitable-widths' unsupport wide-char."
+  (if (fboundp 'texinfo-multitable-widths)
+      (with-temp-buffer
+	(let ((str "$BI}9-J8;z(B"))
+	  (texinfo-mode)
+	  (insert (format " {%s}\n" str))
+	  (goto-char (point-min))
+	  (if (= (car (texinfo-multitable-widths)) (length str))
+	      nil
+	    t)))
+    ;; function definition is void
+    t))
+
+(ptexinfmt-broken-facility texinfo-multitable-item
+  "`texinfo-multitable-item' unsupport wide-char."
+  (not (get 'texinfo-multitable-widths 'broken)))
+
+
+;;; Hardcopy and HTML (discard)
+;; html
+(put 'documentlanguage 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'documentencoding 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'documentdescription 'texinfo-format 'texinfo-discard-line-with-args)
+
+;; size
+(put 'smallbook 'texinfo-format 'texinfo-discard-line)
+(put 'letterpaper 'texinfo-format 'texinfo-discard-line)
+(put 'afourpaper 'texinfo-format 'texinfo-discard-line)
+(put 'afourlatex 'texinfo-format 'texinfo-discard-line)
+(put 'afourwide 'texinfo-format 'texinfo-discard-line)
+(put 'afivepaper 'texinfo-format 'texinfo-discard-line)
+(put 'pagesizes 'texinfo-format 'texinfo-discard-line-with-args)
+
+;; style
+(put 'setchapternewpage 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'kbdinputstyle 'texinfo-format 'texinfo-discard-line-with-args)
+
+;; flags
+(put 'setcontentsaftertitlepage 'texinfo-format 'texinfo-discard-line)
+(put 'setshortcontentsaftertitlepage 'texinfo-format 'texinfo-discard-line)
+(put 'novalidate 'texinfo-format 'texinfo-discard-line-with-args)
+
+;; head & foot
+(put 'headings 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'evenfooting 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'evenheading 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'oddfooting 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'oddheading 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'everyfooting 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'everyheading 'texinfo-format 'texinfo-discard-line-with-args)
+
+;; misc
+(put 'page 'texinfo-format 'texinfo-discard-line)
+(put 'hyphenation 'texinfo-format 'texinfo-discard-command-and-arg)
+
+;; @tie{} (makeinfo 4.3 or later)
+(put 'tie 'texinfo-format 'texinfo-format-tie)
+(ptexinfmt-defun-if-void texinfo-format-tie ()
+  (texinfo-parse-arg-discard)
+  (insert " "))
+
+
+;;; Directory File
+;; @direcategory
+(put 'dircategory 'texinfo-format 'texinfo-format-dircategory)
+(ptexinfmt-defun-if-void texinfo-format-dircategory ()
+  (let ((str (texinfo-parse-arg-discard)))
+    (delete-region (point)
+		   (progn
+		     (skip-chars-forward " ")
+		     (point)))
+    (insert "INFO-DIR-SECTION " str "\n")))
+
+;; @direntry
+(put 'direntry 'texinfo-format 'texinfo-format-direntry)
+(ptexinfmt-defun-if-void texinfo-format-direntry ()
+  (texinfo-push-stack 'direntry nil)
+  (texinfo-discard-line)
+  (insert "START-INFO-DIR-ENTRY\n"))
+
+(put 'direntry 'texinfo-end 'texinfo-end-direntry)
+(ptexinfmt-defun-if-void texinfo-end-direntry ()
+  (texinfo-discard-command)
+  (insert "END-INFO-DIR-ENTRY\n\n")
+  (texinfo-pop-stack 'direntry))
+
+
+;;; Block Enclosing
+;; @detailmenu ... @end detailmenu
+(put 'detailmenu 'texinfo-format 'texinfo-discard-line)
+(put 'detailmenu 'texinfo-end 'texinfo-discard-command)
+
+;; @smalldisplay ... @end smalldisplay
+(put 'smalldisplay 'texinfo-format 'texinfo-format-example)
+(put 'smalldisplay 'texinfo-end 'texinfo-end-example)
+
+;; @smallformat ... @end smallformat
+(put 'smallformat 'texinfo-format 'texinfo-format-flushleft)
+(put 'smallformat 'texinfo-end 'texinfo-end-flushleft)
+
+;; @cartouche  ... @end cartouche
+(put 'cartouche 'texinfo-format 'texinfo-discard-line)
+(put 'cartouche 'texinfo-end 'texinfo-discard-command)
+
+
+;;; Conditional
+;; @ifnottex ... @end ifnottex (makeinfo 3.11 or later)
+(put 'ifnottex 'texinfo-format 'texinfo-discard-line)
+(put 'ifnottex 'texinfo-end 'texinfo-discard-command)
+
+;; @ifnothtml ... @end ifnothtml (makeinfo 3.11 or later)
+(put 'ifnothtml 'texinfo-format 'texinfo-discard-line)
+(put 'ifnothtml 'texinfo-end 'texinfo-discard-command)
+
+;; @ifnotplaintext ... @end ifnotplaintext (makeinfo 4.2 or later)
+(put 'ifnotplaintext 'texinfo-format 'texinfo-discard-line)
+(put 'ifnotplaintext 'texinfo-end 'texinfo-discard-command)
+
+
+;; @ifnotinfo ... @end ifnotinfo (makeinfo 3.11 or later)
+(put 'ifnotinfo 'texinfo-format 'texinfo-format-ifnotinfo)
+(ptexinfmt-defun-if-void texinfo-format-ifnotinfo ()
+  (delete-region texinfo-command-start
+		 (progn (re-search-forward "@end ifnotinfo[ \t]*\n")
+			(point))))
+
+;; @html ... @end html (makeinfo 3.11 or later)
+(put 'html 'texinfo-format 'texinfo-format-html)
+(ptexinfmt-defun-if-void texinfo-format-html ()
+  (delete-region texinfo-command-start
+		 (progn (re-search-forward "@end html[ \t]*\n")
+			(point))))
+
+;; @ifhtml ... @end ifhtml (makeinfo 3.8 or later)
+(put 'ifhtml 'texinfo-format 'texinfo-format-ifhtml)
+(defun texinfo-format-ifhtml ()
+  (delete-region texinfo-command-start
+		 (progn (re-search-forward "@end ifhtml[ \t]*\n")
+			(point))))
+
+;; @ifplaintext ... @end ifplaintext (makeinfo 4.2 or later)
+(put 'ifplaintext 'texinfo-format 'texinfo-format-ifplaintext)
+(ptexinfmt-defun-if-void texinfo-format-ifplaintext ()
+  (delete-region texinfo-command-start
+		 (progn (re-search-forward "@end ifplaintext[ \t]*\n")
+			(point))))
+
+
+
+;;; Marking
+;; @url, @env, @command
+(put 'url 'texinfo-format 'texinfo-format-code)
+(put 'env 'texinfo-format 'texinfo-format-code)
+(put 'command 'texinfo-format 'texinfo-format-code)
+
+;; @acronym
+(put 'acronym 'texinfo-format 'texinfo-format-var)
+
+(ptexinfmt-defun-if-broken texinfo-format-var ()
+  (let ((arg (texinfo-parse-expanded-arg)))
+    (texinfo-discard-command)
+    (insert (upcase arg))))
+
+;; @key
+(put 'key 'texinfo-format 'texinfo-format-key)
+(ptexinfmt-defun-if-void texinfo-format-key ()
+  (insert (texinfo-parse-arg-discard))
+  (goto-char texinfo-command-start))
+
+;; @email{EMAIL-ADDRESS[, DISPLAYED-TEXT]}
+(put 'email 'texinfo-format 'texinfo-format-email)
+(ptexinfmt-defun-if-void texinfo-format-email ()
+  "Format EMAIL-ADDRESS and optional DISPLAYED-TXT.
+Insert < ... > around EMAIL-ADDRESS."
+  (let ((args (texinfo-format-parse-args)))
+  (texinfo-discard-command)
+    ;; if displayed-text
+    (if (nth 1 args)
+	(insert (nth 1 args) " <" (nth 0 args) ">")
+      (insert "<" (nth 0 args) ">"))))
+
+;; @option
+(put 'option 'texinfo-format 'texinfo-format-option)
+(ptexinfmt-defun-if-void texinfo-format-option ()
+  "Insert ` ... ' around arg unless inside a table; in that case, no quotes."
+  ;; `looking-at-backward' not available in v. 18.57, 20.2
+  ;; searched-for character is a control-H
+  (if (not (search-backward "\010"
+			    (save-excursion (beginning-of-line) (point))
+			    t))
+      (insert "`" (texinfo-parse-arg-discard) "'")
+    (insert (texinfo-parse-arg-discard)))
+  (goto-char texinfo-command-start))
+
+;; @verb{<char>TEXT<char>}  (makeinfo 4.1 or later)
+(put 'verb 'texinfo-format 'texinfo-format-verb)
+(ptexinfmt-defun-if-void texinfo-format-verb ()
+  "Format text between non-quoted unique delimiter characters verbatim.
+Enclose the verbatim text, including the delimiters, in braces.  Print
+text exactly as written (but not the delimiters) in a fixed-width.
+
+For example, @verb\{|@|\} results in @ and
+@verb\{+@'e?`!`+} results in @'e?`!`."
+
+  (let ((delimiter (buffer-substring-no-properties
+		    (1+ texinfo-command-end) (+ 2 texinfo-command-end))))
+    (unless (looking-at "{")
+      (error "Not found: @verb start brace"))
+    (delete-region texinfo-command-start (+ 2 texinfo-command-end))
+    (search-forward  delimiter))
+  (delete-backward-char 1)
+  (unless (looking-at "}")
+    (error "Not found: @verb end brace"))
+  (delete-char 1))
+
+
+;;; Accents and Special characters
+;; @pounds{}	==>	#	Pounds Sterling
+(put 'pounds 'texinfo-format 'texinfo-format-pounds)
+(ptexinfmt-defun-if-void texinfo-format-pounds ()
+  (texinfo-parse-arg-discard)
+  (insert "#"))
+
+;; @OE{}	==>	OE	French-OE-ligature
+(put 'OE 'texinfo-format 'texinfo-format-French-OE-ligature)
+(ptexinfmt-defun-if-void texinfo-format-French-OE-ligature ()
+  (insert "OE" (texinfo-parse-arg-discard))
+  (goto-char texinfo-command-start))
+
+;; @oe{}	==>	oe
+(put 'oe 'texinfo-format 'texinfo-format-French-oe-ligature)
+(ptexinfmt-defun-if-void texinfo-format-French-oe-ligature () ; lower case
+  (insert "oe" (texinfo-parse-arg-discard))
+  (goto-char texinfo-command-start))
+
+;; @AA{}	==>	AA	Scandinavian-A-with-circle
+(put 'AA 'texinfo-format 'texinfo-format-Scandinavian-A-with-circle)
+(ptexinfmt-defun-if-void texinfo-format-Scandinavian-A-with-circle ()
+  (insert "AA" (texinfo-parse-arg-discard))
+  (goto-char texinfo-command-start))
+
+;; @aa{}	==>	aa
+(put 'aa 'texinfo-format 'texinfo-format-Scandinavian-a-with-circle)
+(ptexinfmt-defun-if-void texinfo-format-Scandinavian-a-with-circle () ; lower case
+  (insert "aa" (texinfo-parse-arg-discard))
+  (goto-char texinfo-command-start))
+
+;; @AE{}	==>	AE	Latin-Scandinavian-AE
+(put 'AE 'texinfo-format 'texinfo-format-Latin-Scandinavian-AE)
+(ptexinfmt-defun-if-void texinfo-format-Latin-Scandinavian-AE ()
+  (insert "AE" (texinfo-parse-arg-discard))
+  (goto-char texinfo-command-start))
+
+;; @ae{}	==>	ae
+(put 'ae 'texinfo-format 'texinfo-format-Latin-Scandinavian-ae)
+(ptexinfmt-defun-if-void texinfo-format-Latin-Scandinavian-ae () ; lower case
+  (insert "ae" (texinfo-parse-arg-discard))
+  (goto-char texinfo-command-start))
+
+;; @ss{}	==>	ss	German-sharp-S
+(put 'ss 'texinfo-format 'texinfo-format-German-sharp-S)
+(ptexinfmt-defun-if-void texinfo-format-German-sharp-S ()
+  (insert "ss" (texinfo-parse-arg-discard))
+  (goto-char texinfo-command-start))
+
+;; @questiondown{}	==>	?	upside-down-question-mark
+(put 'questiondown 'texinfo-format 'texinfo-format-upside-down-question-mark)
+(ptexinfmt-defun-if-void texinfo-format-upside-down-question-mark ()
+  (insert "?" (texinfo-parse-arg-discard))
+  (goto-char texinfo-command-start))
+
+;; @exclamdown{}	==>	!	upside-down-exclamation-mark
+(put 'exclamdown 'texinfo-format 'texinfo-format-upside-down-exclamation-mark)
+(ptexinfmt-defun-if-void texinfo-format-upside-down-exclamation-mark ()
+  (insert "!" (texinfo-parse-arg-discard))
+  (goto-char texinfo-command-start))
+
+;; @L{}		==>	L/	Polish suppressed-L (Lslash)
+(put 'L 'texinfo-format 'texinfo-format-Polish-suppressed-L)
+(ptexinfmt-defun-if-void texinfo-format-Polish-suppressed-L ()
+  (insert (texinfo-parse-arg-discard) "/L")
+  (goto-char texinfo-command-start))
+
+;; @l{}		==>	l/	Polish suppressed-L (Lslash) (lower case)
+(put 'l 'texinfo-format 'texinfo-format-Polish-suppressed-l-lower-case)
+(ptexinfmt-defun-if-void texinfo-format-Polish-suppressed-l-lower-case ()
+  (insert (texinfo-parse-arg-discard) "/l")
+  (goto-char texinfo-command-start))
+
+;; @O{}		==>	O/	Scandinavian O-with-slash
+(put 'O 'texinfo-format 'texinfo-format-Scandinavian-O-with-slash)
+(ptexinfmt-defun-if-void texinfo-format-Scandinavian-O-with-slash ()
+  (insert (texinfo-parse-arg-discard) "O/")
+  (goto-char texinfo-command-start))
+
+;; @o{}		==>	o/	Scandinavian O-with-slash (lower case)
+(put 'o 'texinfo-format 'texinfo-format-Scandinavian-o-with-slash-lower-case)
+(ptexinfmt-defun-if-void texinfo-format-Scandinavian-o-with-slash-lower-case ()
+  (insert (texinfo-parse-arg-discard) "o/")
+  (goto-char texinfo-command-start))
+
+;; @,{c}	==>	c,	cedilla accent
+(put ', 'texinfo-format 'texinfo-format-cedilla-accent)
+(ptexinfmt-defun-if-void texinfo-format-cedilla-accent ()
+  (insert (texinfo-parse-arg-discard) ",")
+  (goto-char texinfo-command-start))
+
+
+;; @dotaccent{o}	==>	.o	overdot-accent
+(put 'dotaccent 'texinfo-format 'texinfo-format-overdot-accent)
+(ptexinfmt-defun-if-void texinfo-format-overdot-accent ()
+  (insert "." (texinfo-parse-arg-discard))
+  (goto-char texinfo-command-start))
+
+;; @ubaraccent{o}	==>	_o	underbar-accent
+(put 'ubaraccent 'texinfo-format 'texinfo-format-underbar-accent)
+(ptexinfmt-defun-if-void texinfo-format-underbar-accent ()
+  (insert "_" (texinfo-parse-arg-discard))
+  (goto-char texinfo-command-start))
+
+;; @udotaccent{o}	==>	o-.	underdot-accent
+(put 'udotaccent 'texinfo-format 'texinfo-format-underdot-accent)
+(ptexinfmt-defun-if-void texinfo-format-underdot-accent ()
+  (insert (texinfo-parse-arg-discard) "-.")
+  (goto-char texinfo-command-start))
+
+;; @H{o}	==>	""o	long Hungarian umlaut
+(put 'H 'texinfo-format 'texinfo-format-long-Hungarian-umlaut)
+(ptexinfmt-defun-if-void texinfo-format-long-Hungarian-umlaut ()
+  (insert "\"\"" (texinfo-parse-arg-discard))
+  (goto-char texinfo-command-start))
+
+;; @ringaccent{o}	==>	*o	ring accent
+(put 'ringaccent 'texinfo-format 'texinfo-format-ring-accent)
+(ptexinfmt-defun-if-void texinfo-format-ring-accent ()
+  (insert "*" (texinfo-parse-arg-discard))
+  (goto-char texinfo-command-start))
+
+;; @tieaccent{oo}	==>	[oo	tie after accent
+(put 'tieaccent 'texinfo-format 'texinfo-format-tie-after-accent)
+(ptexinfmt-defun-if-void texinfo-format-tie-after-accent ()
+  (insert "[" (texinfo-parse-arg-discard))
+  (goto-char texinfo-command-start))
+
+;; @u{o}	==>	(o	breve accent
+(put 'u 'texinfo-format 'texinfo-format-breve-accent)
+(ptexinfmt-defun-if-void texinfo-format-breve-accent ()
+  (insert "(" (texinfo-parse-arg-discard))
+  (goto-char texinfo-command-start))
+
+;; @v{o}	==>	<o	hacek accent
+(put 'v 'texinfo-format 'texinfo-format-hacek-accent)
+(ptexinfmt-defun-if-void texinfo-format-hacek-accent ()
+  (insert "<" (texinfo-parse-arg-discard))
+  (goto-char texinfo-command-start))
+
+;; @dotless{i}	==>	i	dotless i and dotless j
+(put 'dotless 'texinfo-format 'texinfo-format-dotless)
+(ptexinfmt-defun-if-void texinfo-format-dotless ()
+  (insert (texinfo-parse-arg-discard))
+  (goto-char texinfo-command-start))
+
+;; @.
+(put '\. 'texinfo-format 'texinfo-format-\.)
+(ptexinfmt-defun-if-void texinfo-format-\. ()
+  (texinfo-discard-command)
+  (insert "."))
+
+;; @:
+(put '\: 'texinfo-format 'texinfo-format-\:)
+(ptexinfmt-defun-if-void texinfo-format-\: ()
+  (texinfo-discard-command))
+
+;; @-
+(put '\- 'texinfo-format 'texinfo-format-soft-hyphen)
+(ptexinfmt-defun-if-void texinfo-format-soft-hyphen ()
+  (texinfo-discard-command))
+
+;; @/
+(put '\/ 'texinfo-format 'texinfo-format-\/)
+(ptexinfmt-defun-if-void texinfo-format-\/ ()
+  (texinfo-discard-command))
+
+
+;;; Cross References
+;; @ref, @xref
+(put 'ref 'texinfo-format 'texinfo-format-xref)
+
+(ptexinfmt-defun-if-broken texinfo-format-xref ()
+  (let ((args (texinfo-format-parse-args)))
+    (texinfo-discard-command)
+    (insert "*Note ")
+    (let ((fname (or (nth 1 args) (nth 2 args))))
+      (if (null (or fname (nth 3 args)))
+	  (insert (nth 0 args) "::")
+	(insert (or fname (nth 0 args)) ": ")
+	(if (nth 3 args)
+	    (insert "(" (nth 3 args) ")"))
+	(unless (null (nth 0 args))
+	  (insert (nth 0 args)))))))
+
+;; @uref{URL [,TEXT] [,REPLACEMENT]}
+(put 'uref 'texinfo-format 'texinfo-format-uref)
+(ptexinfmt-defun-if-broken texinfo-format-uref ()
+  "Format URL and optional URL-TITLE.
+Insert ` ... ' around URL if no URL-TITLE argument;
+otherwise, insert URL-TITLE followed by URL in parentheses."
+  (let ((args (texinfo-format-parse-args)))
+    (texinfo-discard-command)
+    ;; if url-title
+    (if (nth 1 args)
+	(insert  (nth 1 args) " (" (nth 0 args) ")")
+      (insert "`" (nth 0 args) "'"))))
+
+;; @inforef
+(put 'inforef 'texinfo-format 'texinfo-format-inforef)
+(ptexinfmt-defun-if-void texinfo-format-inforef ()
+  (let ((args (texinfo-format-parse-args)))
+    (texinfo-discard-command)
+    (if (nth 1 args)
+	(insert "*Note " (nth 1 args) ": (" (nth 2 args) ")" (car args))
+      (insert "*Note " "(" (nth 2 args) ")" (car args) "::"))))
+
+
+;; @anchor
+;; don't emulation
+;; If support @anchor for Mule 2.3, We must fix informat.el and info.el:
+;;  - Info-tagify suport @anthor-*-refill.
+;;  - info.el support Ref in Tag table.
+(unless (get 'anchor 'texinfo-format)
+  (put 'anchor 'texinfo-format 'texinfo-discard-command-and-arg))
+
+
+
+;;; New command definition
+;; @alias NEW=EXISTING
+(put 'alias 'texinfo-format 'texinfo-alias)
+(ptexinfmt-defun-if-void texinfo-alias ()
+  (let ((start (1- (point)))
+	args)
+    (skip-chars-forward " ")
+    (save-excursion (end-of-line) (setq texinfo-command-end (point)))
+    (if (not (looking-at "\\([^=]+\\)=\\(.*\\)"))
+	(error "Invalid alias command")
+      (setq texinfo-alias-list
+	    (cons
+	     (cons
+	      (buffer-substring (match-beginning 1) (match-end 1))
+	      (buffer-substring (match-beginning 2) (match-end 2)))
+	     texinfo-alias-list))
+      (texinfo-discard-command))))
+
+
+;;; Indent
+;; @exampleindent INDENT  (makeinfo 4.0 or later)
+
+;; @paragraphindent INDENT  (makeinfo 4.0 or later)
+;; INDENT: asis, 0, n
+
+;; @firstparagraphindent WORD   (makeinfo 4.6 or later)
+;; WORD: none, insert
+
+
+
+;;; Special
+;; @image{FILENAME [, WIDTH] [, HEIGHT]}
+(put 'image 'texinfo-format 'texinfo-format-image)
+(ptexinfmt-defun-if-void texinfo-format-image ()
+  ;; I don't know makeinfo parse FILENAME.
+  (let ((args (texinfo-format-parse-args))
+	filename)
+    (when (null (nth 0 args))
+      (error "Invalid image command"))
+    (texinfo-discard-command)
+    ;; makeinfo uses FILENAME.txt
+    (setq filename (format "%s.txt" (nth 0 args)))
+    (message "Reading included file: %s" filename)
+    ;; verbatim for Info output
+    (goto-char (+ (point) (cadr (insert-file-contents filename))))
+    (message "Reading included file: %s...done" filename)))
+
+;; @hyphenation command discards an argument within braces
+(put 'hyphenation 'texinfo-format 'texinfo-discard-command-and-arg)
+(ptexinfmt-defun-if-void texinfo-discard-command-and-arg ()
+  "Discard both @-command and its argument in braces."
+  (goto-char texinfo-command-end)
+  (forward-list 1)
+  (setq texinfo-command-end (point))
+  (delete-region texinfo-command-start texinfo-command-end))
+
+
+;;; @multitable ... @end multitable
+(ptexinfmt-defvar-if-void texinfo-extra-inter-column-width 0
+  "*Number of extra spaces between entries (columns) in @multitable.")
+
+(ptexinfmt-defvar-if-void texinfo-multitable-buffer-name
+  "*multitable-temporary-buffer*")
+(ptexinfmt-defvar-if-void texinfo-multitable-rectangle-name
+  "texinfo-multitable-temp-")
+
+;; These commands are defined in texinfo.tex for printed output.
+(put 'multitableparskip 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'multitableparindent 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'multitablecolmargin 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'multitablelinespace 'texinfo-format 'texinfo-discard-line-with-args)
+
+(put 'multitable 'texinfo-format 'texinfo-multitable)
+
+(ptexinfmt-defun-if-void texinfo-multitable ()
+  "Produce multi-column tables."
+
+;; This function pushes information onto the `texinfo-stack'.
+;; A stack element consists of:
+;;   - type-of-command, i.e., multitable
+;;   - the information about column widths, and
+;;   - the position of texinfo-command-start.
+;; e.g., ('multitable (1 2 3 4) 123)
+;; The command line is then deleted.
+  (texinfo-push-stack
+   'multitable
+   ;; push width information on stack
+   (texinfo-multitable-widths))
+  (texinfo-discard-line-with-args))
+
+(put 'multitable 'texinfo-end 'texinfo-end-multitable)
+(ptexinfmt-defun-if-void texinfo-end-multitable ()
+  "Discard the @end multitable line and pop the stack of multitable."
+  (texinfo-discard-command)
+  (texinfo-pop-stack 'multitable))
+
+(ptexinfmt-defun-if-broken texinfo-multitable-widths ()
+  "Return list of widths of each column in a multi-column table."
+  (let (texinfo-multitable-width-list)
+    ;; Fractions format:
+    ;;  @multitable @columnfractions .25 .3 .45
+    ;;
+    ;; Template format:
+    ;;  @multitable {Column 1 template} {Column 2} {Column 3 example}
+    ;; Place point before first argument
+    (skip-chars-forward " \t")
+    (cond
+     ;; Check for common misspelling
+     ((looking-at "@columnfraction ")
+      (error "In @multitable, @columnfractions misspelled"))
+     ;; Case 1: @columnfractions .25 .3 .45
+     ((looking-at "@columnfractions")
+      (forward-word 1)
+      (while (not (eolp))
+	(setq texinfo-multitable-width-list
+	      (cons
+	       (truncate
+		(1-
+		 (* fill-column (read (get-buffer (current-buffer))))))
+	       texinfo-multitable-width-list))))
+     ;;
+     ;; Case 2: {Column 1 template} {Column 2} {Column 3 example}
+     ((looking-at "{")
+      (let ((start-of-templates (point)))
+	(while (not (eolp))
+	  (skip-chars-forward " \t")
+	  (let* ((start-of-template (1+ (point)))
+		 (end-of-template
+		  ;; forward-sexp works with braces in Texinfo mode
+		  (progn (forward-sexp 1) (1- (point)))))
+	    (setq texinfo-multitable-width-list
+		  (cons (- (progn
+			     (goto-char end-of-template)
+			     (current-column))
+			   (progn
+			     (goto-char start-of-template)
+			     (current-column)))
+			texinfo-multitable-width-list))
+	    ;; Remove carriage return from within a template, if any.
+	    ;; This helps those those who want to use more than
+	    ;; one line's worth of words in @multitable line.
+	    (narrow-to-region start-of-template end-of-template)
+	    (goto-char (point-min))
+	    (while (search-forward "\n" nil t)
+	      (delete-char -1))
+	    (goto-char (point-max))
+	    (widen)
+	    (forward-char 1)))))
+     ;;
+     ;; Case 3: Trouble
+     (t
+      (error "\
+You probably need to specify column widths for @multitable correctly")))
+    ;; Check whether columns fit on page.
+    (let ((desired-columns
+	   (+
+	    ;; between column spaces
+	    (length texinfo-multitable-width-list)
+	    ;; additional between column spaces, if any
+	    texinfo-extra-inter-column-width
+	    ;; sum of spaces for each entry
+	    (apply '+ texinfo-multitable-width-list))))
+      (if (> desired-columns fill-column)
+	  (error (format "\
+Multi-column table width, %d chars, is greater than page width, %d chars."
+			 desired-columns fill-column))))
+    texinfo-multitable-width-list))
+
+;; @item  A1  @tab  A2  @tab  A3
+(ptexinfmt-defun-if-void texinfo-multitable-extract-row ()
+  "Return multitable row, as a string.
+End of row is beginning of next @item or beginning of @end.
+Cells within rows are separated by @tab."
+  (skip-chars-forward " \t")
+  (let* ((start (point))
+	 (end (progn
+		(re-search-forward "@item\\|@end")
+		(match-beginning 0)))
+	 (row (progn (goto-char end)
+		     (skip-chars-backward " ")
+		     ;; remove whitespace at end of argument
+		     (delete-region (point) end)
+		     (buffer-substring start (point)))))
+    (delete-region texinfo-command-start end)
+    row))
+
+(put 'multitable 'texinfo-item 'texinfo-multitable-item)
+(ptexinfmt-defun-if-void texinfo-multitable-item ()
+  "Format a row within a multicolumn table.
+Cells in row are separated by @tab.
+Widths of cells are specified by the arguments in the @multitable line.
+All cells are made to be the same height.
+This command is executed when texinfmt sees @item inside @multitable."
+  (let ((original-buffer (current-buffer))
+	(table-widths (reverse (car (cdr (car texinfo-stack)))))
+	(existing-fill-column fill-column)
+	start
+	end
+	(table-column       0)
+	(table-entry-height 0)
+	;; unformatted row looks like:  A1  @tab  A2  @tab  A3
+	;; extract-row command deletes the source line in the table.
+	(unformated-row (texinfo-multitable-extract-row)))
+    ;; Use a temporary buffer
+    (set-buffer (get-buffer-create texinfo-multitable-buffer-name))
+    (delete-region (point-min) (point-max))
+    (insert unformated-row)
+    (goto-char (point-min))
+;; 1. Check for correct number of @tab in line.
+    (let ((tab-number 1)) ;; one @tab between two columns
+      (while (search-forward "@tab" nil t)
+	(setq tab-number (1+ tab-number)))
+      (if (/= tab-number (length table-widths))
+	  (error "Wrong number of @tab's in a @multitable row")))
+    (goto-char (point-min))
+;; 2. Format each cell, and copy to a rectangle
+    ;; buffer looks like this:    A1  @tab  A2  @tab  A3
+    ;; Cell #1: format up to @tab
+    ;; Cell #2: format up to @tab
+    ;; Cell #3: format up to eob
+    (while (not (eobp))
+      (setq start (point))
+      (setq end (save-excursion
+		  (if (search-forward "@tab" nil 'move)
+		      ;; Delete the @tab command, including the @-sign
+		      (delete-region
+		       (point)
+		       (progn (forward-word -1) (1- (point)))))
+		  (point)))
+      ;; Set fill-column *wider* than needed to produce inter-column space
+      (setq fill-column (+ 1
+			   texinfo-extra-inter-column-width
+			   (nth table-column table-widths)))
+      (narrow-to-region start end)
+      ;; Remove whitespace before and after entry.
+      (skip-chars-forward " ")
+      (delete-region (point) (save-excursion (beginning-of-line) (point)))
+      (goto-char (point-max))
+      (skip-chars-backward " ")
+      (delete-region (point) (save-excursion (end-of-line) (point)))
+      ;; Temorarily set texinfo-stack to nil so texinfo-format-scan
+      ;; does not see an unterminated @multitable.
+      (let (texinfo-stack) ;; nil
+	(texinfo-format-scan))
+      (let (fill-prefix) ;; no fill prefix
+	(fill-region (point-min) (point-max)))
+      (setq table-entry-height
+	    (max table-entry-height (count-lines (point-min) (point-max))))
+;; 3. Move point to end of bottom line, and pad that line to fill column.
+      (goto-char (point-min))
+      (forward-line (1- table-entry-height))
+      (let* ((beg (point)) ;; beginning of line
+	     ;; add one more space for inter-column spacing
+	     (needed-whitespace
+	      (1+
+	       (- fill-column
+		  (progn
+		    (end-of-line)
+		    (current-column)))))) ;; end of existing line
+	(insert (make-string
+		 (if (> needed-whitespace 0) needed-whitespace 1)
+		 ? )))
+      ;; now, put formatted cell into a rectangle
+      (set (intern (concat texinfo-multitable-rectangle-name
+			   (int-to-string table-column)))
+	   (extract-rectangle (point-min) (point)))
+      (delete-region (point-min) (point))
+      (goto-char (point-max))
+      (setq table-column (1+ table-column))
+      (widen))
+;; 4. Add extra lines to rectangles so all are of same height
+    (let ((total-number-of-columns table-column)
+	  (column-number 0)
+	  here)
+      (while (> table-column 0)
+	(let ((this-rectangle (int-to-string table-column)))
+	  (while (< (length this-rectangle) table-entry-height)
+	    (setq this-rectangle (append this-rectangle '("")))))
+	(setq table-column (1- table-column)))
+;; 5. Insert formatted rectangles in original buffer
+      (switch-to-buffer original-buffer)
+      (open-line table-entry-height)
+      (while (< column-number total-number-of-columns)
+	(setq here (point))
+	(insert-rectangle
+	 (eval (intern
+		(concat texinfo-multitable-rectangle-name
+			(int-to-string column-number)))))
+	(goto-char here)
+	(end-of-line)
+	(setq column-number (1+ column-number))))
+    (kill-buffer texinfo-multitable-buffer-name)
+    (setq fill-column existing-fill-column)))
+
+