Importing Riece. start
authorueno <ueno>
Thu, 29 May 2003 05:36:43 +0000 (05:36 +0000)
committerueno <ueno>
Thu, 29 May 2003 05:36:43 +0000 (05:36 +0000)
47 files changed:
.cvsignore [new file with mode: 0644]
AUTHORS [new file with mode: 0644]
ChangeLog [new file with mode: 0644]
Makefile.am [new file with mode: 0644]
NEWS [new file with mode: 0644]
README [new file with mode: 0644]
acinclude.m4 [new file with mode: 0644]
configure.ac [new file with mode: 0644]
dcc/.cvsignore [new file with mode: 0644]
dcc/Makefile.am [new file with mode: 0644]
dcc/basename.c [new file with mode: 0644]
dcc/dcc.c [new file with mode: 0644]
dcc/getopt.c [new file with mode: 0644]
dcc/getopt.h [new file with mode: 0644]
dcc/getopt1.c [new file with mode: 0644]
dcc/tcp.c [new file with mode: 0644]
lisp/.cvsignore [new file with mode: 0644]
lisp/COMPILE [new file with mode: 0644]
lisp/ChangeLog.Liece [new file with mode: 0644]
lisp/Makefile.am [new file with mode: 0644]
lisp/riece-000.el [new file with mode: 0644]
lisp/riece-200.el [new file with mode: 0644]
lisp/riece-300.el [new file with mode: 0644]
lisp/riece-400.el [new file with mode: 0644]
lisp/riece-500.el [new file with mode: 0644]
lisp/riece-channel.el [new file with mode: 0644]
lisp/riece-coding.el [new file with mode: 0644]
lisp/riece-commands.el [new file with mode: 0644]
lisp/riece-compat.el [new file with mode: 0644]
lisp/riece-complete.el [new file with mode: 0644]
lisp/riece-display.el [new file with mode: 0644]
lisp/riece-emacs.el [new file with mode: 0644]
lisp/riece-filter.el [new file with mode: 0644]
lisp/riece-globals.el [new file with mode: 0644]
lisp/riece-handle.el [new file with mode: 0644]
lisp/riece-highlight.el [new file with mode: 0644]
lisp/riece-identity.el [new file with mode: 0644]
lisp/riece-inlines.el [new file with mode: 0644]
lisp/riece-message.el [new file with mode: 0644]
lisp/riece-misc.el [new file with mode: 0644]
lisp/riece-naming.el [new file with mode: 0644]
lisp/riece-options.el [new file with mode: 0644]
lisp/riece-server.el [new file with mode: 0644]
lisp/riece-user.el [new file with mode: 0644]
lisp/riece-version.el [new file with mode: 0644]
lisp/riece-xemacs.el [new file with mode: 0644]
lisp/riece.el [new file with mode: 0644]

diff --git a/.cvsignore b/.cvsignore
new file mode 100644 (file)
index 0000000..c89a4cb
--- /dev/null
@@ -0,0 +1,10 @@
+install-sh
+mkinstalldirs
+missing
+Makefile.in
+Makefile
+aclocal.m4
+configure
+config.log
+config.status
+config.cache
diff --git a/AUTHORS b/AUTHORS
new file mode 100644 (file)
index 0000000..f5f0da9
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,9 @@
+Riece is written by Daiki Ueno <ueno@unixuser.org>.
+
+Riece is a redesign of the Liece IRC client.  The code is almost
+completely rewritten.
+
+Liece was mainly written by the same author of Riece.  It is based on
+Irchat (version 3.01) which has been distributed under GNU General
+Public License version 1 or later.  Special thanks to Tor Lillqvist,
+the original author of Irchat.
diff --git a/ChangeLog b/ChangeLog
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..b00af1f
--- /dev/null
@@ -0,0 +1,6 @@
+SUBDIRS = lisp dcc
+
+install-package package:
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@) \
+       done
diff --git a/NEWS b/NEWS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..846067f
--- /dev/null
+++ b/README
@@ -0,0 +1,29 @@
+* What's this?
+
+Riece is a redesign of the Liece IRC client.
+
+Note that the letter "R" means not only "redesign" but also "radical
+development version".  Please use at your own risk :-)
+
+* Directory tree
+
+This package contains following directories:
+
+lisp/ - Emacs Lisp files.
+
+dcc/  - DCC external program source.  (currently not used)
+
+* 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
diff --git a/acinclude.m4 b/acinclude.m4
new file mode 100644 (file)
index 0000000..720c918
--- /dev/null
@@ -0,0 +1,359 @@
+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)])
diff --git a/configure.ac b/configure.ac
new file mode 100644 (file)
index 0000000..8094014
--- /dev/null
@@ -0,0 +1,25 @@
+AC_INIT(configure.ac)
+AC_PREREQ(2.50)
+AM_INIT_AUTOMAKE(riece, 0.0.1)
+
+AC_PROG_CC
+AC_ISC_POSIX
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AC_PROG_RANLIB
+
+AC_CHECK_HEADERS(sys/select.h libgen.h)
+
+AC_CHECK_LIB(nsl, gethostbyname)
+AC_CHECK_LIB(socket, socket)
+
+AC_CHECK_FUNCS(strtoul memmove getaddrinfo)
+AC_CHECK_FUNC(getopt_long,,[AC_LIBOBJ(getopt) AC_LIBOBJ(getopt1)])
+AC_REPLACE_FUNCS(basename)
+AC_CHECK_EMACS
+AC_PATH_LISPDIR
+AC_PATH_PACKAGEDIR
+
+AC_OUTPUT(Makefile \
+lisp/Makefile \
+dcc/Makefile)
diff --git a/dcc/.cvsignore b/dcc/.cvsignore
new file mode 100644 (file)
index 0000000..af6ac77
--- /dev/null
@@ -0,0 +1,5 @@
+Makefile.in
+Makefile
+ldcc
+ltcp
+.deps
diff --git a/dcc/Makefile.am b/dcc/Makefile.am
new file mode 100644 (file)
index 0000000..fb8fab0
--- /dev/null
@@ -0,0 +1,14 @@
+DEFS = -I$(srcdir) -I$(top_srcdir) $(CFLAGS) @DEFS@
+LIBOBJS = @LIBOBJS@
+EXTRA_DIST = basename.c getopt.c getopt.h getopt1.c
+CLEANFILES = ldcc ltcp
+
+bin_PROGRAMS = ldcc ltcp
+
+ltcp_SOURCES = tcp.c
+ltcp_LDADD = $(LIBOBJS)
+ldcc_SOURCES = dcc.c
+ldcc_LDADD = $(LIBOBJS)
+
+package: all
+install-package: package install
diff --git a/dcc/basename.c b/dcc/basename.c
new file mode 100644 (file)
index 0000000..8fae497
--- /dev/null
@@ -0,0 +1,40 @@
+/* Return the name-within-directory of a file name.
+   Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <string.h>
+
+#define _LIBC
+#ifndef _LIBC
+/* We cannot generally use the name `basename' since XPG defines an unusable
+   variant of the function but we cannot use it.  */
+# define basename gnu_basename
+#endif
+
+
+char *
+basename (filename)
+     const char *filename;
+{
+  char *p = strrchr (filename, '/');
+  return p ? p + 1 : (char *) filename;
+}
diff --git a/dcc/dcc.c b/dcc/dcc.c
new file mode 100644 (file)
index 0000000..cd0ccd6
--- /dev/null
+++ b/dcc/dcc.c
@@ -0,0 +1,499 @@
+/* dcc.c
+ * Copyright (C) 1998-2002  Daiki Ueno
+ *
+ * This file is part of Liece.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/socket.h>
+#include <sys/file.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <netdb.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <fcntl.h>
+#include <netinet/in.h>
+#define _GNU_SOURCE
+#include <getopt.h>
+
+#ifndef MAXHOSTNAMELEN
+# define MAXHOSTNAMELEN 31
+#endif
+
+#ifdef HAVE_SYS_SELECT_H
+# include <sys/select.h>
+#endif
+
+#ifdef HAVE_MEMMOVE
+# ifdef HAVE_LIBGEN_H
+#  include <libgen.h>
+#  ifdef basename
+#   undef basename
+#  endif
+# endif
+# include <string.h>
+#else
+# define memmove(x,y,z) bcopy((y), (x), (z))
+#endif
+
+#ifndef HAVE_BASENAME
+# define basename(path) (rindex((path), '/') + 1)
+#endif
+
+static void usage();
+static int prepare_listen_port();
+static int prepare_connect_port();
+
+static int receive_file();
+static int send_file();
+static int select_loop();
+static int chat_listen();
+static int chat_connect();
+
+static u_long primary_address_of();
+static u_long extract_addr_of_string();
+static u_long get_address_externally();
+
+static char *progname;
+
+void version () {
+       printf("%s (Liece) 1.4.0\n"
+                                "Copyright (C) 1998, 1999 Daiki Ueno\n"
+                                "This is free software; see the source for copying conditions.  There is NO\n"
+                                "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n", 
+                                progname);
+}
+
+void usage() {
+  printf("Usage: %s [global-options] command [command-options-and-arguments]\n"
+                                "where global-options are -v, -h, etc.\n"
+                                "where command is one of send, receive, chat, resolve.\n"
+                                "where command-options-and-arguments depend on the specific command.\n\n"
+                                "send <host> <port> <filename>\n"
+                                "receive <host> <port> <size> <filename>\n"
+                                "chat listen <port>\n"
+                                "chat connect <host> <port>\n"
+                                "resolve [hosts ...]\n",
+                                progname);
+}
+
+int prepare_listen_port (int ip_port) {
+  int sock, tries;
+  int opt = 1;
+  static struct sockaddr_in server;
+
+  
+  if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
+    perror("opening stream socket");
+    exit(1);
+  }
+
+#ifdef SO_REUSEADDR
+  if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, 
+                (char *)&opt, sizeof (opt)) < 0) {
+    perror ("setsockopt SO_REUSEADDR");
+  }
+#endif
+
+  /* Bind a port to listen for new connections */
+
+  server.sin_family = AF_INET;
+  server.sin_addr.s_addr = INADDR_ANY;
+  server.sin_port = htons (ip_port);
+  for (tries = 0; tries < 10; tries++) {
+    if (bind (sock, (struct sockaddr *) &server, sizeof (server))) {
+      if (tries >= 9) {
+       perror ("binding stream socket");
+       exit (1);
+      }
+      perror ("binding stream socket. retry in 20 seconds");
+      sleep (20);              /* wait 20 seconds and try again */
+    } else
+      break;
+  }
+  listen (sock, 64);
+  return (sock);
+}
+
+u_long get_address_externally(char *ircserver) {
+  int i, len, dummy;
+  u_long addr;
+  struct hostent *hp;
+  struct sockaddr_in server, client;
+
+  addr = 0xc6290004;                          /* dummy addr --- rootA */
+  if (ircserver && (hp = gethostbyname(ircserver)) != NULL) {
+    addr = ntohl(((struct in_addr *)hp->h_addr_list[0])->s_addr);
+  }
+  if ((dummy = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+    perror("opening stream socket");
+    return -1;
+  }
+  server.sin_family = AF_INET;
+  server.sin_addr.s_addr = htonl(addr);
+  server.sin_port = htons(7);                 /* dummy port --- echo */
+  for (i = 0; i < 8; i++) {
+    server.sin_zero[i] = 0;
+  }
+  if (connect(dummy, (struct sockaddr *)&server, sizeof(server)) < 0) {
+    perror ("connecting remote socket");
+    return -1;
+  }
+  len = sizeof(client);
+  if (getsockname(dummy, (struct sockaddr *)&client, &len) < 0) 
+    return -1;
+  close(dummy);
+  return ntohl(client.sin_addr.s_addr);
+}
+
+\f
+/*
+ * send_file(int port, char *ifile)
+ * listens to connections to port, and when connection established
+ * sends ifile to that socket
+ */
+int send_file (int port, char *ifile) {
+  int sock, ifd, ofd, len;
+  u_long addr, bytessent = 0;
+  char buf[ BUFSIZ * 8 ];
+  fd_set readfds, writefds, fdset;
+  struct stat statbuf;
+  char namebuf[ MAXHOSTNAMELEN ];
+  struct hostent *hp;
+  struct sockaddr_in sin;
+
+  if ((ifd = open (ifile, O_RDONLY)) < 0) { 
+    /* error in opening file to send */
+    close(ofd);
+    return 1;
+  }
+
+  gethostname(namebuf, sizeof (namebuf));
+  fstat (ifd, &statbuf);
+
+  sock = prepare_listen_port(port);
+  len = sizeof (struct sockaddr_in);
+  if (getsockname(sock, (struct sockaddr *)&sin, &len) == 0) 
+    port = ntohs(sin.sin_port);
+       if ((addr = get_address_externally (NULL)) < 0) {
+               gethostname(namebuf, sizeof (namebuf));
+               if (hp = gethostbyname(namebuf)) 
+                       addr = ((struct in_addr *) (hp->h_addr_list)[0])->s_addr;
+               else
+                       return 2;
+       }
+
+       printf ("DCC send %s %d %u %d\n", ifile, port, addr, statbuf.st_size);
+  
+  ofd = accept(sock, (struct sockaddr *) 0, (int *) 0);
+  
+  while ((len = read (ifd, buf, sizeof (buf))) > 0) {
+    write (ofd, buf, len);     
+    bytessent += len;
+    while ((len = read (ofd, buf, sizeof (u_long))) &&
+          ntohl (*(u_long *) buf) != bytessent);
+  }
+  close (ofd);
+  close (ifd);
+  printf ("*** DCC file %s sent\n", ifile);
+
+  return 0;
+}
+
+/*
+ * receive_file(u_long host, int port, char *ifile)
+ * connects to (host,port) and reads everything send from there
+ * for every packet received gives back how much actually got
+ * puts everything in ifile
+ */
+int receive_file (u_long host, int port, int size, char *ifile) {
+  int sock, ifd, ofd, len, bytesreceived = 0, toread, prev = 0;
+  char buf[ BUFSIZ * 8 ];
+  fd_set readfds, writefds, fdset;
+  u_long netsize;
+    
+  if ((ofd = open(ifile, O_WRONLY|O_CREAT|O_TRUNC, 0600)) < 0) {
+    fprintf(stderr, "open: opening file: %s\n", ifile);
+    return 1;
+  }
+  ifd = prepare_connect_port (host, port);
+  if ((toread = sizeof (buf)) > size)
+    toread = size;
+  while (bytesreceived < size && (len = read (ifd, buf, toread)) > 0) {
+    write (ofd, buf, len);
+    bytesreceived += len;
+    netsize = htonl (bytesreceived);
+    lseek (ifd, 0, 2);
+    write (ifd, &netsize, 4);
+    lseek (ifd, 0, 2);
+    if (toread > size - bytesreceived)
+      toread = size - bytesreceived;
+    if (bytesreceived - prev > size / 5) {
+      printf ("DCC %s %d%% (%d/%d bytes) received\n", ifile,
+             100 * bytesreceived / size, bytesreceived, size);
+      prev = bytesreceived;
+    }
+  }
+  printf ("*** DCC file %s received\n", ifile);
+  close (ifd);
+  close (ofd);
+
+  return 0;
+}
+
+/*
+ * select_loop(int sfd)
+ * listens fd given, reads stdin and sends it to socket 
+ * anything read from socket is send to stdout
+ */
+int select_loop (int sfd) {
+  int ofd, len, bytesreceived = 0;
+  char buf[ BUFSIZ * 8 ];
+  fd_set readfds, writefds, fdset;
+
+  for (;;) {
+    FD_ZERO (&readfds);
+    FD_SET (sfd, &readfds);
+    FD_SET (0, &readfds);
+    if (select (32, &readfds, 0, 0, 0) < 0) {
+      perror ("select");
+      close (sfd);
+      return 1;
+    }
+       
+    if (FD_ISSET (sfd, &readfds)) {
+      if ((len = read(sfd, buf, sizeof (buf))) == 0) {
+       close (sfd);
+       return 0;
+      }
+      write (1, buf, len);
+      FD_CLR (sfd, &readfds);
+    }
+    if (FD_ISSET (0, &readfds))        {
+      if ((len = read (0, buf, sizeof (buf))) == 0) {
+       close (sfd);
+       return 0;
+      }
+      write(sfd, buf, len);
+      FD_CLR (ofd, &readfds);
+    }
+  }
+}
+
+int prepare_connect_port (u_long host, int port) {
+  int sock;
+  static struct hostent *hp;
+  static struct sockaddr_in server;
+    
+  sock = socket (AF_INET, SOCK_STREAM, 0);
+  if (sock < 0) {
+    perror ("opening stream socket");
+    exit (1);
+  }
+  server.sin_family = AF_INET;
+  
+  server.sin_addr.s_addr = ntohl (host);
+  server.sin_port = htons (port);
+    
+  if (connect(sock, (struct sockaddr *) &server, sizeof (server)) < 0) {
+    perror ("connecting remote socket");
+    return 0;
+  }
+  
+  return sock;
+}
+
+u_long extract_addr_of_string (char *str) {
+  u_long result = 0;
+
+#ifndef HAVE_STRTOUL
+  while (*str++) 
+    result = result * 10 + *str - '0';
+#else /* !HAVE_STRTOUL */
+  result = strtoul(str, NULL, 10);
+#endif /* HAVE_STRTOUL */
+  return result;
+}
+
+u_long primary_address_of (char *host) {   
+  struct hostent *hp;
+  u_long addr;
+  
+  if ((hp = gethostbyname(host)) == NULL)
+    addr = inet_addr(host);
+  else
+    memmove(&addr, hp->h_addr_list[ 0 ], 4);
+  
+  return ntohl(addr);
+}
+
+int chat_listen(int port) {
+  struct sockaddr_in sin;
+  struct hostent *hp;
+       u_long addr;
+  int sock, len;
+  char namebuf[ MAXHOSTNAMELEN ];
+    
+  sock = prepare_listen_port (port);
+  
+  len = sizeof (struct sockaddr_in);
+  if (getsockname(sock, (struct sockaddr *)&sin, &len) == 0) 
+    port = ntohs(sin.sin_port);
+
+       if ((addr = get_address_externally (NULL)) < 0) {
+               gethostname(namebuf, sizeof (namebuf));
+               if (hp = gethostbyname(namebuf)) 
+                       addr = ((struct in_addr *) (hp->h_addr_list)[0])->s_addr;
+               else
+                       return 2;
+       }
+
+       printf("DCC chat %u %d\n", addr, port);
+  
+  if ((sock = accept(sock, (struct sockaddr *) 0, (int *) 0)) > -1) {
+               printf("DCC chat established\n");
+    return select_loop(sock);
+       }
+  
+  return 1;
+}
+
+int chat_connect(u_long host, int port) {
+  int sock;
+  
+  if ((sock = prepare_connect_port(host, port)) > -1) {
+    printf("DCC chat established\n");
+    return select_loop(sock);
+  }
+  
+  return 1;
+}
+
+\f
+int main (int argc, char **argv) {
+  char *host = "localhost";
+  char *action;
+  int c, status = 0;
+
+  progname = (char *)basename(argv[ 0 ]);
+
+       while (1)       {
+               int this_option_optind = optind ? optind : 1;
+               int option_index = 0;
+               static struct option long_options[] =   {
+                       {"version", 0, 0, 'v'},
+                       {"help", 0, 0, 'h'},
+                       {0, 0, 0, 0}
+               };
+                       
+               c = getopt_long (argc, argv, "vh", long_options, &option_index);
+               if (c == -1)
+                       break;
+               
+               switch (c) {
+               case 'v':
+                       version();
+                       exit(1);
+                       break;
+               case 'h':
+                       usage();
+                       exit(1);
+                       break;
+               default:
+                       break;
+               }
+       }
+
+  if (argc > 1) {
+    action = argv[ 1 ];
+  } else {
+    usage();
+    exit(1);
+  }
+
+  if (!strcmp(action, "resolve")) {
+    if (argc < 3) {
+      usage();
+      exit(1);
+    } else {
+      u_long i, addr;
+      for (i = 2; i < argc; i++) {
+       addr = primary_address_of(argv[i]);
+       if (addr != -1)
+         printf("%u\n", addr);
+       else
+         printf("0\n");
+      }
+      status = 0;
+    }
+  }
+
+  if (!strcmp(action, "send")) {
+    if (argc != 4) {
+      usage();
+      exit(1);
+    }
+    status = send_file (atoi(argv[ 2 ]), argv[ 3 ]);
+  } else if (!strcmp(action, "receive")) {
+    if (argc != 6) {
+      usage();
+      exit(1);
+    }
+    status = 
+      receive_file (extract_addr_of_string(argv[ 2 ]),
+                   atoi(argv[ 3 ]), atoi(argv[ 4 ]), argv[ 5 ]);
+  } else if (!strcmp(action, "chat")) {
+    if (argc > 3) {
+      if (!strcmp(argv[ 2 ], "listen")) {
+       if (argc != 4) {
+         usage();
+         exit(1);
+       }
+       status = chat_listen(atoi(argv[ 3 ]));
+      } else if (!strcmp(argv[ 2 ], "connect")) {
+       if (argc != 5) {
+         usage();
+         exit(1);
+       }
+       status = chat_connect(extract_addr_of_string(argv[ 3 ]), 
+                             atoi(argv[ 4 ]));
+      } else {
+       usage();
+       exit(1);
+      }        
+    }
+  } else {
+    usage();
+    exit(1);
+  }
+
+  return status;
+}
+
+/*
+ * Local variables:
+ *  compile-command: "gcc -DHAVE_STRTOUL -Wall -O6 -o dcc dcc.c"
+ *  c-indent-level: 2
+ *  c-basic-offset: 2
+ *  tab-width: 2
+ * End:
+ */
diff --git a/dcc/getopt.c b/dcc/getopt.c
new file mode 100644 (file)
index 0000000..b5caccd
--- /dev/null
@@ -0,0 +1,755 @@
+/* Getopt for GNU.
+   NOTE: getopt is now part of the C library, so if you don't know what
+   "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu
+   before changing it!
+
+   Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94
+       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.  */
+\f
+/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
+   Ditto for AIX 3.2 and <stdlib.h>.  */
+#ifndef _NO_PROTO
+#define _NO_PROTO
+#endif
+
+#ifdef HAVE_CONFIG_H
+#if defined (emacs) || defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+   using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
+   (which it would do because it found this file in $srcdir).  */
+#include <config.h>
+#else
+#include "config.h"
+#endif
+#endif
+
+#ifndef __STDC__
+/* This is a separate conditional since some stdc systems
+   reject `defined (const)'.  */
+#ifndef const
+#define const
+#endif
+#endif
+
+#include <stdio.h>
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+/* Comment out all this code if we are using the GNU C Library, and are not
+   actually compiling the library itself.  This code is part of the GNU C
+   Library, but also included in many other GNU distributions.  Compiling
+   and linking in this code is a waste when using the GNU C library
+   (especially if it is a shared library).  Rather than having every GNU
+   program understand `configure --with-gnu-libc' and omit the object files,
+   it is simpler to just do this in the source for each such file.  */
+
+#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
+
+
+/* This needs to come after some library #include
+   to get __GNU_LIBRARY__ defined.  */
+#ifdef __GNU_LIBRARY__
+/* Don't include stdlib.h for non-GNU C libraries because some of them
+   contain conflicting prototypes for getopt.  */
+#include <stdlib.h>
+#endif /* GNU C library.  */
+
+/* This version of `getopt' appears to the caller like standard Unix `getopt'
+   but it behaves differently for the user, since it allows the user
+   to intersperse the options with the other arguments.
+
+   As `getopt' works, it permutes the elements of ARGV so that,
+   when it is done, all the options precede everything else.  Thus
+   all application programs are extended to handle flexible argument order.
+
+   Setting the environment variable POSIXLY_CORRECT disables permutation.
+   Then the behavior is completely standard.
+
+   GNU application programs can use a third alternative mode in which
+   they can distinguish the relative order of options and other arguments.  */
+
+#include "getopt.h"
+
+/* For communication from `getopt' to the caller.
+   When `getopt' finds an option that takes an argument,
+   the argument value is returned here.
+   Also, when `ordering' is RETURN_IN_ORDER,
+   each non-option ARGV-element is returned here.  */
+
+char *optarg = NULL;
+
+/* Index in ARGV of the next element to be scanned.
+   This is used for communication to and from the caller
+   and for communication between successive calls to `getopt'.
+
+   On entry to `getopt', zero means this is the first call; initialize.
+
+   When `getopt' returns EOF, this is the index of the first of the
+   non-option elements that the caller should itself scan.
+
+   Otherwise, `optind' communicates from one call to the next
+   how much of ARGV has been scanned so far.  */
+
+/* XXX 1003.2 says this must be 1 before any call.  */
+int optind = 0;
+
+/* The next char to be scanned in the option-element
+   in which the last option character we returned was found.
+   This allows us to pick up the scan where we left off.
+
+   If this is zero, or a null string, it means resume the scan
+   by advancing to the next ARGV-element.  */
+
+static char *nextchar;
+
+/* Callers store zero here to inhibit the error message
+   for unrecognized options.  */
+
+int opterr = 1;
+
+/* Set to an option character which was unrecognized.
+   This must be initialized on some systems to avoid linking in the
+   system's own getopt implementation.  */
+
+int optopt = '?';
+
+/* Describe how to deal with options that follow non-option ARGV-elements.
+
+   If the caller did not specify anything,
+   the default is REQUIRE_ORDER if the environment variable
+   POSIXLY_CORRECT is defined, PERMUTE otherwise.
+
+   REQUIRE_ORDER means don't recognize them as options;
+   stop option processing when the first non-option is seen.
+   This is what Unix does.
+   This mode of operation is selected by either setting the environment
+   variable POSIXLY_CORRECT, or using `+' as the first character
+   of the list of option characters.
+
+   PERMUTE is the default.  We permute the contents of ARGV as we scan,
+   so that eventually all the non-options are at the end.  This allows options
+   to be given in any order, even with programs that were not written to
+   expect this.
+
+   RETURN_IN_ORDER is an option available to programs that were written
+   to expect options and other ARGV-elements in any order and that care about
+   the ordering of the two.  We describe each non-option ARGV-element
+   as if it were the argument of an option with character code 1.
+   Using `-' as the first character of the list of option characters
+   selects this mode of operation.
+
+   The special argument `--' forces an end of option-scanning regardless
+   of the value of `ordering'.  In the case of RETURN_IN_ORDER, only
+   `--' can cause `getopt' to return EOF with `optind' != ARGC.  */
+
+static enum
+{
+  REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
+} ordering;
+
+/* Value of POSIXLY_CORRECT environment variable.  */
+static char *posixly_correct;
+\f
+#ifdef __GNU_LIBRARY__
+/* We want to avoid inclusion of string.h with non-GNU libraries
+   because there are many ways it can cause trouble.
+   On some systems, it contains special magic macros that don't work
+   in GCC.  */
+#include <string.h>
+#define        my_index        strchr
+#else
+
+/* Avoid depending on library functions or files
+   whose names are inconsistent.  */
+
+char *getenv ();
+
+static char *
+my_index (str, chr)
+     const char *str;
+     int chr;
+{
+  while (*str)
+    {
+      if (*str == chr)
+       return (char *) str;
+      str++;
+    }
+  return 0;
+}
+
+/* If using GCC, we can safely declare strlen this way.
+   If not using GCC, it is ok not to declare it.  */
+#ifdef __GNUC__
+/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
+   That was relevant to code that was here before.  */
+#ifndef __STDC__
+/* gcc with -traditional declares the built-in strlen to return int,
+   and has done so at least since version 2.4.5. -- rms.  */
+extern int strlen (const char *);
+#endif /* not __STDC__ */
+#endif /* __GNUC__ */
+
+#endif /* not __GNU_LIBRARY__ */
+\f
+/* Handle permutation of arguments.  */
+
+/* Describe the part of ARGV that contains non-options that have
+   been skipped.  `first_nonopt' is the index in ARGV of the first of them;
+   `last_nonopt' is the index after the last of them.  */
+
+static int first_nonopt;
+static int last_nonopt;
+
+/* Exchange two adjacent subsequences of ARGV.
+   One subsequence is elements [first_nonopt,last_nonopt)
+   which contains all the non-options that have been skipped so far.
+   The other is elements [last_nonopt,optind), which contains all
+   the options processed since those non-options were skipped.
+
+   `first_nonopt' and `last_nonopt' are relocated so that they describe
+   the new indices of the non-options in ARGV after they are moved.  */
+
+static void
+exchange (argv)
+     char **argv;
+{
+  int bottom = first_nonopt;
+  int middle = last_nonopt;
+  int top = optind;
+  char *tem;
+
+  /* Exchange the shorter segment with the far end of the longer segment.
+     That puts the shorter segment into the right place.
+     It leaves the longer segment in the right place overall,
+     but it consists of two parts that need to be swapped next.  */
+
+  while (top > middle && middle > bottom)
+    {
+      if (top - middle > middle - bottom)
+       {
+         /* Bottom segment is the short one.  */
+         int len = middle - bottom;
+         register int i;
+
+         /* Swap it with the top part of the top segment.  */
+         for (i = 0; i < len; i++)
+           {
+             tem = argv[bottom + i];
+             argv[bottom + i] = argv[top - (middle - bottom) + i];
+             argv[top - (middle - bottom) + i] = tem;
+           }
+         /* Exclude the moved bottom segment from further swapping.  */
+         top -= len;
+       }
+      else
+       {
+         /* Top segment is the short one.  */
+         int len = top - middle;
+         register int i;
+
+         /* Swap it with the bottom part of the bottom segment.  */
+         for (i = 0; i < len; i++)
+           {
+             tem = argv[bottom + i];
+             argv[bottom + i] = argv[middle + i];
+             argv[middle + i] = tem;
+           }
+         /* Exclude the moved top segment from further swapping.  */
+         bottom += len;
+       }
+    }
+
+  /* Update records for the slots the non-options now occupy.  */
+
+  first_nonopt += (optind - last_nonopt);
+  last_nonopt = optind;
+}
+
+/* Initialize the internal data when the first call is made.  */
+
+static const char *
+_getopt_initialize (optstring)
+     const char *optstring;
+{
+  /* Start processing options with ARGV-element 1 (since ARGV-element 0
+     is the program name); the sequence of previously skipped
+     non-option ARGV-elements is empty.  */
+
+  first_nonopt = last_nonopt = optind = 1;
+
+  nextchar = NULL;
+
+  posixly_correct = getenv ("POSIXLY_CORRECT");
+
+  /* Determine how to handle the ordering of options and nonoptions.  */
+
+  if (optstring[0] == '-')
+    {
+      ordering = RETURN_IN_ORDER;
+      ++optstring;
+    }
+  else if (optstring[0] == '+')
+    {
+      ordering = REQUIRE_ORDER;
+      ++optstring;
+    }
+  else if (posixly_correct != NULL)
+    ordering = REQUIRE_ORDER;
+  else
+    ordering = PERMUTE;
+
+  return optstring;
+}
+\f
+/* Scan elements of ARGV (whose length is ARGC) for option characters
+   given in OPTSTRING.
+
+   If an element of ARGV starts with '-', and is not exactly "-" or "--",
+   then it is an option element.  The characters of this element
+   (aside from the initial '-') are option characters.  If `getopt'
+   is called repeatedly, it returns successively each of the option characters
+   from each of the option elements.
+
+   If `getopt' finds another option character, it returns that character,
+   updating `optind' and `nextchar' so that the next call to `getopt' can
+   resume the scan with the following option character or ARGV-element.
+
+   If there are no more option characters, `getopt' returns `EOF'.
+   Then `optind' is the index in ARGV of the first ARGV-element
+   that is not an option.  (The ARGV-elements have been permuted
+   so that those that are not options now come last.)
+
+   OPTSTRING is a string containing the legitimate option characters.
+   If an option character is seen that is not listed in OPTSTRING,
+   return '?' after printing an error message.  If you set `opterr' to
+   zero, the error message is suppressed but we still return '?'.
+
+   If a char in OPTSTRING is followed by a colon, that means it wants an arg,
+   so the following text in the same ARGV-element, or the text of the following
+   ARGV-element, is returned in `optarg'.  Two colons mean an option that
+   wants an optional arg; if there is text in the current ARGV-element,
+   it is returned in `optarg', otherwise `optarg' is set to zero.
+
+   If OPTSTRING starts with `-' or `+', it requests different methods of
+   handling the non-option ARGV-elements.
+   See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
+
+   Long-named options begin with `--' instead of `-'.
+   Their names may be abbreviated as long as the abbreviation is unique
+   or is an exact match for some defined option.  If they have an
+   argument, it follows the option name in the same ARGV-element, separated
+   from the option name by a `=', or else the in next ARGV-element.
+   When `getopt' finds a long-named option, it returns 0 if that option's
+   `flag' field is nonzero, the value of the option's `val' field
+   if the `flag' field is zero.
+
+   The elements of ARGV aren't really const, because we permute them.
+   But we pretend they're const in the prototype to be compatible
+   with other systems.
+
+   LONGOPTS is a vector of `struct option' terminated by an
+   element containing a name which is zero.
+
+   LONGIND returns the index in LONGOPT of the long-named option found.
+   It is only valid when a long-named option has been found by the most
+   recent call.
+
+   If LONG_ONLY is nonzero, '-' as well as '--' can introduce
+   long-named options.  */
+
+int
+_getopt_internal (argc, argv, optstring, longopts, longind, long_only)
+     int argc;
+     char *const *argv;
+     const char *optstring;
+     const struct option *longopts;
+     int *longind;
+     int long_only;
+{
+  optarg = NULL;
+
+  if (optind == 0)
+    optstring = _getopt_initialize (optstring);
+
+  if (nextchar == NULL || *nextchar == '\0')
+    {
+      /* Advance to the next ARGV-element.  */
+
+      if (ordering == PERMUTE)
+       {
+         /* If we have just processed some options following some non-options,
+            exchange them so that the options come first.  */
+
+         if (first_nonopt != last_nonopt && last_nonopt != optind)
+           exchange ((char **) argv);
+         else if (last_nonopt != optind)
+           first_nonopt = optind;
+
+         /* Skip any additional non-options
+            and extend the range of non-options previously skipped.  */
+
+         while (optind < argc
+                && (argv[optind][0] != '-' || argv[optind][1] == '\0'))
+           optind++;
+         last_nonopt = optind;
+       }
+
+      /* The special ARGV-element `--' means premature end of options.
+        Skip it like a null option,
+        then exchange with previous non-options as if it were an option,
+        then skip everything else like a non-option.  */
+
+      if (optind != argc && !strcmp (argv[optind], "--"))
+       {
+         optind++;
+
+         if (first_nonopt != last_nonopt && last_nonopt != optind)
+           exchange ((char **) argv);
+         else if (first_nonopt == last_nonopt)
+           first_nonopt = optind;
+         last_nonopt = argc;
+
+         optind = argc;
+       }
+
+      /* If we have done all the ARGV-elements, stop the scan
+        and back over any non-options that we skipped and permuted.  */
+
+      if (optind == argc)
+       {
+         /* Set the next-arg-index to point at the non-options
+            that we previously skipped, so the caller will digest them.  */
+         if (first_nonopt != last_nonopt)
+           optind = first_nonopt;
+         return EOF;
+       }
+
+      /* If we have come to a non-option and did not permute it,
+        either stop the scan or describe it to the caller and pass it by.  */
+
+      if ((argv[optind][0] != '-' || argv[optind][1] == '\0'))
+       {
+         if (ordering == REQUIRE_ORDER)
+           return EOF;
+         optarg = argv[optind++];
+         return 1;
+       }
+
+      /* We have found another option-ARGV-element.
+        Skip the initial punctuation.  */
+
+      nextchar = (argv[optind] + 1
+                 + (longopts != NULL && argv[optind][1] == '-'));
+    }
+
+  /* Decode the current option-ARGV-element.  */
+
+  /* Check whether the ARGV-element is a long option.
+
+     If long_only and the ARGV-element has the form "-f", where f is
+     a valid short option, don't consider it an abbreviated form of
+     a long option that starts with f.  Otherwise there would be no
+     way to give the -f short option.
+
+     On the other hand, if there's a long option "fubar" and
+     the ARGV-element is "-fu", do consider that an abbreviation of
+     the long option, just like "--fu", and not "-f" with arg "u".
+
+     This distinction seems to be the most useful approach.  */
+
+  if (longopts != NULL
+      && (argv[optind][1] == '-'
+         || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
+    {
+      char *nameend;
+      const struct option *p;
+      const struct option *pfound = NULL;
+      int exact = 0;
+      int ambig = 0;
+      int indfound;
+      int option_index;
+
+      for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
+       /* Do nothing.  */ ;
+
+      /* Test all long options for either exact match
+        or abbreviated matches.  */
+      for (p = longopts, option_index = 0; p->name; p++, option_index++)
+       if (!strncmp (p->name, nextchar, nameend - nextchar))
+         {
+           if (nameend - nextchar == (int) strlen (p->name))
+             {
+               /* Exact match found.  */
+               pfound = p;
+               indfound = option_index;
+               exact = 1;
+               break;
+             }
+           else if (pfound == NULL)
+             {
+               /* First nonexact match found.  */
+               pfound = p;
+               indfound = option_index;
+             }
+           else
+             /* Second or later nonexact match found.  */
+             ambig = 1;
+         }
+
+      if (ambig && !exact)
+       {
+         if (opterr)
+           fprintf (stderr, "%s: option `%s' is ambiguous\n",
+                    argv[0], argv[optind]);
+         nextchar += strlen (nextchar);
+         optind++;
+         return '?';
+       }
+
+      if (pfound != NULL)
+       {
+         option_index = indfound;
+         optind++;
+         if (*nameend)
+           {
+             /* Don't test has_arg with >, because some C compilers don't
+                allow it to be used on enums.  */
+             if (pfound->has_arg)
+               optarg = nameend + 1;
+             else
+               {
+                 if (opterr)
+                   {
+                     if (argv[optind - 1][1] == '-')
+                       /* --option */
+                       fprintf (stderr,
+                                "%s: option `--%s' doesn't allow an argument\n",
+                                argv[0], pfound->name);
+                     else
+                       /* +option or -option */
+                       fprintf (stderr,
+                            "%s: option `%c%s' doesn't allow an argument\n",
+                            argv[0], argv[optind - 1][0], pfound->name);
+                   }
+                 nextchar += strlen (nextchar);
+                 return '?';
+               }
+           }
+         else if (pfound->has_arg == 1)
+           {
+             if (optind < argc)
+               optarg = argv[optind++];
+             else
+               {
+                 if (opterr)
+                   fprintf (stderr, "%s: option `%s' requires an argument\n",
+                            argv[0], argv[optind - 1]);
+                 nextchar += strlen (nextchar);
+                 return optstring[0] == ':' ? ':' : '?';
+               }
+           }
+         nextchar += strlen (nextchar);
+         if (longind != NULL)
+           *longind = option_index;
+         if (pfound->flag)
+           {
+             *(pfound->flag) = pfound->val;
+             return 0;
+           }
+         return pfound->val;
+       }
+
+      /* Can't find it as a long option.  If this is not getopt_long_only,
+        or the option starts with '--' or is not a valid short
+        option, then it's an error.
+        Otherwise interpret it as a short option.  */
+      if (!long_only || argv[optind][1] == '-'
+         || my_index (optstring, *nextchar) == NULL)
+       {
+         if (opterr)
+           {
+             if (argv[optind][1] == '-')
+               /* --option */
+               fprintf (stderr, "%s: unrecognized option `--%s'\n",
+                        argv[0], nextchar);
+             else
+               /* +option or -option */
+               fprintf (stderr, "%s: unrecognized option `%c%s'\n",
+                        argv[0], argv[optind][0], nextchar);
+           }
+         nextchar = (char *) "";
+         optind++;
+         return '?';
+       }
+    }
+
+  /* Look at and handle the next short option-character.  */
+
+  {
+    char c = *nextchar++;
+    char *temp = my_index (optstring, c);
+
+    /* Increment `optind' when we start to process its last character.  */
+    if (*nextchar == '\0')
+      ++optind;
+
+    if (temp == NULL || c == ':')
+      {
+       if (opterr)
+         {
+           if (posixly_correct)
+             /* 1003.2 specifies the format of this message.  */
+             fprintf (stderr, "%s: illegal option -- %c\n", argv[0], c);
+           else
+             fprintf (stderr, "%s: invalid option -- %c\n", argv[0], c);
+         }
+       optopt = c;
+       return '?';
+      }
+    if (temp[1] == ':')
+      {
+       if (temp[2] == ':')
+         {
+           /* This is an option that accepts an argument optionally.  */
+           if (*nextchar != '\0')
+             {
+               optarg = nextchar;
+               optind++;
+             }
+           else
+             optarg = NULL;
+           nextchar = NULL;
+         }
+       else
+         {
+           /* This is an option that requires an argument.  */
+           if (*nextchar != '\0')
+             {
+               optarg = nextchar;
+               /* If we end this ARGV-element by taking the rest as an arg,
+                  we must advance to the next element now.  */
+               optind++;
+             }
+           else if (optind == argc)
+             {
+               if (opterr)
+                 {
+                   /* 1003.2 specifies the format of this message.  */
+                   fprintf (stderr, "%s: option requires an argument -- %c\n",
+                            argv[0], c);
+                 }
+               optopt = c;
+               if (optstring[0] == ':')
+                 c = ':';
+               else
+                 c = '?';
+             }
+           else
+             /* We already incremented `optind' once;
+                increment it again when taking next ARGV-elt as argument.  */
+             optarg = argv[optind++];
+           nextchar = NULL;
+         }
+      }
+    return c;
+  }
+}
+
+int
+getopt (argc, argv, optstring)
+     int argc;
+     char *const *argv;
+     const char *optstring;
+{
+  return _getopt_internal (argc, argv, optstring,
+                          (const struct option *) 0,
+                          (int *) 0,
+                          0);
+}
+
+#endif /* _LIBC or not __GNU_LIBRARY__.  */
+\f
+#ifdef TEST
+
+/* Compile with -DTEST to make an executable for use in testing
+   the above definition of `getopt'.  */
+
+int
+main (argc, argv)
+     int argc;
+     char **argv;
+{
+  int c;
+  int digit_optind = 0;
+
+  while (1)
+    {
+      int this_option_optind = optind ? optind : 1;
+
+      c = getopt (argc, argv, "abc:d:0123456789");
+      if (c == EOF)
+       break;
+
+      switch (c)
+       {
+       case '0':
+       case '1':
+       case '2':
+       case '3':
+       case '4':
+       case '5':
+       case '6':
+       case '7':
+       case '8':
+       case '9':
+         if (digit_optind != 0 && digit_optind != this_option_optind)
+           printf ("digits occur in two different argv-elements.\n");
+         digit_optind = this_option_optind;
+         printf ("option %c\n", c);
+         break;
+
+       case 'a':
+         printf ("option a\n");
+         break;
+
+       case 'b':
+         printf ("option b\n");
+         break;
+
+       case 'c':
+         printf ("option c with value `%s'\n", optarg);
+         break;
+
+       case '?':
+         break;
+
+       default:
+         printf ("?? getopt returned character code 0%o ??\n", c);
+       }
+    }
+
+  if (optind < argc)
+    {
+      printf ("non-option ARGV-elements: ");
+      while (optind < argc)
+       printf ("%s ", argv[optind++]);
+      printf ("\n");
+    }
+
+  exit (0);
+}
+
+#endif /* TEST */
diff --git a/dcc/getopt.h b/dcc/getopt.h
new file mode 100644 (file)
index 0000000..c872f41
--- /dev/null
@@ -0,0 +1,125 @@
+/* Declarations for getopt.
+   Copyright (C) 1989, 1990, 1991, 1992, 1993 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.  */
+
+#ifndef _GETOPT_H
+#define _GETOPT_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* For communication from `getopt' to the caller.
+   When `getopt' finds an option that takes an argument,
+   the argument value is returned here.
+   Also, when `ordering' is RETURN_IN_ORDER,
+   each non-option ARGV-element is returned here.  */
+
+extern char *optarg;
+
+/* Index in ARGV of the next element to be scanned.
+   This is used for communication to and from the caller
+   and for communication between successive calls to `getopt'.
+
+   On entry to `getopt', zero means this is the first call; initialize.
+
+   When `getopt' returns EOF, this is the index of the first of the
+   non-option elements that the caller should itself scan.
+
+   Otherwise, `optind' communicates from one call to the next
+   how much of ARGV has been scanned so far.  */
+
+extern int optind;
+
+/* Callers store zero here to inhibit the error message `getopt' prints
+   for unrecognized options.  */
+
+extern int opterr;
+
+/* Set to an option character which was unrecognized.  */
+
+extern int optopt;
+
+/* Describe the long-named options requested by the application.
+   The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
+   of `struct option' terminated by an element containing a name which is
+   zero.
+
+   The field `has_arg' is:
+   no_argument         (or 0) if the option does not take an argument,
+   required_argument   (or 1) if the option requires an argument,
+   optional_argument   (or 2) if the option takes an optional argument.
+
+   If the field `flag' is not NULL, it points to a variable that is set
+   to the value given in the field `val' when the option is found, but
+   left unchanged if the option is not found.
+
+   To have a long-named option do something other than set an `int' to
+   a compiled-in constant, such as set a value from `optarg', set the
+   option's `flag' field to zero and its `val' field to a nonzero
+   value (the equivalent single-letter option character, if there is
+   one).  For long options that have a zero `flag' field, `getopt'
+   returns the contents of the `val' field.  */
+
+struct option
+{
+#if    __STDC__
+  const char *name;
+#else
+  char *name;
+#endif
+  /* has_arg can't be an enum because some compilers complain about
+     type mismatches in all the code that assumes it is an int.  */
+  int has_arg;
+  int *flag;
+  int val;
+};
+
+/* Names for the values of the `has_arg' field of `struct option'.  */
+
+#define        no_argument             0
+#define required_argument      1
+#define optional_argument      2
+
+#if __STDC__
+#if defined(__GNU_LIBRARY__)
+/* Many other libraries have conflicting prototypes for getopt, with
+   differences in the consts, in stdlib.h.  To avoid compilation
+   errors, only prototype getopt for the GNU C library.  */
+extern int getopt (int argc, char *const *argv, const char *shortopts);
+#else /* not __GNU_LIBRARY__ */
+extern int getopt ();
+#endif /* not __GNU_LIBRARY__ */
+extern int getopt_long (int argc, char *const *argv, const char *shortopts,
+                       const struct option *longopts, int *longind);
+extern int getopt_long_only (int argc, char *const *argv,
+                            const char *shortopts,
+                            const struct option *longopts, int *longind);
+
+/* Internal only.  Users should not call this directly.  */
+extern int _getopt_internal (int argc, char *const *argv,
+                            const char *shortopts,
+                            const struct option *longopts, int *longind,
+                            int long_only);
+#else /* not __STDC__ */
+extern int getopt ();
+extern int getopt_long ();
+extern int getopt_long_only ();
+
+extern int _getopt_internal ();
+#endif /* not __STDC__ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _GETOPT_H */
diff --git a/dcc/getopt1.c b/dcc/getopt1.c
new file mode 100644 (file)
index 0000000..a4f1976
--- /dev/null
@@ -0,0 +1,183 @@
+/* getopt_long and getopt_long_only entry points for GNU getopt.
+   Copyright (C) 1987, 88, 89, 90, 91, 92, 1993
+       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.  */
+\f
+#ifdef HAVE_CONFIG_H
+#if defined (emacs) || defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+   using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
+   (which it would do because it found this file in $srcdir).  */
+#include <config.h>
+#else
+#include "config.h"
+#endif
+#endif
+
+#include "getopt.h"
+
+#ifndef __STDC__
+/* This is a separate conditional since some stdc systems
+   reject `defined (const)'.  */
+#ifndef const
+#define const
+#endif
+#endif
+
+#include <stdio.h>
+
+/* Comment out all this code if we are using the GNU C Library, and are not
+   actually compiling the library itself.  This code is part of the GNU C
+   Library, but also included in many other GNU distributions.  Compiling
+   and linking in this code is a waste when using the GNU C library
+   (especially if it is a shared library).  Rather than having every GNU
+   program understand `configure --with-gnu-libc' and omit the object files,
+   it is simpler to just do this in the source for each such file.  */
+
+#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
+
+
+/* This needs to come after some library #include
+   to get __GNU_LIBRARY__ defined.  */
+#ifdef __GNU_LIBRARY__
+#include <stdlib.h>
+#else
+char *getenv ();
+#endif
+
+#ifndef        NULL
+#define NULL 0
+#endif
+
+int
+getopt_long (argc, argv, options, long_options, opt_index)
+     int argc;
+     char *const *argv;
+     const char *options;
+     const struct option *long_options;
+     int *opt_index;
+{
+  return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
+}
+
+/* Like getopt_long, but '-' as well as '--' can indicate a long option.
+   If an option that starts with '-' (not '--') doesn't match a long option,
+   but does match a short option, it is parsed as a short option
+   instead.  */
+
+int
+getopt_long_only (argc, argv, options, long_options, opt_index)
+     int argc;
+     char *const *argv;
+     const char *options;
+     const struct option *long_options;
+     int *opt_index;
+{
+  return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
+}
+
+
+#endif /* _LIBC or not __GNU_LIBRARY__.  */
+\f
+#ifdef TEST
+
+#include <stdio.h>
+
+int
+main (argc, argv)
+     int argc;
+     char **argv;
+{
+  int c;
+  int digit_optind = 0;
+
+  while (1)
+    {
+      int this_option_optind = optind ? optind : 1;
+      int option_index = 0;
+      static struct option long_options[] =
+      {
+       {"add", 1, 0, 0},
+       {"append", 0, 0, 0},
+       {"delete", 1, 0, 0},
+       {"verbose", 0, 0, 0},
+       {"create", 0, 0, 0},
+       {"file", 1, 0, 0},
+       {0, 0, 0, 0}
+      };
+
+      c = getopt_long (argc, argv, "abc:d:0123456789",
+                      long_options, &option_index);
+      if (c == EOF)
+       break;
+
+      switch (c)
+       {
+       case 0:
+         printf ("option %s", long_options[option_index].name);
+         if (optarg)
+           printf (" with arg %s", optarg);
+         printf ("\n");
+         break;
+
+       case '0':
+       case '1':
+       case '2':
+       case '3':
+       case '4':
+       case '5':
+       case '6':
+       case '7':
+       case '8':
+       case '9':
+         if (digit_optind != 0 && digit_optind != this_option_optind)
+           printf ("digits occur in two different argv-elements.\n");
+         digit_optind = this_option_optind;
+         printf ("option %c\n", c);
+         break;
+
+       case 'a':
+         printf ("option a\n");
+         break;
+
+       case 'b':
+         printf ("option b\n");
+         break;
+
+       case 'c':
+         printf ("option c with value `%s'\n", optarg);
+         break;
+
+       case 'd':
+         printf ("option d with value `%s'\n", optarg);
+         break;
+
+       case '?':
+         break;
+
+       default:
+         printf ("?? getopt returned character code 0%o ??\n", c);
+       }
+    }
+
+  if (optind < argc)
+    {
+      printf ("non-option ARGV-elements: ");
+      while (optind < argc)
+       printf ("%s ", argv[optind++]);
+      printf ("\n");
+    }
+
+  exit (0);
+}
+
+#endif /* TEST */
diff --git a/dcc/tcp.c b/dcc/tcp.c
new file mode 100644 (file)
index 0000000..8ed67fe
--- /dev/null
+++ b/dcc/tcp.c
@@ -0,0 +1,254 @@
+/* tcp.c - TCP/IP stream emulation for GNU Emacs.
+ * Copyright (C) 1988, 1989, 1992, 1993 Free Software Foundation, Inc.
+ * Copyright (C) 1998-2002  Daiki Ueno
+ *
+ * This file is part of Liece.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+/* This program is based on `tcp' comming from old GNUS distribution
+   written by Masanobu Umeda <umerin@mse.kyutech.ac.jp>. */
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/socket.h>
+#include <sys/file.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <netdb.h>
+#include <stdio.h>
+#include <signal.h>
+#include <fcntl.h>
+#include <netinet/in.h>
+#define _GNU_SOURCE
+#include <getopt.h>
+
+#ifdef HAVE_BASENAME
+# ifdef HAVE_LIBGEN_H
+#  include <libgen.h>
+#  ifdef basename
+#   undef basename
+#  endif
+# endif
+# include <string.h>
+#else
+# define basename(path) (rindex((path), '/') + 1)
+#endif
+
+#ifndef NI_MAXHOST
+# define NI_MAXHOST 1025
+#endif
+
+static char *progname;
+
+void version () {
+       printf("%s (Liece) 1.4.0\n"
+              "Copyright (C) 1998, 1999 Daiki Ueno\n"
+              "This is free software; see the source for copying conditions.  There is NO\n"
+              "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n", 
+              progname);
+}
+
+void usage() {
+  printf("Usage: %s [options] host [service]\n", progname);
+}
+
+\f
+main (argc, argv)
+  int argc;
+  char *argv[];
+{
+  struct protoent *proto;
+  int family, socktype;
+  struct sockaddr *addr;
+  size_t addrlen;
+#ifdef HAVE_GETADDRINFO
+  struct addrinfo *in, hints;
+#else
+  struct hostent *host;
+  struct servent *serv;
+  struct sockaddr_in sin;
+#endif
+  char *hostname = NULL, *service = "ircd";
+  int port;
+  fd_set *readfds, *writefds;
+  int server, emacsIn = fileno (stdin), emacsOut = fileno (stdout); 
+  char buffer[1024], *retry;
+  int nbuffer, wret, false = 0;
+  int c;
+  
+  progname = (char *) basename (argv[0]);
+
+  while (1)
+    {
+      int this_option_optind = optind ? optind : 1;
+      int option_index = 0;
+      static struct option long_options[] =
+       {
+         {"version", 0, 0, 'v'},
+         {"help", 0, 0, 'h'},
+         {0, 0, 0, 0}
+       };
+    
+      c = getopt_long (argc, argv, "vh", long_options, &option_index);
+      if (c == -1)
+       break;
+    
+      switch (c)
+       {
+       case 'v':
+         version ();
+         exit (1);
+         break;
+       case 'h':
+         usage ();
+         exit (1);
+         break;
+       default:
+         break;
+       }
+    }
+  
+  if (argc < 2)
+    {
+      usage();
+      exit (1);
+    }
+  if (argc >= 2)
+    hostname = argv[1];
+  if (argc >= 3)
+    service = argv[2];
+  
+  proto = getprotobyname ("tcp");
+  if (!proto)
+    {
+      perror ("getprotobyname");
+      exit (1);
+    }
+
+#ifdef HAVE_GETADDRINFO
+  memset (&hints, 0, sizeof (hints));
+  hints.ai_family = AF_UNSPEC;
+  hints.ai_socktype = SOCK_STREAM;
+  hints.ai_protocol = proto->p_proto;
+  if (getaddrinfo (hostname, service, &hints, &in) < 0)
+    {
+      perror ("getaddrinfo");
+      exit (1);
+    }
+  family = in->ai_family;
+  socktype = in->ai_socktype;
+  addr = in->ai_addr;
+  addrlen = in->ai_addrlen;
+  freeaddrinfo (in);
+#else
+  memset (&sin, 0, sizeof (sin));
+  host = gethostbyname (hostname);
+  if (!host)
+    return -1;
+  memcpy (&sin.sin_addr, host->h_addr, host->h_length);
+  serv = getservbyname (service, proto->p_name);
+  if (serv)
+    sin.sin_port = htons (serv->s_port);
+  else if (isdigit (service[0]))
+    sin.sin_port = htons (atoi (service));
+  family = sin.sin_family = AF_INET;
+  socktype = SOCK_STREAM;
+  addr = (struct sockaddr *)&sin;
+  addrlen = sizeof (sin);
+#endif
+
+  server = socket (family, socktype, 0);
+  if (server == -1)
+    {
+      perror ("socket");
+      exit (1);
+    }
+
+  setsockopt (server, SOL_SOCKET, SO_REUSEADDR, 
+             (const char *) &false, sizeof (false));
+
+  if (connect (server, addr, addrlen) < 0)
+    {
+      perror ("connect");
+      close (server);
+      exit (1);
+    }
+
+#ifdef O_NDELAY
+  fcntl (server, F_SETFL, O_NDELAY);
+#endif /* O_NDELAY */
+
+  /* Connection established. */
+
+  readfds = (fd_set *) calloc(server + 1, sizeof (fd_mask));
+  writefds = (fd_set *) calloc(server + 1, sizeof (fd_mask));
+
+  while (1)
+    {
+      FD_SET (server, readfds);
+      FD_SET (emacsIn, readfds);
+      if (select (server+1, readfds, NULL, NULL, NULL) == -1)
+       {
+         perror ("select");
+         exit (1);
+       }
+      if (FD_ISSET (emacsIn, readfds))
+       {
+         /* From Emacs */
+         nbuffer = read (emacsIn, buffer, sizeof buffer -1);
+
+          if (nbuffer == 0)
+           goto finish;
+         for (retry = buffer; nbuffer > 0; nbuffer -= wret, retry += wret)
+           {
+             FD_SET (server, writefds);
+             if (select (server+1, NULL, writefds, NULL, NULL) == -1)
+               {
+                 perror ("select");
+                 exit (1);
+               }
+             wret = write (server, retry, nbuffer);
+             if (wret < 0) goto finish;
+           }
+       }
+      if (FD_ISSET (server, readfds))
+       {
+         /* From NNTP server */
+         nbuffer = read (server, buffer, sizeof buffer -1);
+         if (nbuffer == 0)
+           goto finish;
+         for (retry = buffer; nbuffer > 0; nbuffer -= wret, retry += wret)
+           {
+             FD_SET (emacsOut, writefds);
+             if (select (emacsOut+1, NULL, writefds, NULL, NULL) == -1)
+               {
+                 perror ("select");
+                 exit (1);
+               }
+             wret = write (emacsOut, retry, nbuffer);
+             if (wret < 0) goto finish;
+           }
+       }
+    }
+
+  /* End of communication. */
+ finish:
+  close (server);
+  close (emacsIn);
+  close (emacsOut);
+  exit (0);
+}
diff --git a/lisp/.cvsignore b/lisp/.cvsignore
new file mode 100644 (file)
index 0000000..3dda729
--- /dev/null
@@ -0,0 +1,2 @@
+Makefile.in
+Makefile
diff --git a/lisp/COMPILE b/lisp/COMPILE
new file mode 100644 (file)
index 0000000..8a1e625
--- /dev/null
@@ -0,0 +1,99 @@
+;;; -*- Emacs-Lisp -*-
+
+(defvar riece-modules
+  (cons 'riece-compat
+       (cons (if (featurep 'xemacs)
+                 'riece-xemacs
+               'riece-emacs)
+             '(riece-globals
+               riece-options
+               riece-version
+               riece-inlines
+               riece-highlight
+               riece-coding
+               riece-complete
+
+               ;; riece-identity -+-> riece-channel
+               ;;                 +-> riece-user
+               riece-identity
+               riece-channel
+               riece-user
+
+               riece-misc
+               riece-display
+               riece-server
+
+               ;; riece-channel -+-> riece-naming
+               ;; riece-user    -+
+               riece-naming
+               riece-message
+
+               ;; riece-filter calls riece-{handle,000,200,300,400,500}
+               riece-filter
+               riece-handle
+               riece-000
+               riece-200
+               riece-300
+               riece-400
+               riece-500
+
+               riece-commands
+               riece))))
+
+(defun riece-compile-modules (modules)
+  (let ((load-path (cons nil load-path)))
+    (while modules
+      (let ((source (expand-file-name
+                    (concat (symbol-name (car modules)) ".el"))))
+       (if (file-newer-than-file-p source (concat source "c"))
+           (byte-compile-file source)))
+      (setq modules (cdr modules)))))
+
+(defun riece-install-modules (modules dest just-print)
+  (unless (or just-print (file-exists-p dest))
+    (make-directory dest t))
+  (while modules
+    (let ((name (symbol-name (car modules))))
+      (princ (format "%s.el -> %s\n" name dest))
+      (unless just-print
+       (copy-file (expand-file-name (concat name ".el"))
+                  (expand-file-name (concat name ".el") dest)
+                  t t))
+      (princ (format "%s.elc -> %s\n" name dest))
+      (unless just-print
+       (copy-file (expand-file-name (concat name ".elc"))
+                  (expand-file-name (concat name ".elc") dest)
+                  t t)))
+    (setq modules (cdr modules))))
+
+(defun riece-install-just-print-p ()
+  (let ((flag (getenv "MAKEFLAGS"))
+       case-fold-search)
+    (if flag
+       (string-match "^\\(\\(--[^ ]+ \\)+-\\|[^ =-]\\)*n" flag))))
+
+(defun riece-compile ()
+  (riece-compile-modules riece-modules))
+
+(defun riece-install ()
+  (riece-install-modules
+   riece-modules
+   (expand-file-name "riece" (car command-line-args-left))
+   (riece-install-just-print-p)))
+
+(defun riece-compile-package ()
+  (riece-compile)
+  (setq autoload-package-name "riece")
+  (add-to-list 'command-line-args-left ".")
+  (batch-update-directory)
+  (add-to-list 'command-line-args-left ".")
+  (Custom-make-dependencies)
+  (riece-compile-modules (list 'auto-autoloads 'custom-load)))
+
+(defun riece-install-package ()
+  (riece-install-modules
+   (append riece-modules
+          '(auto-autoloads custom-load))
+   (expand-file-name "riece"
+                    (expand-file-name "lisp" (car command-line-args-left)))
+   (riece-install-just-print-p)))
diff --git a/lisp/ChangeLog.Liece b/lisp/ChangeLog.Liece
new file mode 100644 (file)
index 0000000..8aeb381
--- /dev/null
@@ -0,0 +1,4696 @@
+2003-05-24  Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-000.el (liece-handle-000-messages): Don't set liece-nickname.
+       * liece-400.el (liece-iterate-nick): Abolish.
+       (liece-handle-433-message): Don't use liece-iterate-nick.
+       * liece-channel.el: Abolish channel representation format.
+       (liece-default-channel-representation-format): Abolish.
+       (liece-dcc-channel-representation-format): Abolish.
+       (liece-channel-prepare-representation): Abolish.
+       (liece-channel-parse-representation): Abolish.
+       * liece-commands.el (liece-command-save-variables): Rename from
+       liece-command-save-vars; simplify using with-temp-file.
+       * liece-ctcp.el: Require liece-version.
+       * liece-globals.el: Rearrange variables by usage; don't require
+       liece-version.
+       (liece-last-nickname): Rename from liece-nickname-last.
+       (liece-last-who-expression): Rename from liece-who-expression.
+       (liece-real-userhost): Rename from liece-my-userhost.
+       (liece-last-chat-partner): Rename from liece-privmsg-partner.
+       (liece-last-friends): Rename from liece-friends-last.
+       (liece-real-server-name): New variable.
+       (liece-server-process-alist): New variable.
+       (liece-command-buffer-mode-indicator): Rename from
+       liece-private-indicator.
+       (liece-server-buffer): Abolish.
+       * liece-inlines.el (liece-next-line): Abolish.
+       * liece-misc.el (liece-send-pong): Abolish.
+       (liece-increment-long-reply-count): Define as function.
+       (liece-reset-long-reply-count): Ditto.
+       (liece-check-long-reply-count): Ditto.
+       * liece-q-el.el (liece-quote-el-decode-string): Fix typo.
+       * liece-vars.el (liece-saved-forms): Don't purecopy.
+       (liece-want-traditional): Abolish.
+       (liece-command-window-on-top): Abolish.
+       (liece-one-buffer-mode): Abolish.
+       (liece-saved-variables-file): New variable.
+       (liece-server-alist): Default to nil.
+       (liece-my-userhost): Remove.
+       (liece-nick-max-length): Abolish.
+       (liece-real-nickname): Remove.
+       (liece-grow-tail): Abolish.
+       (liece-retry-with-new-nickname): Rename from liece-auto-iterate-nick.
+       (liece-after-registration): Abolish.
+       (liece-status-message-string): Abolish.
+       (liece-channel-unread-list): Moved to liece-globals.el.
+       * liece-version.el: Bind utf-2000-version, and mule-version.
+       * liece-xemacs.el: Require liece-version.
+       * liece.el (liece-tmp-server-name): Abolish.
+       (liece-read-variables-files): Remove migration logic.
+       (liece): Don't add liece-nickname to liece-nick-alist.
+       (liece-accept-response): Don't retry with the new nickname.
+       
+2003-05-23  Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-message.el: Overhaul; don't depend on dynamic binding.
+       (liece-message-brackets): Abolish.
+       (liece-message-tags): Abolish.
+       (liece-message-empty-predicate): Abolish.
+       (liece-message-make-open-bracket-function): New variable.
+       (liece-message-make-close-bracket-function): New variable.
+       (liece-message-make-name-function): New variable.
+       (liece-message-make-global-name-function): New variable.
+       (liece-message-type): Abolish; define as function.
+       (liece-message-target): Abolish; define as function.
+       (liece-message-speaker): Abolish; define as function.
+       (liece-message-direction): Abolish; use liece-message-own-p.
+       (liece-message-predicate): Abolish.
+       (liece-message-brackets-function): Abolish.
+       (liece-message-tags-function): Abolish.
+       (liece-message-buffer-function): Rename to liece-message-buffers.
+       (liece-message-parent-buffer): Rename to liece-message-parent-buffers.
+       (liece-message-make-open-bracket): New function.
+       (liece-message-make-close-bracket): New function.
+       (liece-message-make-bracket): New function.
+       (liece-message-make-name): New function.
+       (liece-message-make-global-name): New function.
+       (liece-display-message): Rewrite; remove autoload cookie.
+       (liece-make-message): New function.
+       (liece-message-private-p): New function.
+       (liece-message-external-p): New function.
+       * liece-misc.el (liece-own-channel-message): Move to liece-message.el.
+       (liece-own-private-message): Ditto.
+       * liece-commands.el (liece-command-message): Don't use
+       liece-message-empty-predicate.
+       * liece-ctcp.el (liece-ctcp-action-message): Use new API.
+       (liece-ctcp-insert): Ditto.
+       * liece-dcc.el (liece-dcc-chat-filter): Use new API.
+       * liece-handle.el (liece-handle-notice-message): Use new API.
+       (liece-handle-privmsg-message): Ditto.
+
+2003-05-23  Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-misc.el (liece-insert-timestamp): Abolish.
+       (liece-own-frozen): Abolish.
+       (liece-own-message): Abolish.
+       (liece-scroll-if-visible): Abolish.
+       (liece-generate-hex-timestamp): Abolish.
+       (liece-hex-timestamp-valid): Abolish.
+
+2003-05-22  Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-commands.el (liece-command-tag-region): Simplify.
+       * liece-misc.el (liece-remove-properties-region): Abolish.
+
+2003-05-18  OHASHI Akira  <bg66@koka-in.org>
+
+       * liece.el (liece-dialogue-mode-map): Don't bind
+       `liece-command-open-server'.
+
+2003-04-30  OHASHI Akira  <bg66@koka-in.org>
+
+       * liece-channel.el (liece-channel-list-redisplay-buffer): Search a
+       channel correctly.
+
+2003-04-17  Daiki Ueno  <daiki@xemacs.org>
+
+       * liece-channel.el: Require 'liece-misc when compiling.
+       (liece-channel-equal): Define as function.
+       (liece-channel-buffer-create): Define as function.
+       (liece-channel-switch-to-last): Define before it is used.
+       * liece-ctcp.el: Require 'liece-misc when compiling.
+       * liece-message.el: Require 'liece-misc when compiling.
+       * liece-misc.el: Move some macros to the beginning of the file.
+       * liece-nick.el: Require 'liece-inlines when compiling.
+       (liece-nick-equal): Define as function.
+       (liece-nick-buffer-create): Define as function.
+
+2003-03-26  Steve Youngs  <youngs@xemacs.org>
+
+       * liece-channel.el (liece-channel-p): Don't wrap the string-match
+       in a 'eval-when-compile' to avoid a void variable error.
+       (liece-channel-modeless-p): Ditto.
+
+2003-03-09  Ben Wing  <ben@xemacs.org>
+
+       * Makefile.lisp:
+       * Makefile.lisp (autoload): New.
+       Separate autoload building from elc building.
+       
+       * liece-make.el (install-update-package-files):
+       Use new `batch-update-directory-autoloads' if available.
+
+2002-12-08  Ville Skyttä  <scop@xemacs.org>
+
+       * Makefile.lisp (all): Not a double-colon any more.
+
+2002-10-11  Yoichi NAKAYAMA  <yoichi@eken.phys.nagoya-u.ac.jp>
+
+       * liece-emacs.el: Require pces to avoid compile error.
+
+2002-09-26  Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-minibuf.el (liece-minibuf-completing-read): Don't use the
+       7th argument of completing-read.
+
+2002-09-24  Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-handle.el (liece-handle-mode-message): Check chnlp before
+       passing mode argument to liece-channel-set-*.
+       [cf. <Bug#161779>]
+
+2002-09-03  Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-handle.el (liece-handle-quit-message): Don't use
+       liece-nick-mark-as-apart.
+       (liece-handle-join-message): Ditto.     
+       [cf. <Liece:00080>]
+
+2002-09-01  Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-handle.el (liece-handle-mode-message): The arglist of
+       liece-nick-set-mode was changed.
+
+2002-08-27  Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-commands.el (liece-command-join-channel): User
+       liece-nick-get-joined-channels.
+
+       * liece-channel.el (liece-channel-set-topic): Define as function.
+       (liece-channel-add-mode): Ditto.
+       (liece-channel-remove-mode): Ditto.
+       (liece-channel-set-mode): Ditto.
+       (liece-channel-add-ban): Ditto.
+       (liece-channel-remove-ban): Ditto.
+       (liece-channel-set-ban): Ditto.
+       (liece-channel-add-exception): Ditto.
+       (liece-channel-remove-exception): Ditto.
+       (liece-channel-set-exception): Ditto.
+       (liece-channel-add-invite): Ditto.
+       (liece-channel-remove-invite): Ditto.
+       (liece-channel-set-invite): Ditto.
+       * liece-nick.el (liece-nick-mark-as-part): Replace
+       liece-nick-{mark,unmark}-as-apart.
+       (liece-nick-get-modes): Define as function.
+       (liece-nick-add-mode): Ditto.
+       (liece-nick-remove-mode): Ditto.
+       (liece-nick-set-mode): Ditto.
+       * liece-handle.el (liece-handle-mode-message): Follow the changes
+       of arglists of liece-channel-set-mode and liece-nick-set-mode.
+
+       * liece.el: Fix typo.
+       * liece-misc.el (liece-current-nickname): Define as function.
+       (liece-current-channel): Ditto.
+       (liece-current-channels): Ditto.
+       (liece-current-chat-partner): Ditto.
+       (liece-current-chat-partners): Ditto.
+
+2002-08-26  Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-handle.el (liece-handle-mode-message): Care
+       liece-channel-set-* are defined as macros.
+       * liece-inlines.el (string-equal-ignore-case): Don't use
+       compare-strings.
+       (string-list-member-ignore-case): Don't use member-ignore-case.
+       Suggested by "Akinori MUSHA" <knu@iDaemons.org>.
+       [cf. <Liece:00075>]
+
+2002-08-11  OHASHI Akira  <bg66@koka-in.org>
+
+       * liece-window.el (liece-configure-windows): Set
+       `liece-channel-buffer' to nil when `liece-current-chat-partner' or
+       `liece-current-channel' is nil.
+       (Suggested by Kazushige Maeda <pff@softai.co.jp>.)
+
+       * liece-dcc.el (liece-dcc-dequeue-request): Do nothing when
+       `liece-dcc-requests' is empty.
+       (liece-command-dcc-accept): Ditto.
+       (liece-command-dcc-chat-connect): Ditto.
+
+2002-07-15  Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-url.el (liece-url-regexp-alist): New user option.
+       (liece-url-add-buttons): Respect liece-url-regexp-alist.  This
+       function is the slightly modified version of the implementation by
+       akira yamada <akira@arika.org>.  [cf. <Liece:00070>]
+
+2002-07-13  Daiki Ueno  <daiki@xemacs.org>
+
+       * liece-menu.el (liece-menu-add-url): Always switch to *Commands*
+       buffer.
+       * liece-xemacs.el (liece-fix-menu-path-switch-buffer): Removed old
+       defadvice to easy-menu-add-item.
+2002-06-08  Adrian Aichner  <adrian@xemacs.org>
+
+       * liece-commands.el (liece-command-nickname): Use
+       truncate-string-to-width instead of non-existent truncate-string.
+       * liece.el (liece-open-server): Ditto.
+
+2002-06-05  Steve Youngs  <youngs@xemacs.org>
+
+       * liece-inlines.el (string-equal-ignore-case): Don't try to use
+       'compare-strings'.
+2002-05-19  Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-xemacs.el (liece-xemacs-modeline-glyph): Check 'xbm.
+
+2002-05-04  Stephen J. Turnbull  <stephen@xemacs.org>
+
+       * liece-make.el (config-liece-package-directory):
+       * liece-config.el (PACKAGEDIR):
+       Handle case when dirs is nil.
+
+       * Makefile.lisp (package): Preload advice.
+
+2002-05-12  Daiki Ueno  <ueno@unixuser.org>
+
+       * gettext.el (gettext-default-locale): New variable.
+       (bind-text-domain): Use it.
+
+2002-05-07  Daiki Ueno  <ueno@unixuser.org>
+
+       * gettext.el (gettext-mapcar*): Eliminate recursion.
+
+2002-04-14  Daiki Ueno  <ueno@unixuser.org>
+
+       * bitmap-stipple.el (bitmap-stipple-frame-char-width): New function.
+       (bitmap-stipple-frame-char-height): New function.
+
+       * liece-compat.el (liece-region-active-p): New function.
+       (liece-truncate-string-to-width): New function.
+
+       * liece-misc.el: Sort macrodefs.
+       (liece-maybe-poll): Abolish.
+
+       * liece-channel.el (liece-channel-last): Simplified.
+       (liece-channel-switch-to-last): Define as function.
+
+       * liece-commands.el (liece-command-ping): Send system-name until
+       liece-server-name is determined.
+
+       * liece-ctcp.el: Load `liece-q-*' even when compiling.
+
+       * liece-hilit.el (liece-highlight-turn-on-font-lock): Don't set
+       font-lock-support-mode if it isn't bound.
+       
+2002-03-28  Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-400.el (liece-handle-475-message): New handler.
+
+       * liece-commands.el (liece-command-join): Don't encode a channel
+       name before treating it as an integer.
+
+       * liece-ctcp.el: Don't throw an error when liece-q-ccl is not found.
+
+2002-04-08  Daiki Ueno  <daiki@xemacs.org>
+
+       * liece-misc.el: Don't require pccl and broken.
+
+2002-04-07  Daiki Ueno  <daiki@xemacs.org>
+
+       * liece-modules.el: Don't compile liece-q-ccl.el.
+       * liece-ctcp.el: Don't require liece-q-ccl.el.
+
+2002-03-24  Daiki Ueno  <daiki@xemacs.org>
+
+       * liece-coding.el (liece-mime-charset-for-write): Use
+       `mime-charset-to-coding-system' instead of `mime-charset-p'.
+       (liece-mime-charset-for-read): Ditto.
+2002-03-20  Daiki Ueno  <ueno@unixuser.org>
+
+       * gettext.el (bind-text-domain): Respect LC_ALL and LC_MESSAGES;
+       reverse lang-paths.
+
+2002-03-20  Daiki Ueno  <ueno@unixuser.org>
+
+       * gettext.el (gettext-parse-Content-Type): Bind `case-fold-search'
+       to t to extract Content-Type: field properly.
+
+2002-03-19  Daiki Ueno  <ueno@unixuser.org>
+
+       * gettext.el: Autoload `mime-content-type-parameter' and
+       `mime-read-Content-Type' only when compiling.
+       (gettext-parse-Content-Type): Add bogus detection logic.
+
+2002-03-19  Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-compat.el (liece-string-to-list): New definition.
+       * liece-000.el (liece-handle-004-message): Use it.
+       * liece-nick.el (liece-nick-remove-mode): Use it.
+       * liece-channel.el (liece-channel-read-mode): Use it.
+       * liece-handle.el (liece-handle-mode-message): Use it.
+
+       * gettext.el: Require `poem' and `static'.
+       (gettext-string-to-list): New definition.
+
+2002-02-17  OHASHI Akira  <bg66@koka-in.org>
+
+       * gettext.el (bind-text-domain): Implement a catalog probe mechanism.
+       (Implemented by YAMASHITA Junji <ysjj@unixuser.org>)
+
+2002-02-12  Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-modules.el (liece-modules-to-compile): Add `liece-coding'.
+
+       * liece-coding.el (liece-mime-charset-for-write): Use
+       default-mime-charset-for-write as its default.
+       (liece-mime-charset-for-read): Use default-mime-charset as its
+       default.
+
+2002-01-28  Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-dcc.el (liece-dcc-start-process): New function.
+       (liece-command-dcc-send): Use it.
+       (liece-command-dcc-receive): Use it.
+       (liece-command-dcc-chat-listen): Use it.
+       (liece-command-dcc-chat-connect): Use it.
+
+2001-11-09  Yoichi NAKAYAMA  <yoichi@eken.phys.nagoya-u.ac.jp>
+
+       * liece-vars.el (liece-truncate-partial-width-windows): Change
+       default value to fix the inconsistency with docstring.
+
+       * liece-window.el (liece-configure-windows): Ditto.
+
+2001-11-03  OHASHI Akira  <bg66@koka-in.org>
+
+        * liece-emacs.el (liece-emacs-unread-mark): Use regexp-quote.
+        (liece-emacs-read-mark): Ditto.
+        * liece-xemacs.el (liece-xemacs-unread-mark): Ditto.
+        (liece-xemacs-read-mark): Ditto.
+
+2001-10-07   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-misc.el (liece-subtract-time): New function.
+       (liece-time-difference): Use it.
+
+2001-10-05   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-misc.el (liece-time-difference): Fix the arglist.       
+       [cf. <Liece:45>]
+
+2001-10-02   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-compat.el (replace-in-string): Follow a change in XEmacs.
+
+2001-10-02   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-vars.el (liece-buffer-min-size): Rename from
+       `liece-buffer-default-size'.
+
+       * liece-commands.el (liece-command-kill): Use `liece-time-elapsed'
+       instead of `liece-time-add'.
+
+       * liece.el (liece-check-buffers-if-interval-expired): Swap the
+       arguments supplied to `liece-time-difference'.
+       (liece-check-buffers): Use `liece-buffer-min-size' instead of
+       `liece-buffer-default-size'.
+
+       * liece-misc.el (liece-time-difference): Define as function.
+       (liece-time-elapsed): Rename from `liece-time-add'.
+       (liece-generate-hex-timestamp): Define as function.
+
+2001-10-02  Katsuhiro Hermit Endo  <hermit@koka-in.org>
+
+       * liece-misc.el (liece-time-difference): Use `abs' for
+       `liece-check-buffers-if-interval-expired'.
+
+2001-09-16  Katsuhiro Hermit Endo  <hermit@koka-in.org>
+
+       * liece-vars.el (liece-server-alist): Update default value.
+
+2001-06-19  OHASHI Akira  <bg66@koka-in.org>
+
+        * liece-url.el (liece-url-regexp): Fix regexp.
+
+        * liece-vars.el (liece-display-unread-mark): Set default to t.
+
+2001-06-14  OHASHI Akira  <bg66@koka-in.org>
+
+        * liece-channel.el (liece-channel-add-buttons): Fix regexp.
+
+        * liece-handle.el (liece-handle-notice-message): Don't set `temp'
+        to nil.
+
+        * liece-menu.el (liece-menu-channel-menu): Don't enable
+        `liece-command-unread-channel' if `liece-channel-unread-list' is nil.
+        (liece-menu-private-menu): Don't bind `liece-command-userhost'.
+
+        * liece-window.el (liece-command-set-window-style): Run
+        `liece-command-reconfigure-windows'.
+
+2001-06-09  OHASHI Akira  <bg66@koka-in.org>
+
+       * liece-handle.el (liece-handle-privmsg-message): Don't compare when
+       `item' and `liece-current-chat-partner' are nil.
+
+2001-02-12   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-compat.el (liece-read-passwd): Revive.
+
+       * liece-clfns.el (liece-clfns-subr-fboundp): Check existence of
+       the function `symbol-file'.
+
+       * liece-q-ccl.el: Require `poem' for char-int.
+       (liece-quote-ccl-256-table): Simplified.
+
+2001-01-02   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-modules.el: Simplified.
+
+2000-12-09   Tanaka Akira  <akr@m17n.org>
+
+       * liece.el (liece-refresh-buffer-window): Simplified.
+
+2000-11-30   Tanaka Akira  <akr@m17n.org>
+
+       * liece.el (liece-refresh-buffer-window): Force to display a last
+       non-empty line in last line in a window on Emacs 21.
+
+2000-10-19   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-ctcp.el: Remove autoload cookies of
+       `liece-command-ctcp-generic',
+       `liece-command-ctcp-userinfo-from-minibuffer',
+       `liece-command-ctcp-x-face-from-xbm-file' and
+       `liece-command-send-file'.
+
+       * liece-commands.el: Add autoload setting for
+       `liece-command-ctcp-action',
+       `liece-command-ctcp-userinfo-from-minibuffer' and
+       `liece-command-ctcp-x-face-from-xbm-file'.
+
+2000-10-16   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-commands.el (liece-command-quit): Use `liece-close-server'.
+
+       * liece.el (liece): Simplify.
+       (liece-close-server): Accept optional argument `quit-string'.
+
+2000-10-12   Akira Ohashi  <bg66@luck.gr.jp>
+
+       * liece-menu.el (liece-menu-ctcp-menu): Follow the CTCP command
+       changed from `liece-command-client-*' to `liece-command-ctcp-*'.
+
+2000-10-07   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-commands.el (liece-command-qualify-nicks): Refer 1st argument.
+
+2000-10-05   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-minibuf.el (liece-minibuffer-complete-channel-modes):
+       Don't use old style backquotes.
+       (liece-minibuffer-completing-read-multiple-1): Remove a partially
+       matched word construct if it exists.
+
+2000-10-03   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-commands.el (liece-command-set-operators): Reset `run'.
+       (liece-command-set-voices): Ditto.
+
+2000-09-30   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-xemacs.el (liece-xemacs-modeline-glyph): Add 'xpm check.
+       (liece-xemacs-create-nick-glyph): Ditto.
+       (liece-xemacs-unread-mark): Ditto.
+
+2000-09-23  Akira Ohashi  <bg66@luck.gr.jp>
+
+       * liece-menu.el (liece-command-toggle-freeze): Rename from
+       `liece-command-freeze'.
+       (liece-command-toggle-own-freeze): Rename from
+       `liece-command-own-freeze'.
+       (liece-command-toggle-beep): Rename from `liece-dialogue-beep'.
+
+2000-09-22   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-handle.el (liece-handle-kill-message): Call
+       `liece-close-server' instead of `liece-clear-system'.
+
+       * liece-commands.el: Don't autoload `liece-window-configuration-pop'.
+       (liece-command-quit): Just send quit.
+
+       * liece.el (liece-close-server): Run `liece-exit-hook'; abolish
+       argument `quit-string'.
+
+       * liece-filter.el (liece-sentinel): Call `liece-close-server'.
+
+2000-09-20   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-compat.el: Require `wid-edit'.
+
+       * liece-inlines.el (liece-locate-icon-file): Don't check existence
+       of the file.
+
+       * liece-emacs.el: Don't require `static' and `wid-edit'.
+       (liece-splash-image): Set default to nil.
+       (liece-emacs-splash-function): New variable.
+       (liece-emacs-splash-with-image): New function splitted from
+       `liece-emacs-splash'; use `image-size'; hide cursor.
+       (liece-emacs-splash-with-stipple): New function.
+
+2000-09-20   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-commands.el (liece-command-toggle-away): Rename from
+       `liece-command-away'.
+       (liece-command-toggle-freeze): Rename from `liece-command-freeze'.
+       (liece-command-toggle-own-freeze): Rename from
+       `liece-command-own-freeze'.
+       (liece-command-toggle-beep): Rename from `liece-command-beep'.
+       (liece-command-load-vars): Abolish.
+
+       * liece.el (liece-dialogue-beep): Abolish.
+       (liece-dialogue-freeze): Abolish.
+       (liece-dialogue-own-freeze): Abolish.
+       (liece-initialize-buffers): Don't parse error message.
+       (liece): Assume `liece-away-message' is nil.
+       (liece-command-map): Don't bind `liece-command-freeze' and
+       `liece-command-own-freeze'.
+       (liece-dialogue-mode-map): Don't bind `liece-command-timestamp'
+       and `liece-command-find-timestamp'; bind
+       `liece-command-toggle-private' to "C-t p"; bind
+       `liece-command-toggle-away' to "C-t a"; bind
+       `liece-command-toggle-freeze' to "C-t f"; bind
+       `liece-command-toggle-own-freeze' to "C-t o".
+
+       * liece-minibuf.el (liece-minibuffer-parse-modes): Don't complete
+       mode flags when completing an argument.
+
+2000-09-19   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-version.el (liece-version): Bump up to 2.0.0.
+
+       * liece-menu.el (liece-menu-callback-set-operators): Rename from
+       `liece-menu-callback-mode+o'.
+       (liece-menu-callback-set-voices): Rename from
+       `liece-menu-callback-mode+v'.
+       (liece-menu-callback-unset-operators): Rename from
+       `liece-menu-callback-mode-o'.
+       (liece-menu-callback-unset-voices): Rename from
+       `liece-menu-callback-mode-v'.
+
+       * liece-nick.el (liece-nick-region-opers): Abolish.
+       (liece-nick-region-voices): Abolish.
+       (liece-nick-update-region): Don't set them.
+
+       * liece.el (liece-dialogue-mode-map): Don't bind `liece-command-exec',
+       `liece-command-lusers' and `liece-command-userhost'.
+
+       * liece-commands.el (liece-command-exec): Abolish.
+       (liece-command-inline): Abolish.
+       (liece-command-set-operators): Rename from `liece-command-mode+o'.
+       (liece-command-set-voices): Rename from `liece-command-mode+v'.
+       (liece-command-qualify-nicks): New function.
+       (liece-command-mode-o): Abolish.
+       (liece-command-mode-v): Abolish.
+       (liece-command-userhost): Abolish.
+       (liece-command-lusers): Abolish.
+
+2000-09-18   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-vars.el (liece-channel-buffer-mode): Set default to t.
+       (liece-nick-buffer-mode): Ditto.
+       (liece-channel-list-buffer-mode): Ditto.
+
+       * liece.el (liece-open-server-internal): Simplify.
+       (liece-open-server): Strip bracketed server name here.
+       (liece-start-server): Fix last change.
+
+2000-09-17   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-vars.el (liece-highlight-mode): Set default to t.
+
+       * liece.el (liece-open-server): Simplify.
+       (liece-start-server): Canonicalize `liece-server' here.
+
+2000-09-17  Akira Ohashi  <bg66@luck.gr.jp>
+
+       * liece-menu.el (liece-menu-channel-menu): Move `liece-command-freeze'
+       from `liece-menu-IRC-menu'.
+       (liece-menu-channel-menu): Move `liece-command-own-freeze'
+       from 'liece-menu-IRC-menu'.
+       (liece-menu-channel-menu): New menu item `liece-dialogue-beep'.
+       (liece-menu-channel-menu): New menu item
+       `liece-command-unread-channel'.
+
+2000-09-17  Akira Ohashi  <bg66@luck.gr.jp>
+
+       * liece-channel.el (liece-channel-read-functions): Rename from
+       `liece-channel-read-hook'.
+
+       * liece-handle.el (liece-channel-unread-functions): Rename from
+       `liece-channel-unread-hook'.
+
+       * liece-emacs.el (toplevel): Use them.
+
+       * liece-xemacs.el (toplevel): Ditto.
+
+2000-09-17   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-make.el (make-liece-sample-files): Abolish.
+       (make-liece-info-files): Abolish.
+
+       * liece-url.el (liece-add-url-functions): Rename from `liece-url-add-hook'.
+
+       * liece.el (liece-after-insert-functions): Rename from `liece-insert-hook'.
+       (liece-before-insert-functions): Rename from `liece-before-insert-hook'.
+
+       * liece-handle.el (liece-notice-cleartext-hook): Abolish.
+       (liece-privmsg-cleartext-hook): Abolish.
+
+       * liece-filter.el (liece-handle-message): Simplify.
+
+       * liece-ctcp.el (liece-ctcp-message): Don't ignore errors in hooks.
+       (liece-ctcp-notice): Ditto.
+       (liece-ctcp-file-notice): Ditto.
+
+       * liece-channel.el (liece-channel-add-mode): Don't use pushnew.
+       (liece-channel-add-exception): Ditto.
+       (liece-channel-add-invite): Ditto.
+
+2000-09-12   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-vars.el (liece-inhibit-startup-message): New user option.
+
+2000-09-11   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-xemacs.el (liece-xemacs-splash-at-point): Don't check `console-type'.
+       (liece-x-face-insert-with-xemacs): Ditto.
+
+2000-09-11  Akira Ohashi  <bg66@luck.gr.jp>
+
+       * liece-emacs.el (liece-emacs-unread-character): Abolish.
+
+       * liece-vars.el (liece-channel-unread-character): New variable.
+
+       * liece-xemacs.el (liece-xemacs-unread-mark): Simplify; Don't use
+       `featurep' and `console-type'.
+       (toplevel): Ditto.
+
+2000-09-11   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-minibuf.el: Autoload `completing-read-multiple'; declare
+       `crm-separator'.
+       (liece-minibuffer-completing-read): Rename from
+       `liece-minibuffer-completing-default-read'; accept optional arguments
+       `history' and `default'.
+       (liece-minibuffer-completion-separator): New variable.
+       (liece-minibuffer-completion-table): New variable.
+       (liece-minibuffer-completing-read-multiple-1): New completion function.
+       (liece-minibuffer-completing-read-multiple): Rename from
+       `liece-minibuffer-completing-sequential-read'; accept optional
+       arguments `history' and `default'; use `completing-read-multiple'
+       when optional 8th argument `multiple-candidate' is specified.
+
+       * liece-xemacs.el (liece-xemacs-redisplay-unread-mark): Don't bind `chnl'.
+
+2000-09-11   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-commands.el (liece-command-quit): Don't send QUIT.
+
+       * liece-emacs.el (liece-emacs-splash): Use `generate-new-buffer'
+       instead of `liece-get-buffer-create'
+
+       * liece-xemacs.el (liece-xemacs-splash): Synch with liece-emacs.el
+
+       * liece.el (liece-clear-system): Call
+       `liece-buffer-dispose-function' instead of burying buffer.
+       (liece-open-server-internal): Simplify; Don't use
+       `liece-get-buffer-create' to prepare process-buffer.
+       (liece-close-server): Accept optional argument `quit-string'.
+
+       * liece-vars.el (liece-buffer-dispose-function): New variable.
+
+2000-09-10   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-inlines.el (string-list-remove-ignore-case): Remove car of the element.
+       (string-list-delete-ignore-case): Ditto.
+       (string-list-remove): Ditto.
+       (string-list-delete): Ditto.
+
+2000-09-06   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-clfns.el (remq): New compiler macro.
+
+2000-09-05  Akira Ohashi  <bg66@luck.gr.jp>
+
+       * liece-channel.el (liece-channel-redisplay-buffer): New hook
+       `liece-channel-read-hook'.
+       (liece-channel-change): Run `liece-redisplay-unread-mark'.
+
+       * liece-handle.el (liece-handle-privmsg-message): New hook
+       `liece-channel-unread-hook'.
+
+       * liece-vars.el (liece-display-unread-mark): New variable.
+
+       * liece-xemacs.el (liece-xemacs-unread-icon): Rename from
+       `liece-xemacs-channel-balloon-icon'.
+       (liece-xemacs-unread-mark): Rename and simplified from
+       `liece-xemacs-channel-balloon'.
+       (liece-xemacs-read-mark): Rename and simplified from
+       `liece-xemacs-channel-balloon-kill'.
+       (liece-xemacs-redisplay-unread-mark): New function.
+       (toplevel): Add them to hook.
+
+       * liece-emacs.el (liece-emacs-unread-character): New variable.
+       (liece-emacs-unread-mark): New function.
+       (liece-emacs-read-mark): Ditto.
+       (liece-emacs-redisplay-unread-mark): Ditto.
+       (toplevel): Add them to hook.
+
+2000-09-04   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-inlines.el (string-equal-ignore-case): Check return value
+       of `compare-strings'.
+
+2000-09-03   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-clfns.el: Require `pym'.
+       (liece-clfns-subr-fboundp): New macro.
+       (last,member-if,member-if-not,delete-if,remove-if,remove-if-not,
+       assoc-if,rassoc-if): Use it.
+
+       * liece-inlines.el (string-list-member-ignore-case): Use
+       `member-ignore-case'.
+       (string-list-remove-ignore-case): Use remq.
+       (string-list-member): Abolish.
+       (string-list-delete-ignore-case): Use delq.
+       (string-equal-ignore-case): Use `compare-strings' if available.
+
+2000-09-01   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-channel.el (liece-channel-change): Handle
+       `liece-current-chat-partner'.
+
+       * Makefile.am (SOURCES): Remove `liece-crypt'.
+
+       * liece-crypt.el: Remove.
+
+       * liece-400.el (liece-handle-433-message): Use `liece-beep'
+       (liece-handle-432-message): Ditto.
+
+       * liece-misc.el (liece-beep): New macro.
+       (liece-set-beep): Rename from `liece-beep'.
+
+       * liece-xemacs.el (liece-xemacs-channel-balloon): Abolish local
+       variable `chnl'.
+
+       * liece.el: Don't require `liece-crypt'.
+       (liece-crypt-map): Abolish.
+       (liece-buffer-mode-alist): Remove `liece-CRYPT-buffer'.
+       (liece-command-mode-map): Don't bind
+       `liece-command-enter-message-opposite-crypt-mode'.
+       (liece): Don't initialize crypt indicator.
+       (liece-command-mode): Ditto.
+       (liece-dialogue-mode): Ditto.
+       (liece-channel-mode): Ditto.
+
+       * liece-xemacs.el: Don't require `liece-crypt'.
+       (liece-toolbar-crypt-active-icon): Abolish.
+       (liece-toolbar-crypt-inactive-icon): Abolish.
+       (liece-toolbar-crypt-icon): Abolish.
+       (liece-toolbar-crypt-glyph): Abolish.
+       (liece-toolbar-crypt-active-glyph): Abolish.
+       (liece-toolbar-crypt-inactive-glyph): Abolish.
+       (liece-toolbar-spec-list): Don't set `liece-toolbar-crypt-glyph'.
+       (liece-xemacs-setup-toolbar-hook): Remove `liece-toolbar-setup-crypt-glyph'.
+       (liece-toolbar-setup-crypt-glyph): Abolish.
+       (liece-toolbar-toggle-crypt): Abolish.
+
+       * liece-vars.el (liece-defected-message-prefix): Abolish.
+       (liece-suspicious-message-prefix): Abolish.
+       (liece-beep-function): New variable.
+
+       * liece-message.el (liece-message-brackets-function): Don't handle
+       `liece-message-encrypted-p'.
+       (liece-message-encrypted-p): Abolish.
+       (liece-message-suspicious-p): Abolish.
+       (liece-message-garbled-p): Abolish.
+       (liece-message-fingerprint): Abolish.
+       (liece-message-timestamp): Abolish.
+
+       * liece-menu.el (liece-menu-crypt-menu): Abolish.
+       (liece-menu-channel-menu): Remove `liece-menu-crypt-menu'.
+       (liece-menu-alist): Ditto.
+       (liece-menu-crypt-menu-map): Abolish.
+
+       * liece-handle.el (liece-handle-notice-message): Don't use
+       `with-liece-decryption'.
+       (liece-handle-privmsg-message): Ditto.
+       Use `liece-beep' instead of `beep'.
+
+       * liece-modules.el (liece-modules-to-compile): Remove `liece-crypt'.
+
+       * liece-globals.el (liece-crypt-indicator): Abolish.
+       (liece-CRYPT-buffer): Abolish.
+       (liece-C-buffer): Abolish.
+
+       * liece-commands.el: Don't require `liece-crypt'.
+       (liece-command-send-message): Abolish optional argument ARG and KEY.
+       (liece-command-enter-message): Ditto.
+       (liece-command-message): Ditto.
+       (liece-enter-message): Abolish.
+       (liece-command-part): Don't set crypt indicator.
+       (liece-switch-to-channel): Ditto.
+       (liece-switch-to-channel-no): Ditto.
+       (liece-command-private-conversation): Ditto.
+       (liece-command-toggle-crypt): Abolish.
+
+2000-08-31  Akira Ohashi  <bg66@luck.gr.jp>
+
+       * liece-handle.el (liece-handle-privmsg-message): Fixed.
+
+2000-08-30  Akira Ohashi  <bg66@luck.gr.jp>
+
+       * liece-commands.el (liece-command-unread-channel): New function.
+
+       * liece.el (liece-command-map): Bind "\C-u" to it.
+       (liece-channel-list-mode-map): Bind "u" to it.
+
+2000-08-29   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-channel.el (liece-channel-change): Run
+       `liece-redisplay-buffer-functions' only when
+       `liece-current-channel' is non-nil.
+
+       * liece-commands.el (liece-command-who): Check
+       `liece-current-channel'.
+       (liece-command-names): Ditto.
+       Suggested by: Yoichi NAKAYAMA <yoichi@eken.phys.nagoya-u.ac.jp>.
+
+2000-08-30  Akira Ohashi <bg66@luck.gr.jp>
+
+       * liece-vars.el (liece-channel-unread-list): New variable.
+
+       * liece-channel.el (liece-channel-unread-p): New function.
+       (liece-channel-redisplay-buffer): Use it.
+
+       * liece-handle.el (liece-handle-privmsg-message): Ditto.
+
+2000-08-29  Akira Ohashi  <bg66@luck.gr.jp>
+
+       * liece-channel.el (liece-channel-change): Run
+       `liece-redisplay-buffer-functions'.
+
+2000-08-23   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-handle.el (liece-handle-privmsg-message): Use
+       `liece-pick-buffer-1' to construct channel buffer name.
+
+2000-08-23  Akira Ohashi  <bg66@luck.gr.jp>
+
+       * liece-xemacs.el (liece-xemacs-channel-balloon): New function.
+       Show balloon icon to `liece-cahnnel-list-buffer' as XEmacs glyphs
+       when non-current channel message is received.
+       (liece-xemacs-channel-balloon-kill): New function.
+       Kill the balloon icon.
+       
+2000-08-17   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece.el (liece-server-keyword-map): Bind connection type.
+
+2000-08-16   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece.el (liece-open-server-internal): Use
+       `liece-open-network-stream'; bind liece-tcp-connection-type.
+
+       * liece-tcp.el (liece-tcp-open-program-stream-as-binary): Abolish.
+       (liece-tcp-open-ssl-stream-as-binary): Abolish.
+       (liece-tcp-open-rlogin-stream-as-binary): Abolish.
+       (liece-tcp-wait-for-string): Abolish.
+       (liece-tcp-stream-alist): New variable.
+       (liece-open-network-stream): Abolish 5th argument `type'.
+
+2000-08-01  Yoshiki Hayashi  <yoshiki@xemacs.org>
+
+       * liece-xemacs.el (liece-toolbar-position): Use
+       function defaul-toolbar-position instead of variable.
+
+2000-07-17   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-emacs.el (create-image): Don't advise.
+       (liece-widget-keymap): Remove checking about 'button3.
+       (liece-emacs-widget-button-click): Save point in window explicitly.
+
+       * liece-ctcp.el (liece-command-ctcp-generic): Fix format string.
+
+2000-07-16  Akira Ohashi  <bg66@luck.gr.jp>
+
+       * liece-commands.el (liece-command-beep): New function.
+       Toggle the automatic beep notice when the channel message is received.
+
+       * liece.el (liece-dialogue-mode-map): Bind "B" to liece-dialogue-beep.
+
+       * liece-vars.el (liece-default-beep): New variable.
+       (liece-beep-when-invited): Ditto.
+       (liece-beep-when-privmsg): Ditto.
+       (liece-beep-words-list): Ditto.
+
+2000-05-07   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-tcp.el
+       (liece-tcp-rlogin-parameters): Use `socket' instead of `telnet'.
+       (liece-tcp-open-rlogin-stream): Don't wait for a connection.
+       (liece-tcp-open-rlogin-stream-as-binary): Simply wrap
+       `liece-tcp-open-rlogin-stream'.
+
+2000-04-21   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-ctcp.el
+       (liece-ctcp-make-menu-command-wrapper): Quote CTCP subcommands.
+
+       * liece-mail.el (liece-maintainer-address): New ML address.
+
+2000-04-12   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-url.el: Don't require browse-url when compiling.
+       (liece-url-browser-name): Abolish.
+       (liece-url-prepare-browser-function): Abolish.
+       (liece-url-mail-regexp): Abolish.
+       (liece-url-browser-function): Abolish.
+       (liece-url-link-action): Use browse-url directly.
+       (liece-command-browse-url): Ditto.
+       (liece-url-add-buttons): Remove local variable `url-start',
+       `url-end' and `url'.
+       Suggested by: Kenichi OKADA <okada@opaopa.org>
+
+       * liece-xemacs.el
+       (liece-toolbar-position): Check feature 'toolbar was provided.
+
+2000-04-08   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-xemacs.el (liece-xemacs-setup-toolbar): Run
+       `liece-xemacs-setup-toolbar-hook' only once.
+       (liece-setup-toolbar): Don't check return value
+       of `liece-xemacs-setup-toolbar'.
+       Reported by: Yosuke MITSUMASU <werdna@ntn.org>
+
+2000-04-05   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-commands.el: Add autoload for liece-command-ctcp-version,
+       liece-command-ctcp-userinfo,liece-command-ctcp-clientinfo,
+       liece-command-ctcp-ping,liece-command-ctcp-time,
+       liece-command-ctcp-x-face,liece-command-ctcp-comment,
+       liece-command-ctcp-help.
+       Suggested by: HARUYAMA Seigo <haruyama@unixuser.org>.
+
+       * liece-ctcp.el
+       (liece-ctcp-make-menu-command-wrapper): Don't use `#'.
+       (liece-ctcp-make-command-wrapper): Ditto.
+
+2000-04-04   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece.el (liece-client-query-keys): Rename all commands.
+
+       * liece-vars.el
+       (liece-ctcp-userinfo): Rename from `liece-client-userinfo'.
+       (liece-ctcp-x-face): Ditto.
+
+       * liece-ctcp.el (liece-ctcp-message): Abolish macro.
+       (liece-ctcp-file-message): Ditto.
+
+2000-03-28   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-emacs.el: Require `derived'.
+
+2000-03-24   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-inlines.el (liece-locate-path): Use
+       `liece-locate-data-directory' instead of `locate-data-directory'.
+
+2000-03-23   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-q-ccl.el (ccl-set-register-right): Abolish.
+       (liece-quote-ccl-decode): Simplified.
+
+       * liece-compat.el (liece-suppress-mode-line-format): Copy original
+       `mode-line-format' before modification.
+       (locate-data-directory): Abolish.
+       (liece-locate-data-directory): New function.
+
+       * liece-xemacs.el (liece-xemacs-suppress-modeline-format): Ditto.
+       (liece-locate-data-directory): Override with `locate-data-directory'.
+
+       * liece.el
+       (liece-command-mode): Define `mode-line-format' as buffer local.
+       (liece-dialogue-mode): Exchange `mode-line-modified' position.
+       (liece-clear-system): Check buffer status.
+
+       * liece-ctcp.el (liece-ctcp-xyzzy-message): Abolish.
+       (liece-command-send-file): Don't narrowing buffer.
+       (liece-ctcp-file-save-directory): Default to `liece-directory'.
+       (liece-register-file-handler): New macro.
+       (liece-ctcp-notice): Rewrite.
+       (liece-ctcp-message): Rewrite.
+       (liece-query-client-insert-to-generic): Abolish.
+       (liece-query-client-version): Abolish.
+       (liece-query-client-userinfo): Abolish.
+       (liece-query-client-help): Abolish.
+       (liece-query-client-clientinfo): Abolish.
+       (liece-query-client-ping): Abolish.
+       (liece-query-client-time): Abolish.
+       (liece-query-client-x-face): Abolish.
+       (liece-query-client-last-command): Rename from
+       `liece-query-client-lastcommand'.
+       (liece-query-client-alist): Abolish.
+       (liece-ctcp-last-nick): Rename from `liece-query-client-nick'.
+       (liece-command-ctcp-x-face-from-minibuffer): Abolish.
+       (liece-command-ctcp-x-face-from-commandbuffer): Abolish.
+       (liece-command-ctcp-userinfo-from-commandbuffer): Abolish.
+
+2000-03-22   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-xemacs.el (liece-xemacs-icon-path): Abolish.
+       (liece-toolbar-position): Default to `default-toolbar-position'.
+       (liece-xemacs-setup-toolbar): Remove directory checking.
+       (liece-xemacs-modeline-glyph): Suppress glyph specs.
+       (liece-xemacs-create-nick-glyph): Ditto.
+
+       * liece-emacs.el (liece-emacs-icon-path): Abolish.
+
+       * liece-intl.el (liece-intl-load-catalogue): Rewrite with
+       `liece-locate-path'; remove local binding.
+
+       * liece-window.el (liece-window-load-style-file): Rewrite with
+       `liece-locate-path'; remove local binding.
+
+       * liece-compat.el (locate-data-directory): New function.
+
+       * liece-inlines.el (liece-find-data-directory): Abolish.
+       (liece-locate-path): Rename from `liece-find-path'; use
+       `locate-data-directory'; reorder arguments.
+       (liece-locate-icon-file): New function.
+
+2000-03-20   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-globals.el
+       (liece-command-buffer,liece-dialogue-buffer,liece-private-buffer,
+       liece-others-buffer,liece-channel-buffer,
+       liece-channel-buffer-format,liece-channel-list-buffer,
+       liece-nick-buffer,liece-nick-buffer-format,
+       liece-KILLS-buffer,liece-IGNORED-buffer,liece-WALLOPS-buffer,
+       liece-CRYPT-buffer,liece-server-buffer): Remove preceding `*IRC*'.
+
+       * liece-xemacs.el
+       (liece-xemacs-splash-at-point): Bind
+       `liece-insert-environment-version' to nil.
+       (liece-xemacs-splash): Ditto.
+       (liece-xemacs-suppress-modeline-format): New function.
+       (liece-suppress-mode-line-format): Override with
+       `liece-xemacs-suppress-modeline-format'.
+       (liece-xemacs-mode-line-buffer-identification): Decorate 1st
+       element and modify whole identification by side effect.
+
+       * liece-compat.el (current-language-environment): Abolish.
+       (frame-title-format): Abolish.
+       (enable-multibyte-characters): Abolish.
+       (liece-suppress-mode-line-format): New function.
+
+       * liece-version.el: Use product.el.
+       (liece-version): New function.
+       (liece-user-interface-product): Abolish.
+       (liece-product-name): Abolish.
+       (liece-product-version): Abolish.
+       (liece-product-code-name): Abolish.
+       (liece-user-agent-value): Abolish.
+       (liece-command-version): Abolish.
+       (liece-environment-version): Rename from
+       `liece-emacs-user-agent-value'.
+
+       * bitmap-stipple.el
+       (bitmap-stipple-insert-pixmap): Don't set point to `point-min'.
+
+       * liece-xbm.el: Update.
+
+       * liece-emacs.el (liece-emacs-splash): Display version number;
+       bind `liece-insert-environment-version' to nil.
+       (liece-emacs-mode-line-buffer-identification): Decorate 1st
+       element and modify whole identification by side effect.
+
+       * liece-vars.el (liece-nick-max-length): New variable.
+       (liece-insert-environment-version): New variable.
+
+       * liece.el (liece-truncate-nickname): Abolish.
+       (liece-client-query-keys,liece-dialogue-keys,
+       liece-select-keys,liece-crypt-keys): Define as a plist.
+       (liece-local-set-keys): New function borrowed from gnus-util.el.
+       (liece-define-keys): Ditto.
+       (liece-define-keys-safe): Ditto.
+       (liece-define-keys-1): Ditto.
+       (liece-command-map): Bind "\C-m" to liece-command-modec.
+       (liece-command-mode): Don't set `mode-line-format' directly;
+       exchange `mode-line-modified' position;
+       (liece-dialogue-mode): Ditto.
+       (liece-others-mode): Ditto.
+       (liece-channel-mode): Ditto.
+       (liece-nick-mode): Ditto.
+       (liece-channel-list-mode): Ditto.
+
+2000-03-19   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * gettext.el (bind-text-domain): Don't refer "PATHNAME/DOMAIN.mo"
+       directly.
+
+       * bitmap-stipple.el,gettext.el,liece-000.el,liece-200.el,
+       liece-300.el,liece-400.el,liece-500.el,liece-commands.el,
+       liece-config.el,liece-crypt.el,liece-ctcp.el,liece-dcc.el,
+       liece-filter.el,liece-globals.el,liece-handle.el,liece-hilit.el,
+       liece-inlines.el,liece-intl.el,liece-mail.el,liece-make.el,
+       liece-menu.el,liece-message.el,liece-minibuf.el,liece-misc.el,
+       liece-nick.el,liece-q-ccl.el,liece-q-el.el,liece-tcp.el,
+       liece-version.el,liece-window.el,liece-x-face.el: Checkdoc.
+
+       * liece-menu.el (liece-nick-popup-menu): Use copy-sequence instead
+       of copy-tree.
+
+       * liece-modules.el (liece-modules-to-compile): Modify for
+       `liece-clfns' and `liece-handler'.
+
+       * liece-handler.el: Rename from llunf.el.
+
+       * liece-clfns.el: New file.
+
+       * liece-channel.el (liece-channel-add-buttons): Fix regexp.
+       (liece-channel-add-ban): Use add-to-list instead of pushnew.
+
+       * liece-coding.el
+       (liece-default-coding-system): Abolish.
+       (liece-mime-charset-for-write): Rename from
+       `liece-default-mime-charset'.
+       (liece-mime-charset-for-read): Rename from
+       `liece-default-mime-charset-for-read'.
+
+       * liece.el (liece-client-query-map,liece-dcc-map,
+       liece-crypt-map,liece-friends-map,liece-channel-list-mode-map,
+       liece-nick-mode-map,): Use make-sparse-keymap when initialising.
+       (liece-command-mode): Don't set liece-display-frame-title to nil.
+       (liece-dialogue-mode-map): Bind `L' to liece-command-load-vars
+       instead of `C-l'; bind `S' to liece-command-save-vars instead of
+       `s'; bind `M' to liece-command-modec instead of `C-m'; bind `O' to
+       liece-dialogue-own-freeze instead of `M'.
+       (liece-buffer-last-check-time): Rename from
+       `liece-last-checkbuffer-time'.
+       (liece-check-buffers): Define as function.
+       (liece-check-buffers-if-interval-expired): Simplified.
+
+       * liece-vars.el
+       (liece-buffer-max-size): Rename from `liece-buffer-maxsize'.
+       (liece-buffer-default-size): Rename from `liece-buffer-defsize'.
+       (liece-buffer-check-interval): Rename from
+       `liece-checkbuffer-interval'.
+
+       * liece-emacs.el (liece-emacs-widget-button-click): Don't use
+       `event-buffer'.
+
+       * liece-xemacs.el
+       (liece-xemacs-get-buffer-window-list): Abolish.
+       (liece-xemacs-run-at-time): Abolish.
+       (liece-xemacs-put-text-property): Abolish.
+       (liece-xemacs-add-text-property): Abolish.
+
+       * liece-minibuf.el (liece-minibuffer-map): Use `set-keymap-parent'
+       instead of `liece-set-keymap-parents'.
+
+       * liece-compat.el: Don't require emu, broken, alist.
+       (remassoc): Abolish.
+       (remassq): Abolish.
+       (liece-run-at-time): Abolish.
+       (liece-cancel-timer): Abolish.
+       (with-timeout): Abolish.
+       (with-timeout-handler): Abolish.
+       (liece-get-buffer-window-list): Abolish.
+       (liece-set-keymap-parents): Abolish.
+       (event-buffer): Abolish.
+       (event-point): Abolish.
+       (truncate-string-to-width): Abolish.
+       (plist-get): Abolish.
+       (read-passwd): Abolish.
+       (colon-keyword-usable): Abolish.
+       (turn-on-font-lock): Abolish.
+       (liece-make-overlay): Abolish.
+       (liece-delete-overlay): Abolish.
+       (liece-overlay-put): Abolish.
+       (liece-move-overlay): Abolish.
+       (liece-overlay-end): Abolish.
+       (liece-overlay-get): Abolish.
+       (liece-overlays-at): Abolish.
+       (liece-put-text-property): Abolish.
+       (liece-add-text-property): Abolish.
+       (buffer-disable-undo): Abolish.
+       (valid-plist-p): Abolish.
+
+       * liece-url.el (liece-url-browser-netscape): Abolish.
+
+2000-03-08   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-compat.el (liece-get-buffer-window): Search all frames.
+
+2000-02-28   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece.el (liece-command-mode): Set frame-title-format when
+       running on window-system environment.
+
+2000-02-18   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-emacs.el (liece-emacs-splash): Use `frame-char-width' and
+       `frame-char-height' when calculating logo centering.
+
+2000-02-17   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-400.el (liece-handle-443-message): Check channel name.
+
+2000-02-13   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-coding.el
+       (liece-coding-encode-charset-region): Define as function.
+       (liece-coding-encode-charset-string): Define as function.
+
+       * liece-dcc.el
+       (liece-dcc-chat-send): Switch to liece-command-buffer.
+       (liece-dcc-enqueue-request): Rename.
+       (liece-dcc-dequeue-request): Ditto.
+
+       * liece-misc.el (liece-send-as-binary): Abolish.
+       (liece-repair-crlf): Abolish.
+       (liece-send): Switch to liece-command-buffer.
+
+       * liece-emacs.el (liece-emacs-splash): Use `font-info' if 'font
+       parameter of the selected frame is not a fontset name.
+
+       * liece.el (liece-open-server-internal): Set process-buffer of
+       open-network-stream as unibyte.
+
+2000-02-10   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-xemacs.el (liece-toolbar-icon-convert-1): New function.
+       (liece-toolbar-icon-states): New variable.
+
+       * liece-emacs.el (liece-emacs-widget-button-click): Don't preserve
+       previously selected window.
+
+2000-01-23   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-emacs.el: Require `image' when compiling.
+       (create-image): Add optional argument `data-p'.
+
+2000-01-22   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-message.el (liece-message-empty-predicate): New variable.
+
+       * liece-commands.el
+       (liece-command-message): Use `liece-message-empty-predicate'.
+
+2000-01-16   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-modules.el (liece-modules): Don't install `queue-m'.
+
+       * liece-dcc.el: Don't require `queue-m' at runtime.
+
+       * liece-hilit.el:
+       Add autoload setting for `liece-channel-add-buttons' and
+       `liece-nick-add-buttons'.
+       (liece-highlight-maybe-turn-on-font-lock): Activate
+       `liece-channel-add-buttons' and `liece-nick-add-buttons' when
+       inserting every line.
+
+       * liece-compat.el (liece-map-overlays): New function.
+       (liece-kill-all-overlays): Use it.
+
+       * liece-xemacs.el (liece-xemacs-map-extents): New function.
+       (liece-xemacs-kill-all-overlays): Use it.
+       (liece-map-overlays): New alias to `liece-xemacs-map-extents'.
+
+       * liece-nick.el (liece-nick-redisplay-buffer): New function.
+       (liece-nick-add-buttons): New function.
+
+       * liece-channel.el
+       (liece-channel-redisplay-buffer): New function.
+       (liece-channel-list-redisplay-buffer): New function.
+       (liece-channel-buffer-invisible-p): Remove redundant cond.
+       (liece-channel-part-internal): Remove redundant `function'.
+       (liece-channel-list-add-button): Rename from
+       `liece-channel-add-button'.
+       (liece-channel-push-button-action): Use `liece-command-join'
+       instead of `liece-switch-to-channel'.
+
+       * liece-commands.el (liece-switch-to-channel-1): Abolish.
+       (liece-redisplay-buffer-functions): New variable.
+
+2000-01-07   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-commands.el
+       (liece-command-next-channel): Traverse channel list circularly.
+       (liece-command-previous-channel): Likewise.
+
+1999-12-26   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-commands.el
+       (liece-command-previous-channel): Remove nil from channel list.
+       (liece-command-next-channel): Ditto.
+
+1999-12-24   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-emacs.el (liece-emacs-splash): Check whether logo height
+       is larger than frame height.
+
+       * liece-crypt.el (liece-crypt-maybe-encrypt-message): Simplified.
+
+       * liece-commands.el
+       (liece-command-enter-message-encrypted): Abolish.
+       (liece-command-enter-message-cleartext): Abolish.
+       (liece-command-enter-message-opposite-crypt-mode): Abolish.
+       (liece-command-enter-message-with-key): Abolish.
+
+1999-12-23   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-version.el (liece-user-agent-value): Add APEL version.
+
+       * liece-inlines.el (liece-next-line): New macro.
+
+       * liece-ctcp.el
+       (liece-command-client-action): Use `liece-next-line'.
+       (liece-command-client-userinfo-from-commandbuffer): Ditto.
+
+       * liece-channel.el (liece-channel-member): Use `member-if' instead
+       of `find-if'.
+
+       * liece.el (liece): Don't use `liece-command-describe-briefly'.
+       (liece-command-mode): Don't bind `next-line-add-newlines'.
+       (liece-dialogue-keys): Don't bind `C-u'.
+
+       * liece-commands.el (liece-command-topic): If called with prefix
+       argument insert the current topic as default.
+       (liece-command-finger): Add documentation about optional 2nd
+       argument.
+       (liece-command-describe-briefly): Abolish.
+       (liece-enter-message): Abolish local variable `message'.
+       (liece-command-join-channel): Fix paren style.
+       (liece-command-join-partner): Ditto.
+       (liece-command-join): Ditto.
+       (liece-command-part): Ditto.
+       (liece-switch-to-channel-no): Ditto.
+       (liece-command-complete): Ditto.
+       (liece-command-next-channel): Rewrite with using
+       `liece-channel-member'.
+       (liece-command-previous-channel):
+       (liece-command-push): Abolish local variable `rest-sym' and
+       `item'; don't use `liece-channel-remove'.
+       (liece-command-pop): Abolish local variable `rest-sym'.
+       (liece-command-tag-region): Don't create temp buffer.
+
+1999-12-21   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-misc.el (liece-set-channel-indicator): Switch to
+       `liece-command-buffer' when updating modeline.
+
+1999-12-19   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-minibuf.el (liece-minibuffer-map): Don't use
+       `set-keymap-parents'.
+
+       * liece-compat.el (liece-set-keymap-parents): Rename from
+       `set-keymap-parents'.
+       (turn-on-font-lock,event-buffer,event-point,region-active-p,
+       remassoc,remassq,valid-plist-p,plist-get): Add document.
+
+1999-12-14   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece.el (liece-insert-internal): Don't bind `tab-stop-list'.
+       (liece-dialogue-mode): Declare `tab-stop-list' as buffer local.
+
+1999-12-01   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-message.el (liece-message-parent-buffer): Add condtion.
+
+1999-11-13   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece.el (liece-read-variables-files): Make the `~/.liece/'
+       directory if there is no initialization file.
+
+1999-11-10   Kenichi OKADA  <okada@opaopa.org>
+
+       * liece-xemacs.el (liece-xemacs-splash-at-point): Calculate
+       horizontal position of the splash logo.
+
+1999-11-10   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-emacs.el (liece-emacs-splash): Check the number of
+       the arguments of `insert-image'.
+
+1999-11-07   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-coding.el (detect-coding-string): Remove.
+       (liece-detect-coding-string): Don't define if
+       `detect-coding-string' does not exist.
+
+1999-11-05   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-url.el (liece-url-add-buttons): Accept optional arguments
+       `start' and `end'.
+
+       * liece.el (liece-save-point): New macro; borrowed from SKK.
+       (liece-before-insert-hook): New variable.
+       (liece-insert-internal): Refine.
+
+1999-11-01   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-misc.el (liece-get-buffer-create): Use memq instead of
+       member to search over buffers list.
+
+1999-10-29  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-handle.el (liece-handle-ping-message): Return the
+       argument correctly.
+
+       * liece.el (liece-insert-internal): Remove `inline'.
+
+1999-10-27  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-commands.el (liece-command-nick-scroll-down): Fix
+       argument list.
+       (liece-command-nick-scroll-up): Ditto.
+
+       * liece-hilit.el (liece-highlight-turn-on-font-lock): Set
+       `liece-highlight-maybe-play-jingle' as local hook.
+       (liece-highlight-font-lock-keywords): Undo last change.
+
+1999-10-26   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece.el (liece-refresh-windows): Remove.
+       (liece-refresh-buffer-window): New function `liece-refresh-windows'.
+       (liece-insert-internal): Preserve old point unconditionally when
+       the buffer is frozen.
+
+1999-10-21   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-misc.el (liece-freeze): Rename from `liece-freeze-toggle'.
+       (liece-own-freeze): Rename from `liece-own-freeze-toggle'.
+
+       * liece.el: Add autoload for `liece-command-submit-bug-report'.
+       (liece-overriding-command-keys): Rename.
+       (liece-dialogue-keys): Bind `liece-command-submit-bug-report'.
+
+       * liece-commands.el (liece-command-scroll-down): Use
+       `scroll-other-window'; accept prefix value.
+       (liece-command-scroll-up): Ditto.
+       (liece-command-nick-scroll-down): Ditto.
+       (liece-command-nick-scroll-up): Ditto.
+       (liece-command-freeze): Accept prefix argument.
+       (liece-command-own-freeze): Ditto.
+       (liece-command-quit): Refine.
+
+1999-10-20   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-commands.el (liece-command-display-friends): Remove
+       `save-excursion'.
+
+       * liece.el (liece-read-variables-files): Prepare startup
+       directory if it does not exist.
+
+       * liece-vars.el (liece-directory): New variable.
+       (liece-variables-file): Relocate under `liece-directory'.
+
+       * liece-ctcp.el (liece-ctcp-version-message): Refer
+       `liece-user-agent-value'.
+
+       * liece-menu.el: Check features about menubars.
+
+       * liece-xemacs.el (liece-xemacs-hide-scrollbars): Set
+       `scrollbar-height' to 0 if `horizontal-scrollbar-visible-p' is not
+       available.
+
+       * liece-mail.el (liece-command-submit-bug-report): New function.
+       (liece-maintainer-address): New variable.
+
+       * gettext.el (gettext-load-message-catalogue): Enclose with
+       `as-binary-input-file' instead of using `set-buffer-multibyte' twice.
+       (gettext-load-portable-message-catalogue): Likewise.
+       (dgettext): Check the cdr of catalogue entry.
+       (gettext-gmo-read-32bit-word): Mask each byte with 255.
+
+       * liece-compat.el (truncate-string-to-width): New alias.
+
+       * liece.el (liece-server-keyword-bind): Quote colon keywords.
+
+       * liece-make.el (make-liece-info-files): Check if
+       `set-language-environment' exists.
+
+       * liece-misc.el (liece-server-host): Quote colon keyword.
+
+1999-10-19   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-hilit.el (liece-highlight-font-lock-keywords): Undo last
+       change; accept partial matcher as the value of
+       `liece-highlight-pattern'.
+       (liece-highlight-maybe-play-jingle): New function.
+       (liece-highlight-maybe-turn-on-font-lock): Add
+       `liece-highlight-maybe-play-jingle' to `after-change-functions'.
+
+1999-10-14   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * gettext.el (gettext-load-message-catalogue): Use hashtable.
+       (gettext-load-portable-message-catalogue): Likewise.
+
+1999-10-13  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-misc.el (next-visible-point): Don't advise.
+       (liece-remove-properties-region): Enclose by `save-restriction'.
+
+1999-10-12   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-commands.el (liece-command-send-action): Remove.
+
+       * liece-ctcp.el (liece-command-client-action): Move from
+       `liece-commands.el'; mark `liece-command-send-action' as obsolete.
+       (liece-client-x-face-notice): Remove whitespaces.
+
+       * liece-handle.el (liece-handle-kick-message): Fix message.
+
+1999-10-11  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * gettext.el (gettext-default-mime-charset): New variable.
+       (gettext-parse-Content-Type): Use it.
+
+1999-10-07  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-misc.el (liece-message): Fix message prefix.
+
+       * liece-compat.el (liece-find-data-directory): Move to
+       `liece-inlines'.
+
+       * liece-xemacs.el (liece-xemacs-icon-path): Use `liece-find-path'.
+
+       * liece-emacs.el (liece-emacs-icon-path): Use `liece-find-path'.
+
+       * liece-inlines.el (liece-find-path): New function.
+
+1999-10-05  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-version.el (liece-user-interface-product): Renamed from
+       `liece-client-product'.
+       (liece-client-version-major): Abolish.
+       (liece-client-version-minor): Abolish.
+       (liece-client-version-beta): Abolish.
+       (liece-client-version-alpha): Abolish.
+       (liece-client-version-codename): Abolish.
+       (liece-product-name): New macro.
+       (liece-product-version): New macro.
+       (liece-product-code-name): New macro.
+
+1999-10-03   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-hilit.el (liece-highlight-jingle-function): New variable.
+       (liece-highlight-font-lock-keywords): If liece-highlight-pattern
+       matches, play jingle.
+
+1999-10-01   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-message.el (liece-message-parent-buffer): Check the
+       message direction in private conversation.
+
+1999-09-28   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-version.el (liece-emacs-user-agent-value): Include
+       `emacs-patch-level'.  It exists in XEmacs 21.1.1 or later.
+
+1999-09-22  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece.el (liece-channel-mode): Make `truncate-lines' local.
+       (liece-others-mode): Ditto.
+       (liece-channel-list-mode): Ditto.
+       (liece-nick-mode): Ditto.
+
+1999-09-18   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece.el (liece-open-server): Set `liece-status-message-string'
+       when timeout is expired.
+
+1999-09-14   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-menu.el (liece-use-localized-menu): New variable.
+       (liece-command-define-menus): Use it.
+       (liece-command-define-menus-1): New function; to raverse menu
+       items recursively.
+
+       * liece.el (liece): Call `liece-intl-load-catalogue' before switch
+       to the command buffer.
+
+       * liece-dcc.el: Refine.
+
+       * liece-ctcp.el (liece-client-x-face-notice): Do not decode empty
+       `X-Face'.
+
+1999-09-11   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-vars.el (liece-dcc-program): Rename to `ldcc'.
+
+       * liece-tcp.el (liece-tcp-program): Rename to `ltcp'.
+
+       * gettext.el (gettext-parse-Content-Type): Require `path-util'.
+
+       * liece-x-face.el: Require `path-util'.
+
+1999-09-10   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * Makefile.am (SOURCES): Add `gettext.el'.
+
+       * liece-modules.el (liece-modules-to-compile): Add `gettext.el'.
+
+       * liece-intl.el: Use `gettext.el'.
+       (liece-intl-domains-alist): Abolish.
+       (liece-intl-domain-to-mime-charset-alist): Abolish.
+       (liece-intl-prepare-prefix): Abolish.
+       (liece-intl-parse-Content-Type): Abolish.
+       (liece-intl-convert-string): Abolish.
+       (liece-intl-catalogue-path): Abolish.
+
+       * gettext.el: New file.
+
+       * liece-ctcp.el: Add autoload setting for `liece-ctcp-dcc-message'.
+
+       * liece.el (liece): Save window splitting only when called
+       interactively.
+       (liece-clear-system): Do not restore window splitting.
+       (liece-command-mode): Set syntax table explicitly; make
+       `frame-title-format' buffer local.
+
+       * liece-window.el (liece-window-configuration-push): Do not save
+       `frame-title-format'.
+       (liece-window-configuration-pop): Likewise.
+
+       * liece-commands.el (liece-command-quit): Restore window splitting
+       only when called interactively.
+
+1999-09-09   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece.el (liece-server-keyword-map): New variable.
+       (liece-server-keyword-bind): New macro modified version of
+       `mail-source-bind' from `mail-source.el'.
+       (liece-server-parse-string): New function.
+       (liece-open-server): Use them.
+
+1999-09-08   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece-300.el (liece-handle-353-message): Reverse reply list.
+
+       * All files are renamed from `irchat-*' to `liece-*'.
+       All symbols are renamed too.
+
+       * irchat-vars.el (irchat-connection-timeout): Default to 60.
+
+       * irchat-nick.el (irchat-nick-insert): Handle reverse order
+       sorting.
+
+1999-09-07  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat.el (irchat): Call `irchat-command-mode' just once.
+       (irchat-initialize-buffers): Likewise.
+
+       * irchat-channel.el (irchat-channel-buffer-create): Call
+       `irchat-channel-mode' just once.
+
+       * irchat-nick.el (irchat-nick-buffer-create): Call
+       `irchat-nick-mode' just once.
+
+       * irchat-message.el (irchat-message-parent-buffer): Fix condition.
+
+1999-09-06  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-nick.el (irchat-nick-sort-nicks): New variable.
+
+       * irchat-intl.el (irchat-intl-load-catalogue): Ignore all errors
+       when reading catalogue file.
+
+       * irchat-menu.el: Do not require `irchat-ctcp'; add autoload
+       settings for `irchat-menu-callback-ctcp-version',
+       `irchat-menu-callback-ctcp-userinfo',
+       `irchat-menu-callback-ctcp-help',
+       `irchat-menu-callback-ctcp-clientinfo' and
+       `irchat-menu-callback-ctcp-ping'; add `irchat-menu-add-url' to
+       `irchat-url-add-hook'.
+
+       * irchat-url.el (irchat-url-add-buttons): Enclose with
+       `save-excursion'; run `irchat-url-add-hook'.
+
+1999-09-06  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * Liece 1.3.7.
+
+       * irchat-xemacs.el (irchat-xemacs-setup-menu): Abolish.
+
+       * irchat-intl.el (irchat-intl-get-msgstr-if): Abolish.
+
+       * irchat-vars.el: Remove defconst for colon keyword.
+
+1999-09-05  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-menu.el: All the menu specs are expanded immediately.
+       (irchat-menu-prepare-menus): Abolish.
+       (irchat-menu-define): New function.
+       (irchat-menu-alist): New variable.
+
+       * irchat-handle.el (irchat-handle-topic-message): Check empty
+       topic line.
+
+       * irchat.el (irchat): When `irchat-startup-channel-list' contains
+       list element send cadr as a channel key.
+
+       * irchat-emacs.el (irchat-emacs-widget-convert-button): Make the
+       keymap `irchat-widget-keymap' parented from current local map.
+
+       * irchat-nick.el (irchat-nick-sort-predicate): New variable.
+       (irchat-nick-update): Sort nicknames with
+       `irchat-nick-sort-predicate'.
+       (irchat-nick-insert): Search sorted position before insertion.
+       (irchat-nick-replace): Call `irchat-nick-insert' when
+       `irchat-nick-sort-predicate' is valid.
+
+       * irchat-message.el (irchat-message-parent-buffer): Add condition
+       for private conversation.
+
+       * irchat-make.el (make-irchat-info-files): Set language
+       environment to `Japanese'.
+
+       * irchat-dcc.el (irchat-dcc-channel-representation-format):
+       Remove.
+
+       * irchat-minibuf.el (irchat-minibuffer-complete-channel-modes):
+       Use `string-list-member-ignore-case' instead of
+       `string-list-ci-member'.
+
+       * irchat-url.el: Remove `irchat-insert-hook'.
+
+       * irchat-hilit.el (irchat-highlight-maybe-turn-on-font-lock):
+       Add `irchat-url-add-buttons' to `irchat-insert-hook'.
+
+       * irchat.el (irchat-initialize-buffers): Fix last change.
+
+       * irchat-300.el: Enclose autoloads by `eval-and-compile'.
+
+       * irchat-channel.el: Declare variable
+       `irchat-dcc-channel-representation-format'.
+
+1999-09-04  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * Liece 1.3.6.
+
+       * irchat.el: Add autoload for `irchat-command-browse-url'; do not
+       require `irchat-url' and `irchat-dcc'; add autoload for
+       `irchat-command-mail-compose'.
+       (irchat-initialize-timers): Rewrite with `dolist'; do
+       not check `irchat-timers-list-initialized-p'.
+       (irchat-truncate-nickname): Use `truncate-string-to-width' instead
+       of `truncate-string'.
+       (irchat-buffer-mode-alist): New variable.
+       (irchat-dialogue-setup-buffer): Abolish.
+       (irchat-others-setup-buffer): Abolish.
+       (irchat-channel-list-setup-buffer): Abolish.
+       (irchat-private-setup-buffer): Abolish.
+       (irchat-KILLS-setup-buffer): Abolish.
+       (irchat-IGNORED-setup-buffer): Abolish.
+       (irchat-WALLOPS-setup-buffer): Abolish.
+       (irchat-CRYPT-setup-buffer): Abolish.
+       (irchat-initialize-buffers): Rewrite.
+
+       * irchat-ctcp.el (irchat-client-version-insert): Do not indent
+       explicitly.
+       (irchat-client-message-no-lf): Abolish.
+
+       * irchat-300.el, irchat-xemacs.el, irchat-commands.el: Do not
+       require `irchat-dcc' and `irchat-mail'.
+
+       * irchat-dcc.el (irchat-command-dcc-send): Remove autoload cookie.
+
+1999-09-03  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-inlines.el (forward-line): Do not advise.
+
+       * irchat-intl.el: Do not require `alist'; require `mcharset',
+       `static' and `cl' during compilation.
+       (irchat-intl-msgid-regexp): Fix regexp.
+       (irchat-intl-msgstr-regexp): Ditto.
+       (irchat-intl-set-msgstr): Abolish.
+       (irchat-intl-load-catalogue): Optimize with side-effects.
+
+       * irchat.el (irchat): Load message catalogue only once.
+
+1999-08-31  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat.el (irchat-close-server-internal): Use
+       `irchat-server-opened'.
+
+       * irchat-hilit.el (irchat-highlight-maybe-turn-on-widget):
+       Abolish.
+
+       * irchat-channel.el (irchat-channel-add-button): Use
+       `irchat-widget-convert-button'.
+
+       * irchat-nick.el (irchat-nick-insert): Use
+       `irchat-widget-convert-button'.
+       (irchat-nick-replace): Ditto.
+
+       * irchat-compat.el (irchat-widget-convert-button): New alias.
+       (irchat-widget-button-click): Alias to `widget-button-click'.
+
+       * irchat-emacs.el (irchat-widget-keymap): New variable.
+       (irchat-emacs-widget-convert-button): New function.
+       (irchat-emacs-widget-button-click): New function.
+       (irchat-widget-convert-button): Redefine here.
+       (irchat-widget-button-click): Redefine here.
+
+       * irchat-url.el (irchat-url-add-buttons): Use
+       `irchat-widget-convert-button'.
+
+1999-08-23  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-emacs.el (irchat-emacs-splash): Use `fontset-pixel-size'.
+
+1999-08-22  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-compat.el: Do not require `wid-browse' during
+       compilation.
+       (irchat-widget-button-click): New function.
+
+       * irchat-emacs.el: Enclose autoloads with `eval-and-compile'.
+       (irchat-emacs-create-mode-line-image): Specify
+       `:ascent' property when creating the image.
+       (irchat-emacs-create-nick-image): Ditto.
+
+1999-08-22  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * Makefile.am (EXTRA_DIST): Add `irchat-emacs.el'.
+
+       * irchat-xemacs.el (irchat-xemacs-glyph-nick-buffer): Abolish.
+       (irchat-xemacs-glyph-nick-region): Remove interactive spec.
+
+       * irchat-intl.el: Do not require `mime-parse'.
+
+       * irchat-tcp.el: Bind `ssl-program-arguments'.
+
+1999-08-22  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-modules.el (irchat-modules-to-compile): Add
+       `irchat-emacs'.
+
+       * irchat-xemacs.el (irchat-xemacs-glyph-nick-buffer): Refine.
+
+       * irchat-vars.el (irchat-icon-directory): Move from
+       `irchat-xemacs.el'.; To be used under FSF Emacs 20.4.91.
+       (irchat-nick-image-alist): Move from `irchat-xemacs.el'.
+
+       * irchat-emacs.el: New file.; Most of FSF Emacs specific routines
+       are stored here.
+       (irchat-emacs-icon-path): New macro.
+       (irchat-emacs-mode-line-buffer-identification): New function.
+       (irchat-emacs-mode-line-buffer-identification): New variable.
+
+1999-08-20  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece.xpm: Reduce colors.
+
+1999-08-20  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-x-face.el (irchat-x-face-insert-function): Don't use
+       `eval-when-compile' while checking bitmap-mule.
+
+1999-08-20  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat.el (irchat-splash-pixmap): Renamed from
+       `irchat-stipple-pixmap'; use the XPM data under FSF Emacs 20.4.91.
+       (irchat-x-splash): Likewise.
+
+       * irchat-channel.el (irchat-channel-virtual): Undo last change.
+
+1999-08-15  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-400.el (irchat-handle-400-messages): Do not pass empty
+       channel names to `irchat-channel-virtual'.
+
+       * irchat-channel.el (irchat-channel-virtual): Make channel ID for
+       `!' channels invisible from user.
+
+       * irchat-vars.el (irchat-channel-id-length): Default to 5.
+
+1999-08-14  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-300.el (irchat-353-channel): Abolish.
+       (irchat-handle-366-message): Do not use `irchat-353-channel'.
+
+1999-08-13  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-200.el (irchat-handle-218-message): Do not indent
+       explicitly.
+
+1999-08-08  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-compat.el (with-timeout): New macro for compatibility.
+
+       * irchat-xemacs.el: Check `horizontal-scrollbar-visible-p' for
+       XEmacs 20.4.
+
+       * irchat.el (irchat-open-server): Do not truncate trailing `_'.
+
+       * Liece 1.3.5.
+
+       * irchat-handle.el (irchat-handle-mode-message): Handle channel
+       invite list.
+       (irchat-handle-join-message): Pass optional argument to
+       `match-string'.
+
+       * irchat-channel.el (irchat-channel-get-invites): New macro.
+       (irchat-channel-add-invite): New macro.
+       (irchat-channel-remove-invite): New macro.
+       (irchat-channel-set-invite): New macro.
+
+       * irchat-300.el: Handle channel invite list.
+       (irchat-handle-346-message) <RPL_INVITELIST>: New handler.
+       (irchat-handle-347-message) <RPL_ENDOFINVITE>: New handler
+
+1999-08-07  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-200.el: Register 200 handler again.
+       (irchat-handle-200-message): Do not indent explicitly.
+       (irchat-handle-201-message): Likewise.
+       (irchat-handle-213-message): Likewise.
+       (irchat-handle-214-message): Likewise.
+       (irchat-handle-262-message) <RPL_ENDOFTRACE>: New handler.
+
+       * irchat-300.el (irchat-handle-365-message): Turn hops count into
+       string.
+
+       * irchat-xemacs.el (irchat-toolbar-map-button-list): Fix typo.
+
+1999-08-06  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-intl.el (irchat-intl-load-catalogue): Add nil check.
+       (irchat-intl-catalogue-path): Fix last change.
+
+1999-08-06  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-window.el (irchat-window-load-style-file): Cache
+       `irchat-window-style-directory'.
+
+       * irchat-xemacs.el (irchat-xemacs-icon-path): Cache
+       `irchat-icon-directory'.
+
+       * irchat-intl.el (irchat-intl-catalogue-path): New macro.
+       (irchat-intl-load-catalogue): Use it.
+
+       * irchat-make.el (install-update-manifest-file): Fix for data
+       directories.
+       (config-irchat-package-directory): Splitt into
+       `config-irchat-package'.
+
+       * irchat-xemacs.el: Do not require `smiley'.
+       (irchat-xemacs-icon-path): New macro.
+       (irchat-toolbar-icon-plist-get): Use it.
+       (irchat-xemacs-setup-toolbar): Use it.
+       (irchat-xemacs-create-nick-glyph): Use it.
+       (irchat-xemacs-modeline-glyph): Use it.
+
+       * irchat-vars.el (irchat-use-smiley): Abolish.
+
+       * irchat-hilit.el (irchat-maybe-smiley-region): Abolish. If you
+       want to use this functionality, please setup `irchat-insert-hook'.
+
+1999-08-05  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * liece.xpm: New splash logo.
+
+       * irchat-xemacs.el (irchat-xemacs-splash-at-point): Use
+       `glyph-width', `glyph-height' and `window-pixel-height' to
+       calculate position of the splash logo.
+
+1999-08-04  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-compat.el (irchat-find-data-directory): Move from
+       `irchat-misc'.
+
+       * irchat-intl.el: Use new style macros.
+       (irchat-intl-parse-Content-Type): Check statically if
+       `mime-content-type-parameter' is available.
+       (irchat-intl-load-catalogue): Use `irchat-find-data-directory'.
+
+       * irchat.el (irchat-open-server): Add server parameter `relay'.
+
+       * irchat-window.el (irchat-window-set-default-style): Use
+       `irchat-find-data-directory'.
+
+       * irchat-tcp.el: Fix comment string.
+       (irchat-tcp-open-rlogin-stream): New function.
+       (irchat-tcp-open-rlogin-stream-as-binary): New function.
+       (irchat-tcp-default-connection-type): Add rlogin to custom spec.
+       (irchat-tcp-rlogin-program): New variable.
+       (irchat-tcp-relay-host): New variable.
+       (irchat-tcp-rlogin-parameters): New variable.
+       (irchat-tcp-rlogin-user-name): New variable.
+
+1999-08-03  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-config.el (irchat-config-info-file-regexp): New variable.
+
+       * irhcat-hilit.el: Require font-lock during compilation.
+
+       * irchat-vars.el (irchat-tab-stop-list): New variable.
+
+       * irhcat-000.el, irchat-200.el, irchat-300.el, irchat-400.el,
+       irchat-ctcp.el: Do not use `mapcar' when registering handlers.
+
+       * irchat-misc.el (irchat-find-etc-directory): New function.
+
+       * irchat.el: Add autoloads for
+       `bitmap-stipple-xbm-file-to-stipple' and
+       `bitmap-stipple-insert-pixmap'.
+
+       * irchat-xemacs.el (irchat-x-face-insert-with-xemacs): Use xface
+       glyph if this feature has been provided and `console-type' returns
+       'tty or 'pc, or otherwise make string glyph.
+       [Rename from overriding function `irchat-x-face-insert']
+       (irchat-xemacs-create-nick-glyph): Call `console-type' instead of
+       referring `window-system'.
+       (irchat-xemacs-modeline-glyph): Check current console type.
+       (irchat-xemacs-splash-at-point): Ditto.
+       (irchat-find-etc-directory): Advise it.
+
+       * irchat-compat.el (irchat-static-autoload): New macro.
+       (colon-keyword-usable): New facility checking.
+
+       * irchat-x-face.el: Add autoloads for `x-face-encode',
+       `x-face-read-existing-file-name', `bitmap-insert-xbm-buffer',
+       `bitmap-decode-xbm', `bitmap-read-xbm-buffer' and `bitmap-compose'.
+       (irchat-x-face-insert-function): New variable.
+       (irchat-x-face-insert-with-bitmap): Rename from overriding
+       function `irchat-x-face-insert'.
+
+       * irchat-url.el: Do not check with requiring browse-url. Assume
+       that function `browse-url' have already been autoloaded.
+
+1999-08-01  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat.el (irchat-command-mode): Set local value of
+       `next-line-add-newlines' 't.
+       (irchat-wait-for-response): Use `with-timeout'.
+       (irchat): Do not use `make-variable-buffer-local' when
+       `irchat-freeze' and `irchat-own-freeze' are initialized.
+       (irchat-dialogue-mode): Define `irchat-freeze' and
+       `irchat-own-freeze' here.
+
+       * irchat-misc.el (next-line): Abolish.
+
+       * irchat-handle.el (irchat-handle-nick-message): Fix typo.
+
+1999-07-30  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-inlines.el (string-list-modify-ignore-case): Fix typo.
+
+1999-07-29  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-make.el: Generate file `MANIFEST.liece'.
+       (install-update-manifest-file): New function.
+
+1999-07-28  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-commands.el (irchat-command-end-of-buffer): Do not use
+       `set-window-point'.
+
+       * irchat-300.el (irchat-handle-367-message): Use
+       `irchat-channel-add-ban' instead of temp variable.
+       (irchat-367-channel): Abolish.
+       (irchat-367-regexps): Abolish.
+       (irchat-handle-348-message): New handler for handling channel
+       exception list.
+       (irchat-handle-349-message): New handler for handling channel
+       exception list.
+
+1999-07-27  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-handle.el (irchat-handle-mode-message): Handle channel
+       exception list.
+
+       * irchat-channel.el: (irchat-channel-get-exceptions): New macro.
+       (irchat-channel-add-exception): New macro.
+       (irchat-channel-remove-exception): New macro.
+       (irchat-channel-set-exception): New macro.
+
+1999-07-25  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-commands.el (irchat-command-end-of-buffer): Do not use
+       `pop-to-buffer'.
+       (irchat-command-describe-briefly): Do not use backquote.
+
+1999-07-24  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-compat.el: Do not refer `widget-minor-mode-map'.
+
+       * irchat-hilit.el (irchat-highlight-maybe-turn-on-widget): Use
+       `current-local-map' instead of `widget-minor-mode-map'.
+
+       * Liece 1.3.4.
+
+       * irchat-q-ccl.el (irchat-quote-ccl-encode-region): Fix typo.
+
+       * irchat-crypt.el: Add autoload for `crc32-string'.
+       (irchat-crypt-hash-crc32-string): New function.
+       (irchat-crypt-default-hash-function): New variable.
+       (irchat-crypt-key-fingerprint): Rewrite with above functions.
+
+       * irchat-handle.el (irchat-handle-topic-message): Fix argument
+       order of `irchat-channel-set-topic'.
+
+       * irchat-misc.el (irchat-maybe-update-channel-indicator): Abolish.
+       Call `irchat-set-channel-indicator' directly.
+
+       * irchat-nick.el (irchat-nick-replace): Remove widgets.
+
+       * irchat-menu.el (irchat-nick-popup-menu): Move "Kick" menu to the
+       bottom of menu entries.
+
+       * irchat-xemacs.el (irchat-xemacs-setup-menu): Ditto.
+
+1999-07-23  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-globals.el (irchat-frame-title-format-last): Abolish.
+
+       * irchat.el (irchat-accept-response): Call `irchat' with no
+       arguments. Here's the point that take care of growing tail.
+       (irchat): Call `irchat-window-configuration-pop' and
+       `irchat-window-configuration-push' consequently.
+
+       * irchat-commands.el (irchat-command-keepalive): Call `irchat'
+       with no arguments.
+
+       * irchat-filter.el (irchat-sentinel): Call `irchat' with no
+       arguments.
+
+       * irchat-window.el: Add window configuration stack utility.
+       (irchat-window-configuration-push): New function.
+       (irchat-window-configuration-pop): New function.
+       (irchat-window-configuration-stack): New variable.
+
+       * irchat-compat.el: Require wid-edit and wid-browse during
+       compilation.
+       (widget-minor-mode-map): Bind `mouse-button-3'.
+       (irchat-dont-set-event-point): New advice against
+       `widget-button-click' for FSF Emacs.
+       (irchat-save-current-buffer): New advice against
+       `widget-button-click' for FSF Emacs.
+       (remassq): New function.
+
+       * irchat-channel.el (irchat-channel-push-button): Abolish.
+       (irchat-channel-list-insert): Abolish.
+       (irchat-channel-button): New widget.
+       (irchat-channel-add-button): New function.
+       (irchat-channel-button-action): New function.
+
+       * irchat-url.el: Use widget.
+       (irchat-url-link): New widget.
+       (irchat-url-add-button): New function.
+       (irchat-url-iterate-buffer): Abolish.
+       (irchat-url-search-forward): Abolish.
+       (irchat-url-add-to-completion): Abolish
+       (irchat-url-link-action): Renamed from irchat-url-push-button.
+
+       * irchat-hilit.el: Renamed from irchat-hilight.el.
+       (irchat-highlight-overlay-put-mouse-face): Abolish.
+       (irchat-highlight-insert-with-mouse-face): Abolish.
+       (irchat-highlight-insert-line-with-mouse-face): Abolish.
+       (irchat-highlight-with-widget): Abolish.
+       (irchat-url-face): Abolish.
+       (irchat-mouse-face): Abolish.
+       (irchat-highlight-maybe-turn-on-widget): New function.
+       This function turns on `widget-minor-mode' in
+       `irchat-nick-mode', `irchat-channel-list-mode' or
+       `irchat-dialogue-mode'.
+
+1999-07-21  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * Liece 1.3.3.
+
+       * irchat.el (irchat-override-command-keys): Bind "\C-c\C-a" to
+       `irchat-command-previous-channel'.
+
+       * irchat-crypt.el: Add routines for encapsulate cipher algorithms.
+       (irchat-crypt-import-cipher-algorithm): New function.
+       (irchat-crypt-key-fingerprint): New function.
+       (irchat-crypt-build-decryption-key): New function.
+       (irchat-crypt-build-encryption-key): New function.
+       (irchat-crypt-encrypt-string): New function.
+       (irchat-crypt-decrypt-string): New function.
+       (irchat-crypt-algorithm-major-version): New function.
+       (irchat-crypt-algorithm-minor-version): New function.
+       (irchat-crypt-secure-passphrase-read): Abolish.
+       (irchat-crypt-ignore-suspicious): Abolish.
+       (irchat-crypt-ignore-defected): Abolish.
+       (irchat-get-idea-decryption-key): Abolish.
+       (irchat-command-set-default-key): Check if this function was
+       called interactively.
+       (irchat-command-add-decryption-key): Renamed from
+       `irchat-command-add-new-key'.
+       (irchat-command-delete-decryption-key): Renamed from
+       `irchat-command-delete-key'.
+       (irchat-crypt-decryption-keys): Renamed from
+       `irchat-crypt-known-keys'.
+       (irchat-crypt-encryption-keys): Renamed from
+       `irchat-crypt-default-keys'.
+
+       * irchat-coding.el (irchat-default-mime-charset-for-read): New
+       variable. Default to 'x-ctext.
+
+       * irchat-compat.el: Do not require 'defface.
+       (irchat-compat-enable-to-read-multibyte): Abolish.
+
+       * irchat-modules.el (irchat-modules-to-compile): Remove
+       `irchat-ck-*' and `defface'. Use `japanese-zenkaku-*' with hook.
+
+       * irchat-vars.el (irchat-convert-hankaku-katakana): Abolished.
+
+       * irchat-inlines.el: All string functions are rewritten.
+
+1999-07-05  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-ctcp.el: Register ACTION handler.
+
+1999-07-04  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-version.el (irchat-emacs-user-agent-value): Modify for
+       XEmacs UTF-2000-MULE.
+
+       * irchat-crypt.el: Do not use IDEA as the default cipher algorithm.
+       (irchat-crypt-cipher-algorithm): New variable.
+       (irchat-crypt-encrypt-message-format): Add version field of
+       the cipher algorithm.
+       (irchat-crypt-current-keys): Always restore the computed keys into
+       this variable. [Renamed from irchat-default-idea-key-list]
+
+1999-06-26  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-xemacs.el (irchat-use-toolbar): Add custom spec.
+       (irchat-toolbar-toggle-crypt): Check irchat-use-toolbar.
+       (irchat-setup-toolbar): Ditto.
+
+1999-06-14  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * Liece 1.3.2.
+
+       * irchat.el (irchat-define-keys): Rewrite.
+       (irchat-truncate-nickname): Rewrite; rename from irchat-read-nickname.
+
+       * irchat-handle.el, irchat-400.el, irchat-300.el, irchat-200.el,
+       irchat-000.el:
+       Declarations of hook variables are splitted into each file.
+
+       * irchat-300.el: Register 322 reply handler.
+
+1999-06-11  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat.el (irchat-dialogue-mode-map): Bind mouse-button-2 to
+       irchat-url-push-button.
+
+       * irchat-url.el (irchat-url-push-button): Check all overlays
+       around event point.
+
+       * irchat-filter.el (irchat-handle-message): Ignore errors which
+       occurs during hook evaluation.
+
+       * irchat-ctcp.el (irchat-ctcp-message): Ignore errors which
+       occurrs during hook evaluation.
+       (irchat-ctcp-notice): Likewise.
+       (irchat-ctcp-file-notice): Likewise.
+
+       * irchat-channel.el (irchat-channel-push-button): Use
+       irchat-overlays-at instead of overlays-at.
+
+1999-06-10  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-hilight.el (irchat-quoted-colors-mirc):
+       Rename from irchat-quoted-colors.
+       (irchat-quoted-colors-ircle): New color table.
+       (irchat-highlight-maybe-hide-prefix): Fix regexp.
+       (irchat-highlight-colorize-quote): Check vender specific extension.
+
+       * irchat-channel.el (irchat-channel-push-button):
+       Check all overlays under the point.
+
+       * irchat-filter.el: Rename default backend name to "generic".
+
+       * irchat-handle.el: Use multiple values bindings.
+       (irchat-handle-notice-message): Fix argument against
+       irchat-ctcp-notice.
+
+       *irchat-misc.el (irchat-compose-time-string): Use
+       format-time-string. Now only accepts encoded time.
+
+       * irchat-misc.el (irchat-pick-buffer): Check if chnl is string and
+       apropriate buffer does not exist.
+       (irchat-pick-buffer-1): Do not return buffer list.
+
+1999-06-10  Daiki Ueno  <ueno@unixuser.org>
+
+       * irchat.el (irchat-debug-mode-map): Abolish.
+       (irchat-debug-keys): Abolish.
+       (irchat-command-keys): Fix return key code.
+
+       * irchat-window.el (irchat-window-to-buffer):
+       Remove irchat-debug-buffer.
+
+       * irchat-vars.el (irchat-debug-mode-hook): Abolish.
+       (irchat-debug-prefix): Abolish.
+
+       * irchat-nick.el (irchat-nick-equal): New alias to string-ci-equal.
+       (irchat-nick-member): New function.
+       (irchat-command-toggle-nick-buffer-mode): Do not toggle when
+       irchat-nick-buffer has not been created.
+
+       * llhandler.el, irchat-modules.el (irchat-modules-to-compile):
+       Remove llhandler.
+
+       * irchat-misc.el (irchat-split-line): New function.
+       (irchat-split-rest): Abolish.
+       (irchat-with-split-rest): Abolish.
+       (irchat-maybe-update-channel-indicator): Do not use backquote.
+       (irchat-freeze-toggle): Use irchat-nick-equal.
+       (irchat-message-from-ignored): Rename from irchat-msg-from-ignored.
+
+       * irchat-message.el (irchat-message-parent-buffer):
+       Use irchat-nick-equal.
+
+       * irchat-make.el (compile-irchat): Add comments.
+
+       * irchat-intl.el (irchat-intl-prepare-prefix):
+       Do not treat irchat-debug-prefix.
+
+       * irchat-inlines.el (filter-elements): Move from irchat-compat.
+
+       * irchat-globals.el (irchat-debug-buffer): Remove.
+
+       * irchat-crypt.el (irchat-idea-encrypt-message-format): Rename from
+       irchat-idea-encrypt-msg-format.
+       (irchat-crypt-maybe-decrypt-message): Use irchat-nick-equal.
+
+       * irchat-compat.el: Require cl at load time.
+       (buffer-or-string-p): Remove.
+       (irchat-get-buffer-window): Enclose with eval-and-compile.
+       (irchat-get-buffer-window-list): Ditto.
+       (irchat-mode-line-buffer-identification): New alias to 'identity.
+       (mapvector): Remove.
+
+       * irchat-commands.el (irchat-command-debug): Abolished.
+       (irchat-command-join-channel): Use irchat-channel-equal.
+       (irchat-command-join): Use force-mode-line-update.
+       (irchat-command-private-conversation): Ditto.
+       (irchat-command-list): Check if 1st argument is empty string.
+       (irchat-command-who): Ditto.
+       (irchat-command-names): Ditto.
+       (irchat-command-mode+o): Use irchat-nick-member.
+
+       * irchat-channel.el (irchat-command-toggle-channel-buffer-mode):
+       Do not toggle when
+       irchat-channel-buffer has not been created.
+
+       * irchat-handle.el, irchat-filter.el, irchat-dcc.el,
+       irchat-ctcp.el, irchat-500.el, irchat-400.el, irchat-300.el,
+       irchat-200.el, irchat-000.el: Use llunf instead of llhandler.
+
+       * llunf.el: New file.
+
+       * idea.el, b64.el (>>): Move from irchat-compat.
+       (<<): Ditto.
+
+1999-06-06  Daiki Ueno  <ueno@unixuser.org>
+
+       * irchat-misc.el (irchat-freeze-toggle): Use force-mode-line-update.
+       (irchat-own-freeze-toggle): Ditto.
+
+       * irchat-dcc.el: Require irchat-minibuf.el.
+       (irchat-command-dcc-send): Use
+       irchat-minibuffer-completing-default-read.
+       (irchat-command-dcc-chat-listen): Ditto.
+
+1999-06-04  Daiki Ueno  <ueno@unixuser.org>
+
+       * irchat.el (irchat-override-command-keys): Add "\C-v" and "l".
+       (irchat-dialogue-keys): Remove "\C-v" and "\C-f".
+
+       * irchat.el (irchat-override-command-keys):
+       Add "\C-n", "\C-p" and "\C-a".
+       (irchat-dialogue-keys): Remove "\C-n" and "\C-p".
+
+       * irchat-nick.el (irchat-nick-set-user-at-host): New macro.
+       (irchat-nick-mark-as-apart): New macro.
+       (irchat-nick-unmark-as-apart): New macro.
+
+       * irchat-version.el (irchat-emacs-user-agent-value):
+        Ignore parenthesis in
+       `emacs-version' for XEmacs 21.2.15.
+
+1999-06-03  Daiki Ueno  <ueno@unixuser.org>
+
+       * irchat-handle.el, irchat-dcc.el, irchat-500.el, irchat-300.el,
+       irchat-200.el: Do not check "strange" reply.
+
+       * irchat-message.el (irchat-message-parent-buffer):
+       Check if irchat-current-channel exists.
+
+       * irchat-coding.el: Do not require irchat-vars.
+
+       * irchat-menu.el (irchat-nick-popup-menu):
+       Enclose save-selected-window.
+
+       * irchat-misc.el (irchat-get-buffer-create): Do not use unless.
+
+       * irchat-nick.el (irchat-nick-change): Set chnl property internally.
+
+       * irchat-dcc.el (irchat-command-dcc-chat-listen):
+       Use irchat-get-buffer-create instead
+       of get-buffer-create.
+       (irchat-command-dcc-chat-connect): Ditto.
+       (irchat-dcc-compare-hostnames): Ditto.
+
+       * irchat-ctcp.el (irchat-file-start):
+       Use irchat-get-buffer-create instead of
+       get-buffer-create.
+       (irchat-file-cont): Ditto.
+       (irchat-file-end): Ditto.
+       (irchat-ctcp-client-notice): Ditto.
+
+       * irchat.el (irchat-open-server-internal):
+       Use irchat-get-buffer-create instead of
+       get-buffer-create.
+       (irchat-dialogue-setup-buffer): Ditto.
+       (irchat-others-setup-buffer): Ditto.
+       (irchat-channel-list-setup-buffer): Ditto.
+       (irchat-private-setup-buffer): Ditto.
+       (irchat-KILLS-setup-buffer): Ditto.
+
+1999-06-02  Daiki Ueno  <ueno@unixuser.org>
+
+       * irchat-xemacs.el (irchat-xemacs-nick-popup-menu):
+       Remove save-excursion.
+
+       * irchat-channel.el (irchat-channel-push-button):
+       Remove save-excursion, just use save-selected-window instead.
+       (irchat-channel-real): Remove save-match-data.
+
+       * irchat.el (irchat-clear-system):
+       Check irchat-obarray has been initialized.
+
+       * Makefile.am (SOURCES): Add irchat-message.el and irchat-coding.el.
+       (EXTRA_DIST): Add liece.xbm.
+
+1999-06-02  Daiki Ueno  <ueno@unixuser.org>
+
+       * Liece 1.3.1.
+
+       * irchat-url.el (url-irc-liece): New function.
+       [should be called from url-irc.el]
+
+       * Makefile.am (EXTRA_DIST): Add bitmap-stipple.
+
+1999-06-02  Daiki Ueno  <ueno@unixuser.org>
+
+       * irchat-coding.el (irchat-detect-coding-region): New function.
+       (irchat-detect-coding-region-function): Use above.
+
+       * irchat-coding.el (irchat-detect-coding-string): New function.
+       (irchat-detect-coding-string-function): Use above.
+
+       * irchat-channel.el (irchat-channel-push-button):
+       Switch to channel list buffer.
+
+1999-06-02  Daiki Ueno  <ueno@unixuser.org>
+
+       * irchat-nick.el (irchat-nick-update-region): Undo last change.
+
+       * irchat-menu.el (irchat-nick-popup-menu): Switch to nick buffer.
+
+       * irchat-filter.el: fix comments.
+       (irchat-filter): Split multiple lines without string matching.
+       (irchat-handle-message): Renamed from irchat-handle-message-2.
+       (irchat-parse-user-at-host): New function.
+
+       * irchat-coding.el (irchat-detect-coding-region-function): Renamed from
+       irchat-custom-detect-coding-region-function.
+       (irchat-detect-coding-string-function): Renamed from
+       irchat-custom-detect-coding-string-function.
+
+1999-06-01  Daiki Ueno  <ueno@unixuser.org>
+
+       * irchat.el (irchat-command-mode): Do not use mapvector.
+
+       * irchat-handle.el (irchat-handle-notice-msg): Fix arguments against
+       with-irchat-decryption.
+       (irchat-handle-privmsg-msg): Likewise.
+
+       * irchat-commands.el (irchat-command-send-message): Fix arguments of
+       with-irchat-encryption.
+       (irchat-command-message): Likewise.
+
+       * irchat-crypt.el (irchat-crypt-maybe-decrypt-message):
+       Exchange car with cdr in arglist.
+       (with-irchat-encryption): Accept flat arglist.
+       (with-irchat-decryption): Likewise.
+
+       * irchat.el (irchat-nick-mode-map): Define as prefix commands.
+
+       * irchat.el (irchat-channel-mode): Eliminate channel indicator.
+       (irchat-others-mode): Likewise.
+       (irchat-dialogue-mode): Likewise.
+
+       * irchat-misc.el (irchat-set-channel-indicator):
+       Eliminate channel indicator.
+
+       * irchat-ctcp.el (irchat-ctcp-action-msg):
+       Use irchat-display-message.
+
+1999-06-01  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-400.el: Remove redundancies on regexps.
+       (irchat-handle-432-msg) <ERR_ERRONEUSNICKNAME>: Rewrite.
+       (irchat-handle-433-msg) <ERR_NICKNAMEINUSE>: Resend NICK command only
+       if irchat-auto-iterate-nick is non-nil.
+
+       * irchat.el (irchat-command-keys): Add irchat-command-mode+o,
+       irchat-command-mode-o, irchat-command-mode+v, irchat-command-mode-v.
+       XXX: Should be prefixed commands?
+
+1999-05-31  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-message.el (irchat-message-predicate):
+       Normalize irchat-message-blackets-predicate.
+
+       * irchat-inlines.el (irchat-eval-form): New function.
+
+       * irchat-message.el (irchat-message-predicate):
+       Rename specifier typep to type.
+
+       * irchat-misc.el (irchat-own-channel-message):
+       Bind irchat-message-direction 'outgoing.
+       (irchat-own-private-message): Ditto.
+
+       * irchat-message.el (irchat-message-tags): New variable.
+       (irchat-message-tags-function): New function.
+       (irchat-message-private-buffer): Abolished.
+       Use irchat-message-buffer-function.
+
+1999-05-31  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-nick.el (irchat-nick-update-region):
+       Move opening save-excursion.
+
+       * irchat-channel.el (irchat-channel-push-button):
+       Move point to event ocurred position before calling
+       irchat-nick-update-region.
+
+       * irchat-nick.el (irchat-nick-update-region):
+       Remove argument event from arglist.
+
+       * irchat-menu.el (irchat-nick-popup-menu):
+       Move point to event ocurred position before calling
+       irchat-nick-update-region.
+
+       * irchat-xemacs.el (irchat-xemacs-setup-menu):
+       Remove argument event from arglist.
+       (irchat-xemacs-nick-popup-menu): Move point to event ocurred
+       position before calling irchat-nick-update-region.
+
+       * irchat.el: Use modern key sequence expression.
+       (irchat-command-map): New keymap which override
+       irchat-dialogue-keys with prefix command ("\C-c").
+       (irchat-friends-map): New keymap. [prefix command for friends]
+       (irchat-dialogue-keys): Import some useful command keys.
+
+       * irchat-channel.el (irchat-channel-parse-representation):
+       To remove let, construct representation object directly.
+
+       * irchat-channel.el (irchat-channel-list-insert): Remove format.
+
+       * irchat-vars.el: Do not require mcharset.
+
+       * irchat.el (irchat-nick-mode-map): Do not check xemacs.
+
+       * irchat-xemacs.el (irchat-nick-popup-menu): New alias to
+       irchat-xemacs-nick-popup-menu which override original one.
+
+       * irchat-compat.el: Use emu's mouse-button emulation.
+       (irchat-button2): Abolished.
+       (irchat-button3): Abolished.
+
+       * irchat-vars.el (irchat-variables-files): Do not load
+       `~/.irchat3_vars.el' at startup time.
+
+       * irchat-vars.el (irchat-debug-prefix): Clear.
+
+       * irchat.el: Do not check `set-face-stipple' is bound.
+       (irchat-x-splash): Add interactive spec.
+
+1999-05-30  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat.el (irchat-x-splash): Do centering.
+
+       * bitmap-stipple.el (bitmap-stipple-insert-pixmap):
+       Add optional argument center.
+
+       * liece.xbm: New file.
+
+       * irchat.el: Check if liece.xbm exists.
+
+       * irchat.el (irchat-stipple-pixmap): New variable.
+       (irchat-x-splash): New function.
+
+       * bitmap-stipple.el: New file.
+
+       * irchat-modules.el (irchat-modules-to-compile): Add bitmap-stipple.
+
+       * irchat-commands.el (irchat-command-send-action): Fix typo.
+
+       * irchat-hilight.el (irchat-highlight-font-lock-keywords):
+       Fix regexp.
+
+       * irchat-inlines.el (irchat-or): New function.
+       (irchat-and): New function.
+
+       * irchat-filter.el (irchat-handle-msg-msg): Abolished.
+
+       * irchat-crypt.el (irchat-message-encrypted-p): Move into
+       irchat-message.
+       (irchat-message-suspicious-p): Ditto.
+       (irchat-message-garbled-p): Ditto.
+       (irchat-message-fingerprint): Ditto.
+       (irchat-message-timestamp): Ditto.
+
+       * irchat-vars.el: All format strings are removed.
+       (irchat-format-string): Abolished.
+
+       * irchat-modules.el (irchat-modules-to-compile): Add
+       irchat-message.
+
+       * irchat-dcc.el (irchat-dcc-chat-filter): Use
+       irchat-display-message.
+
+       * irchat-commands.el (irchat-command-send-action):
+       Bind irchat-message-type.
+
+       * irchat-handle.el (irchat-handle-privmsg-msg):
+       Use irchat-display-message.
+       (irchat-handle-privmsglike-msg): Abolished.
+
+       * irchat-misc.el (irchat-own-channel-message):
+       Use irchat-display-message.
+       (irchat-own-private-message): Likewise.
+
+       * irchat-message.el: New file.
+
+1999-05-29  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat.el, irchat-vars.el (irchat-before-kill-emacs-hook): New hook.
+
+1999-05-29  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-vars.el (irchat-signoff-message):
+       Renamed from irchat-signoff-msg.
+
+       * irchat.el (irchat-obarray-size): Moved from irchat-globals.el.
+
+       * irchat-globals.el: Remove obsolete variables.
+
+       * irchat-ctcp.el (irchat-client-error-message):
+       Moved from irchat-globals.el.
+
+       * irchat-commands.el (irchat-save-variables-are-dirty): Renamed
+       from irchat-save-vars-is-dirty.
+       (irchat-command-send-action): Add prefix.
+
+       * irchat-400.el (irchat-nickname-last): Renamed from
+       irchat-old-nickname.
+
+       * irchat-000.el (irchat-servername): Abolished.
+
+1999-05-28  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-crypt.el: Do not require 'idea.
+
+       * irchat-commands.el (irchat-command-message): Treat channel target.
+
+       * irchat-300.el (irchat-handle-317-msg) <RPL_WHOISIDLE>:
+       Add argument rest to match-string.
+
+1999-05-28  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * Liece 1.2.8.25.
+
+       * irchat.el (irchat-command-keys): Do not bind lisp-complete-symbol.
+
+       * irchat-commands.el (irchat-command-load-vars): Enclose body with
+       unwind-protect.
+       (irchat-command-complete): Use irchat-minibuffer-finalize-completion.
+       (get-word-left): Abolished.
+       (irchat-switch-to-channel-1): New function.
+       (irchat-switch-to-channel): Use irchat-switch-to-channel-1.
+       (irchat-switch-to-channel-no): Likewise.
+       (irchat-command-message): Check crypt-type.
+
+       * irchat-minibuf.el (irchat-minibuffer-complete-channel-modes):
+       Complete ban patterns.
+       (irchat-minibuffer-parse-modes): Rename property 'uah to 'ban.
+
+       * irchat-handle.el (irchat-handle-mode-msg):
+       Use irchat-channel-set-ban.
+
+       * irchat-channel.el (irchat-channel-add-ban): New macro.
+       (irchat-channel-remove-ban): New macro.
+       (irchat-channel-set-ban): New macro.
+       (irchat-channel-get-bans): New function.
+
+       * irchat-300.el:
+       (irchat-handle-317-msg) <RPL_WHOISIDLE>: Remove condtionals for
+       obsolete servers. [2.5 or 2.6].
+       (irchat-handle-367-msg) <RPL_BANLIST>: Treat it as generic long
+       reply handler.
+       (irchat-367-channel): New variable.
+       (irchat-367-regexps): New variable.
+       (irchat-handle-368-msg) <RPL_ENDOF_BANLIST>: Save ban patterns as
+       'ban property.
+
+1999-05-26  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat.el (irchat-clear-system):
+       Use dotimes when initializing irchat-obarray.
+
+1999-05-26  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat.el (irchat-command-keys):
+       Bind irchat-command-display-friends.
+
+       * irchat-commands.el (irchat-command-display-friends): New command.
+
+       * irchat-vars.el (irchat-display-friends-function): New variable.
+
+       * irchat-300.el (irchat-303-display-friends): New function.
+       (irchat-303-display-all-friends): New function.
+
+       * irchat-minibuf.el (irchat-minibuffer-complete-channel-modes):
+       Complete nickname using operators and voices.
+       (irchat-minibuffer-parse-modes): Likewise.
+       (irchat-minibuffer-finalize-completion): Notice no match found.
+
+       * Makefile.am: New file.
+
+1999-05-25  UENO Daiki  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat.el (irchat-others-mode): Set parent mode explicitly.
+       (irchat-channel-mode): Ditto.
+
+1999-05-24  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-minibuf.el (irchat-minibuffer-parse-modes): Parse ban
+       pattern.
+
+       * irchat-200.el (irchat-handle-206-msg) <RPL_TRACESERVER>:
+       Use multiline display format.
+       (irchat-handle-214-msg) <RPL_STATSNLINE>: Likewise.
+       (irchat-handle-213-msg) <RPL_STATSCLINE>: Likewise.
+
+       * irchat-ctcp.el (irchat-client-insert): Quote format string.
+
+1999-05-23  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * Liece 1.2.8.24.
+
+       * irchat-ctcp.el (irchat-minibuffer-complete-client-query): Use
+       `irchat-minibuffer-finalize-completion'.
+
+       * irchat-minibuf.el (irchat-minibuffer-finalize-completion): New
+       function.
+       (irchat-minibuffer-complete-channel-modes): Use above.
+
+       * irchat.el (irchat-check-buffers): Fix loop condition.
+
+1999-05-23  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-dcc.el (irchat-dcc-message): New function.
+
+       * irchat-nick.el (irchat-nick-join-1): Check dups.
+
+       * irchat-ctcp.el (irchat-client-insert): New function.
+
+       * irchat-commands.el (irchat-command-prepare-message-prefix):
+       Abolished.
+       (irchat-command-prepare-own-message-prefix): Ditto.
+
+       * irchat-misc.el (irchat-own-private-message): Generate prefix
+       string automatically.
+       (irchat-own-channel-message): Likewise.
+
+1999-05-22  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>
+
+       * irchat-compat.el (run-hook-with-args-until-success): Abolished.
+
+       * irchat.el (irchat-command-mode): Change mode-line-format.
+       (irchat-open-server): Save password.
+       (irchat-insert-internal): Rewrite.
+
+       * irchat-200.el (irchat-handle-215-msg) <RPL_STATSILINE>:
+       Fix regexp.
+       (irchat-handle-242-msg) <RPL_STATSUPTIME>: Cut off preceding `:'.
+       (irchat-handle-205-msg) <RPL_TRACEUSER>: Fix typo.
+       (irchat-handle-218-msg) <RPL_STATSYLINE>: Fix display format.
+
+1999-05-13  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-inlines.el (format-quote): Abolished.
+
+       * irchat-ctcp.el (irchat-ctcp-action-msg): Pass arguments to
+       PRIVMSG handler.
+
+       * irchat-hilight.el (irchat-highlight-turn-on-font-lock): Make
+       `after-change-hook' local.
+
+1999-05-12  sphere      <sphere@pop12.odn.ne.jp>
+
+       * irchat-url.el (irchat-command-browse-url): Fix typo.
+
+1999-05-11  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-crypt.el (irchat-command-set-default-key): Fix typo.
+
+       * irchat-window.el (irchat-command-set-window-style): Fix typo.
+
+       * irchat-url.el (irchat-command-browse-url): Fix typo.
+
+       * irchat-channel.el (irchat-channel-set-voice): Quote regexp.
+
+1999-05-09  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-ctcp.el (irchat-command-client-time): Fix typo.
+
+       * irchat.el (irchat-channel-mode): Explicitly define as
+       it derives from `irchat-dialogue-mode'.
+       (irchat-others-mode): Ditto.
+
+       * irchat-compat.el (irchat-kill-all-overlays): New function.
+
+       * irchat-nick.el (irchat-nick-update): Do not switch to buffer.
+       (irchat-nick-join): Do not check whether nickname has been inserted.
+       (irchat-nick-update): Kill all overlays.
+
+       * irchat-mail.el: Follow the value of `mail-user-agent'.
+       (irchat-mail-pop-to-buffer): Abolished.
+       (irchat-mail-compose-with-mail): Abolished.
+       (irchat-mail-compose-with-gnus): Abolished.
+
+       * irchat-inlines.el (nth1, nth1cdr):Abolished.
+       (matching-substring): Abolished.
+       (irchat-greater-flags): Abolished.
+
+1999-05-08  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-300.el (irchat-353-scan-channels): New macro.
+
+       * irchat-minibuf.el (irchat-minibuffer-completing-default-read):
+       Renamed from `irchat-completing-default-read'.
+       (irchat-minibuffer-completing-sequential-read): Renamed from
+       `irchat-completing-sequential-read'.
+
+       * irchat-channel.el (irchat-channel-set-operator-1): Renamed from
+       `irchat-set-channel-operator' within irchat-misc.el.
+       Restrict its use to internal only.
+       (irchat-channel-set-voice-1): Likewise.
+
+       * irchat-commands.el (irchat-command-wait): Abolished.
+
+       * irchat-nick.el (irchat-nick-update): Assume that the 2nd
+       argument CHNL is one of channels we've already joined.
+
+       * irchat-misc.el (irchat-change-nick-of): Change nicks, opers and
+       voices properties properly.
+       (irchat-change-nick-of-1): New function. Modify nick alist by
+       side effect.
+       (irchat-change-nick-of-2): New function which resembles above,
+       but it acts on singular list.
+       (irchat-greet-user): Abolished.
+       (irchat-user-on-my-channel): Abolished.
+       (irchat-user-on-this-channel): Abolished.
+
+       * irchat-handle.el (irchat-handle-channel-msg): Do not use
+       `irchat-change-nick-of' directly.
+       (irchat-handle-nick-msg): Likewise.
+       (irchat-handle-quit-msg): Likewise.
+
+1999-05-07  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-commands.el (irchat-command-nickname): Do not set
+       `irchat-real-nickname'.
+
+1999-05-06  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * Liece 1.2.8.23.
+
+       * irchat-hilight.el (irchat-quoted-colors): New variable.
+       (irchat-highlight-colorize-quote): New function.
+       (irchat-highlight-turn-on-font-lock): Add buffer locality to
+       some members of `after-change-hook'.
+
+       * Makefile (install): Do not depend on `dcc'.
+
+1999-05-05  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-handle.el (irchat-handle-part-msg): Call
+       `irchat-channel-part' and `irchat-nick-part' exclusively.
+       (irchat-handle-kick-msg): Likewise.
+
+       * irchat-channel.el (irchat-channel-equal): New alias.
+       (irchat-channel-member): Renamed from `irchat-channel-memberp'.
+       (irchat-channel-join-internal): New function.
+       (irchat-channel-part-internal): New function.
+
+       * irchat-ctcp.el (irchat-ctcp-client-msg): Fix reply string.
+
+       * irchat-minibuf.el (irchat-minibuffer-parse-modes): Completion
+       fixed for ban pattern.
+
+       * irchat-nick.el (irchat-nick-normalize): New macro.
+       (irchat-nick-strip): New macro.
+       (irchat-nick-parse-nick-after): New function.
+
+       * irchat-handle.el (irchat-handle-silence-msg): New handler.
+
+1999-05-04  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-handle.el (irchat-handle-part-msg): Fix quotation of part
+       message.
+
+       * irchat-400.el: Fix unconsistent user data returned from pirc.
+       (irchat-handle-442-msg): `ERR_NOTONCHANNEL'.
+       (irchat-handle-443-msg): `ERR_USERONCHANNEL'.
+
+       * irchat-misc.el (irchat-update-thischannel): Abolished.
+
+       * irchat-commands.el (irchat-channel-virtual): Save matched data.
+       (irchat-channel-real): Likewise.
+
+       * irchat-300.el (irchat-handle-364-msg): `RPL_LINKS'. Fix regexp.
+       (irchat-handle-333-msg): New hander for `RPL_TOPICWHOTIME'.
+       (irchat-handle-namereply-msg): Abolished.
+       (irchat-handle-whoreply-msg): Abolished.
+
+       * irchat-000.el (irchat-handle-005-msg): `RPL_MAP'.
+       Support for ircu server mapping facility.
+       (irchat-handle-006-msg): New handler for `RPL_MAPMORE'.
+       (irchat-handle-007-msg): New handler for `RPL_MAPEND'.
+
+1999-05-03  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-handle.el (irchat-handle-part-msg): Handle left message.
+
+       * irchat-custom.el (irchat-connection-timeout): New variable.
+
+       * irchat.el (irchat-accept-response): Add optional arg timeout.
+       (irchat-accept-process-output): New function.
+       (irchat-clear-system): Reset `irchat-timers-list-initialized-p'.
+       (irchat-initialize-timers): Fix secs parameter.
+
+       * irchat-xemacs.el (irchat-xemacs-run-at-time): New function.
+
+       * irchat-compat.el (irchat-run-at-time): New alias.
+       (irchat-cancel-timer): New alias.
+
+       * irchat-commands.el (irchat-command-start-ison-timer): Abolished.
+       (irchat-command-cancel-ison-timer): Abolished.
+
+       * irchat-timer.el: Removed.
+\f
+1999-04-29  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat.el (irchat-initialize-timers): New function.
+
+       * irchat-q-ccl.el (irchat-quote-ccl-decode-region): New function.
+       (irchat-quote-ccl-encode-region): New function.
+
+       * irchat-q-el.el (irchat-quote-el-decode-region): New function.
+       (irchat-quote-el-encode-region): New function.
+
+       * irchat-ctcp.el (irchat-complete-client): New macro.
+       (irchat-complete-query): New macro.
+       (irchat-command-client-time): New command.
+       (irchat-ctcp-client-msg): Rename each *-msg-hook to *-hook.
+       (irchat-minibuffer-complete-client-query): New function.
+
+       * irchat-commands.el (irchat-command-activate-friends): Fix
+       completion.
+
+       * irchat-compat.el (filter-elements): Add `lisp-indent-function'
+       property with value 2.
+
+1999-04-28  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-dcc.el (irchat-dcc-object): Implement as cl-struct.
+
+       * irchat-compat.el (irchat-static-require): New macro.
+       (irchat-static-require-if): New macro.
+       (irchat-static-defun-if): New macro.
+
+       * Liece 1.2.8.22.
+
+1999-04-27  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * README-styles.ja, TODO.ja, sample.dot.liece.ja: Removed.
+
+1999-04-26  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-inlines.el: Require irchat-setup.
+
+       * irchat-x-face.el: Use `static.el'.
+
+       * irchat-handle.el (irchat-handle-join-msg): Set user-at-host
+       information after calling `irchat-nick-join'.
+
+       * irchat-globals.el (irchat-default-channel-candidate): New
+       variable.
+
+1999-04-22  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-handle.el (irchat-handle-324-msg): Fix regexp.
+
+1999-04-16  Daiki Ueno  <ueno@bleu.ueda.info.waseda.ac.jp>
+
+       * irchat-xemacs.el: Add hooks to hide modelines.
+
+1999-04-12  Daiki Ueno  <ueno@bleu.ueda.info.waseda.ac.jp>
+
+       * irchat.el (irchat-refresh-windows): New function.
+
+       * irchat-300.el: Remove all occurrences of `matching-substring'.
+       (irchat-handle-352-msg): Do not pick-up channel buffer.
+
+       * irchat-config.el, irchat-modules.el: New files.
+
+1999-04-07  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat.el (irchat-switch-to-channel-no-*): Use `dotimes' on the
+       definitions of themselves.
+
+       * irchat-vars.el (irchat-ignore-spec-convert): Fix tag.
+
+1999-04-06  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * dcc.c (send_file): Use `get_address_externally'.
+       (chat_listen): Likewise.
+
+1999-04-05  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * getaddrinfo.c: Include `stdlib.h'.
+
+1999-04-04  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * Liece 1.2.8.21.
+
+       * irchat-handle.el (irchat-handle-mode-msg): Fix channel mode parser.
+
+       * irchat-commands.el (irchat-command-ban-kick): New command.
+       (irchat-command-ban): New command.
+
+       * irchat-ctcp.el (irchat-ctcp-version-msg): Eliminate the client
+       version string.
+       (irchat-client-version-notice): Fix regexp.
+       (irchat-client-version-insert): New function.
+
+       * irchat-misc.el (irchat-repair-crlf): Fixed.
+
+1999-04-01  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * tcp.c (NI_MAXHOST): Add check if it has been already defined.
+
+       * irchat.el (irchat-command-keys): Bind `C-c C-j'.
+\f
+1999-03-31  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-handle.el (irchat-handle-mode-msg): Fix regexp.
+
+       * irchat-commands.el (irchat-command-finger): Add prefix arg.
+
+1999-03-30  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-filter.el (irchat-handle-message): Fix regexp.
+
+       * irchat-handle.el (irchat-handle-join-msg): Fix regexp.
+       (irchat-handle-nick-msg): Fix regexp.
+
+1999-03-24  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-commands.el (irchat-command-finger): Specify nick twice.
+
+       * liece-faq.texinfo: Fix URI of APEL's ftp sites.
+
+1999-03-17  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * Liece 1.2.8.20.
+
+       * irchat-crypt.el (with-irchat-encryption): New macro.
+       (with-irchat-decryption): New macro.
+
+       * irchat-compat.el (valid-plist-p): Fixed.
+
+       * irchat-tcp.el (irchat-tcp-default-connection-type): Renamed from
+       `irchat-tcp-connection-type'.
+       (irchat-open-network-stream-as-binary): Add optional arg `type'.
+       (irchat-open-network-stream): Likewise.
+
+       * irchat-vars.el (irchat-server-alist): Add `:prescript' and
+       `:type' keywords.
+
+1999-03-16  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-compat.el: Require `pcustom'.
+       (point-at-bol): Abolished. Use `line-beginning-position'.
+       (point-at-eol): Abolished. Use `line-end-position'.
+
+       * tcp.c: New file.
+
+       * irchat-tcp.el: New file; TCP/IP emulation using external program.
+
+       * irchat-compat.el (read-passwd): New function to keep compatibility.
+       (passwd-echo): New variable to keep compatibility.
+
+       * irchat-commands.el (irchat-command-who): Confirm really send WHO
+       command with no arguments.
+       (irchat-command-list): Likewise.
+       (irchat-command-names): Likewise.
+
+       * irchat-misc.el (irchat-set-crypt-indicator): Activate crypt mode
+       also in private mode.
+       (irchat-read-passwd): Abolished. Use `read-passwd'.
+
+       * irchat-crypt.el (irchat-crypt-maybe-encrypt-message): Renamed
+       from `irchat-crypt-with-encrypt-message'.
+       (irchat-crypt-maybe-decrypt-message): Likewise.
+
+1999-03-15  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-handle.el (irchat-handle-join-msg): Fix regexp.
+
+       * irchat-hilight.el (irchat-highlight-maybe-hide-quote): Fixed.
+
+1999-03-14  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * Liece 1.2.8.19.
+
+       * irchat-commands.el (irchat-command-poll-names): Check if
+       `irchat-server-opened' returns t.
+       (irchat-command-poll-friends): Likewise.
+
+       * irchat-hilight.el (irchat-highlight-turn-on-font-lock): Remove
+       all hooks before calling `turn-on-font-lock'.
+
+       * irchat-compat.el (run-hook-with-args-until-success): Do not use
+       `run-hook-with-args'.
+
+       * irchat-filter.el (irchat-handle-message-2): Use
+       `run-hook-with-args-until-success' instead of
+       `run-hook-with-args'.
+
+       * irchat-handle.el (irchat-handle-with-running-cleartext-hook):
+       Use `run-hook-with-args-until-success' instead of
+       `run-hook-with-args'.
+       (irchat-handle-run-cleartext-hook): Likewise.
+       (irchat-handle-run-hook-with-args): Likewise.
+
+       * irchat-timer.el (irchat-start-timer): Use `run-at-time' with 1st
+       argument 0 instead of nil.
+
+       * irchat-ctcp.el (irchat-query-client-nick-maybe-change): Return
+       with nil explicitly.
+
+       * irchat-vars.el (irchat-service-spec): New widget.
+       (irchat-service-spec-convert): New function; widget-converter.
+       (irchat-server-spec): New widget.
+       (irchat-server-spec-convert): New function; widget-converter.
+       (irchat-ignore-spec): New widget.
+       (irchat-ignore-spec-convert): New function; widget-converter.
+
+       * irchat-url.el (irchat-command-browse-url): Use the URL added
+       most recently, if `current-prefix' equals `-'.
+       (irchat-url-browser-netscape): Do not bind the process buffer.
+
+       * irchat-menu.el (irchat-menu-add-button): Add 3rd argument.
+
+1999-03-13  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-xemacs.el: Use extents instead of overlays.
+       (irchat-xemacs-put-text-property): New function.
+       (irchat-xemacs-get-text-property): New function.
+       (irchat-xemacs-kill-all-overlays): New function.
+       (irchat-xemacs-overlays-at): New function.
+
+       * irchat-compat.el (irchat-make-overlay): New emulation function.
+       (irchat-delete-overlay): Ditto.
+       (irchat-overlay-put): Ditto.
+       (irchat-move-overlay): Ditto.
+       (irchat-overlay-end): Ditto.
+       (irchat-overlay-get): Ditto.
+       (irchat-overlays-at): Ditto.
+       (irchat-kill-all-overlays): Ditto.
+
+1999-03-12  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-xemacs.el (irchat-toolbar-toggle-crypt): New function.
+       (irchat-toolbar-icon-convert): New function; widget-converter.
+       (irchat-toolbar-icon): New widget.
+       (irchat-toolbar-icon-plist-get): New function.
+       (irchat-toolbar-map-button-list): New function.
+       (irchat-xemacs-setup-toolbar): Renamed from
+       `irchat-xemacs-setup-toolbar-list'.
+       (irchat-toolbar-setup-crypt-glyph): New function.
+       (irchat-toolbar-toggle-crypt): New function.
+       (irchat-use-toolbar): New customizable variable.
+
+       * irchat-compat.el (irchat-put-text-property): Implemented as
+       function.
+
+       * irchat.el (irchat-after-load-startup-hook): New hook variable.
+
+       * irchat-hilight.el (irchat-highlight-maybe-turn-on-font-lock):
+       New function.
+
+       * Liece 1.2.8.18.
+
+       * irchat-channel.el (irchat-channel-create-buffer): Use
+       `irchat-format-time-function'.
+
+       * irchat-hilight.el: Use font-lock.el.
+
+1999-03-11  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-debug.el (irchat-debug-enter-handler): Moved from
+       llhandler.el.
+       (irchat-debug-leave-handler): Ditto.
+
+       * llhandler.el (llhandler-debug-enter): Abolished.
+       (llhandler-debug-leave): Abolished.
+
+       * irchat-version.el (irchat-emacs-user-agent-value): New variable
+       imported from `mime-edit-user-agent-value' of SEMI.
+       (irchat-user-agent-value): New variable.
+       (irchat-make-user-agent-string): Abolished.
+       (irchat-make-emacs-user-agent-string): Abolished.
+       (irchat-command-version): New command.
+
+       * irchat-hilight.el (irchat-maybe-highlight-region): New function.
+       (irchat-maybe-smiley-region): New function.
+       (irchat-maybe-highlight-url-region): New function.
+       (irchat-highlight-put-url-properties-region): New function.
+
+       * irchat-ctcp.el: Add hooks in order to let
+       `irchat-query-client-nick' follow the changes.
+       (irchat-query-client-nick-maybe-change): New function.
+       (irchat-query-client-nick-maybe-reset): New function.
+
+       * irchat-url.el (irchat-url-gather-hook): New hook variable.
+       (irchat-command-browse-url): Use `_'.
+       (irchat-url-gather-urls-region): New function.
+       (irchat-url-search-forward): New function.
+
+       * irchat-compat.el (easy-menu-add-item): New alias.
+
+       * irchat-xemacs.el (easy-menu-add-item): New advice.
+
+1999-03-10 Tsunehiko Baba <tbaba@mtl.t.u-tokyo.ac.jp>
+
+       * dcc.c (main): Add cast against return value of basename(3).
+
+1999-03-10  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-menu.el (irchat-menu-url-menu): New variable.
+
+       * Liece 1.2.8.17.
+
+       * irchat-misc.el (irchat-compose-time-string): Renamed from
+       `irchat-compose-servertimestring'.
+
+       * irchat-compat.el (plist-get): New function for compatibility.
+
+       * irchat-ctcp.el (irchat-client-time-notice): New handler.
+       (irchat-ctcp-time-msg): Ditto.
+
+       * irchat-minibuf.el (irchat-minibuffer-complete-channel-modes):
+       Also display candidates when `irchat-minibuffer-parse-modes'
+       returns 'flag.
+
+       * irchat-400.el (irchat-handle-433-msg): `ERR_NICKNAMEINUSE'.
+       Do grow-tail iteration on `irchat-real-nickname' only if
+       `irchat-auto-iterate-nick' is specified.
+
+       * irchat-vars.el (irchat-server-alist): Enable to specify keywords
+       (:host, :service, :password, etc.).
+       (irchat-auto-iterate-nick): New customizable variable.
+
+       * irchat-menu.el (irchat-menu-add-url): New function.
+       (irchat-command-mode-url-menu): New menu entry.
+
+       * irchat.el (irchat): Do not ping to server.
+       (irchat-open-server): Use new format of `irchat-server-alist'.
+
+1999-03-02  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-handle.el (irchat-handle-privmsglike-msg): Define as subst.
+
+       * irchat-make.el (install-just-print-p): New function
+       imported from APEL 9.13's `APEL-MK'.
+       (config-irchat-package): Likewise.
+       (compile-irchat-package): Likewise.
+       (install-irchat-package): Likewise.
+       (install-update-package-files): Likewise.
+       (make-irchat-sample-files): New function imported from packaged
+       version of Liece.
+       (make-irchat-info-files): Ditto.
+
+       * irchat-300.el (irchat-handle-366-msg): Do not update nicks when
+       `irchat-353-nameslist' holds no element.
+
+1999-03-01  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-handle.el (irchat-handle-quit-msg,
+       irchat-handle-mode-msg, irchat-handle-join-msg,
+       irchat-handle-part-msg): Quote regexp.
+
+1999-02-28  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat.el (irchat-clear-system): Fix backquotes.
+
+1999-02-25  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-300.el (irchat-handle-303-msg): Fix. Add check for empty
+       reply.
+
+1999-02-24  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-handle.el (irchat-handle-notice-msg): Fix. Call handler
+       with `funcall'.
+
+       * irchat.el (irchat-channel-mode-map): Make keymap as sparse.
+       (irchat-others-mode-map): Likewise.
+
+       * irchat-commands.el (irchat-command-deactivate-friends):
+       Fix argument.
+
+       * Liece 1.2.8.16.
+
+       * irchat-globals.el (irchat-who-expression): New variable.
+
+       * irchat-misc.el (irchat-toggle-command-buffer-mode): Change
+       `irchat-private-indicator'.
+
+       * irchat-300.el (irchat-handle-315-msg): `RPL_ENDOFWHO'.
+       Display `no matches found' message
+       (irchat-handle-{322,323,353,366}-msg): Count iterations.
+
+       * irchat.el (irchat-command-mode): Do not save
+       `frame-title-format' twice. Use `irchat-current-channel' in place
+       of `irchat-channel-indicator'.
+
+       * llhandler.el (llhandler-debug-enter): New function.
+       (llhandler-debug-leave): New function.
+       (llhandler-define-handler): New macro.
+       (llhandler-eval-args): Abolished.
+
+       * irchat-crypt.el (irchat-encrypt-message): Encode messages.
+       (irchat-decrypt-message): Likewise. Decode messages.
+       (irchat-crypt-with-encrypted-message): Do not encode message which
+       has type `cleartext'.
+
+1999-02-23  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-misc.el (irchat-send-pong): New macro.
+       (irchat-increment-long-reply-count): New macro.
+       (irchat-reset-long-reply-count): New macro.
+       (irchat-check-long-reply-count): New macro.
+
+       * irchat-globals.el (irchat-long-reply-count) New variable.
+       (irchat-long-reply-max): New variable.
+
+       * irchat-commands.el (irchat-command-save-vars): Fix. Set marker
+       at output position.
+
+1999-02-21  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-300.el (irchat-handle-303-msg): Add differential IsON.
+
+       * irchat-commands.el (irchat-command-start-ison-timer,
+       irchat-command-cancel-ison-timer, irchat-command-activate-friends,
+       irchat-command-deactivate-friends): Do completion case
+       insensitively.
+
+       * irchat-vars.el (irchat-saved-forms): Add symbol `irchat-friends'
+       to be saved its value.
+
+1999-02-20  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * Liece 1.2.8.15.
+
+       * irchat-filter.el (irchat-sentinel): Do not throw signal, just
+       clear whole system.
+       (irchat-sentinel-error): Ditto.
+
+       * irchat-vars.el (irchat-friends): New user customizable variable.
+       (irchat-poll-friends-interval): New user customizable variable.
+       (irchat-poll-names-interval): New user customizable variable.
+
+       * irchat-commands.el (irchat-command-poll-names): Renamed from
+       `irchat-command-pollnames'; implemented as function.
+       (irchat-command-keepalive): Implemented as function.
+       (irchat-command-poll-friends): New function.
+       (irchat-command-activate-friends): New command.
+       (irchat-command-deactivate-friends): New command.
+
+       * irchat-300.el (irchat-handle-331-msg): Call
+       `irchat-set-channel-indicator'.
+       (irchat-handle-332-msg): Ditto.
+
+       * irchat-globals.el (irchat-channel-status-indicator): New
+       variable; default value of `frame-title-format'.
+       (irchat-friends-last): New variable.
+       (irchat-frame-title-format-last): New variable.
+
+       * irchat-misc.el (irchat-set-frame-title-format): Do not calculate
+       `frame-title-format' directly.
+       (irchat-maybe-update-channel-indicator): New macro.
+
+1999-02-20  P.F.FrontJr. <pff@softai.co.jp>:
+
+       * irchat-misc.el (irchat-set-channel-indicator): Display channel
+       status on mode line.
+
+       * irchat-vars.el (irchat-display-status-on-channel-indicator):
+       New user customizable variable.
+
+1999-02-15  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat.el (irchat-read-variables-files): Set alternative
+       startup file as primary one.
+
+       * irchat-timer.el (irchat-start-timer): Do not require `timer' or
+       `itimer'; autoload timer functions.
+       (irchat-cancel-timer): Ditto.
+
+1999-02-14  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-ck-ccl (irchat-ck-ccl): Remove.
+       (irchat-ck-ccl-cj-to-ck-string): Use `ccl-execute-on-string'.
+       (irchat-ck-ccl-ck-to-cj-string): Ditto.
+
+       * irchat-xemacs.el (irchat-xemacs-setup-toolbar): New function.
+
+       * irchat-menu.el (irchat-command-add-menus): New function; add
+       menubar menus explicitly.
+
+       * irchat-coding.el (irchat-coding-custom-detect-coding-region):
+       New variable; set user customizable function to detect coding system.
+       (irchat-coding-custom-detect-coding-string): Likewise.
+       (irchat-detect-coding-string-tcljp): Transported from
+       `tclKanjiUtil.c'; trivial encoding detection routine.
+       (irchat-default-coding-system): Moved from `irchat-vars.el'.
+       (irchat-default-mime-charset): Ditto.
+       (irchat-detect-coding-system): Ditto.
+
+       * crc32.el (crc32-region): Remove `mark-active'.
+
+       * irchat-timer.el (irchat-cancel-timer): Fix for XEmacs's
+       `itimer'.
+
+       * Liece 1.2.8.14.
+
+       * irchat-dcc.el (irchat-dcc-requests): Rename from
+       `irchat-dcc-request-list'; implemented as actually a queue.
+
+       * queue-m.el: New file; imported from elib.
+
+       * irchat-filter.el (irchat-filter): Remove checking whether
+       process output line contains LF; remove duplicated LF checking
+       likewise; enclose with `save-match-data'.
+       (irchat-handle-message): Add checking user-at-host cookie with
+       restricted line.
+
+       * irchat-window.el (irchat-window-functionp): Remove; use
+       `irchat-functionp'.
+
+       * irchat-channel.el (irchat-channel-get-nicks): Fix; apply car
+       against each elements.
+
+1999-02-13  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-commands.el (irchat-command-mode+o,
+       irchat-command-mode+v): Build completion list using
+       `filter-elements'.
+
+       * irchat-vars.el (irchat-exit-hook): Rename from
+       `irchat-Exit-hook'.
+
+       * irchat-inlines.el (irchat-functionp): New macro.
+
+       * irchat-compat.el (mapvector): New macro.
+
+       * irchat-misc.el (irchat-greet-author): Remove.
+       (irchat-split-rest): Fix arguments.
+       (irchat-completing-default-read): 3rd and later arguments become
+       optional.
+       (irchat-completing-sequential-read): Evaluate completion table
+       consequently; Add optional argument `multiple-candidate', if this
+       arg is non-nil always create new table with its initial state.
+
+       * llhandler.el (llhandler-define-entry-point): Add debugging
+       triger in frount of function definition.
+       (llhandler-define-with-return): Ditto.
+       (llhandler-define): Ditto.
+       (llhandler-enter-format-string): New constant; for debugging use.
+       (llhandler-leave-format-string): Ditto.
+       (llhandler-eval-args): New macro.
+
+       * irchat.el (irchat-open-server-internal): Use
+       `open-network-stream-as-binary'.
+       (irchat-startup-hook): Rename from `irchat-Startup-hook'.
+
+1999-02-07  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * Liece 1.2.8.13.
+
+       * idea.el (idea-ecb-decrypt-string): Enclose Base64 decoded string
+       with `string-as-unibyte'.
+       (idea-cbc-decrypt-string): Ditto.
+
+       * idea.el: Sync up with Irchat-980625-2.
+
+       * crc32.el: Ditto.
+
+       * irchat-300.el (irchat-handle-303-msg): Fix matched string.
+
+       * irchat-handle.el (irchat-handle-privmsg-msg): Check whether
+       private message has come from entirely outer.
+
+       * irchat-filter.el (irchat-handle-message): Remove all occurence
+       of CR out of inputs :(
+
+1999-02-06  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat.el (irchat-read-variables-files): Save alternatively
+       specified startup file name into `irchat-variables-files'.
+
+1999-02-04  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-dcc.el (irchat-command-dcc-accept): Remove destructive
+       checking.
+
+       * irchat-make.el: Do not use `add-to-list' for Emacs19.
+
+       * irchat-nick.el (irchat-nick-replace): Fixed regexp.
+
+1999-02-03  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-coding.el (irchat-coding-detect-coding-region)
+       (irchat-coding-detect-coding-string): New function.
+       (irchat-coding-decode-mime-charset-region): Use above directly.
+       (irchat-coding-decode-mime-charset-string): Ditto.
+
+1999-02-02  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-commands.el (irchat-command-who): Fixed setting
+       `irchat-channel-alist.
+
+       * Liece 1.2.8.12.
+
+       * irchat-nick.el (irchat-nick-get-user-at-host): New macro.
+
+       * irchat-compat.el (temp-minibuffer-message): New function.
+
+       * irchat-minibuf.el: New file; custom minibuffer completion.
+
+       * irchat.el (irchat-open-server-internal): Add check for dotless
+       IP or IPv6 address representation.
+
+       * irchat-channel.el (irchat-channel-set-voice): Replace with
+       regexp.
+
+1999-02-01  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-300.el (irchat-handle-319-msg): Fixed channel conversion.
+
+       * irchat-commands.el (irchat-command-modec): Fixed completion.
+       (irchat-command-mode-o,irchat-command-mode+v,irchat-command-mode-v):
+       Fix format string.
+
+       * dcc.c (chat_listen): Print connection result.
+
+       * irchat-dcc.el (irchat-command-dcc-chat-listen): Add dummy
+       argument `chat' for compatibility.
+
+       * irchat-channel.el (irchat-channel-remove-mode): Use `delq'.
+       (irchat-nick-remove-mode): Ditto.
+
+       * Liece 1.2.8.11.
+
+       * irchat-menu.el (irchat-menu-popup-menu): Check whether XEmacs or
+       not compile time.
+\f
+1999-01-31  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-compat.el (set-keymap-parents): New macro.
+
+       * irchat-commands.el (irchat-command-join-channel): Add flag
+       whether `irchat-command-buffer-mode' is toggled.
+       (irchat-command-join-partner): Ditto.
+
+       * irchat-300.el (irchat-count-words-from-string): Count postfix
+       white spaces.
+
+       * irchat-q-el.el: Splited from `irchat-ctcp.el'; binary data
+       quotation in emacs-lisp.
+       * irchat-q-ccl.el: Same functionality as above but implemented in
+       Emacs CCL.
+
+       * b64.el (b64-encode-string, b64-decode-string): Add autoload
+       cookie.
+
+       * irchat.el (irchat-channel-list-keys): New variable.
+       (irchat-define-keys): Add lisp-mode indentation.
+       (irchat-channel-mode-map, irchat-others-mode-map): Set
+       `irchat-dialogue-mode-map' as its keymap parent.
+
+1999-01-28  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * Liece 1.2.8.10.
+
+       * dcc.c: Rewritten but this is obsoleted.
+
+       * irchat-commands.el (irchat-command-end-of-buffer): Renamed from
+       `irchat-command-eod-buffer'; this works also in `irchat-{channel,
+       others}-buffer-mode'.
+
+       * dcc.ml (getaddr_ext): New function.
+
+       * irchat-dcc.el (irchat-dcc-send-filter): Fix regexp.
+       (irchat-dcc-add-to-process-alist): Add process key as symbol.
+       (irchat-dcc-get-process-object): Likewise.
+       (irchat-command-dcc-receive): Fixed arguments of
+       `irchat-dcc-add-to-process-alist'.
+       (irchat-command-dcc-send): Likewise.
+       (irchat-command-dcc-accept): Fix typo.
+
+1999-01-27  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat.el (irchat-others-mode-map): Add key binding of
+       `irchat-command-tag-region'
+
+       * irchat-commands.el (irchat-command-join-channel): Use
+       `irchat-channel-memberp'.
+       (irchat-command-modec): Make completion from supported mode list.
+       (irchat-channel-real): Try match with
+       `irchat-channel-conversion-map' case insensitively.
+       (irchat-channel-virtual): Ditto.
+
+1999-01-26  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-globals.el (irchat-supported-channel-mode-alist):
+       (irchat-supported-user-mode-alist): New variable
+
+       * irchat-nick.el (irchat-nick-get-modes): New macro.
+       (irchat-nick-add-mode): New macro.
+       (irchat-nick-remove-mode): New macro.
+       (irchat-nick-set-mode): New macro.
+
+       * irchat-000.el (irchat-handle-004-msg): Save server supported
+       modes.
+
+       * Liece 1.2.8.9.
+
+       * irchat-make.el: Add local copy of APEL to `load-path'.
+       (autoload-irchat): New function to generate autoload file.
+
+       * irchat.el (irchat-command-keys): Add key definition of
+       `irchat-command-set-window-style' (C-c s).
+       (irchat): Parse `irchat-variables-files' specified in command
+       line.
+       (irchat-read-variables-files): Add optional argument `file'.
+
+       * irchat-window.el (irchat-window-set-default-style): Fallback
+       style used when encountered an error at style-file loading time.
+
+       * irchat-handle.el (irchat-handle-mode-msg): Gather channel modes
+       correctly.
+
+       * irchat-channel.el (irchat-channel-get-modes): New macro.
+       (irchat-channel-set-mode): New macro.
+       (irchat-channel-add-mode): New macro.
+       (irchat-channel-remove-mode): New macro.
+
+       * irchat-menu.el (irchat-menu-prepare-menus): Fix typo in
+       `irchat-command-previous-channel'.
+       (irchat-menu-IRC-menu): Add menu items.
+
+1999-01-23  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-misc.el (irchat-change-nick-of): Fixed.
+
+1999-01-22  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * llhandler.el: New file.
+
+       * Liece 1.2.8.8.
+
+       * irchat-handle.el (irchat-handler-defun-*): Abolished.
+       (irchat-handler-defsubst-*): Abolished.
+       (irchat-handler-obarray): New variable.
+       (irchat-handle-error-msg): New handler.
+       Handler API has been rewritten with `irchat-handler-obarray',
+       which enables faster handler lookup from hash.
+
+1999-01-21  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-ctcp.el: Rewritten with new handler API.
+       (irchat-ctcp-file-save-directory): New user variable.
+       (irchat-client-message): New macro.
+       (irchat-client-file-message): New macro.
+
+       * irchat-vars.el (irchat-gather-channel-modes): New user variable.
+       (irchat-*-buffer): Moved into `irchat-globals.el'.
+
+       * irchat-misc.el: Require `invisible'.
+       (irchat-remove-properties-region): Use
+       `next-single-property-change' instead of `next-property-change'.
+       (next-visible-point): Add advice to pass optional argument
+       `limit'.
+       (irchat-change-nick-of): Fixed.
+
+1999-01-20  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-compat.el (filter-elements): Renamed from `filtercar'.
+       Rewritten as macro with referring to `dabbrev-filter-elements'.
+
+       * defface.el (defface-set-face-inverse): New function.
+       (defface-face-inverse): Ditto.
+       (defface-set-face-bold): Abolished. Use `face-set-bold-p'.
+       (defface-face-bold): Abolished. Use `face-bold-p'.
+       (defface-set-face-italic): Abolished. Use `face-set-italic-p'.
+       (defface-face-italic): Abolished. Use `face-italic-p'.
+
+1999-01-19  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-commands.el (irchat-command-tag-region): Renamed from
+       `irchat-dialogue-tag-line'. Add removing 'face and 'invisible
+       properties from text moved into kill ring.
+
+       * sample.dot.liece{,.ja}: Fixed documentation about window
+       configuration.
+
+       * irchat-misc.el (irchat-pick-buffer): Assume that channel names
+       are associated to channel buffers case insensitively.
+       (irchat-remove-properties-region): New macro.
+
+1999-01-18  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-compat.el (keymap-accept-event-array): Abolished.
+
+       * Liece 1.2.8.7.
+
+       * irchat-misc.el (matching-substring): Became an alias for
+       `match-string'.
+
+       * irchat.el (irchat-open-server): Fixed.
+       (irchat-open-server-internal): Fixed.
+       Do not require `smiley'.
+
+1999-01-17  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-300.el (irchat-handle-364-msg): Fixed.
+
+       * irchat-200.el (irchat-handle-213-msg): Fixed.
+
+       * irchat-intl.el (irchat-intl-load-catalogue): Do not bind `lang'
+       to `current-language-environment'.
+
+       * irchat-window.el (irchat-configure-windows): Switch to
+       `irchat-command-buffer' before calling function
+       `irchat-window-configure-frame'.
+
+       * irchat-timer.el: Enclose statement which has newly styled macros
+       with `eval'.
+
+       * irchat-compat.el (run-hook-with-args-until-success): New macro
+       for compatibility.
+
+       * irchat-misc.el (irchat-convert-received-input): New macro.
+       No longer require `irchat-filter'.
+
+1999-01-16  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-caesar.el: Abolished.
+
+       * irchat-compat.el (function-documentation): New macro.
+
+       * irchat-commands.el (irchat-command-point-back-to-command-buffer):
+       New command. Bind key to `c'.
+       (irchat-command-caesar-line): Abolished. Use `mule-caesar-region'.
+
+       * irchat-misc.el (irchat-is-message-ignored): Moved from
+       `irchat.el'.
+       (irchat-maybe-poll): Ditto.
+       (irchat-set-crypt-indicator): Ditto.
+       (irchat-get-buffer-create): Ditto.
+       (irchat-hex-char-to-integer): Imported from `misty1.el'.
+       (irchat-hex-string-to-integer): Ditto.
+
+1999-01-15  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat.el (irchat-read-variables-files): New function.
+       (irchat-command-read-variables-files): New alias to
+       `irchat-read-variables-files'.
+       (irchat-initialize-buffers): New wrapper function.
+       (irchat-replace-internal): New macro.
+       (irchat-insert-internal): New macro.
+
+       * irchat-compat.el (ccl-enable-to-read-multibyte): New broken
+       facility.
+       (buffer-or-string-p): New macro.
+
+       * irchat-misc.el (irchat-send-as-binary): New macro.
+       (irchat-send): Add `string-as-unibyte' while checking length of
+       string.
+       (irchat-replace-in-string): Abolished.
+
+       * irchat-ck-ccl.el: CCL version of `ck' to `cj' converter.
+
+       * irchat-ck-el.el: Renamed from `irchat-hankana.el'.
+
+       * irchat-make.el: irchat-make.el: Add checking whether CCL accepts
+       `read-multibyte-character'.
+
+1999-01-14  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-misc.el (irchat-nickname): New macro.
+
+       * irchat-window.el (irchat-configure-windows): Enclose
+       calling function `irchat-window-configure-frame' with
+       `save-excursion'.
+
+       * irchat-crypt.el (irchat-crypt-with-decrypt-message):
+       Renamed from `irchat-crypt-with-encrypted-message'.
+       (irchat-crypt-with-encrypt-message): New macro.
+
+       * irchat-commands.el (irchat-command-join-partner): Fixed.
+       (irchat-command-timestamp): Fixed.
+       (irchat-command-send-message): Fixed.
+       (irchat-command-message): Fixed.
+       (irchat-command-prepare-message-prefix): New macro.
+       (irchat-command-prepare-own-message-prefix): New macro.
+
+       * Liece 1.2.8.6.
+
+       * irchat-channel.el (irchat-channel-join): Fixed.
+
+       * irchat-url.el (irchat-url-prepare-browser-function): New macro.
+       (irchat-url-command-browse-url): Add checking
+       `irchat-url-browser-name' prior to `irchat-url-browser-function'.
+
+1999-01-13  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * README-styles.ja: New file.
+
+       * irchat-channel.el (irchat-channel-change): Enclose with
+       `save-excursion'.
+
+1999-01-11  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat.el (irchat): Fixed bug in XEmacs toolbar specification.
+
+1999-01-10  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-nick.el (irchat-nick-get-joined-channels): New macro.
+
+       * irchat-channel.el (irchat-channel-get-nicks): New macro.
+       (irchat-channel-get-opers): Ditto.
+       (irchat-channel-get-voices): Ditto.
+       (irchat-channel-get-topic): Ditto.
+
+       * styles/{top,bottom}: Fixed command buffer lines.
+
+       * Liece 1.2.8.5.
+
+       * irchat.el (irchat-insert): Remove checking "(featurep 'custom)".
+
+       * defface.el: New file.
+
+1999-01-09  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-handle.el (irchat-handler-define-entry-point): New alias.
+       (irchat-handler-defun-with-return): New macro.
+       (irchat-handler-defsubst-with-return): New macro.
+
+       * irchat-{000,200,300,400,500}.el: Rewritten with new handler API.
+
+       * irchat-handle.el (irchat-handler-entry-point-defun): New macro.
+       (irchat-handler-entry-point-defsubst): New macro.
+
+       * irchat-handle.el (irchat-handle-with-running-cleartext-hook):
+       Renamed from `irchat-handle-with-cleartext-hook'.
+       (irchat-handle-run-cleartext-hook):
+       Renamed from `irchat-handle-cleartext-hook'.
+
+1999-01-08  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * styles/top: New file.
+
+       * irchat-misc.el (irchat-message): New macro.
+
+       * Liece 1.2.8.4.
+
+       * styles/{bottom,middle}: New file.
+
+       * irchat-window.el (irchat-configure-windows): Moved from
+       `irchat'.
+
+       * irchat-window.el: New file for style-based window configuration.
+
+       * irchat-nick.el (irchat-nick-replace): Fixed moving point to
+       highlight mouse face.
+
+1999-01-05  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-nick.el (irchat-nick-update-region): Set point to mouse
+       clicked position.
+
+       * Liece 1.2.8.3.
+
+       * irchat.el (irchat-nick-mode-map): Add popup menu.
+
+       * irchat-menu.el (irchat-nick-popup-menu): New function.
+       (irchat-menu-popup-menu): New macro.
+
+       * irchat-intl.el (irchat-intl-get-msgstr-if): New macro.
+
+       * irchat-nick.el (irchat-nick-update-region): New function.
+       (irchat-nick-region-nicks): Moved from `irchat-xemacs'.
+       (irchat-nick-region-opers): Ditto.
+       (irchat-nick-region-voices): Ditto.
+
+       * irchat-menu.el (irchat-menu-callback-*): Moved from
+       `irchat-xemacs'.
+       (irchat-menu-define-menus): Moved to defadviced block.
+
+       * irchat-xemacs.el (irchat-xemacs-setup-menu): Shared
+       `irchat-nick-update-region'.
+
+       * irchat-channel.el (irchat-channel-set-operator): Fixed regexp.
+
+       * irchat-nick.el (irchat-nick-replace): Fixed regexp.
+
+1999-01-04  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-nick.el (irchat-nick-replace): Fixed execution order.
+
+       * irchat-nick.el (irchat-nick-replace): Fixed regexp.
+       And enclose `save-restriction'.
+
+       * irchat-menu.el: Add easymenu support.
+
+       * Liece 1.2.8.2.
+
+       * irchat-crypt.el (irchat-crypt-with-encrypted-message):
+       New macro.
+
+       * irchat-handle.el (irchat-handler-defsubst): New macro.
+       (irchat-handler-defun): Ditto.
+       (irchat-handler-return): Ditto.
+       All handler routines are defined with new form.
+       (irchat-handle-with-cleartext-hook): New macro.
+       (irchat-handle-cleartext-hook): Ditto.
+       (irchat-handle-run-hook-with-args): Ditto.
+       Handler code eliminated by global jump.
+       (irchat-handle-set-channel-prefix): New macro.
+       (irchat-handle-set-dialogue-prefix): Ditto.
+       (irchat-handle-set-private-prefix): Ditto.
+
+       * irchat-misc.el (irchat-insert-change): New macro.
+       (irchat-insert-notice): Ditto.
+       (irchat-insert-broadcast): Ditto.
+       (irchat-insert-wallops): Ditto.
+       (irchat-insert-error): Ditto.
+       (irchat-insert-info): Ditto.
+       (irchat-insert-timestamp): Ditto.
+       (irchat-insert-dcc): Ditto.
+       (irchat-insert-client): Ditto.
+
+1999-01-03  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-commands.el (irchat-switch-to-channel-no): Fixed.
+
+       * irchat-hilight.el (irchat-highlight-region): Check
+       `irchat-display-prefix-tag'.
+
+       * irchat-vars.el (irchat-display-prefix-tag): New variable.
+
+       * irchat-hilight.el (irchat-highlight-hide-prefix-region):
+       New function.
+
+       * irchat-version.el (irchat-version-user-agent-style): Abolished.
+       (liece-client-product): New variable.
+       (liece-client-name): New macro.
+       (liece-client-version-major): Ditto.
+       (liece-client-version-minor): Ditto.
+       (liece-client-version-beta): Ditto.
+       (liece-client-version-alpha): Ditto.
+       (liece-client-codename): Ditto.
+
+       * irchat-version.el (irchat-make-emacs-user-agent-string): New
+       function.
+
+       * irchat.el (irchat-insert): Renamed from `irchat-w-insert'.
+       (irchat-replace): Renamed from `irchat-w-replace'.
+
+       * irchat-intl.el (irchat-intl-domain-to-mime-charset-alist): New
+       variable.
+
+       * irchat-intl.el (irchat-intl-parse-Content-Type): Do not use
+       `mime-parse-Content-Type' when `mime-parse' is not loaded.
+
+       * irchat.el: Remove extra calls of `suppress-keymap'.
+
+       * irchat-compat.el: Remove all CL emulation.
+
+       * Liece 1.2.8.1.
+
+       * irchat-intl.el (irchat-intl-use-localized-messages): New
+       variable.
+
+1999-01-02  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-intl.el (irchat-intl-parse-Content-Type): Parse
+       "Content-Type:" header to recognize coding used in PO files.
+
+1999-01-01  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-intl.el (irchat-intl-domains-to-coding-system-alist):
+       Abolished.
+
+       * irchat-commands.el (irchat-command-find-timestamp): Regexp fixed.
+\f
+1998-12-30  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * Add experimental i18n feature.
+
+       * po/ja.po: New file.
+
+       * irchat-intl.el: New file.
+
+       * irchat-ctcp.el (irchat-ctcp-msg): Message format fixed.
+
+       * irchat-channel.el (irchat-channel-join): Fixed.
+       (irchat-channel-create-buffer): Fixed.
+
+1998-12-29  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-commands.el (irchat-switch-to-channel{,-no}):
+       Do not reconfigure windows.
+
+       * TODO.ja: New file.
+
+       * Liece 1.2.6.13/1.2.8.0.
+
+       * irchat-commands.el (irchat-switch-to-channel): Fixed.
+       (irchat-switch-to-channel-no): Fixed.
+
+       * irchat-misc.el (irchat-toggle-command-buffer-mode): When hiding
+       state of nick buffer is toggled, reconfigure windows every time.
+
+       * irchat-handle.el (irchat-handle-join-msg): Check whether joined
+       channel is modeless.
+
+       * irchat-misc.el (irchat-channel-modeless-p): New macro.
+       (irchat-channel-modeless-regexp): New variable.
+
+       * irchat-handle.el (irchat-handle-{join,quit,mode,part}-msg):
+       Compression of changes reworked.
+
+       * irchat-vars.el (irchat-display-time): Rename from
+       `irchat-print-time'.
+       (irchat-time-prefix-regexp): Regexp for time prefix.
+
+       * irchat-mail.el: Add autoloads instead of all requires
+       (`gnus-msg', `sendmail', `mime-edit').
+       (irchat-mail-compose-with-mail): Add evals to silence
+       byte-compiler.
+       (irchat-command-mail-compose): Fix completion.
+
+       * irchat-channel.el (irchat-channel-buffer-create):
+       Rewritten as a macro.
+
+       * irchat-nick.el (irchat-nick-buffer-create): Ditto.
+
+       * irchat-compat.el: `<<' and `>>' are become aliases of lsh.
+
+       * irchat.el: Rename `irchat-Select-keys' to `irchat-select-keys'.
+
+       * sample.liece{,.ja}: Add sample setting of
+       `irchat-startup-channel-list'.
+
+       * irchat.el (irchat-command-keys): Bind `C-c b' and `C-c N b' to
+       `irchat-command{,-nick}-scroll-down' (synced up with irchat-2.4jp24f).
+       (irchat-nick-keys): Bind scrolling functions.
+
+       * irchat.el (irchat-command-mode): Display `minor-mode-alist' on
+       mode-line.
+
+       * irchat-globals.el (irchat-obarray):
+       Set initial array length to 1.
+
+       * irchat.el: Remove preparation code of `irchat-obarray'.
+
+       * liece-faq.texinfo: Change formatting style.
+
+1998-12-10  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-commands.el (irchat-command-nick-scroll-down): Add check
+       whether `irchat-nick-buffer' is visible.
+       (irchat-command-nick-scroll-up): Ditto.
+
+       * irchat-commands.el (irchat-command-scroll-down): Add check
+       whether `irchat-channel-buffer' is visible.
+       (irchat-command-scroll-up): Ditto.
+
+1998-12-09  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-misc.el (irchat-set-channel-indicator): Add check for
+       `irchat-display-frame-title'.
+
+       * irchat.el (irchat-configure-windows): Bind
+       `irchat-channel-buffer-mode' and `irchat-nick-buffer-mode' at the
+       entry point.
+
+       * irchat-channel.el (irchat-channel-switch-to-last): New macro.
+
+       * Liece 1.2.6.12.
+
+       * irchat-commands.el (irchat-channel-real): Fix spelling.
+       (irchat-channel-virtual): Ditto.
+
+       * irchat-channel.el (irchat-channel-switch-to-last): New function.
+
+       * irchat-channel.el (irchat-channel-last): New macro.
+
+       * irchat-misc.el (irchat-change-nick-of): Fixed.
+
+1998-12-04  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-misc.el (irchat-own-channel-message):
+       (ircaht-own-private-message): Remove dialogue buffer from target
+       buffers.
+
+       * liece-faq.texinfo: Fix hook for auto invisible.
+
+1998-12-03  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-handle.el (irchat-pick-buffer): Moved to `irchat-misc.el'.
+
+       * irchat-highlit.el (irchat-highlight-pattern-alist): Fix regexp
+       for DCC chatting line.
+
+       * irchat-commands.el (irchat-command-modec): Select target channel.
+
+       * irchat-dcc.el (irchat-command-dcc-chat-listen):
+       (irchat-command-dcc-chat-listen): Use `as-binary-process'
+       block.
+
+       * irchat.el (irchat-open-server-internal): Ditto.
+
+       * irchat-vars.el (irchat-binary-coding-system): Abolished.
+
+       * irchat.el (irchat-open-server-internal): Bind
+       `file-coding-system-for-{read|write}' for Mule 2.3.
+
+       * irchat.el: `irchat-switch-to-channel-no-*' registered automatically.
+
+1998-12-02  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-vars.el: Require `mcharset'.
+
+       * Liece 1.2.6.11.
+
+       * irchat-vars.el (irchat-default-mime-charset): New variable.
+
+       * irchat-coding.el: Use `mcharset' instead of
+       `{encode|decode}-coding-*'.
+       (irchat-coding-encode-charset-region):
+       (irchat-coding-encode-charset-string): New macro.
+
+       * irchat-dcc.el (irchat-dcc-pop-request-object): Fixed.
+
+       * irchat-compat.el (caar): New macro.
+
+       * irchat-misc.el (irchat-repair-crlf): New function.
+
+       * Liece 1.2.6.10.
+
+       * irchat.el (irchat-dcc-map): New keymap.
+
+       * irchat-dcc.el (irchat-command-dcc-accept): New function.
+       (irchat-dcc-get-*): Access method for request object.
+       (irchat-dcc-pop-request-object): New macro.
+
+       * Liece 1.2.6.9.
+
+       * irchat-dcc.el: Very experimental DCC chat support added.
+       (irchat-command-dcc-chat-listen): New function.
+       (irchat-command-dcc-chat-connect): Ditto.
+       (irchat-dcc-chat-listen-filter): Ditto.
+       (irchat-dcc-chat-connect-filter): Ditto.
+       (irchat-dcc-chat-filter): Ditto.
+       (irchat-dcc-channel-representation-format): New variable.
+
+       * irchat-channel.el: Very experimental multiple server support
+       added.
+       (irchat-default-channel-representation-format): New variable. This
+       is unified channel locater. Set default as
+       "@<server abbreviation>+<channel name>".
+       (irchat-channel-parse-representation): New function.
+       (irchat-channel-prepare-representation): Ditto.
+
+       * irchat-misc.el (irchat-own-channel-message): New function.
+
+       * irchat-misc.el (irchat-own-message): New macro.
+
+       * dcc.ml: Explicitly return with code 0.
+
+       * irchat-dcc.el (irchat-dcc-send-filter): Fixed.
+       (irchat-dcc-receive-filter): Fixed.
+
+1998-12-01  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-vars.el (irchat-dcc-prefix): New variable.
+
+       * irchat-compat.el (cdddr): New macro.
+
+       * irchat-dcc.el (irchat-dcc-add-to-receive-list): New macro.
+       (irchat-dcc-add-to-process-alist): Ditto.
+       (irchat-dcc-get-process-object): Ditto.
+       (irchat-dcc-sentinel): New sentinel function.
+       (irchat-dcc-prepare-directory): New function.
+       (irchat-ctcp-dcc-msg): Add handler for DCC chat.
+       (irchat-command-dcc-send): Rewritten.
+       (irchat-command-dcc-receive): Ditto.
+       (irchat-command-dcc-list): Ditto.
+
+       * Liece 1.2.6.8.
+
+       * dcc.ml: New file.
+
+       * naddr.mli: Ditto.
+
+       * naddr.ml: Ditto.
+
+       * irchat-misc.el (irchat-own-message):
+       (irchat-own-private-message): Add check whether channel buffer has
+       been created.
+
+       * sample.dot.liece: Fix typo.
+
+       * sample.dot.liece.ja: Ditto.
+
+       * irchat-url.el (irchat-url-browser-netscape): Use builtin
+       composer when encounted `mailto:'.
+
+       * irchat-commands.el (irchat-dialogue-insert): Abolished.
+\f
+1998-11-28  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-misc.el (irchat-own-private-message): Check if
+       `irchat-command-buffer-mode' is not 'chat.
+
+       * Liece 1.2.6.7.
+
+       * irchat-channel.el (irchat-channel-prepare-partner):
+       Fixed for setting `irchat-current-chat-partner'.
+
+       * irchat.el: Do not require `irchat-mail'.
+
+1998-11-27  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat.el: Set default `truncate-lines'.
+
+1998-11-26  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-vars.el (irchat-display-frame-title): New variable.
+
+       * Liece 1.2.6.6.
+
+       * irchat-channel.el (irchat-command-toggle-channel-buffer-mode):
+       Remove setting dirty flag.
+
+       * irchat-nick.el (irchat-command-toggle-nick-buffer-mode):
+       Ditto
+
+1998-11-25  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-mail.el: New file.
+
+       * irchat-vars.el (irchat-convert-hankaku-katakana): New variable.
+
+       * irchat-hankana.el: New file.
+
+       * Liece 1.2.6.5.
+
+       * irchat-300.el (irchat-handle-303-msg): Print come back
+       messages for private conversation.
+
+       * irchat-misc.el (irchat-set-channel-indicator): New macro.
+
+       * irchat-handle.el (irchat-handle-nick-msg): Fixed channel indicator.
+
+       * irchat.el (irchat-close-server): Set `irchat-server' to nil.
+
+       * irchat-handle.el (irchat-handle-join-msg): Fixed for private
+       conversation.
+
+       * Add copylefts.
+
+1998-11-23  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-globals.el (irchat-ison-timer): New variable.
+
+       * irchat-vars.el (irchat-ison-interval): New variable.
+
+       * irchat-commands.el (irchat-command-set-ison-timer): New
+       function.
+       (irchat-command-cancel-ison-timer): Ditto.
+
+       * irchat-misc.el (irchat-completing-sequential-read): New function.
+
+       * Liece 1.2.6.4.
+
+       * irchat-compat.el (irchat-button3): Moved into `eval-and-compile'
+       enclosure.
+
+       * irchat.el: Do not require alist.
+
+       * irchat-handle.el (irchat-handle-quit-msg): Rewritten.
+
+       * irchat-handle.el (irchat-handle-nick-msg): Handle nick message
+       and reflect changes to private buffers.
+
+1998-11-21  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * Liece 1.2.6.3.
+
+       * irchat-misc.el (irchat-channel-p): New macro.
+       (irchat-toggle-command-buffer-mode): New wrapper function.
+
+       * irchat.el (irchat-windows-reconfiguration-needed): Fixed
+       predicate for nick buffer mode and channel list mode.
+
+       * irchat.el (irchat-command-keys): Removed duplicated binding of
+       `irchat-command-enter-message'(`\C-j' and `\M-\C-j').
+
+1998-11-19  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-handle.el (irchat-handle-privmsg-msg): Fixed.
+
+       * etc/ball.*.xpm: Remove background color in each XPM file
+       (From Yasushi Shoji <yashi@yashi.com>).
+
+       * sample.dot.liece: Add sample customizations of new feature.
+       `irchat-channel-list-buffer-mode',
+       `irchat-channel-list-window-width-percent',
+       `irchat-auto-join-partner'.
+
+       * irchat-filter.el (irchat-filter): Remove unreferenced binding.
+
+       * irchat-handle.el (irchat-handle-privmsg-msg): Handle private
+       message and join automatically.
+
+       * Liece 1.2.6.2.
+
+       * irchat-vars.el (irchat-auto-join-partner): New variable.
+       (irchat-channel-list-window-width-percent): Ditto.
+
+       * irchat-compat.el (irchat-button3): New variable.
+
+       * irchat-channel.el (irchat-channel-push-button): New handler.
+       (irchat-channel-list-insert): New function.
+       (irchat-channel-prepare-partner): New function.
+
+       * irchat-url.el (irchat-url-push-button): Search URL string around
+       event line.
+
+       * irchat.el (irchat-channel-list-mode): New major mode.
+       (irchat-configure-windows): Fixed for channel list window.
+       (irchat-channel-list-mode-map); New keymap.
+
+       * All irchat-{`Command', `Nick', `Channel', `Others', `Crypt'}-*
+       symbols renamed with uncapitalized one.
+
+1998-11-16  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * Liece 1.2.4.4.
+
+       * irchat-filter.el: Do not require mcharset.
+
+       * irchat-timer.el: Macro expression fixed (for Emacs19).
+
+       * Liece 1.2.4.3/1.2.6.1.
+
+       * irchat-vars.el (irchat-binary-coding-system):
+       New variable.
+
+       * irchat-coding.el: New file.
+
+       * irchat-filter.el (irchat-run-message-hook-types):
+       Abolished.
+       (irchat-handle-message): Rewritten.
+       (irchat-handle-message-2): Rewritten.
+
+1998-11-15  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat.el (irchat-Dialogue-mode-map):
+       (irchat-Channel-mode-map):
+       (irchat-Others-mode-map): Add check whether array style keymap
+       expression is acceptable.
+
+       * liece-faq.texinfo: New FAQ added for older version of emacsen.
+
+       * irchat-handle.el (irchat-handle-privmsg-msg):
+       Rewritten.
+
+       * irchat-200.el (irchat-handle-200-msgs):
+       Channel mask regexp fixed.
+
+       * irchat-300.el (irchat-handle-300-msgs):
+       Ditto.
+
+       * irchat-400.el (irchat-handle-400-msgs):
+       Ditto.
+
+       * sample.dot.liece: Add sample hook for auto invisible.
+
+       * Liece 1.2.3.5.
+
+       * irchat-vars.el (irchat-default-coding-system):
+       Set default to 'iso-2022-jp.
+       (irchat-detect-coding-system): New custom variable.
+
+       * irchat-misc.el (irchat-send): Add code conversion with
+       `encode-coding-region' .
+
+       * irchat-filter.el (irchat-filter): Add coding-system detection.
+
+       * irchat-compat.el (irchat-set-process-coding-system):
+       (irchat-buffer-disable-undo): Abolished.
+       (buffer-disable-undo): New macro.
+
+       * defsubst.el: Removed.
+
+1998-11-14  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-ctcp.el (irchat-ccl-quote-decode): Fixed.
+
+1998-11-13  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-ctcp.el (ccl-cascade-write):
+       (ccl-set-register-right): New broken facility.
+       (irchat-ccl-quote-decode): Rewritten with checking broken CCL
+       facilities.
+
+       * irchat-timer.el (irchat-start-timer):
+       Fixed macro expression for older versions of emacsen.
+
+       * irchat-compat.el (defface): New macro for older versions of
+       emacsen.
+
+1998-11-12  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-ctcp.el: Add CCL usability checking with `ccl-usable'.
+
+1998-11-11  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-version.el (irchat-make-user-agent-string):
+       (irchat-make-version-string):
+       Regexp fixed.
+
+       * irchat-ctcp.el (irchat-ccl-quote-decode):
+       (irchat-ccl-quote-encode): Check if module `pccl' exists.
+
+       * sample.dot.liece: Renamed from sample.irchat3_vars.el.
+
+       * irchat-version.el (liece-client-minor-version):
+       Numbered as 1.2.3.3.
+       (irchat-version-user-agent-style):
+       Declaration revereted to `defvar' from `defcustom'.
+
+       * Makefile: Removed `-lnsl'.
+\f
+1998-10-20  Daiki Ueno  <daiki@kake.info.waseda.ac.jp>
+
+       * irchat-nick.el (irchat-Nick-update): Bug fixed in splitting 353
+       (NAMEREPLY) message.
+
+       * irchat-inlines.el (list-to-assoclist): Rewritten.
+
+1998-10-08  Daiki Ueno  <daiki@dice.cache.waseda.ac.jp>
+
+       * irchat-xemacs.el (irchat-toolbar-spec-list): Replace
+       `irchat-Command-push' and `irchat-Command-pop' with
+       `irchat-Command-previous-channel' and `irchat-Command-next-channel'.
+       (irchat-x-face-face-insert): Evaluate also when loaded.
+
+1998-10-07  Daiki Ueno  <daiki@dice.cache.waseda.ac.jp>
+
+       * irchat-crypt.el (base64-encode-string): Fixed autoload with
+       `mel' to `mel-b' package.
+       (base64-decode-string): Ditto.
+
+1998-10-06  Daiki Ueno  <daiki@dice.cache.waseda.ac.jp>
+
+       * irchat-xemacs.el (irchat-xemacs-splash-logo): Splash screen with
+       "liece.xpm" on every loadup time.
+
+       * irchat-version.el (liece-client-version): Numbered as 1.2.1.
+
+       * irchat-x-face.el (irchat-x-face-face-insert): Display X-Face on
+       each prefix line align middle.
+
+       * irchat-debug.el: New file.
+
+1998-10-02  Daiki Ueno  <daiki@dice.cache.waseda.ac.jp>
+
+       * irchat.el (irchat-Debug-mode): New major mode for
+       `irchat-Command-debug'.
+
+       * liece-faq.texinfo: New file.
+
+       * irchat-commands.el (irchat-Client-query-map): Key binding for
+       `irchat-Command-client-x-face-from-minibuffer' substituted with
+       `irchat-Command-client-x-face-from-xbm-file'.
+
+       * irchat-compat.el (replace-in-string): New function from XEmacs
+       subr.el.
+
+       * irchat-x-face.el: New file.
+       (irchat-x-face-insert): Now works properly with GNU Emacs.
+
+       * irchat-xemacs.el (irchat-x-face-insert): New function.
+       (irchat-x-face-encode): Ditto.
+
+       * irchat-ctcp.el (irchat-ctcp-x-face-msg): X-Face query support.
+       Now it works only with X-Face utility.
+
+       * irchat-version.el (liece-client-version-beta): New variable.
+
+1998-10-01  Daiki Ueno  <daiki@dice.cache.waseda.ac.jp>
+
+       * irchat.el (irchat-clear-system): Restart now reworked.
+
+       * irchat-make.el (config-irchat): Add check wheter APEL version is
+       9.0 or later.
+
+       * irchat-ctcp.el (irchat-ctcp-version-msg): Rewritten with new
+       style version string.
+
+       * irchat-version.el (irchat-version-user-agent-style): New
+       variable.
+       (irchat-make-user-agent-string): New function.
+       (irchat-make-client-version-string): Ditto.
+       (irchat-make-version-string): Ditto.
+
+       * irchat-make.el (config-irchat): Rewritten.
+
+       * irchat-ctcp.el: Renamed from irchat-cta.el.
+       (irchat-ccl-quote-cs): New coding system for file transfer.
+       (irchat-ccl-quote-encode): New CCL program.
+       (irchat-ccl-quote-decode): Ditto.
+       (irchat-ctcp-msg): Hook checking code eliminated.
+       (irchat-ctcp-client-msg): Ditto.
+\f
+1998-09-30  Daiki Ueno  <daiki@dice.cache.waseda.ac.jp>
+
+       * irchat-hilight.el (irchat-highlight-buffer):
+       Add check whether there is point has
+
+       * irchat-compat (irchat-get-text-property):
+       Add signal handler for XEmacs extents.
+
+       * irchat-commands.el: Require `irchat-dcc.el'.
+
+       * Makefile: New rule for .texinfo to .info.
+
+       * irchat-hilight.el (irchat-highlight-buffer): Bug fix for
+       `irchat-highlight-pattern'.
+
+1998-09-29  Daiki Ueno  <daiki@kiss.kake.info.waseda.ac.jp>
+
+       * irchat-make.el (install-irchat): Fixed usage of function
+       install-files.
+
+       * irchat-nick.el: Do not require widget wid-edit.
+
+       * irchat-make.el (irchat-modules-to-compile): Added
+       irchat-channel, irchat-nick to module list.
+
+       * irchat-hilight.el (irchat-highlight-insert-with-mouse-face):
+       Addded check whether function widget-create is bounded.
+
+       * irchat-compat.el: Require cl.
+
+       * Makefile: Require cl. Machine specific option removed.
+
+       * irchat-commands.el (irchat-Command-send-message):
+       New signal handler for `encode-coding-string' with unknown coding
+       system. This encoding is needed when `irchat-crypt-mode-active-p'
+       is non nil.
+
+       * irchat.el: Renamed from irchat-main.el.
+
+       * irchat-main.el: Removed.
+
+1998-09-29  Daiki Ueno  <daiki@dice.cache.waseda.ac.jp>
+
+       * irchat-crypt.el (irchat-read-passphrase): New alias.
+
+1998-09-28  Daiki Ueno  <daiki@dice.cache.waseda.ac.jp>
+
+       * irchat-make.el: New file.
+
+       * irchat-compat.el: New file.
+
+       * irchat-ja.texinfo: New file.
+
+       * setpath.el: Removed.
+
+       * irchat-url.el (irchat-url-button-push): New handler.
+
+       * irchat-main.el (irchat-Select-map): New keymap.
+
+       * irchat-filter.el: Added autoloads for entry points of 000, 200,
+       300, 400, 500 message handlers.
+
+       * irchat-misc.el (irchat-greet-author): Abolished.
+
+       * irchat-channel.el: Splitted from irchat-commands.el.
+
+       * irchat-nick.el: Ditto.
diff --git a/lisp/Makefile.am b/lisp/Makefile.am
new file mode 100644 (file)
index 0000000..6916609
--- /dev/null
@@ -0,0 +1,26 @@
+EXTRA_DIST = COMPILE ChangeLog.Liece \
+       riece-000.el riece-200.el riece-300.el riece-400.el riece-500.el \
+       riece-channel.el riece-coding.el riece-commands.el riece-compat.el \
+       riece-complete.el riece-display.el riece-emacs.el riece-filter.el \
+       riece-globals.el riece-handle.el riece-highlight.el riece-identity.el \
+       riece-inlines.el riece-message.el riece-misc.el riece-naming.el \
+       riece-options.el riece-server.el riece-user.el riece-version.el \
+       riece-xemacs.el riece.el
+
+CLEANFILES = auto-autoloads.el custom-load.el *.elc
+FLAGS ?= -batch -q -no-site-file
+
+all: compile
+
+compile:
+       $(EMACS) $(FLAGS) -l COMPILE -f riece-compile
+
+install: compile
+       $(EMACS) $(FLAGS) -l COMPILE -f riece-install $(lispdir) # $(MAKE)
+
+package:
+       $(XEMACS) $(FLAGS) -l COMPILE -f riece-compile-package
+
+install-package: package
+       $(XEMACS) $(FLAGS) -l COMPILE -f riece-install-package \
+               $(PACKAGEDIR) # $(MAKE)
diff --git a/lisp/riece-000.el b/lisp/riece-000.el
new file mode 100644 (file)
index 0000000..2d6eab6
--- /dev/null
@@ -0,0 +1,63 @@
+;;; riece-000.el --- handlers for 000 replies
+;; Copyright (C) 1998-2003 Daiki Ueno
+
+;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Created: 1998-09-28
+;; Keywords: IRC, riece
+
+;; This file is part of Riece.
+
+;; 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.
+
+;;; Code:
+
+(eval-when-compile (require 'riece-inlines))
+
+(require 'riece-misc)
+(require 'riece-filter)                        ;riece-default-handle-message
+(require 'riece-version)
+
+(eval-when-compile
+  (autoload 'riece-default-handle-numeric-reply "riece-filter"))
+(defun riece-handle-default-000-message (prefix number name string)
+  (setq riece-nick-accepted 'ok)
+  (riece-default-handle-numeric-reply
+   riece-info-prefix prefix number name string))
+
+(defun riece-handle-001-message (prefix number name string)
+  "RPL_WELCOME \"Welcome to the Internet Relay Network <nick>!<user>@<host>\""
+  (setq riece-real-server-name prefix
+       riece-real-nickname name
+       riece-real-userhost nil)
+  (riece-send-string (format "USERHOST %s\r\n" riece-real-nickname))
+  (riece-insert-info
+   (list riece-dialogue-buffer riece-others-buffer)
+   (concat (substring string 1) "\n")))
+
+(defun riece-handle-004-message (prefix number name string)
+  "RPL_MYINFO \"<umodes> <chnlmodes>\""
+  (if (string-match "^[^ ]+ +[^ ]+ +\\([^ ]+\\) +" string)
+      (setq riece-supported-user-modes
+           (string-to-list (match-string 1 string))
+           riece-supported-channel-modes
+           (string-to-list (substring string (match-end 0))))
+    (riece-insert-info
+     (list riece-dialogue-buffer riece-others-buffer)
+     (concat string "\n"))))
+
+(provide 'riece-000)
+
+;;; riece-000.el ends here
diff --git a/lisp/riece-200.el b/lisp/riece-200.el
new file mode 100644 (file)
index 0000000..527867b
--- /dev/null
@@ -0,0 +1,40 @@
+;;; riece-200.el --- handlers for 200 replies
+;; Copyright (C) 1998-2003 Daiki Ueno
+
+;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Created: 1998-09-28
+;; Keywords: IRC, riece
+
+;; This file is part of Riece.
+
+;; 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.
+
+;;; Code:
+
+(eval-when-compile (require 'riece-inlines))
+
+(require 'riece-misc)
+(require 'riece-commands)
+
+(eval-when-compile
+  (autoload 'riece-default-handle-numeric-reply "riece-filter"))
+(defun riece-handle-default-200-message (prefix number name string)
+  (riece-default-handle-numeric-reply
+   riece-info-prefix prefix number name string))
+
+(provide 'riece-200)
+
+;;; riece-200.el ends here
diff --git a/lisp/riece-300.el b/lisp/riece-300.el
new file mode 100644 (file)
index 0000000..771a416
--- /dev/null
@@ -0,0 +1,230 @@
+;;; riece-300.el --- handlers for 300 replies
+;; Copyright (C) 1998-2003 Daiki Ueno
+
+;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Created: 1998-09-28
+;; Keywords: IRC, riece
+
+;; This file is part of Riece.
+
+;; 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.
+
+;;; Code:
+
+(eval-when-compile (require 'riece-inlines))
+
+(require 'riece-misc)
+(require 'riece-commands)
+
+(require 'riece-filter)                        ;riece-default-handle-message
+
+(eval-when-compile
+  (autoload 'riece-default-handle-numeric-reply "riece-filter"))
+(defun riece-handle-default-300-message (prefix number name string)
+  (riece-default-handle-numeric-reply
+   riece-info-prefix prefix number name string))
+
+(defun riece-handle-302-message (prefix number name string)
+  "RPL_USERHOST \":*1<reply> *( \" \" <reply> )\""
+  (let ((replies (split-string (substring string 1) " ")))
+    (while replies
+      (if (string-match
+          (concat "^\\(" riece-user-regexp
+                  "\\)\\(\\*\\)?=\\([-+]\\)\\([^ ]+\\)")
+          (car replies))
+         (riece-insert-info
+          (list riece-dialogue-buffer riece-others-buffer)
+          (concat
+           (riece-concat-server-name
+            (format "%s is (%s) [%s, %s]"
+                    (match-string 1 (car replies))
+                    (riece-strip-user-at-host (match-string 4 (car replies)))
+                    (if (match-beginning 2)
+                        "operator"
+                      "not operator")
+                    (if (eq (match-string 3 (car replies)) ?-)
+                        "away"
+                      "not away")))
+           "\n")))
+      (setq replies (cdr replies)))))
+
+(defun riece-handle-303-message (prefix number name string)
+  (riece-insert-info
+   (list riece-dialogue-buffer riece-others-buffer)
+   (concat
+    (riece-concat-server-name (concat "Online: " (substring string 1)))
+    "\n")))
+
+(defun riece-handle-301-message (prefix number name string)
+  (if (string-match
+       (concat "^\\(" riece-user-regexp "\\) :")
+       string)
+      (riece-insert-info
+       (list riece-dialogue-buffer riece-others-buffer)
+       (concat
+       (riece-concat-server-name
+        (format "%s is away: %s"
+                (match-string 1 string)
+                (substring string (match-end 0))))
+       "\n"))))
+
+(defun riece-handle-311-message (prefix number name string)
+  (if (string-match
+       (concat "^\\(" riece-user-regexp
+              "\\) \\([^ ]+\\) \\([^ ]+\\) \\* :")
+       string)
+      (riece-insert-info
+       (list riece-dialogue-buffer riece-others-buffer)
+       (concat
+       (riece-concat-server-name
+        (format "%s is %s (%s@%s)"
+                (match-string 1 string)
+                (substring string (match-end 0))
+                (match-string 2 string)
+                (match-string 3 string)))
+       "\n"))))
+
+(defun riece-handle-312-message (prefix number name string)
+  (if (string-match
+       (concat "^\\(" riece-user-regexp "\\) \\([^ ]+\\) :")
+       string)
+      (riece-insert-info
+       (list riece-dialogue-buffer riece-others-buffer)
+       (concat
+       (riece-concat-server-name
+        (format "on via server %s: %s"
+                riece-real-server-name
+                (substring string (match-end 0))))
+       "\n"))))
+
+(defun riece-handle-313-message (prefix number name string)
+  (if (string-match (concat "^" riece-user-regexp) string)
+      (riece-insert-info
+       (list riece-dialogue-buffer riece-others-buffer)
+       (concat
+       (riece-concat-server-name
+        (concat (match-string 0 string) " is an IRC operator"))
+       "\n"))))
+
+(defun riece-handle-317-message (prefix number name string)
+  (if (string-match
+       (concat "^\\(" riece-user-regexp "\\) \\([0-9]+\\) :")
+       string)
+      (riece-insert-info
+       (list riece-dialogue-buffer riece-others-buffer)
+       (concat
+       (riece-concat-server-name
+        (format "%s is %s seconds idle"
+                (match-string 1 string)
+                (match-string 2 string)))
+       "\n"))))
+
+(defun riece-handle-318-message (prefix number name string))
+
+(defun riece-handle-351-message (prefix number name string)
+  (if (string-match "\\([^ ]+\\.[^ ]+\\) \\([^ ]+\\) :" string)
+      (riece-insert-info
+       (list riece-dialogue-buffer riece-others-buffer)
+       (concat
+       (riece-concat-server-name
+        (format "%s is running on %s: %s"
+                (match-string 1 string)
+                (match-string 2 string)
+                (substring string (match-end 0))))
+       "\n"))))
+
+(defun riece-handle-315-message (prefix number name string))
+
+(defun riece-handle-353-message (prefix number name string)
+  "RPL_NAMREPLY        \"<channel> :[[@|+]<nick> [[@|+]<nick> [...]]]\"."
+  (if (string-match "^[=\*@] *\\([^ ]+\\) +:" string)
+      (let ((channel (match-string 1 string))
+           users)
+       (setq string (substring string (match-end 0)))
+       (if (string-match " *$" string)
+           (setq string (substring string 0 (match-beginning 0))))
+       (setq users (split-string string))
+       (while users
+         (if (eq (aref (car users) 0) ?@)
+             (progn
+               (riece-naming-assert-join (substring (car users) 1) channel)
+               (riece-channel-toggle-operator
+                channel (substring (car users) 1) t))
+           (if (eq (aref (car users) 0) ?+)
+               (progn
+                 (riece-naming-assert-join (substring (car users) 1) channel)
+                 (riece-channel-toggle-speaker
+                  channel (substring (car users) 1) t))
+             (riece-naming-assert-join (car users) channel)))
+         (setq users (cdr users)))
+       (riece-redisplay-buffers))))
+
+(defun riece-handle-366-message (prefix number name string))
+
+(defun riece-handle-324-message (prefix number name string)
+  (if (string-match "^\\([^ ]+\\) \\([^ ]+\\) " string)
+      (let* ((channel (match-string 1 string))
+            (mode-string (substring string (match-beginning 2)))
+            (modes (string-to-list (match-string 2 string)))
+            (toggle (pop modes)))
+       (while modes
+         (riece-channel-toggle-mode channel (car modes) (eq toggle ?+))
+         (setq modes (cdr modes)))
+       (let ((buffer (cdr (riece-identity-assoc-no-server
+                           (riece-make-identity channel)
+                           riece-channel-buffer-alist))))
+         (riece-insert-info buffer (concat "Mode: " mode-string "\n"))
+         (riece-insert-info
+          (if (and riece-channel-buffer-mode
+                   (not (eq buffer riece-channel-buffer)))
+              (list riece-dialogue-buffer riece-others-buffer)
+            riece-dialogue-buffer)
+          (concat
+           (riece-concat-server-name
+            (format "Mode for %s: %s" channel mode-string))
+           "\n"))))))
+
+(defun riece-handle-set-topic (prefix number name string remove)
+  (if (string-match "^\\([^ ]+\\) :" string)
+      (let* ((channel (match-string 1 string))
+            (message (substring string (match-end 0)))
+            (buffer (cdr (riece-identity-assoc-no-server
+                          (riece-make-identity channel)
+                          riece-channel-buffer-alist))))
+       (if remove
+           (riece-channel-set-topic (riece-get-channel channel) nil)
+         (riece-channel-set-topic (riece-get-channel channel) message)
+       (riece-insert-info buffer (concat "Topic: " message "\n"))
+       (riece-insert-info
+        (if (and riece-channel-buffer-mode
+                 (not (eq buffer riece-channel-buffer)))
+            (list riece-dialogue-buffer riece-others-buffer)
+          riece-dialogue-buffer)
+        (concat
+         (riece-concat-server-name
+          (format "Topic for %s: %s" channel message))
+         "\n"))
+       (riece-update-channel-indicator)))))
+
+(defun riece-handle-331-message (prefix number name string)
+  (riece-handle-set-topic prefix name name string t))
+
+(defun riece-handle-332-message (prefix number name string)
+  (riece-handle-set-topic prefix name name string nil))
+
+(provide 'riece-300)
+
+;;; riece-300.el ends here
diff --git a/lisp/riece-400.el b/lisp/riece-400.el
new file mode 100644 (file)
index 0000000..6434ebc
--- /dev/null
@@ -0,0 +1,61 @@
+;;; riece-400.el --- handlers for 400 replies
+;; Copyright (C) 1998-2003 Daiki Ueno
+
+;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Created: 1998-09-28
+;; Keywords: IRC, riece
+
+;; This file is part of Riece.
+
+;; 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.
+
+;;; Code:
+
+(eval-when-compile (require 'riece-inlines))
+
+(require 'riece-globals)
+(require 'riece-misc)
+
+(eval-when-compile
+  (autoload 'riece-default-handle-numeric-reply "riece-filter"))
+(defun riece-handle-default-400-message (prefix number name string)
+  (riece-default-handle-numeric-reply
+   riece-error-prefix prefix number name string))
+
+(defun riece-handle-432-message (prefix number name string)
+  "ERR_ERRONEUSNICKNAME        \"<nick> :Erroneous nickname\"."
+  (riece-send-string
+   (format "NICK %s\r\n"
+          (read-string
+           (format "Erroneous nickname \"%s\".  Choose a new one: "
+                   (car (riece-split-parameters string)))))))
+
+(defun riece-handle-433-message (prefix number name string)
+  "ERR_NICKNAMEINUSE \"<nick> :Nickname is already in use\"."
+  (riece-send-string
+   (format "NICK %s\r\n"
+          (read-string
+           (format "Nickname \"%s\" already in use.  Choose a new one: "
+                   (car (riece-split-parameters string)))))))
+
+(defun riece-handle-464-message (prefix number name string)
+  "ERR_PASSWDMISMATCH \":Password incorrect\"."
+  (message "Password incorrect from %s." prefix)
+  (setq riece-reconnect-with-password t))
+
+(provide 'riece-400)
+
+;;; riece-400.el ends here
diff --git a/lisp/riece-500.el b/lisp/riece-500.el
new file mode 100644 (file)
index 0000000..3589df9
--- /dev/null
@@ -0,0 +1,39 @@
+;;; riece-500.el --- handlers for 500 replies
+;; Copyright (C) 1998-2003 Daiki Ueno
+
+;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Created: 1998-09-28
+;; Keywords: IRC, riece
+
+;; This file is part of Riece.
+
+;; 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.
+
+;;; Code:
+
+(eval-when-compile (require 'riece-inlines))
+
+(require 'riece-misc)
+
+(eval-when-compile
+  (autoload 'riece-default-handle-numeric-reply "riece-filter"))
+(defun riece-handle-default-500-message (prefix number name string)
+  (riece-default-handle-numeric-reply
+   riece-error-prefix prefix number name string))
+
+(provide 'riece-500)
+
+;;; riece-500.el ends here
diff --git a/lisp/riece-channel.el b/lisp/riece-channel.el
new file mode 100644 (file)
index 0000000..b2cc8c5
--- /dev/null
@@ -0,0 +1,272 @@
+;;; riece-channel.el --- a channel object
+;; Copyright (C) 1998-2003 Daiki Ueno
+
+;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Created: 1998-09-28
+;; Keywords: IRC, riece
+
+;; This file is part of Riece.
+
+;; 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.
+
+;;; Code:
+
+(eval-when-compile (require 'riece-inlines))   ;string-assoc-ignore-case, etc.
+
+(require 'riece-options)
+(require 'riece-identity)
+
+;;; String representation of a channel:
+(defconst riece-channel-regexp "^[+&#!]")
+(defconst riece-channel-modeless-regexp "^[+!]")
+
+(defun riece-channel-p (string)
+  "Return t if STRING is a channel.
+\(i.e. it matches `riece-channel-regexp')"
+  (string-match riece-channel-regexp string))
+
+(defun riece-channel-modeless-p (string)
+  "Return t if STRING is a modeless channel.
+\(i.e. it matches `riece-channel-modeless-regexp')"
+  (string-match riece-channel-modeless-regexp string))
+
+;;; Channel object:
+(defun riece-find-channel (name)
+  "Get a channel object named NAME from the server buffer."
+  (riece-with-server-buffer
+   (let ((symbol (intern-soft (downcase (riece-identity-prefix name))
+                             riece-obarray)))
+     (if symbol
+        (symbol-value symbol)))))
+
+(defun riece-forget-channel (name)
+  (riece-with-server-buffer
+   (let ((symbol (intern-soft (downcase (riece-identity-prefix name)))))
+     (when symbol
+       (makunbound symbol)
+       (unintern (symbol-name symbol) riece-obarray)))))
+
+(defun riece-make-channel (&optional users operators speakers
+                                    topic modes banned invited uninvited
+                                    key)
+  "Make an instance of channel object.
+Arguments are appropriate to channel users, operators, speakers
+\(+v), topic, modes, banned users, invited users, uninvited users, and
+the channel key, respectively."
+  (vector users operators speakers topic modes banned invited uninvited))
+
+(defun riece-get-channel (name)
+  (riece-with-server-buffer
+   (let ((symbol (intern-soft (downcase (riece-identity-prefix name))
+                             riece-obarray)))
+     (if symbol
+        (symbol-value symbol)
+       (set (intern (downcase (riece-identity-prefix name))
+                   riece-obarray)
+           (riece-make-channel))))))
+
+(defun riece-channel-users (channel)
+  "Return the users of CHANNEL."
+  (aref channel 0))
+
+(defun riece-channel-operators (channel)
+  "Return the operators of CHANNEL."
+  (aref channel 1))
+
+(defun riece-channel-speakers (channel)
+  "Return the speakers of CHANNEL."
+  (aref channel 2))
+
+(defun riece-channel-topic (channel)
+  "Return the topic of CHANNEL."
+  (aref channel 3))
+
+(defun riece-channel-modes (channel)
+  "Return the modes of CHANNEL."
+  (aref channel 4))
+
+(defun riece-channel-banned (channel)
+  "Return the banned users of CHANNEL."
+  (aref channel 5))
+
+(defun riece-channel-invited (channel)
+  "Return the invited users of CHANNEL."
+  (aref channel 6))
+
+(defun riece-channel-uninvited (channel)
+  "Return the uninvited users of CHANNEL."
+  (aref channel 7))
+
+(defun riece-channel-key (channel)
+  "Return the key of CHANNEL."
+  (aref channel 8))
+
+(defun riece-channel-set-users (channel value)
+  "Set the users of CHANNEL to VALUE."
+  (aset channel 0 value))
+
+(defun riece-channel-set-operators (channel value)
+  "Set the operators of CHANNEL to VALUE."
+  (aset channel 1 value))
+
+(defun riece-channel-set-speakers (channel value)
+  "Set the speakers of CHANNEL to VALUE."
+  (aset channel 2 value))
+
+(defun riece-channel-set-topic (channel value)
+  "Set the topic of CHANNEL to VALUE."
+  (aset channel 3 value))
+
+(defun riece-channel-set-modes (channel value)
+  "Set the modes of CHANNEL to VALUE."
+  (aset channel 4 value))
+
+(defun riece-channel-set-banned (channel value)
+  "Set the banned users of CHANNEL to VALUE."
+  (aset channel 5 value))
+
+(defun riece-channel-set-invited (channel value)
+  "Set the invited users of CHANNEL to VALUE."
+  (aset channel 6 value))
+
+(defun riece-channel-set-uninvited (channel value)
+  "Set the uninvited users of CHANNEL to VALUE."
+  (aset channel 7 value))
+
+(defun riece-channel-set-key (channel value)
+  "Set the key of CHANNEL to VALUE."
+  (aset channel 8 value))
+
+(defun riece-channel-get-users (&optional name)
+  "Return channel's users as list."
+  (riece-channel-users
+   (riece-get-channel (or name riece-current-channel))))
+
+(defun riece-channel-get-operators (&optional name)
+  "Return channel's operators as list."
+  (riece-channel-operators
+   (riece-get-channel (or name riece-current-channel))))
+
+(defun riece-channel-get-speakers (&optional name)
+  "Return channel's speakers as list."
+  (riece-channel-speakers
+   (riece-get-channel (or name riece-current-channel))))
+
+(defun riece-channel-get-topic (&optional name)
+  "Return channel's topic."
+  (riece-channel-topic
+   (riece-get-channel (or name riece-current-channel))))
+
+(defun riece-channel-get-modes (&optional name)
+  "Return channel's modes as list."
+  (riece-channel-modes
+   (riece-get-channel (or name riece-current-channel))))
+
+(defun riece-channel-get-banned (&optional name)
+  "Return channel's banned users as list."
+  (riece-channel-banned
+   (riece-get-channel (or name riece-current-channel))))
+
+(defun riece-channel-get-invited (&optional name)
+  "Return channel's invited users as list."
+  (riece-channel-invited
+   (riece-get-channel (or name riece-current-channel))))
+
+(defun riece-channel-get-uninvited (&optional name)
+  "Return channel's uninvited users as list."
+  (riece-channel-uninvited
+   (riece-get-channel (or name riece-current-channel))))
+
+(defun riece-channel-get-key (&optional name)
+  "Return channel's key."
+  (riece-channel-key
+   (riece-get-channel (or name riece-current-channel))))
+
+;;; Functions called from `riece-handle-mode-message':
+(defun riece-channel-toggle-mode (name mode flag)
+  "Add or remove channel MODE of channel."
+  (let* ((channel (riece-get-channel (or name riece-current-channel)))
+        (modes (riece-channel-modes channel)))
+    (if flag
+       (unless (memq mode modes)
+         (riece-channel-set-modes channel (cons mode modes)))
+      (if (memq mode modes)
+         (riece-channel-set-modes channel (delq mode modes))))))
+
+(defun riece-channel-toggle-banned (name pattern flag)
+  "Add or remove banned PATTERN of channel."
+  (let* ((channel (riece-get-channel (or name riece-current-channel)))
+        (banned (riece-channel-banned channel)))
+    (if flag
+       (unless (member pattern banned)
+         (riece-channel-set-banned channel (cons pattern banned)))
+      (if (setq pattern (car (member pattern banned)))
+         (riece-channel-set-banned channel (delq pattern banned))))))
+
+(defun riece-channel-toggle-invited (name pattern flag)
+  "Add or remove invited PATTERN of channel."
+  (let* ((channel (riece-get-channel (or name riece-current-channel)))
+        (invited (riece-channel-invited channel)))
+    (if flag
+       (unless (member pattern invited)
+         (riece-channel-set-invited channel (cons pattern invited)))
+      (if (setq pattern (car (member pattern invited)))
+         (riece-channel-set-invited channel (delq pattern invited))))))
+
+(defun riece-channel-toggle-uninvited (name pattern flag)
+  "Add or remove uninvited PATTERN to channel."
+  (let* ((channel (riece-get-channel (or name riece-current-channel)))
+        (uninvited (riece-channel-uninvited channel)))
+    (if flag
+       (unless (member pattern uninvited)
+         (riece-channel-set-uninvited channel (cons pattern uninvited)))
+      (if (setq pattern (car (member pattern uninvited)))
+         (riece-channel-set-uninvited
+          channel (delq pattern uninvited))))))
+
+(defun riece-channel-toggle-user (name user flag)
+  "Add or remove an user to channel."
+  (let* ((channel (riece-get-channel (or name riece-current-channel)))
+        (users (riece-channel-users channel)))
+    (if flag
+       (unless (member user users)
+         (riece-channel-set-users channel (cons user users)))
+      (if (setq user (car (member user users)))
+         (riece-channel-set-users channel (delq user users))))))
+
+(defun riece-channel-toggle-operator (name user flag)
+  "Add or remove an operator to channel."
+  (let* ((channel (riece-get-channel (or name riece-current-channel)))
+        (operators (riece-channel-operators channel)))
+    (if flag
+       (unless (member user operators)
+         (riece-channel-set-operators channel (cons user operators)))
+      (if (setq user (car (member user operators)))
+         (riece-channel-set-operators channel (delq user operators))))))
+
+(defun riece-channel-toggle-speaker (name user flag)
+  "Add or remove an speaker to channel."
+  (let* ((channel (riece-get-channel (or name riece-current-channel)))
+        (speakers (riece-channel-speakers channel)))
+    (if flag
+       (unless (member user speakers)
+         (riece-channel-set-speakers channel (cons user speakers)))
+      (if (setq user (car (member user speakers)))
+         (riece-channel-set-speakers channel (delq user speakers))))))
+
+(provide 'riece-channel)
+
+;;; riece-channel.el ends here
diff --git a/lisp/riece-coding.el b/lisp/riece-coding.el
new file mode 100644 (file)
index 0000000..9d14be1
--- /dev/null
@@ -0,0 +1,66 @@
+;;; riece-coding.el --- converting string with coding system
+;; Copyright (C) 1998-2003 Daiki Ueno
+
+;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Created: 1998-09-28
+;; Keywords: IRC, riece, coding-system, MULE
+
+;; This file is part of Riece.
+
+;; 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.
+
+;;; Code:
+
+(require 'riece-globals)
+
+(defgroup riece-coding nil
+  "Coding system"
+  :tag "Coding"
+  :prefix "riece-"
+  :group 'riece)
+  
+(defcustom riece-default-coding-system
+  (if (and (or (featurep 'mule)
+              (featurep 'file-coding)))
+      (cons 'ctext 'iso-2022-jp-2))
+  "Coding system for process I/O.
+The value is a coding system, or a cons cell (DECODING . ENCODING)
+specifying the coding systems for decoding and encoding respectively."
+  :type '(choice (symbol :tag "Coding system")
+                (cons (symbol :tag "Input coding system")
+                      (symbol :tag "Output coding system"))
+                (const nil :tag "No conversion"))
+  :group 'riece-coding)
+
+(defun riece-encode-coding-string (string)
+  (if (and (local-variable-p 'riece-coding-system (current-buffer))
+          riece-coding-system)         ;should be nil on non-Mule environment
+      (if (consp riece-coding-system)
+         (encode-coding-string string (cdr riece-coding-system))
+       (encode-coding-string string riece-coding-system))
+    string))
+
+(defun riece-decode-coding-string (string)
+  (if (and (local-variable-p 'riece-coding-system (current-buffer))
+          riece-coding-system)         ;should be nil on non-Mule environment
+      (if (consp riece-coding-system)
+         (decode-coding-string string (car riece-coding-system))
+       (decode-coding-string string riece-coding-system))
+    string))
+
+(provide 'riece-coding)
+
+;;; riece-coding.el ends here
diff --git a/lisp/riece-commands.el b/lisp/riece-commands.el
new file mode 100644 (file)
index 0000000..ea07bd9
--- /dev/null
@@ -0,0 +1,523 @@
+;;; riece-commands.el --- commands available in command buffer
+;; Copyright (C) 1998-2003 Daiki Ueno
+
+;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Created: 1998-09-28
+;; Keywords: IRC, riece
+
+;; This file is part of Riece.
+
+;; 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.
+
+;;; Code:
+
+(eval-when-compile (require 'riece-inlines))
+
+(require 'riece-channel)
+(require 'riece-complete)
+(require 'riece-display)
+(require 'riece-version)
+(require 'riece-server)
+(require 'riece-misc)
+(require 'riece-identity)
+(require 'riece-message)
+
+;;; Channel movement:
+(defun riece-command-switch-to-channel (channel)
+  (interactive
+   (list (completing-read "Channel/user: "
+                         (mapcar #'list riece-current-channels)
+                         nil t)))
+  (riece-switch-to-channel channel)
+  (riece-command-configure-windows))
+
+(defun riece-command-switch-to-channel-by-number (number)
+  (interactive
+   (let ((command-name (symbol-name this-command)))
+     (if (string-match "[0-9]+$" command-name)
+        (list (string-to-number (match-string 0 command-name)))
+       (list (string-to-number (read-string "Number: "))))))
+  (let ((channels riece-current-channels)
+       (index 1))
+    (while (and channels
+               (< index number))
+      (if (car channels)
+         (setq index (1+ index)))
+      (setq channels (cdr channels)))
+    (if (car channels)
+       (riece-command-switch-to-channel (car channels))
+      (error "No such number!"))))
+       
+(eval-and-compile
+  (let ((number 1))
+    (while (<= number 20)
+      (defalias (intern (concat "riece-command-switch-to-channel-by-number-"
+                               (number-to-string number)))
+       'riece-command-switch-to-channel-by-number)
+      (setq number (1+ number)))))
+
+(defun riece-command-next-channel ()
+  "Select the next channel."
+  (interactive)
+  (let ((pointer (cdr (string-list-member-ignore-case
+                      riece-current-channel
+                      riece-current-channels))))
+    (while (and pointer
+               (null (car pointer)))
+      (setq pointer (cdr pointer)))
+    (if (car pointer)
+       (riece-command-switch-to-channel (car pointer))
+      (error "No such channel!"))))
+
+(defun riece-command-previous-channel ()
+  "Select the previous channel."
+  (interactive)
+  (let ((pointer (string-list-member-ignore-case
+                 riece-current-channel
+                 riece-current-channels))
+       (start riece-current-channels)
+       channel)
+    (while (and start (not (eq start pointer)))
+      (if (car start)
+         (setq channel (car start)))
+      (setq start (cdr start)))
+    (if channel
+       (riece-command-switch-to-channel channel)
+      (error "No such channel!"))))
+
+(defun riece-command-select-command-buffer ()
+  "Select the command buffer."
+  (interactive)
+  (let ((window (get-buffer-window riece-command-buffer)))
+    (if window
+       (select-window window))))
+
+(defun riece-command-configure-windows ()
+  (interactive)
+  (riece-redisplay-buffers t))
+
+(defun riece-command-toggle-channel-buffer-mode ()
+  (interactive)
+  (setq riece-channel-buffer-mode
+       (not riece-channel-buffer-mode))
+  (riece-command-configure-windows))
+
+(defun riece-command-toggle-user-list-buffer-mode ()
+  (interactive)
+  (setq riece-user-list-buffer-mode
+       (not riece-user-list-buffer-mode))
+  (riece-command-configure-windows))
+
+(defun riece-command-toggle-channel-list-buffer-mode ()
+  (interactive)
+  (setq riece-channel-list-buffer-mode
+       (not riece-channel-list-buffer-mode))
+  (riece-command-configure-windows))
+
+(defun riece-get-users-on-server ()
+  (riece-with-server-buffer
+   (let (users)
+     (mapatoms
+      (lambda (atom)
+       (unless (riece-channel-p (symbol-name atom))
+         (push (symbol-name atom) users)))
+      riece-obarray)
+     (if (member riece-real-nickname users)
+        users
+       (cons riece-real-nickname users)))))
+
+(defun riece-command-finger (user &optional recurse)
+  (interactive
+   (let* ((completion-ignore-case t)
+         (user (completing-read
+                "User: "
+                (mapcar #'list (riece-get-users-on-server)))))
+     (list user current-prefix-arg)))
+  (if recurse
+      (riece-send-string (format "WHOIS %s %s\r\n" user user))
+    (riece-send-string (format "WHOIS %s\r\n" user))))
+
+(defun riece-command-topic (topic)
+  (interactive
+   (list (read-from-minibuffer
+         "Topic: " (cons (or (riece-channel-get-topic
+                              riece-current-channel)
+                             "")
+                         0))))
+  (riece-send-string (format "TOPIC %s :%s\r\n"
+                            (riece-identity-prefix riece-current-channel)
+                            topic)))
+
+(defun riece-command-invite (&optional user channel)
+  (interactive
+   (let ((completion-ignore-case t)
+        user channel)
+     (if current-prefix-arg
+        (setq channel
+              (completing-read
+               "Channel: "
+               (mapcar #'list riece-current-channels))))
+     (list (completing-read
+           "User: "
+           (mapcar #'list (riece-get-users-on-server)))
+          channel)))
+  (if channel
+      (riece-send-string (format "INVITE %s %s\r\n"
+                                user (riece-identity-prefix channel)))
+    (riece-send-string (format "INVITE %s %s\r\n"
+                              user (riece-identity-prefix
+                                    riece-current-channel)))))
+
+(defun riece-command-change-mode (channel change)
+  (interactive
+   (let* ((completion-ignore-case t)
+         (channel
+          (if current-prefix-arg
+              (completing-read
+               "Channel/user: "
+               (mapcar #'list riece-current-channels))
+            riece-current-channel))
+         (riece-overriding-server-name (riece-identity-server channel))
+         (riece-temp-minibuffer-message
+          (concat "[Available modes: "
+                  (riece-with-server-buffer
+                   (if (and (riece-channel-p channel)
+                            riece-supported-channel-modes)
+                       (apply #'string riece-supported-channel-modes)
+                     (if (and (not (riece-channel-p channel))
+                              riece-supported-user-modes)
+                         (apply #'string riece-supported-user-modes))))
+                  "]")))
+     (list channel
+          (read-from-minibuffer
+           (concat (riece-concat-modes channel "Mode (? for help)") ": ")
+           nil riece-minibuffer-map))))
+  (riece-send-string (format "MODE %s :%s\r\n" channel change)))
+
+(defun riece-command-set-operators (users &optional arg)
+  (interactive
+   (let ((operators (riece-channel-get-operators riece-current-channel))
+        (completion-ignore-case t)
+        users)
+     (if current-prefix-arg
+        (setq users (riece-completing-read-multiple
+                     "Users"
+                     (mapcar #'list operators)))
+       (setq users (riece-completing-read-multiple
+                   "Users"
+                   (delq nil (mapcar (lambda (user)
+                                       (unless (member user operators)
+                                         (list user)))
+                                     (riece-channel-get-users
+                                      riece-current-channel))))))
+     (list users current-prefix-arg)))
+  (let (group)
+    (while users
+      (push (pop users) group)
+      (if (or (= (length group) 3)
+             (null users))
+         (riece-send-string
+          (format "MODE %s %c%s %s\r\n"
+                  (riece-identity-prefix riece-current-channel)
+                  (if current-prefix-arg
+                      ?-
+                    ?+)
+                  (make-string (length group) ?o)
+                  (mapconcat #'identity group " ")))))))
+
+(defun riece-command-set-speakers (users &optional arg)
+  (interactive
+   (let ((speakers (riece-channel-get-speakers riece-current-channel))
+        (completion-ignore-case t)
+        users)
+     (if current-prefix-arg
+        (setq users (riece-completing-read-multiple
+                     "Users"
+                     (mapcar #'list speakers)))
+       (setq users (riece-completing-read-multiple
+                   "Users"
+                   (delq nil (mapcar (lambda (user)
+                                       (unless (member user speakers)
+                                         (list user)))
+                                     (riece-channel-get-users
+                                      riece-current-channel))))))
+     (list users current-prefix-arg)))
+  (let (group)
+    (while users
+      (push (pop users) group)
+      (if (or (= (length group) 3)
+             (null users))
+         (riece-send-string
+          (format "MODE %s %c%s %s\r\n"
+                  (riece-identity-prefix riece-current-channel)
+                  (if current-prefix-arg
+                      ?-
+                    ?+)
+                  (make-string (length group) ?v)
+                  (mapconcat #'identity group " ")))))))
+
+(defun riece-command-send-message (message)
+  "Send MESSAGE to the current channel."
+  (if (equal message "")
+      (error "No text to send"))
+  (unless riece-current-channel
+    (error (substitute-command-keys
+           "Type \\[riece-command-join] to join a channel")))
+  (riece-send-string
+   (format "PRIVMSG %s :%s\r\n"
+          (riece-identity-prefix riece-current-channel)
+          message))
+  (riece-own-channel-message message))
+
+(defun riece-command-enter-message ()
+  "Send the current line to the current channel."
+  (interactive)
+  (riece-command-send-message (buffer-substring
+                              (riece-line-beginning-position)
+                              (riece-line-end-position)))
+  (let ((next-line-add-newlines t))
+    (next-line 1)))
+
+(defun riece-command-join-channel (target key)
+  (let ((server-name (riece-identity-server target))
+       process)
+    (if server-name
+       (setq process (cdr (assoc server-name riece-server-process-alist)))
+      (setq process riece-server-process))
+    (unless process
+      (error "%s" (substitute-command-keys
+                  "Type \\[riece-command-open-server] to open server.")))
+    (riece-process-send-string process
+                              (if key
+                                  (format "JOIN %s :%s\r\n"
+                                          (riece-identity-prefix target)
+                                          key)
+                                (format "JOIN %s\r\n"
+                                        (riece-identity-prefix target))))))
+
+(defun riece-command-join-partner (target)
+  (let ((pointer (riece-identity-member target riece-current-channels)))
+    (if pointer
+       (riece-command-switch-to-channel (car pointer))
+      (riece-join-channel target)
+      (riece-switch-to-channel target)
+      (riece-redisplay-buffers))))
+
+(defun riece-command-join (target &optional key)
+  (interactive
+   (let ((completion-ignore-case t)
+        (target
+         (completing-read "Channel/user: "
+                          (mapcar #'list riece-current-channels)))
+        key)
+     (if (and current-prefix-arg
+             (riece-channel-p target))
+        (setq key
+              (riece-read-passwd (format "Key for %s: " target))))
+     (list target key)))
+  (let ((pointer (riece-identity-member target riece-current-channels)))
+    (if pointer
+       (riece-command-switch-to-channel (car pointer))
+      (if (riece-channel-p target)
+         (riece-command-join-channel target key)
+       (riece-command-join-partner target)))))
+
+(defun riece-command-part-channel (target message)
+  (let ((server-name (riece-identity-server target))
+       process)
+    (if server-name
+       (setq process (cdr (assoc server-name riece-server-process-alist)))
+      (setq process riece-server-process))
+    (unless process
+      (error "%s" (substitute-command-keys
+                  "Type \\[riece-command-open-server] to open server.")))
+    (riece-process-send-string process
+                              (if message
+                                  (format "PART %s :%s\r\n"
+                                          (riece-identity-prefix target)
+                                          message)
+                                (format "PART %s\r\n"
+                                        (riece-identity-prefix target))))))
+
+(defun riece-command-part (target &optional message)
+  (interactive
+   (let ((completion-ignore-case t)
+        (target
+         (completing-read "Channel/user: "
+                          (mapcar #'list riece-current-channels)
+                          nil t (cons riece-current-channel 0)))
+        message)
+     (if (and current-prefix-arg
+             (riece-channel-p target))
+        (setq message (read-string "Message: ")))
+     (list target message)))
+  (if (riece-identity-member target riece-current-channels)
+      (if (riece-channel-p target)
+         (riece-command-part-channel target message)
+       (riece-part-channel target)
+       (riece-redisplay-buffers))
+    (error "You are not talking with %s" target)))
+
+(defun riece-command-change-nickname (nickname)
+  "Change your nickname to NICK."
+  (interactive "sEnter your nickname: ")
+  (riece-send-string (format "NICK %s\r\n" nickname)))
+
+(defun riece-command-scroll-down (lines)
+  "Scroll LINES down dialogue buffer from command buffer."
+  (interactive "P")
+  (let ((other-window-scroll-buffer
+        (if riece-channel-buffer-mode
+            riece-channel-buffer
+          riece-dialogue-buffer)))
+    (when (get-buffer-window other-window-scroll-buffer)
+      (condition-case nil
+         (scroll-other-window-down lines)
+       (beginning-of-buffer
+        (message "Beginning of buffer"))))))
+
+(defun riece-command-scroll-up (lines)
+  "Scroll LINES up dialogue buffer from command buffer."
+  (interactive "P")
+  (let* ((other-window-scroll-buffer
+         (if riece-channel-buffer-mode
+             riece-channel-buffer
+           riece-dialogue-buffer)))
+    (when (get-buffer-window other-window-scroll-buffer)
+      (condition-case nil
+         (scroll-other-window lines)
+       (end-of-buffer
+        (message "End of buffer"))))))
+
+(defun riece-command-nick-scroll-down (lines)
+  "Scroll LINES down nick buffer from command buffer."
+  (interactive "P")
+  (let ((other-window-scroll-buffer riece-user-list-buffer))
+    (when (get-buffer-window other-window-scroll-buffer)
+      (condition-case nil
+         (scroll-other-window-down lines)
+       (beginning-of-buffer
+        (message "Beginning of buffer"))))))
+
+(defun riece-command-nick-scroll-up (lines)
+  "Scroll LINES up nick buffer from command buffer."
+  (interactive "P")
+  (let* ((other-window-scroll-buffer riece-user-list-buffer))
+    (when (get-buffer-window other-window-scroll-buffer)
+      (condition-case nil
+         (scroll-other-window lines)
+       (end-of-buffer
+        (message "End of buffer"))))))
+
+(defun riece-command-toggle-away (&optional message)
+  "Mark yourself as being away."
+  (interactive
+   (if current-prefix-arg
+       (let ((message (read-string "Away message: ")))
+        (list message))))
+  (if message
+      (riece-send-string (format "AWAY :%s\r\n" message))
+    (riece-send-string "AWAY\r\n")))
+
+(defun riece-command-toggle-freeze (&optional arg)
+  "Prevent automatic scrolling of the dialogue window.
+If prefix argument ARG is non-nil, toggle frozen status."
+  (interactive "P")
+  (riece-freeze (if riece-channel-buffer-mode
+                   riece-channel-buffer
+                 riece-dialogue-buffer)
+               (if arg (prefix-numeric-value arg))))
+
+(defun riece-command-toggle-own-freeze (&optional arg)
+  "Prevent automatic scrolling of the dialogue window.
+The difference from `riece-command-freeze' is that your messages are hidden.
+If prefix argument ARG is non-nil, toggle frozen status."
+  (interactive "P")
+  (riece-own-freeze (if riece-channel-buffer-mode
+                       riece-channel-buffer
+                     riece-dialogue-buffer)
+                   (if arg (prefix-numeric-value arg))))
+
+(defun riece-command-quit (&optional arg)
+  "Quit IRC."
+  (interactive "P")
+  (if (y-or-n-p "Really quit IRC? ")
+      (let ((message
+            (if arg
+                (read-string "Message: ")
+              (or riece-quit-message
+                  (riece-extended-version)))))
+       (riece-close-all-server message))))
+
+(defun riece-command-raw (command)
+  "Enter raw IRC command, which is sent to the server."
+  (interactive "sIRC command: ")
+  (riece-send-string (concat command "\r\n")))
+
+(defun riece-command-end-of-buffer ()
+  "Get end of the dialogue buffer."
+  (interactive)
+  (let (buffer window)
+    (setq buffer (if riece-channel-buffer-mode
+                    riece-channel-buffer
+                  riece-dialogue-buffer))
+    (or (setq window (get-buffer-window buffer))
+       (setq window (get-buffer-window riece-dialogue-buffer)
+             buffer riece-dialogue-buffer))
+    (when window
+      (save-selected-window
+       (select-window window)
+       (goto-char (point-max))))))
+
+(defun riece-command-copy-region (start end)
+  "Move current region between START and END to `kill-ring'."
+  (interactive "r")
+  (kill-new (buffer-substring-no-properties start end)))
+
+(defun riece-command-open-server (server-name)
+  (interactive
+   (list (completing-read "Server: " riece-server-alist)))
+  (let ((process (riece-start-server
+                 (riece-server-name-to-server server-name)
+                 server-name)))
+    (with-current-buffer (process-buffer process)
+      (setq riece-server-name server-name))
+    (push (cons server-name process) riece-server-process-alist)))
+
+(defun riece-command-close-server (server-name &optional message)
+  (interactive
+   (list (completing-read "Server: " riece-server-process-alist)
+        (if current-prefix-arg
+            (read-string "Message: ")
+          (or riece-quit-message
+              (riece-extended-version)))))
+  (riece-close-server server-name message))
+
+(defun riece-command-universal-server-name-argument ()
+  (interactive)
+  (let* ((riece-overriding-server-name
+         (completing-read "Server: "
+                          riece-server-process-alist))
+        (command
+         (key-binding (read-key-sequence
+                       (format "Command to execute on \"%s\":"
+                               riece-overriding-server-name)))))
+    (message "")
+    (call-interactively command)))
+
+(provide 'riece-commands)
+
+;;; riece-commands.el ends here
diff --git a/lisp/riece-compat.el b/lisp/riece-compat.el
new file mode 100644 (file)
index 0000000..bcc82ac
--- /dev/null
@@ -0,0 +1,60 @@
+;;; riece-compat.el --- compatibility functions
+;; Copyright (C) 1998-2003 Daiki Ueno
+
+;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Created: 1998-09-28
+;; Keywords: IRC, riece, APEL
+
+;; This file is part of Riece.
+
+;; 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.
+
+;;; Code:
+
+(defalias 'riece-mode-line-buffer-identification
+  'identity)
+
+(defun riece-simplify-mode-line-format ()
+  "Remove unnecessary information from `mode-line-format'."
+  (let ((value (rassq 'mode-line-modified mode-line-format)))
+    (if value
+       (setq mode-line-format (delq value (copy-sequence mode-line-format)))
+      mode-line-format)))
+
+(defun riece-line-beginning-position ()
+  (save-excursion
+    (beginning-of-line)
+    (point)))
+
+(defun riece-line-end-position ()
+  (save-excursion
+    (end-of-line)
+    (point)))
+
+(defvar riece-read-passwd nil)
+(defun riece-read-passwd (prompt)
+  (if (not riece-read-passwd)
+      (if (functionp 'read-passwd)
+         (setq riece-read-passwd 'read-passwd)
+       (if (load "passwd" t)
+           (setq riece-read-passwd 'read-passwd)
+         (autoload 'ange-ftp-read-passwd "ange-ftp")
+         (setq riece-read-passwd 'ange-ftp-read-passwd))))
+  (funcall riece-read-passwd prompt))
+
+(provide 'riece-compat)
+
+;;; riece-compat.el ends here
diff --git a/lisp/riece-complete.el b/lisp/riece-complete.el
new file mode 100644 (file)
index 0000000..902d364
--- /dev/null
@@ -0,0 +1,118 @@
+;;; riece-complete.el --- completion
+;; Copyright (C) 1998-2003 Daiki Ueno
+
+;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Created: 1999-02-02
+;; Keywords: minibuffer, completion
+
+;; This file is part of Riece.
+
+;; 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.
+
+;;; Code:
+
+(require 'riece-compat)
+
+(defvar riece-minibuffer-map
+  (let ((map (make-sparse-keymap)))
+    (set-keymap-parent map minibuffer-local-map)
+    (define-key map "?" 'riece-minibuffer-help)
+    map))
+
+(defvar riece-temp-minibuffer-message nil)
+
+;; stolen (and renamed) from XEmacs's minibuf.el.
+(defun riece-temp-minibuffer-message (message)
+  (let ((end (point-max)))
+    (save-excursion
+      (goto-char (point-max))
+      (message nil)
+      (insert message))
+    (let ((inhibit-quit t))
+      (sit-for 2)
+      (delete-region end (point-max)))))
+
+(defun riece-minibuffer-help ()
+  (interactive)
+  (if riece-temp-minibuffer-message
+      (riece-temp-minibuffer-message riece-temp-minibuffer-message)))
+
+;;; stolen (and renamed) from crm.el.
+(defvar riece-completing-read-multiple-separator ",")
+(defvar riece-completing-read-multiple-table nil)
+  
+(defun riece-completing-read-multiple-1 (string predicate flag)
+  "Function used by `riece-completing-read-multiple'.
+The value of STRING is the string to be completed.
+
+The value of PREDICATE is a function to filter possible matches, or
+nil if none.
+
+The value of FLAG is used to specify the type of completion operation.
+A value of nil specifies `try-completion'.  A value of t specifies
+`all-completions'.  A value of lambda specifes a test for an exact match.
+
+For more information on STRING, PREDICATE, and FLAG, see the Elisp
+Reference sections on 'Programmed Completion' and 'Basic Completion
+Functions'."
+  (let ((except (split-string string riece-completing-read-multiple-separator))
+       (table (copy-sequence riece-completing-read-multiple-table))
+       lead)
+    ;; Remove a partially matched word construct if it exists.
+    (or (string-match
+        (concat riece-completing-read-multiple-separator "$")
+        string)
+       (setq except (butlast except)))
+    (when (string-match
+          (concat ".*" riece-completing-read-multiple-separator)
+          string)
+      (setq lead (substring string 0 (match-end 0))
+           string (substring string (match-end 0))))
+    (while except
+      (let ((entry (assoc (car except) table)))
+       (if entry
+           (setq table (delq entry table)))
+       (setq except (cdr except))))
+    (if (null flag)
+       (progn
+         (setq string (try-completion string table predicate))
+         (or (eq t string)
+             (concat lead string)))
+      (if (eq flag 'lambda)
+         (eq t (try-completion string table predicate))
+       (if flag
+           (all-completions string table predicate))))))
+
+(defun riece-completing-read-multiple
+  (prompt table &optional predicate require-match initial-input
+         history default)
+  "Execute `completing-read' consequently.
+
+See the documentation for `completing-read' for details on the arguments:
+PROMPT, TABLE, PREDICATE, REQUIRE-MATCH, INITIAL-INPUT, HISTORY, DEFAULT."
+  (let ((prompt
+        (format "%s (separated by \"%s\"): "
+                prompt riece-completing-read-multiple-separator))
+       (riece-completing-read-multiple-table table))
+    (split-string
+     (completing-read
+      prompt #'riece-completing-read-multiple-1
+      predicate require-match initial-input history default)
+     riece-completing-read-multiple-separator)))
+
+(provide 'riece-complete)
+
+;;; riece-complete.el ends here
diff --git a/lisp/riece-display.el b/lisp/riece-display.el
new file mode 100644 (file)
index 0000000..4047604
--- /dev/null
@@ -0,0 +1,264 @@
+;;; riece-display.el --- buffer arrangement
+;; Copyright (C) 1998-2003 Daiki Ueno
+
+;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Created: 1998-09-28
+;; Keywords: IRC, riece
+
+;; This file is part of Riece.
+
+;; 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.
+
+;;; Code:
+
+(require 'riece-options)
+(require 'riece-channel)
+(require 'riece-misc)
+
+(defvar riece-update-buffer-functions
+  '(riece-user-list-update-buffer
+    riece-channel-list-update-buffer
+    riece-update-channel-indicator
+    riece-update-channel-list-indicator))
+
+(defcustom riece-configure-windows-function #'riece-configure-windows
+  "Function to configure windows."
+  :type 'function
+  :group 'riece-looks)
+
+(defun riece-configure-windows ()
+  (let ((buffer (current-buffer))
+       (show-user-list
+        (and riece-channel-list-buffer-mode
+             riece-current-channel
+             ;; User list buffer is nuisance for private conversation.
+             (riece-channel-p riece-current-channel))))
+    (delete-other-windows)
+    (if (and riece-current-channel
+            (or show-user-list riece-channel-list-buffer-mode))
+       (let ((rest-window (split-window (selected-window)
+                                        (/ (window-width) 5) t)))
+         (if (and show-user-list riece-channel-list-buffer-mode)
+             (progn
+               (set-window-buffer (split-window)
+                                  riece-channel-list-buffer)
+               (set-window-buffer (selected-window)
+                                  riece-user-list-buffer))
+           (if show-user-list
+               (set-window-buffer (selected-window)
+                                  riece-user-list-buffer)
+             (if riece-channel-list-buffer-mode
+                 (set-window-buffer (selected-window)
+                                    riece-channel-list-buffer))))
+         (select-window rest-window)))
+    (if (and riece-current-channel
+            riece-channel-buffer-mode)
+       (let ((rest-window (split-window)))
+         (set-window-buffer (selected-window)
+                            riece-channel-buffer)
+         (set-window-buffer (split-window rest-window 4)
+                            riece-others-buffer)
+         (with-current-buffer riece-channel-buffer
+           (setq truncate-partial-width-windows nil))
+         (with-current-buffer riece-others-buffer
+           (setq truncate-partial-width-windows nil))
+         (set-window-buffer rest-window
+                            riece-command-buffer))
+      (set-window-buffer (split-window (selected-window) 4)
+                        riece-dialogue-buffer)
+      (set-window-buffer (selected-window)
+                        riece-command-buffer))
+    (riece-set-window-points)
+    (select-window (or (get-buffer-window buffer)
+                      (get-buffer-window riece-command-buffer)))))
+
+(defun riece-set-window-points ()
+  (if (and riece-user-list-buffer
+          (get-buffer-window riece-user-list-buffer))
+      (with-current-buffer riece-user-list-buffer
+       (unless (riece-frozen riece-user-list-buffer)
+         (set-window-start (get-buffer-window riece-user-list-buffer)
+                           (point-min)))))
+  (if (get-buffer-window riece-channel-list-buffer)
+      (with-current-buffer riece-channel-list-buffer
+       (unless (riece-frozen riece-channel-list-buffer)
+         (set-window-start (get-buffer-window riece-channel-list-buffer)
+                           (point-min))))))
+
+(defun riece-user-list-update-buffer ()
+  (if (get-buffer riece-user-list-buffer)
+      (save-excursion
+       (set-buffer riece-user-list-buffer)
+       (when (and riece-current-channel
+                  (riece-channel-p riece-current-channel))
+         (let ((inhibit-read-only t)
+               buffer-read-only
+               (users (riece-channel-get-users riece-current-channel))
+               (operators (riece-channel-get-operators riece-current-channel))
+               (speakers (riece-channel-get-speakers riece-current-channel)))
+           (erase-buffer)
+           (while users
+             (if (member (car users) operators)
+                 (insert "@" (car users) "\n")
+               (if (member (car users) speakers)
+                   (insert "+" (car users) "\n")
+                 (insert " " (car users) "\n")))
+             (setq users (cdr users))))))))
+
+(defun riece-channel-list-update-buffer ()
+  (if (get-buffer riece-channel-list-buffer)
+      (save-excursion
+       (set-buffer riece-channel-list-buffer)
+       (let ((inhibit-read-only t)
+             buffer-read-only
+             (index 1)
+             (channels riece-current-channels))
+         (erase-buffer)
+         (while channels
+           (if (car channels)
+               (insert (format "%2d:%s\n" index (car channels))))
+           (setq index (1+ index)
+                 channels (cdr channels)))))))
+
+(defsubst riece-update-channel-indicator ()
+  (setq riece-channel-indicator
+       (if riece-current-channel
+           (riece-concat-current-channel-modes
+            (if (and riece-current-channel
+                     (riece-channel-p riece-current-channel)
+                     (riece-channel-get-topic riece-current-channel))
+                (concat riece-current-channel ": "
+                        (riece-channel-get-topic riece-current-channel))
+              riece-current-channel))
+         "None"))
+  (with-current-buffer riece-command-buffer
+    (force-mode-line-update)))
+
+(defun riece-update-channel-list-indicator ()
+  (if (and riece-current-channels
+          ;; There is at least one channel.
+          (delq nil (copy-sequence riece-current-channels)))
+      (let ((index 1))
+       (setq riece-channel-list-indicator
+             (mapconcat
+              #'identity
+              (delq nil
+                    (mapcar
+                     (lambda (channel)
+                       (prog1 (if channel
+                                  (format "%d:%s" index channel))
+                         (setq index (1+ index))))
+                     riece-current-channels))
+              ",")))
+    (setq riece-channel-list-indicator "No channel")))
+
+(defun riece-update-buffers ()
+  (run-hooks 'riece-update-buffer-functions)
+  (force-mode-line-update t))
+
+(eval-when-compile
+  (autoload 'riece-channel-mode "riece"))
+(defun riece-channel-buffer-create (identity)
+  (with-current-buffer
+      (riece-get-buffer-create (format riece-channel-buffer-format identity))
+    (unless (eq major-mode 'riece-channel-mode)
+      (riece-channel-mode)
+      (let (buffer-read-only)
+       (riece-insert-info (current-buffer)
+                          (concat "Created on "
+                                  (funcall riece-format-time-function
+                                           (current-time))
+                                  "\n"))))
+    (current-buffer)))
+
+(eval-when-compile
+  (autoload 'riece-user-list-mode "riece"))
+(defun riece-user-list-buffer-create (identity)
+  (with-current-buffer
+      (riece-get-buffer-create (format riece-user-list-buffer-format identity))
+    (unless (eq major-mode 'riece-user-list-mode)
+      (riece-user-list-mode))
+    (current-buffer)))
+
+(defun riece-switch-to-channel (identity)
+  (setq riece-last-channel riece-current-channel
+       riece-current-channel identity
+       riece-channel-buffer
+       (cdr (riece-identity-assoc-no-server
+             identity riece-channel-buffer-alist))
+       riece-user-list-buffer 
+       (cdr (riece-identity-assoc-no-server
+             identity riece-user-list-buffer-alist))))
+
+(defun riece-join-channel (channel-name)
+  (let ((identity (riece-make-identity channel-name)))
+    (unless (riece-identity-member-no-server
+            identity riece-current-channels)
+      (setq riece-current-channels
+           (riece-identity-assign-binding
+            identity riece-current-channels
+            riece-default-channel-binding)))
+    (unless (riece-identity-assoc-no-server
+            identity riece-channel-buffer-alist)
+      (let ((buffer (riece-channel-buffer-create identity)))
+       (push (cons identity buffer) riece-channel-buffer-alist)))
+    (unless (riece-identity-assoc-no-server
+            identity riece-user-list-buffer-alist)
+      (let ((buffer (riece-user-list-buffer-create identity)))
+       (push (cons identity buffer) riece-user-list-buffer-alist)))))
+
+(defun riece-switch-to-nearest-channel (pointer)
+  (let ((start riece-current-channels)
+       identity)
+    (while (and start (not (eq start pointer)))
+      (if (car start)
+         (setq identity (car start)))
+      (setq start (cdr start)))
+    (unless identity
+      (while (and pointer
+                 (null (car pointer)))
+       (setq pointer (cdr pointer)))
+      (setq identity (car pointer)))
+    (if identity
+       (riece-switch-to-channel identity)
+      (setq riece-last-channel riece-current-channel
+           riece-current-channel nil))))
+
+(defun riece-part-channel (channel-name)
+  (let* ((identity (riece-make-identity channel-name))
+        (pointer (riece-identity-member-no-server
+                  identity riece-current-channels)))
+    (if pointer
+       (setcar pointer nil))
+    ;;XXX
+    (if (riece-identity-equal-no-server identity riece-current-channel)
+       (riece-switch-to-nearest-channel pointer))))
+
+(defun riece-redisplay-buffers (&optional force)
+  (riece-update-buffers)
+  (if (or force
+         ;; The current channel is changed, and some buffers are visible.
+         (unless (equal riece-last-channel riece-current-channel)
+           (let ((buffers riece-buffer-list))
+             (catch 'found
+               (while buffers
+                 (if (and (buffer-live-p (car buffers))
+                          (get-buffer-window (car buffers)))
+                     (throw 'found t)
+                   (setq buffers (cdr buffers))))))))
+      (funcall riece-configure-windows-function)))
+
+(provide 'riece-display)
diff --git a/lisp/riece-emacs.el b/lisp/riece-emacs.el
new file mode 100644 (file)
index 0000000..eb13289
--- /dev/null
@@ -0,0 +1,29 @@
+;;; riece-emacs.el --- FSF Emacs specific functions
+;; Copyright (C) 1999 Daiki Ueno
+
+;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Created: 1999-08-21
+;; Keywords: emulation
+
+;; This file is part of Riece.
+
+;; 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.
+
+;;; Code:
+
+(provide 'riece-emacs)
+
+;;; riece-emacs.el ends here
diff --git a/lisp/riece-filter.el b/lisp/riece-filter.el
new file mode 100644 (file)
index 0000000..97a25a6
--- /dev/null
@@ -0,0 +1,145 @@
+;;; riece-filter.el --- process filter and sentinel
+;; Copyright (C) 1998-2003 Daiki Ueno
+
+;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Created: 1998-09-28
+;; Keywords: IRC, riece
+
+;; This file is part of Riece.
+
+;; 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.
+
+;;; Code:
+
+(eval-when-compile (require 'riece-inlines))
+
+(require 'riece-handle)
+(require 'riece-misc)
+(require 'riece-server)                        ;riece-close-server
+
+(defun riece-handle-numeric-reply (prefix number name string)
+  (let ((base-number (* (/ number 100) 100))
+       function)
+    (condition-case nil
+       (require (intern (format "riece-%03d" base-number)))
+      (error))
+    (setq function (intern-soft (format "riece-handle-%03d-message" number)))
+    (unless (and function
+                (symbol-function function))
+      (setq function
+           (intern-soft
+            (format "riece-handle-default-%03d-message" base-number))))
+    (if (and function
+            (symbol-function function))
+       (condition-case error
+           (funcall function prefix number name
+                    (riece-decode-coding-string string))
+         (error
+          (if riece-debug
+              (message "Error occurred in `%S': %S" function error)))))))
+
+(defun riece-default-handle-numeric-reply
+  (client-prefix prefix number name string)
+  (riece-insert
+   (list riece-dialogue-buffer riece-others-buffer)
+   (concat client-prefix
+          (riece-concat-server-name
+           (mapconcat #'identity (riece-split-parameters string) " "))
+          "\n")))
+
+(defun riece-handle-message (prefix message string)
+  (if (and prefix
+          (string-match "![^\x00\x0d\x0a @]+@" prefix))
+      (riece-user-set-user-at-host
+       (riece-get-user (substring prefix 0 (match-beginning 0)))
+       (riece-parse-user-at-host (substring prefix (1+ (match-beginning 0))))))
+  (setq message (downcase message)
+       string (riece-decode-coding-string string))
+  (unless (run-hook-with-args-until-success
+          (intern (concat "riece-" message "-hook"))
+          prefix string)
+    (let ((function (intern-soft (concat "riece-handle-" message "-message"))))
+      (if function
+         (condition-case error
+             (funcall function prefix string)
+           (error
+            (if riece-debug
+                (message "Error occurred in `%S': %S" function error))))))
+    (run-hook-with-args-until-success
+     (intern (concat "riece-after-" message "-hook"))
+     prefix string)))
+
+(defun riece-filter (process input)
+  (save-excursion
+    (set-buffer (process-buffer process))
+    (goto-char riece-read-point)
+    (unless riece-debug
+      (delete-region (riece-line-beginning-position) (point-min))
+      (setq riece-read-point (point)))
+    (insert input)
+    (goto-char (prog1 riece-read-point
+                (setq riece-read-point (point))))
+    (beginning-of-line)
+    (catch 'contiguous
+      (while (not (eobp))
+       (save-excursion
+         (if (looking-at
+              ":\\([^ ]+\\) +\\([0-5][0-9][0-9]\\) +\\([^ ]+\\) +\\(.*\\)\r\n")
+             (riece-handle-numeric-reply
+              (match-string 1)         ;prefix
+              (string-to-number (match-string 2)) ;number
+              (match-string 3)         ;name
+              (match-string 4))                ;reply string
+           (if (looking-at "\\(:\\([^ ]+\\) +\\)?\\([^ ]+\\) +\\(.*\\)\r\n")
+               (riece-handle-message
+                (match-string 2)       ;optional prefix
+                (match-string 3)       ;command
+                (match-string 4))      ;params & trailing
+             (if (looking-at ".*\r\n")
+                 (if riece-debug
+                     (message "Weird message from server: %s"
+                              (buffer-substring (point) (progn
+                                                          (end-of-line)
+                                                          (point)))))
+               (throw 'contiguous nil)))))
+       (forward-line)))))
+
+(eval-when-compile
+  (autoload 'riece "riece"))
+(defun riece-sentinel (process status)
+  (if riece-reconnect-with-password
+      (unwind-protect
+         (riece)
+       (setq riece-reconnect-with-password nil))
+    (let ((server-name (with-current-buffer (process-buffer process)
+                        riece-server-name)))
+      (if (and (process-id process)            ;not a network connection
+              (string-match "^exited abnormally with code \\([0-9]+\\)"
+                            status))
+         (if server-name
+             (message "Connection to \"%s\" closed: %s"
+                      server-name (match-string 1 status))
+           (message "Connection closed: %s" (match-string 1 status)))
+       (if server-name
+           (message "Connection to \"%s\" closed: %s"
+                    server-name (substring status 0 (1- (length status))))
+         (message "Connection closed: %s"
+                  (substring status 0 (1- (length status))))))
+      (riece-close-server server-name))))
+
+(provide 'riece-filter)
+
+;;; riece-filter.el ends here
diff --git a/lisp/riece-globals.el b/lisp/riece-globals.el
new file mode 100644 (file)
index 0000000..c7b74c7
--- /dev/null
@@ -0,0 +1,163 @@
+;;; riece-globals.el --- global variables and constants.
+;; Copyright (C) 1998-2003 Daiki Ueno
+
+;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Created: 1998-09-28
+;; Keywords: IRC, riece
+
+;; This file is part of Riece.
+
+;; 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.
+
+;;; Code:
+
+;;; Miscellaneous global variables:
+(defvar riece-server-process nil
+  "Primary server process.")
+(defvar riece-server-process-alist nil
+  "An alist mapping secondary server name to opened processes.")
+
+(defvar riece-current-channel nil
+  "The channel you currently have joined.")
+(defvar riece-current-channels nil
+  "The channels you have currently joined.")
+
+(defvar riece-save-variables-are-dirty nil
+  "Non nil if the variables in `riece-saved-forms' are changed.")
+
+(defvar riece-polling 0
+  "Interval for polling the server.")
+
+(defvar riece-reconnect-with-password nil
+  "If non-nil, attempt to reconnect with password.")
+
+(defvar riece-obarray-size 1327
+  "The size of obarray used by riece on channelname and username space.")
+
+;;; Variables local to the server buffers:
+(defvar riece-server-name nil
+  "The name of the server.
+Local to the server buffers.")
+(defvar riece-real-nickname nil
+  "Your nickname the server offers.
+Local to the server buffers.")
+(defvar riece-last-nickname nil
+  "The last nickname you requested.
+Local to the server buffers.")
+(defvar riece-nick-accepted nil
+  "The flag your nickname is accepted by the server.
+Possible values are nil, `ok', and `sent'.
+Local to the server buffers.")
+(defvar riece-real-server-name nil
+  "The server name offered by the server.
+Local to the server buffers.")
+(defvar riece-real-userhost nil
+  "Your hostname the server offers.
+Local to the server buffers.")
+(defvar riece-user-at-host ""
+  "The user@host for the current input.
+Local to the server buffers.")
+(defvar riece-user-at-host-type nil
+  "The authentication type of `riece-user-at-host'.
+Possible values are 'ok 'not-verified 'fake or 'invalid.
+Local to the server buffers.")
+(defvar riece-supported-user-modes nil
+  "User modes supported by server.
+Local to the server buffers.")
+(defvar riece-supported-channel-modes nil
+  "Channel modes supported by server.
+Local to the server buffers.")
+(defvar riece-channel-filter ""
+  "Filter of the result of NAMES or LIST.
+This enables us to use \\[universal-argument] with NAMES and TOPIC.
+Local to the server buffers.")
+(defvar riece-read-point nil
+  "Point at the last input was seen.
+Local to the server buffers.")
+(defvar riece-obarray nil
+  "Namespace of the IRC world.
+Local to the server buffers.")
+(defvar riece-coding-system nil
+  "Coding system for process I/O.
+Local to the server buffers.")
+
+;;; Variables local to the command buffer:
+(defvar riece-default-channel-candidate nil
+  "A channel name used as completion candidate.
+Local to the command buffer.")
+(defvar riece-last-channel nil
+  "The channel you joined the last time.")
+(defvar riece-command-buffer-mode 'channel
+  "Command buffer mode.
+Possible values are `chat' and `channel'.
+Local to the command buffer.")
+
+;;; Variables local to the channel buffers:
+(defvar riece-freeze nil
+  "If non-nil, channel window is not scrolled.
+Local to the channel buffers.")
+(defvar riece-own-freeze nil
+  "If non-nil, channel window is not scrolled until you input.
+Local to the channel buffers.")
+
+;;; Modeline indicators:
+(defvar riece-channel-indicator "None"
+  "A modeline indicator of the current channel.")
+(defvar riece-channel-list-indicator "No channel"
+  "The current joined channels, \"pretty-printed.\".")
+
+(defvar riece-away-indicator "-")
+(defvar riece-freeze-indicator nil)
+(defvar riece-own-freeze-indicator nil)
+
+;;; Buffers:
+(defvar riece-command-buffer "*Commands*"
+  "Name of command input buffer.")
+(defvar riece-dialogue-buffer "*Dialogue*"
+  "Name of dialogue output buffer.")
+(defvar riece-private-buffer "*Private*"
+  "Name of private message buffer.")
+(defvar riece-others-buffer "*Others*"
+  "Name of others message buffer.")
+(defvar riece-channel-buffer nil
+  "Name of channel message buffer.")
+(defvar riece-channel-buffer-format "*Channel:%s*"
+  "Format of channel message buffer.")
+(defvar riece-channel-list-buffer " *Channels*"
+  "Name of channel list buffer.")
+(defvar riece-user-list-buffer nil
+  "Name of user list buffer.")
+(defvar riece-user-list-buffer-format " *Users:%s*"
+  "Format of user list buffer.")
+(defvar riece-wallops-buffer " *WALLOPS*")
+
+(defvar riece-channel-buffer-alist nil)
+(defvar riece-user-list-buffer-alist nil)
+(defvar riece-buffer-list nil)
+(defvar riece-overriding-server-name nil)
+
+(defconst riece-change-prefix "*** Change: ")
+(defconst riece-notice-prefix "*** Notice: ")
+(defconst riece-wallops-prefix "*** Notice: ")
+(defconst riece-error-prefix "*** Error: ")
+(defconst riece-info-prefix "*** Info: ")
+(defconst riece-prefix-regexp "\\*\\*\\* \\([^:]+: \\)")
+
+(defconst riece-time-prefix-regexp "[0-9][0-9]:[0-9][0-9] ")
+
+(provide 'riece-globals)
+
+;;; riece-globals.el ends here
diff --git a/lisp/riece-handle.el b/lisp/riece-handle.el
new file mode 100644 (file)
index 0000000..91bc3ae
--- /dev/null
@@ -0,0 +1,372 @@
+;;; riece-handle.el --- basic message handlers
+;; Copyright (C) 1998-2003 Daiki Ueno
+
+;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Created: 1998-09-28
+;; Keywords: IRC, riece
+
+;; This file is part of Riece.
+
+;; 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.
+
+;;; Code:
+
+(eval-when-compile (require 'riece-inlines))
+
+(require 'riece-misc)
+(require 'riece-message)
+(require 'riece-channel)
+(require 'riece-naming)
+(require 'riece-display)
+
+(defun riece-handle-nick-message (prefix string)
+  (let* ((old (riece-prefix-nickname prefix))
+        (new (car (riece-split-parameters string)))
+        (channels (riece-user-get-channels old))
+        (visible (riece-identity-member-no-server
+                  riece-current-channel channels)))
+    (riece-naming-assert-rename old new)
+    (let ((pointer (riece-identity-member-no-server
+                   (riece-make-identity old)
+                   riece-current-channels)))
+      (when pointer
+       (setcar pointer (riece-make-identity new))
+       (setcar (riece-identity-assoc-no-server (riece-make-identity old)
+                                               riece-channel-buffer-alist)
+               (riece-make-identity new))
+       (setcar (riece-identity-assoc-no-server (riece-make-identity old)
+                                               riece-user-list-buffer-alist)
+               (riece-make-identity new))
+       (if (riece-identity-equal-no-server (riece-make-identity old)
+                                           riece-current-channel)
+           (riece-switch-to-channel (riece-make-identity new)))
+       (push (riece-make-identity new) channels)))
+    (riece-insert-change (mapcar
+                         (lambda (channel)
+                           (cdr (riece-identity-assoc-no-server
+                                 (riece-make-identity channel)
+                                 riece-channel-buffer-alist)))
+                         channels)
+                        (format "%s -> %s\n" old new))
+    (riece-insert-change (if visible
+                            riece-dialogue-buffer
+                          (list riece-dialogue-buffer riece-others-buffer))
+                        (concat
+                         (riece-concat-server-name
+                          (format "%s -> %s" old new))
+                         "\n"))
+    (riece-redisplay-buffers)))
+
+(defun riece-handle-privmsg-message (prefix string)
+  (let* ((user (riece-prefix-nickname prefix))
+        (parameters (riece-split-parameters string))
+        (targets (split-string (pop parameters) ","))
+        (message (pop parameters)))
+    (unless (equal message "")
+      (while targets
+       (riece-display-message
+        (riece-make-message user (riece-make-identity (pop targets))
+                            message))))))
+
+(defun riece-handle-notice-message (prefix string)
+  (let* ((user (if prefix
+                  (riece-prefix-nickname prefix)))
+        (parameters (riece-split-parameters string))
+        (targets (split-string (pop parameters) ","))
+        (message (pop parameters)))
+    (unless (equal message "")
+      (if user
+         (while targets
+           (riece-display-message
+            (riece-make-message user (riece-make-identity (pop targets))
+                                message 'notice)))
+       ;; message from server
+       (riece-insert-notice
+        (list riece-dialogue-buffer riece-others-buffer)
+        (concat (riece-concat-server-name message) "\n"))))))
+
+(defun riece-handle-ping-message (prefix string)
+  (riece-send-string (format "PONG :%s\r\n"
+                            (if (eq (aref string 0) ?:)
+                                (substring string 1)
+                              string))))
+
+(defun riece-handle-join-message (prefix string)
+  (let ((user (riece-prefix-nickname prefix))
+       (channels (split-string (car (riece-split-parameters string)) ",")))
+    (while channels
+      (riece-naming-assert-join user (car channels))
+      ;;XXX
+      (if (string-equal-ignore-case user riece-real-nickname)
+         (riece-switch-to-channel (riece-make-identity (car channels))))
+      (let ((buffer (cdr (riece-identity-assoc-no-server
+                         (riece-make-identity (car channels))
+                         riece-channel-buffer-alist))))
+       (riece-insert-change
+        buffer
+        (format "%s (%s) has joined %s\n"
+                user
+                (riece-user-get-user-at-host user)
+                (car channels)))
+       (riece-insert-change
+        (if (and riece-channel-buffer-mode
+                 (not (eq buffer riece-channel-buffer)))
+            (list riece-dialogue-buffer riece-others-buffer)
+          riece-dialogue-buffer)
+        (concat
+         (riece-concat-server-name
+          (format "%s (%s) has joined %s"
+                  user
+                  (riece-user-get-user-at-host user)
+                  (car channels)))
+         "\n")))
+      (setq channels (cdr channels)))
+    (riece-redisplay-buffers)))
+
+(defun riece-handle-part-message (prefix string)
+  (let* ((user (riece-prefix-nickname prefix))
+        (parameters (riece-split-parameters string))
+        (channels (split-string (pop parameters) ","))
+        (message (pop parameters)))
+    (while channels
+      (riece-naming-assert-part user (car channels))
+      (let ((buffer (cdr (riece-identity-assoc-no-server
+                         (riece-make-identity (car channels))
+                         riece-channel-buffer-alist))))
+       (riece-insert-change
+        buffer
+        (concat
+         (riece-concat-message
+          (format "%s has left %s" user (car channels))
+          message)
+         "\n"))
+       (riece-insert-change
+        (if (and riece-channel-buffer-mode
+                 (not (eq buffer riece-channel-buffer)))
+            (list riece-dialogue-buffer riece-others-buffer)
+          riece-dialogue-buffer)
+        (concat
+         (riece-concat-server-name
+          (riece-concat-message
+           (format "%s has left %s" user (car channels))
+           message))
+         "\n")))
+      (setq channels (cdr channels)))
+    (riece-redisplay-buffers)))
+
+(defun riece-handle-kick-message (prefix string)
+  (let* ((kicker (riece-prefix-nickname prefix))
+        (parameters (riece-split-parameters string))
+        (channel (pop parameters))
+        (user (pop parameters))
+        (message (pop parameters)))
+    (riece-naming-assert-part user channel)
+    (let ((buffer (cdr (riece-identity-assoc-no-server
+                       (riece-make-identity channel)
+                       riece-channel-buffer-alist))))
+      (riece-insert-change
+       buffer
+       (concat
+       (riece-concat-message
+        (format "%s kicked %s out from %s" kicker user channel)
+        message)
+       "\n"))
+      (riece-insert-change
+       (if (and riece-channel-buffer-mode
+               (not (eq buffer riece-channel-buffer)))
+          (list riece-dialogue-buffer riece-others-buffer)
+        riece-dialogue-buffer)
+       (concat
+       (riece-concat-server-name
+        (riece-concat-message
+         (format "%s kicked %s out from %s\n" kicker user channel)
+         message))
+       "\n")))
+    (riece-redisplay-buffers)))
+
+(defun riece-handle-quit-message (prefix string)
+  (let* ((user (riece-prefix-nickname prefix))
+        (channels (copy-sequence (riece-user-get-channels user)))
+        (pointer channels)
+        (message (car (riece-split-parameters string))))
+    ;; If you are quitting, no need to cleanup.
+    (unless (string-equal-ignore-case user riece-real-nickname)
+      ;; You were talking with the user.
+      (if (riece-identity-member-no-server (riece-make-identity user)
+                                          riece-current-channels)
+         (riece-part-channel user)) ;XXX
+      (setq pointer channels)
+      (while pointer
+       (riece-naming-assert-part user (car pointer))
+       (setq pointer (cdr pointer)))
+      (let ((buffers
+            (mapcar
+             (lambda (channel)
+               (cdr (riece-identity-assoc-no-server
+                     (riece-make-identity channel)
+                     riece-channel-buffer-alist)))
+             channels)))
+       (riece-insert-change buffers
+                            (concat (riece-concat-message
+                                     (format "%s has left IRC" user)
+                                     message)
+                                    "\n"))
+       (riece-insert-change (if (and riece-channel-buffer-mode
+                                     (not (memq riece-channel-buffer
+                                                buffers)))
+                                (list riece-dialogue-buffer
+                                      riece-others-buffer)
+                              riece-dialogue-buffer)
+                            (concat
+                             (riece-concat-server-name
+                              (riece-concat-message
+                               (format "%s has left IRC" user)
+                               message))
+                             "\n"))))
+    (riece-redisplay-buffers)))
+
+(defun riece-handle-kill-message (prefix string)
+  (let* ((killer (riece-prefix-nickname prefix))
+        (parameters (riece-split-parameters string))
+        (user (pop parameters))
+        (message (pop parameters))
+        (channels (copy-sequence (riece-user-get-channels user)))
+        pointer)
+    ;; You were talking with the user.
+    (if (riece-identity-member-no-server (riece-make-identity user)
+                                        riece-current-channels)
+       (riece-part-channel user)) ;XXX
+    (setq pointer channels)
+    (while pointer
+      (riece-naming-assert-part user (car pointer))
+      (setq pointer (cdr pointer)))
+    (let ((buffers
+          (mapcar
+           (lambda (channel)
+             (cdr (riece-identity-assoc-no-server
+                   (riece-make-identity channel)
+                   riece-channel-buffer-alist)))
+           channels)))
+      (riece-insert-change buffers
+                          (concat (riece-concat-message
+                                   (format "%s killed %s" killer user)
+                                   message)
+                                  "\n"))
+      (riece-insert-change (if (and riece-channel-buffer-mode
+                                   (not (memq riece-channel-buffer
+                                              buffers)))
+                              (list riece-dialogue-buffer
+                                    riece-others-buffer)
+                            riece-dialogue-buffer)
+                          (concat
+                           (riece-concat-server-name
+                            (riece-concat-message
+                             (format "%s killed %s" killer user)
+                            message))
+                           "\n")))
+    (riece-redisplay-buffers)))
+
+(defun riece-handle-invite-message (prefix string)
+  (let* ((user (riece-prefix-nickname prefix))
+        (parameters (riece-split-parameters string))
+        (channel (pop parameters)))
+    (riece-insert-info
+     (list riece-dialogue-buffer riece-others-buffer)
+     (concat
+      (riece-concat-server-name
+       (format "%s invites you to %s" user channel))
+      "\n"))))
+
+(defun riece-handle-topic-message (prefix string)
+  (let* ((user (riece-prefix-nickname prefix))
+        (parameters (riece-split-parameters string))
+        (channel (pop parameters))
+        (topic (pop parameters)))
+    (riece-channel-set-topic (riece-get-channel channel) topic)
+    (let ((buffer (cdr (riece-identity-assoc-no-server
+                       (riece-make-identity channel)
+                       riece-channel-buffer-alist))))
+      (riece-insert-change
+       buffer
+       (format "Topic by %s: %s\n" user topic))
+      (riece-insert-change
+       (if (and riece-channel-buffer-mode
+               (not (eq buffer riece-channel-buffer)))
+          (list riece-dialogue-buffer riece-others-buffer)
+        riece-dialogue-buffer)
+       (concat
+       (riece-concat-server-name
+        (format "Topic on %s by %s: %s" channel user topic))
+       "\n"))
+      (riece-redisplay-buffers))))
+
+(defsubst riece-parse-channel-modes (string channel)
+  (while (string-match "^[-+]\\([^ ]*\\) *" string)
+    (let ((toggle (aref string 0))
+         (modes (string-to-list (match-string 1 string))))
+      (setq string (substring string (match-end 0)))
+      (while modes
+       (if (and (memq (car modes) '(?O ?o ?v ?k ?l ?b ?e ?I))
+                (string-match "\\([^-+][^ ]*\\) *" string))
+           (let ((parameter (match-string 1 string)))
+             (setq string (substring string (match-end 0)))
+             (cond
+              ((eq (car modes) ?o)
+               (riece-channel-toggle-operator channel parameter
+                                              (eq toggle ?+)))
+              ((eq (car modes) ?v)
+               (riece-channel-toggle-speaker channel parameter
+                                             (eq toggle ?+)))
+              ((eq (car modes) ?b)
+               (riece-channel-toggle-banned channel parameter
+                                            (eq toggle ?+)))
+              ((eq (car modes) ?e)
+               (riece-channel-toggle-uninvited channel parameter
+                                               (eq toggle ?+)))
+              ((eq (car modes) ?I)
+               (riece-channel-toggle-invited channel parameter
+                                             (eq toggle ?+)))))
+         (riece-channel-toggle-mode channel (car modes)
+                                    (eq toggle ?+)))
+       (setq modes (cdr modes))))))
+
+(defun riece-handle-mode-message (prefix string)
+  (let ((user (riece-prefix-nickname prefix))
+       channel)
+    (when (string-match "\\([^ ]+\\) *:?" string)
+      (setq channel (match-string 1 string)
+           string (substring string (match-end 0)))
+      (riece-parse-channel-modes string channel)
+      (let ((buffer (cdr (riece-identity-assoc-no-server
+                         (riece-make-identity channel)
+                         riece-channel-buffer-alist))))
+       (riece-insert-change
+        buffer
+        (format "Mode by %s: %s\n" user string))
+       (riece-insert-change
+        (if (and riece-channel-buffer-mode
+                 (not (eq buffer riece-channel-buffer)))
+            (list riece-dialogue-buffer riece-others-buffer)
+          riece-dialogue-buffer)
+        (concat
+         (riece-concat-server-name
+          (format "Mode on %s by %s: %s" channel user string))
+         "\n"))
+       (riece-redisplay-buffers)))))
+
+(provide 'riece-handle)
+
+;;; riece-handle.el ends here
diff --git a/lisp/riece-highlight.el b/lisp/riece-highlight.el
new file mode 100644 (file)
index 0000000..9575ca8
--- /dev/null
@@ -0,0 +1,229 @@
+;;; riece-highlight.el --- coloring IRC buffers
+;; Copyright (C) 1998-2003 Daiki Ueno
+
+;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Created: 1998-09-28
+;; Keywords: IRC, riece
+
+;; This file is part of Riece.
+
+;; 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.
+
+;;; Code:
+
+(eval-when-compile (require 'riece-inlines))
+
+(require 'riece-globals)
+(require 'font-lock)
+
+(defgroup riece-highlight nil
+  "Highlight your IRC buffer"
+  :tag "Highlight"
+  :prefix "riece-"
+  :group 'riece)
+
+(defgroup riece-highlight-faces nil
+  "Faces for highlight your IRC buffer"
+  :tag "Faces"
+  :prefix "riece-highlight-"
+  :group 'riece-highlight)
+
+(defcustom riece-change-face 'riece-change-face
+  "Face used for displaying \"*** Change:\" line."
+  :type 'face
+  :group 'riece-highlight-faces)
+
+(defcustom riece-notice-face 'riece-notice-face
+  "Face used for displaying \"*** Notice:\" line."
+  :type 'face
+  :group 'riece-highlight-faces)
+
+(defcustom riece-wallops-face 'riece-wallops-face
+  "Face used for displaying \"*** Wallops:\" line."
+  :type 'face
+  :group 'riece-highlight-faces)
+  
+(defcustom riece-error-face 'riece-error-face
+  "Face used for displaying \"*** Error:\" line."
+  :type 'face
+  :group 'riece-highlight-faces)
+
+(defcustom riece-info-face 'riece-info-face
+  "Face used for displaying \"*** Info:\" line."
+  :type 'face
+  :group 'riece-highlight-faces)
+
+(defcustom riece-server-face 'riece-server-face
+  "Face used for displaying \"(from server)\" extent."
+  :type 'face
+  :group 'riece-highlight-faces)
+
+(defcustom riece-prefix-face 'riece-prefix-face
+  "Face used for displaying \"<nick>\" extent."
+  :type 'face
+  :group 'riece-highlight-faces)
+
+(defface riece-change-face
+  '((((class color)
+      (background dark))
+     (:foreground "cyan" :bold t))
+    (((class color)
+      (background light))
+     (:foreground "RoyalBlue" :bold t))
+    (t
+     (:bold t)))
+  "Face used for displaying \"*** Change:\" line"
+  :group 'riece-highlight-faces)
+
+(defface riece-notice-face
+  '((((class color)
+      (background dark))
+     (:foreground "green2" :bold t))
+    (((class color)
+      (background light))
+     (:foreground "MidnightBlue" :bold t))
+    (t
+     (:bold t)))
+  "Face used for displaying \"*** Notice:\" line"
+  :group 'riece-highlight-faces)
+
+(defface riece-wallops-face
+  '((((class color)
+      (background dark))
+     (:foreground "yellow" :bold t))
+    (((class color)
+      (background light))
+     (:foreground "blue4" :bold t))
+    (t
+     (:bold t)))
+  "Face used for displaying \"*** Wallops:\" line"
+  :group 'riece-highlight-faces)
+
+(defface riece-error-face
+  '((((class color)
+      (background dark))
+     (:foreground "cornflower blue" :bold t))
+    (((class color)
+      (background light))
+     (:foreground "DarkGreen"))
+    (t
+     (:bold t)))
+  "Face used for displaying \"*** Error:\" line"
+  :group 'riece-highlight-faces)
+
+(defface riece-info-face
+  '((((class color)
+      (background dark))
+     (:foreground "PaleTurquoise" :bold t))
+    (((class color)
+      (background light))
+     (:foreground "RoyalBlue"))
+    (t
+     (:bold t)))
+  "Face used for displaying \"*** Info:\" line"
+  :group 'riece-highlight-faces)
+
+(defface riece-server-face
+  '((((class color)
+      (background dark))
+     (:foreground "Gray70"))
+    (((class color)
+      (background light))
+     (:foreground "DimGray"))
+    (t
+     (:bold t)))
+  "Face used for displaying \"(from server)\" extent."
+  :group 'riece-highlight-faces)
+
+(defface riece-prefix-face
+  '((((class color)
+      (background dark))
+     (:foreground "moccasin"))
+    (((class color)
+      (background light))
+     (:foreground "firebrick"))
+    (t
+     (:bold nil)))
+  "Face used for displaying \"<nick>\" extent"
+  :group 'riece-highlight-faces)
+
+(defcustom riece-highlight-font-lock-keywords
+  (append
+   (list
+    `(,(concat
+       "^\\(" riece-time-prefix-regexp "\\)?"
+       "\\(\\([][<>(-][][<>(-]?[^<>)]*[][<>)-][][<>)-]?\\)\\|"
+       "\\(=[^ ]*=\\|\\*\\*[^ \*]*\\*\\*\\)\\) ")
+      (3 riece-prefix-face append t)))
+   ;; set property to the whole line
+   (mapcar
+    (lambda (line)
+      (cons
+       (concat
+       "^\\(" riece-time-prefix-regexp "\\)?\\("
+       (regexp-quote
+        (symbol-value (intern (format "riece-%s-prefix" line))))
+       ".*\\)$")
+       (list 2 (intern (format "riece-%s-face" line)) t t)))
+    '(change notice wallops error info))
+   (list (list "(from [^)]+)$" 0 riece-server-face t)))
+  "Normal and deformed faces for IRC normal line."
+  :type '(repeat (list string))
+  :group 'riece-highlight)
+
+(put 'riece-channel-mode 'font-lock-defaults
+     '(riece-highlight-font-lock-keywords t))
+(put 'riece-others-mode 'font-lock-defaults
+     '(riece-highlight-font-lock-keywords t))
+(put 'riece-dialogue-mode 'font-lock-defaults
+     '(riece-highlight-font-lock-keywords t))
+
+(defun riece-highlight-schedule-turn-on-font-lock ()
+  (add-hook 'riece-channel-mode-hook
+           'riece-highlight-turn-on-font-lock)
+  (add-hook 'riece-others-mode-hook
+           'riece-highlight-turn-on-font-lock)
+  (add-hook 'riece-dialogue-mode-hook
+           'riece-highlight-turn-on-font-lock))
+
+(add-hook 'riece-after-load-startup-hook
+         'riece-highlight-schedule-turn-on-font-lock)
+
+(defvar font-lock-support-mode)
+(defun riece-highlight-turn-on-font-lock ()
+  (make-local-variable 'font-lock-defaults)
+  (setq font-lock-defaults '(riece-highlight-font-lock-keywords t))
+  (make-local-variable 'font-lock-verbose)
+  (setq font-lock-verbose nil)
+  (when (boundp 'font-lock-support-mode)
+    (make-local-variable 'font-lock-support-mode)
+    (setq font-lock-support-mode nil))
+  (make-local-hook 'font-lock-mode-hook)
+  (setq font-lock-mode-hook nil)
+  (turn-on-font-lock)
+  (make-local-hook 'after-change-functions)
+  (add-hook 'after-change-functions
+           'riece-highlight-hide-prefix nil 'local))
+
+(defun riece-highlight-hide-prefix (start end length)
+  (save-excursion
+    (goto-char start)
+    (if (looking-at riece-prefix-regexp)
+       (put-text-property (match-beginning 1) (match-end 1) 'invisible t))))
+
+(provide 'riece-highlight)
+
+;;; riece-highlight.el ends here
diff --git a/lisp/riece-identity.el b/lisp/riece-identity.el
new file mode 100644 (file)
index 0000000..43396f5
--- /dev/null
@@ -0,0 +1,158 @@
+;;; riece-identity.el --- an identity object
+;; Copyright (C) 1998-2003 Daiki Ueno
+
+;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Created: 1998-09-28
+;; Keywords: IRC, riece
+
+;; This file is part of Riece.
+
+;; 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.
+
+;;; Code:
+
+(eval-when-compile (require 'riece-inlines))
+
+(require 'riece-globals)
+
+(defun riece-find-server-name ()
+  (or riece-overriding-server-name
+                                       ;already in the server buffer
+      (if (local-variable-p 'riece-server-name (current-buffer))
+         riece-server-name
+       (if riece-current-channel
+           (riece-identity-server riece-current-channel)))))
+
+(defun riece-find-server-process ()
+  (let ((server-name (riece-find-server-name)))
+    (if server-name
+       (cdr (assoc server-name riece-server-process-alist))
+      riece-server-process)))
+
+(defmacro riece-with-server-buffer (&rest body)
+  `(let ((process (riece-find-server-process)))
+     (if process
+        (with-current-buffer (process-buffer process)
+          ,@body)
+       (error "Server closed."))))
+
+(defun riece-identity-prefix (identity)
+  "Return the component sans its server from IDENTITY."
+  (if (string-match " " identity)
+      (substring identity 0 (match-beginning 0))
+    identity))
+
+(defun riece-identity-server (identity)
+  "Return the server component in IDENTITY."
+  (if (string-match " " identity)
+      (substring identity (match-end 0))))
+
+(defun riece-make-identity (prefix &optional server)
+  "Make an identity object from PREFIX and SERVER."
+  (if (riece-identity-server prefix)
+      prefix
+    (unless server
+      (setq server (riece-find-server-name)))
+    (if server
+       (concat prefix " " server)
+      prefix)))
+
+(defun riece-identity-equal-no-server (ident1 ident2)
+  "Return t, if IDENT1 and IDENT2 is equal.
+The only difference with `riece-identity-equal', this function doesn't
+append server name before comparison."
+  (and (string-equal-ignore-case
+       (riece-identity-prefix ident1)
+       (riece-identity-prefix ident2))
+       (equal
+       (riece-identity-server ident1)
+       (riece-identity-server ident2))))
+
+(defun riece-identity-equal (ident1 ident2)
+  "Return t, if IDENT1 and IDENT2 is equal."
+  (riece-identity-equal-no-server
+   (if (riece-identity-server ident1)
+       ident1
+     (riece-make-identity ident1))
+   (if (riece-identity-server  ident2)
+       ident2
+     (riece-make-identity ident2))))
+
+(defun riece-identity-member-no-server (elt list)
+  "Return non-nil if an identity ELT is an element of LIST.
+The only difference with `riece-identity-member', this function uses
+`riece-identity-equal-no-server' for comparison."
+  (catch 'found
+    (while list
+      (if (and (stringp (car list))
+              (riece-identity-equal-no-server (car list) elt))
+         (throw 'found list)
+       (setq list (cdr list))))))
+
+(defun riece-identity-member (elt list)
+  "Return non-nil if an identity ELT is an element of LIST."
+  (catch 'found
+    (while list
+      (if (and (stringp (car list))
+              (riece-identity-equal (car list) elt))
+         (throw 'found list)
+       (setq list (cdr list))))))
+
+(defun riece-identity-assoc-no-server (elt alist)
+  "Return non-nil if an identity ELT matches the car of an element of ALIST."
+  (catch 'found
+    (while alist
+      (if (riece-identity-equal-no-server (car (car alist)) elt)
+         (throw 'found (car alist))
+       (setq alist (cdr alist))))))
+
+(defun riece-identity-assoc (elt alist)
+  "Return non-nil if an identity ELT matches the car of an element of ALIST."
+  (catch 'found
+    (while alist
+      (if (riece-identity-equal (car (car alist)) elt)
+         (throw 'found (car alist))
+       (setq alist (cdr alist))))))
+
+(defun riece-identity-assign-binding (item list binding)
+  (let ((slot (riece-identity-member item binding))
+       pointer)
+    (unless list                       ;we need at least one room
+      (setq list (list nil)))
+    (setq pointer list)
+    (if slot
+       (while (not (eq binding slot))
+         (unless (cdr pointer)
+           (setcdr pointer (list nil)))
+         (setq pointer (cdr pointer)
+               binding (cdr binding)))
+      (while (or (car pointer) (car binding))
+       (unless (cdr pointer)
+         (setcdr pointer (list nil)))
+       (setq pointer (cdr pointer)
+             binding (cdr binding))))
+    (setcar pointer item)
+    list))
+
+(defun riece-current-nickname ()
+  "Return the current nickname."
+  (riece-with-server-buffer
+   (if riece-real-nickname
+       (riece-make-identity riece-real-nickname))))
+
+(provide 'riece-identity)
+
+;;; riece-identity.el ends here
diff --git a/lisp/riece-inlines.el b/lisp/riece-inlines.el
new file mode 100644 (file)
index 0000000..5aa21c9
--- /dev/null
@@ -0,0 +1,69 @@
+;;; riece-inlines.el --- inline functions
+;; Copyright (C) 1998-2003 Daiki Ueno
+
+;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Created: 1998-09-28
+;; Keywords: IRC, riece
+
+;; This file is part of Riece.
+
+;; 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.
+
+;;; Code:
+
+(defsubst string-equal-ignore-case (s1 s2)
+  (string-equal (upcase s1) (upcase s2)))
+
+(defsubst string-list-member-ignore-case (thing list)
+  "Returns t if thing is member of list, not funcallable"
+  (catch 'found
+    (while list
+      (if (and (stringp (car list))
+              (string-equal-ignore-case (car list) thing))
+         (throw 'found list)
+       (setq list (cdr list))))))
+
+(defsubst string-list-delete-ignore-case (thing list)
+  (let ((pointer (string-list-member-ignore-case thing list)))
+    (if pointer
+       (delq (car pointer) list)
+      list)))
+
+(defsubst string-list-delete (thing list)
+  (let ((pointer (member thing list)))
+    (if pointer
+       (delq (car pointer) list)
+      list)))
+
+(defsubst string-list-modify-ignore-case (modifiers list)
+  (while modifiers
+    (let ((pointer (string-list-member-ignore-case
+                   (car (car modifiers)) list)))
+      (if pointer
+         (setcar pointer (cdr (car modifiers))))
+      (setq modifiers (cdr modifiers)))))
+
+(defsubst string-assoc-ignore-case (key list)
+  (catch 'found
+    (while list
+      (if (and (car-safe (car list))
+              (string-equal-ignore-case key (car (car list))))
+         (throw 'found (car list))
+       (setq list (cdr list))))))
+
+(provide 'riece-inlines)
+
+;;; riece-inlines.el ends here
diff --git a/lisp/riece-message.el b/lisp/riece-message.el
new file mode 100644 (file)
index 0000000..6acb78e
--- /dev/null
@@ -0,0 +1,223 @@
+;;; riece-message.el --- generate and display message line
+;; Copyright (C) 1999-2003 Daiki Ueno
+
+;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Keywords: message
+
+;; This file is part of Riece.
+
+;; 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.
+
+;;; Code:
+
+(eval-when-compile (require 'riece-inlines))
+
+(require 'riece-identity)
+(require 'riece-channel)
+(require 'riece-user)
+(require 'riece-display)
+(require 'riece-misc)
+
+(defgroup riece-message nil
+  "Messages"
+  :tag "Message"
+  :prefix "riece-"
+  :group 'riece)
+
+(defcustom riece-message-make-open-bracket-function
+  #'riece-message-make-open-bracket
+  "Function which makes `open-bracket' string for each message."
+  :type 'function
+  :group 'riece-message)
+
+(defcustom riece-message-make-close-bracket-function
+  #'riece-message-make-close-bracket
+  "Function which makes `close-bracket' string for each message."
+  :type 'function
+  :group 'riece-message)
+
+(defcustom riece-message-make-name-function
+  #'riece-message-make-name
+  "Function which makes local identity for each message."
+  :type 'function
+  :group 'riece-message)
+
+(defcustom riece-message-make-global-name-function
+  #'riece-message-make-global-name
+  "Function which makes global identity for each message."
+  :type 'function
+  :group 'riece-message)
+
+(defun riece-message-make-open-bracket (message)
+  "Makes `open-bracket' string for MESSAGE."
+  (riece-message-make-bracket message t))
+
+(defun riece-message-make-close-bracket (message)
+  "Makes `close-bracket' string for MESSAGE."
+  (riece-message-make-bracket message nil))
+
+(defun riece-message-make-bracket (message open-p)
+  (if (eq open-p (riece-message-own-p message))
+      (if (eq (riece-message-type message) 'notice)
+         "-"
+       (if (eq (riece-message-type message) 'action)
+           "]"
+         (if (riece-message-private-p message)
+             (if (riece-message-own-p message)
+                 ">"
+               "=")
+           (if (riece-message-external-p message)
+               ")"
+             ">"))))
+    (if (eq (riece-message-type message) 'notice)
+       "-"
+      (if (eq (riece-message-type message) 'action)
+         "["
+       (if (riece-message-private-p message)
+           (if (riece-message-own-p message)
+                 "<"
+             "=")
+         (if (riece-message-external-p message)
+             "("
+           "<"))))))
+
+(defun riece-message-make-name (message)
+  "Makes local identity for MESSAGE."
+  (riece-identity-prefix
+   (if (and (riece-message-private-p message)
+           (riece-message-own-p message))
+       (riece-message-target message)
+     (riece-message-speaker message))))
+
+(defun riece-message-make-global-name (message)
+  "Makes global identity for MESSAGE."
+  (if (riece-message-private-p message)
+      (if (riece-message-own-p message)
+         (riece-identity-prefix (riece-message-target message))
+       (riece-identity-prefix (riece-message-speaker message)))
+    (concat (riece-identity-prefix (riece-message-target message)) ":"
+           (riece-identity-prefix (riece-message-speaker message)))))
+
+(defun riece-message-buffer (message)
+  "Return the buffer where MESSAGE should appear."
+  (let* ((target (if (riece-identity-equal-no-server
+                     (riece-message-target message)
+                     (riece-current-nickname))
+                    (riece-message-speaker message)
+                  (riece-message-target message)))
+        (entry (riece-identity-assoc-no-server
+                target riece-channel-buffer-alist)))
+    (unless entry
+      (riece-join-channel target)
+      ;; If you are not joined any channel,
+      ;; switch to the target immediately.
+      (unless riece-current-channel
+       (riece-switch-to-channel target))
+      (riece-redisplay-buffers)
+      (setq entry (riece-identity-assoc-no-server
+                  target riece-channel-buffer-alist)))
+    (cdr entry)))
+
+(defun riece-message-parent-buffers (message buffer)
+  "Return the parents of BUFFER where MESSAGE should appear.
+Normally they are *Dialogue* and/or *Others*."
+  (if (or (and buffer (riece-frozen buffer))
+         (and riece-current-channel
+              (not (riece-identity-equal-no-server
+                    (riece-message-target message)
+                    riece-current-channel))))
+      (list riece-dialogue-buffer riece-others-buffer)
+    riece-dialogue-buffer))
+
+(defun riece-display-message (message)
+  "Display MESSAGE object."
+  (let* ((open-bracket
+         (funcall riece-message-make-open-bracket-function message))
+        (close-bracket
+         (funcall riece-message-make-close-bracket-function message))
+        (name
+         (funcall riece-message-make-name-function message))
+        (global-name
+         (funcall riece-message-make-global-name-function message))
+        (buffer (riece-message-buffer message))
+        (parent-buffers (riece-message-parent-buffers message buffer)))
+    (riece-insert buffer
+                 (concat open-bracket name close-bracket
+                         " " (riece-message-text message) "\n"))
+    (riece-insert parent-buffers
+                 (concat
+                  (riece-concat-server-name
+                   (concat open-bracket global-name close-bracket
+                           " " (riece-message-text message)))
+                  "\n"))
+    (run-hook-with-args 'riece-after-display-message-functions message)))
+
+(defun riece-make-message (speaker target text &optional type own-p)
+  "Make an instance of message object.
+Arguments are appropriate to the sender, the receiver, and text
+content, respectively.
+Optional 4th argument TYPE specifies the type of the message.
+Currently possible values are `action' and `notice'.
+Optional 5th argument is the flag to indicate that this message is not
+from the network."
+  (vector speaker target text type own-p))
+
+(defun riece-message-speaker (message)
+  "Return the sender of MESSAGE."
+  (aref message 0))
+
+(defun riece-message-target (message)
+  "Return the receiver of MESSAGE."
+  (aref message 1))
+
+(defun riece-message-text (message)
+  "Return the text part of MESSAGE."
+  (aref message 2))
+
+(defun riece-message-type (message)
+  "Return the type of MESSAGE.
+Currently possible values are `action' and `notice'."
+  (aref message 3))
+
+(defun riece-message-own-p (message)
+  "Return t if MESSAGE is not from the network."
+  (aref message 4))
+
+(defun riece-message-private-p (message)
+  "Return t if MESSAGE is a private message."
+  (if (riece-message-own-p message)
+      (not (riece-channel-p (riece-message-target message)))
+    (riece-identity-equal-no-server
+     (riece-message-target message)
+     (riece-current-nickname))))
+
+(defun riece-message-external-p (message)
+  "Return t if MESSAGE is from outside the channel."
+  (not (riece-identity-member-no-server
+       (riece-message-target message)
+       (mapcar #'riece-make-identity
+               (riece-user-get-channels (riece-message-speaker message))))))
+
+(defun riece-own-channel-message (message &optional channel type)
+  "Display MESSAGE as you sent to CHNL."
+  (riece-display-message
+   (riece-make-message (riece-current-nickname)
+                      (or channel riece-current-channel)
+                      message type t)))
+
+(provide 'riece-message)
+
+;;; riece-message.el ends here
diff --git a/lisp/riece-misc.el b/lisp/riece-misc.el
new file mode 100644 (file)
index 0000000..8090332
--- /dev/null
@@ -0,0 +1,172 @@
+;;; riece-misc.el --- miscellaneous functions (not inlined)
+;; Copyright (C) 1998-2003 Daiki Ueno
+
+;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Created: 1998-09-28
+;; Keywords: IRC, riece
+
+;; This file is part of Riece.
+
+;; 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.
+
+;;; Code:
+
+(eval-when-compile (require 'riece-inlines))
+
+(require 'riece-options)
+(require 'riece-coding)
+(require 'riece-identity)
+(require 'riece-version)
+(require 'riece-channel)
+(require 'riece-user)
+
+(defun riece-get-buffer-create (name)
+  (let ((buffer (get-buffer-create name)))
+    (or (memq buffer riece-buffer-list)
+       (push buffer riece-buffer-list))
+    buffer))
+
+(defun riece-insert (buffers string)
+  (unless (listp buffers)
+    (setq buffers (list buffers)))
+  (while buffers
+    (run-hooks 'riece-before-insert-functions)
+    (save-excursion
+      (set-buffer (riece-get-buffer-create (car buffers)))
+      (let ((inhibit-read-only t)
+           buffer-read-only
+           (start (goto-char (point-max))))
+       (insert (format-time-string "%H:%M") " " string)
+       (if (and (not (riece-frozen (current-buffer)))
+                (get-buffer-window (current-buffer)))
+           (set-window-point (get-buffer-window (current-buffer))
+                             (point)))
+       (run-hook-with-args 'riece-after-insert-functions start (point))))
+    (setq buffers (cdr buffers))))
+
+(defun riece-insert-change (buffer message)
+  (riece-insert buffer (concat riece-change-prefix message)))
+
+(defun riece-insert-notice (buffer message)
+  (riece-insert buffer (concat riece-notice-prefix message)))
+
+(defun riece-insert-wallops (buffer message)
+  (riece-insert buffer (concat riece-wallops-prefix message)))
+
+(defun riece-insert-error (buffer message)
+  (riece-insert buffer (concat riece-error-prefix message)))
+
+(defun riece-insert-info (buffer message)
+  (riece-insert buffer (concat riece-info-prefix message)))
+
+(defun riece-freeze (buffer &optional arg)
+  (with-current-buffer buffer
+    (setq riece-freeze (if arg (< 0 arg) (not riece-freeze))
+         riece-freeze-indicator (if riece-freeze "F" "-"))
+    (force-mode-line-update)))
+
+(defun riece-frozen (buffer)
+  (with-current-buffer buffer riece-freeze))
+
+(defun riece-own-freeze (buffer &optional arg)
+  (with-current-buffer buffer
+    (setq riece-own-freeze (if arg (< 0 arg) (not riece-own-freeze))
+         riece-own-freeze-indicator (if riece-own-freeze "M" "-"))
+    (force-mode-line-update)))
+
+(defun riece-process-send-string (process string)
+  (with-current-buffer (process-buffer process)
+    (process-send-string process (riece-encode-coding-string string))))
+
+(defun riece-send-string (string)
+  (let ((process (riece-find-server-process)))
+    (unless process
+      (error "%s" (substitute-command-keys
+                  "Type \\[riece-command-open-server] to open server.")))
+    (riece-process-send-string process string)))
+
+(defun riece-split-parameters (string)
+  (if (eq ?: (aref string 0))
+      (list (substring string 1))
+    (let (parameters)
+      (catch 'done
+       (while (string-match "^\\([^ ]+\\) +" string)
+         (setq parameters (nconc parameters (list (match-string 1 string)))
+               string (substring string (match-end 0)))
+         (and (not (equal "" string)) (eq ?: (aref string 0))
+              (setq string (substring string 1))
+              (throw 'done nil))))
+      (or (equal "" string)
+         (setq parameters (nconc parameters (list string))))
+      parameters)))
+
+(defun riece-concat-modes (target string)
+  (let ((modes
+        (if (riece-channel-p target)
+            (riece-channel-get-modes target)
+          (riece-user-get-modes target))))
+    (if modes
+       (concat string " [" (apply #'string modes) "]")
+      string)))
+
+(defsubst riece-concat-current-channel-modes (string)
+  (if riece-current-channel
+      (riece-concat-modes riece-current-channel string)
+    string))
+
+(defun riece-concat-message (string message)
+  (if (or (null message)
+         (equal message ""))
+      string
+    (concat string " (" message ")")))
+
+(defun riece-concat-server-name (string)
+  (riece-with-server-buffer
+   (if riece-server-name
+       (concat string " (from " riece-server-name ")")
+     string)))
+
+(defun riece-prefix-user-at-host (prefix)
+  (if (string-match "!" prefix)
+      (substring prefix (match-end 0))
+    prefix))
+
+(defun riece-prefix-nickname (prefix)
+  (if (string-match "!" prefix)
+      (substring prefix 0 (match-beginning 0))
+    prefix))
+
+(defun riece-parse-user-at-host (user-at-host)
+  (if (memq (aref user-at-host 0) '(?^ ?= ?~ ?- ?+))
+      (progn
+       (if (memq (aref user-at-host 0) '(?^ ?=))
+           (setq riece-user-at-host-type 'fake)
+         (if (memq (aref user-at-host 0) '(?~ ?-))
+             (setq riece-user-at-host-type 'not-verified)
+           (if (eq (aref user-at-host 0) ?+)
+               (setq riece-user-at-host-type 'ok))))
+       (substring user-at-host 1))
+    (setq riece-user-at-host-type 'ok)
+    user-at-host))
+
+(defun riece-strip-user-at-host (user-at-host)
+  (if (memq (aref user-at-host 0) '(?^ ?= ?~ ?- ?+))
+      (substring user-at-host 1)
+    user-at-host))
+
+(provide 'riece-misc)
+
+;;; riece-misc.el ends here
diff --git a/lisp/riece-naming.el b/lisp/riece-naming.el
new file mode 100644 (file)
index 0000000..fa085ba
--- /dev/null
@@ -0,0 +1,79 @@
+;;; riece-naming.el --- toplevel naming management
+;; Copyright (C) 1998-2003 Daiki Ueno
+
+;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Created: 1998-09-28
+;; Keywords: IRC, riece
+
+;; This file is part of Riece.
+
+;; 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.
+
+;;; Code:
+
+(eval-when-compile (require 'riece-inlines))
+
+(require 'riece-globals)
+(require 'riece-channel)
+(require 'riece-user)
+(require 'riece-display)
+
+(defun riece-naming-assert-join (user-name channel-name)
+  (if (string-equal-ignore-case user-name riece-real-nickname)
+      (riece-join-channel channel-name))
+  (riece-user-toggle-channel user-name channel-name t)
+  (riece-channel-toggle-user channel-name user-name t))
+
+(defun riece-naming-assert-part (user-name channel-name)
+  (if (string-equal-ignore-case user-name riece-real-nickname)
+      (progn
+       (riece-part-channel channel-name)
+       (riece-forget-channel channel-name))
+    (riece-user-toggle-channel user-name channel-name nil)
+    (riece-channel-toggle-user channel-name user-name nil)
+    (riece-channel-toggle-operator channel-name user-name nil)
+    (riece-channel-toggle-speaker channel-name user-name nil)
+    (if (riece-identity-equal user-name (riece-current-nickname))
+       (let* ((identity (riece-make-identity channel-name))
+              (pointer (riece-identity-member
+                        identity riece-current-channels)))
+         (if pointer
+             (setcar pointer nil))))))
+
+(defun riece-naming-assert-rename (old-name new-name)
+  (if (string-equal-ignore-case old-name riece-real-nickname)
+      (setq riece-last-nickname riece-real-nickname
+           riece-real-nickname new-name))
+  (let* ((old (riece-get-user old-name))
+        (channels (riece-user-channels old))
+        users pointer)
+    (while channels
+      (setq users (riece-channel-get-users (car channels))
+           pointer (member old-name users))
+      (if pointer
+         (setcar pointer new-name))
+      (setq users (riece-channel-get-operators (car channels))
+           pointer (member old-name users))
+      (if pointer
+         (setcar pointer new-name))
+      (setq users (riece-channel-get-speakers (car channels))
+           pointer (member old-name users))
+      (if pointer
+         (setcar pointer new-name))
+      (setq channels (cdr channels)))
+    (riece-rename-user old-name new-name)))
+
+(provide 'riece-naming)
diff --git a/lisp/riece-options.el b/lisp/riece-options.el
new file mode 100644 (file)
index 0000000..7c7515e
--- /dev/null
@@ -0,0 +1,261 @@
+;;; riece-options.el --- customization
+;; Copyright (C) 1998-2003 Daiki Ueno
+
+;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Created: 1998-09-28
+;; Keywords: IRC, riece
+
+;; This file is part of Riece.
+
+;; 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.
+
+;;; Code:
+
+(require 'riece-globals)
+
+;; User modifiable variables.
+(defgroup riece nil
+  "Riece specific customize group")
+
+(defgroup riece-options nil
+  "Riece user customizable variables"
+  :prefix "riece-"
+  :group 'riece)
+
+(defcustom riece-saved-forms
+  '(riece-server-alist
+    riece-channel-buffer-mode
+    riece-user-list-buffer-mode)
+  "Variables saved after each session is completed."
+  :type 'string
+  :group 'riece-options)
+
+(defcustom riece-debug nil
+  "If non-nil, random debug spews."
+  :type 'boolean
+  :group 'riece-options)
+
+(defgroup riece-looks nil
+  "Related to look and feel"
+  :prefix "riece-"
+  :group 'riece)
+
+(defcustom riece-truncate-partial-width-windows nil
+  "If non-nil, truncate lines in splitting windows such as others buffer."
+  :type 'boolean
+  :group 'riece-looks)
+
+(defcustom riece-use-full-window t
+  "If non-nil, whole Emacs window is used to display dialogue."
+  :type 'boolean
+  :group 'riece-looks)
+
+(defcustom riece-tab-stop-list '(2 4 6 8 10 12 14 16)
+  "To override `tab-stop-list'."
+  :type '(repeat integer)
+  :group 'riece-looks)
+
+(defcustom riece-icon-directory nil
+  "Location of the icon directory."
+  :type 'directory
+  :group 'riece-looks)
+
+(defcustom riece-user-image-alist
+  '((?@ . "ball.red.xpm")
+    (?+ . "ball.gray.xpm")
+    (?  . "ball.blank.xpm"))
+  "An alist of icons to display user's mode."
+  :type '(repeat (list (character :tag "Mark")
+                      (string :tag "XPM file")))
+  :group 'riece-looks)
+
+(defcustom riece-inhibit-startup-message nil
+  "If non-nil, the startup message will not be displayed."
+  :group 'riece-looks
+  :type 'boolean)
+
+(defcustom riece-directory "~/.riece"
+  "Where to look for data files."
+  :type 'directory
+  :group 'riece-options)
+  
+(defcustom riece-variables-file
+  (expand-file-name "init" riece-directory)
+  "Where to look for variables."
+  :type 'file
+  :group 'riece-options)
+
+(defcustom riece-saved-variables-file
+  (expand-file-name "save" riece-directory)
+  "Where to look for variables.
+This file was saved the last session."
+  :type 'file
+  :group 'riece-options)
+
+(defcustom riece-variables-files
+  (list riece-saved-variables-file riece-variables-file)
+  "Where to look for variables.  Helps to remove clutter from your .emacs.
+This feature is most likely to dissappear in near future.  The preferred
+way is to put Riece variables on .emacs or file loaded from there."
+  :type '(repeat (file :tag "Initialization File"))
+  :group 'riece-options)
+
+(defgroup riece-server nil
+  "Server settings"
+  :prefix "riece-"
+  :group 'riece)
+
+(defgroup riece-channel nil
+  "Channel settings"
+  :prefix "riece-"
+  :group 'riece)
+
+(define-widget 'riece-service-spec 'radio
+  "Edit service spec entries"
+  :convert-widget 'riece-service-spec-convert)
+
+(defun riece-service-spec-convert (widget)
+  (widget-put widget :args '((integer :tag "Port Number")
+                            (string :tag "Name")))
+  widget)
+
+(define-widget 'riece-server-spec 'repeat
+  "Edit server spec entries"
+  :match (lambda (widget value)
+          (eval `(and ,@(mapcar
+                         (lambda (entry)
+                           (or (stringp (cdr entry))
+                               (listp (cdr entry))))
+                         value))))
+  :convert-widget 'riece-server-spec-convert)
+
+(defun riece-server-spec-convert (widget)
+  (let* ((host '(const :format "" :value :host))
+        (service '(const :format "" :value :service))
+        (host
+         `(group :inline t ,host (string :tag "Host")))
+        (service
+         `(group :inline t ,service riece-service-spec))
+        (spec
+         `(cons (string :tag "Name")
+                (radio (string :tag "Host")
+                       (list ,host ,service))))
+        (args (list spec)))
+    (widget-put widget :args args)
+    widget))
+  
+(defcustom riece-server-alist nil
+  "An alist mapping server names to plist."
+  :type 'riece-server-spec
+  :group 'riece-server)
+
+(defcustom riece-server (getenv "IRCSERVER")
+  "IRC server host we are connecting to."
+  :type 'string
+  :group 'riece-server)
+
+(defcustom riece-default-password (getenv "IRCPASSWORD")
+  "Your password."
+  :type '(radio (string :tag "Password")
+               (const :tag "No" nil))
+  :group 'riece-server)
+
+(defcustom riece-username (or (getenv "IRCNAME")
+                             (user-real-login-name))
+  "Your user name."
+  :type 'string
+  :group 'riece-server)
+
+(defcustom riece-nickname (or (getenv "IRCNICK")
+                             (user-real-login-name))
+  "Your nickname."
+  :type 'string
+  :group 'riece-server)
+
+(defcustom riece-startup-channel-list nil
+  "A list of channels to join automatically at startup."
+  :type '(repeat (string :tag "Startup Channel"))
+  :group 'riece-channel)
+
+(defcustom riece-retry-with-new-nickname nil
+  "When nickname has already been in use, grow-tail automatically."
+  :type 'boolean
+  :group 'riece-server)
+
+(defcustom riece-channel-buffer-mode t
+  "When non-nil, Riece will display a channel buffer."
+  :type 'boolean
+  :group 'riece-looks)
+
+(defcustom riece-user-list-buffer-mode t
+  "When non-nil, Riece will display a nick list buffer."
+  :type 'boolean
+  :group 'riece-looks)
+
+(defcustom riece-channel-list-buffer-mode t
+  "When non-nil, Riece will display a channel list buffer."
+  :type 'boolean
+  :group 'riece-looks)
+
+(defcustom riece-default-freeze nil
+  "If non nil, channel buffer local freeze flag is on at starting."
+  :type 'boolean
+  :group 'riece-looks)
+
+(defcustom riece-default-own-freeze nil
+  "If non nil, channel buffer local own freeze flag is on at starting."
+  :type 'boolean
+  :group 'riece-looks)
+
+(defcustom riece-default-channel-binding nil
+  "The channel list to bind the channel number when joining."
+  :type '(repeat (radio (string :tag "Bound Channel")
+                       (const nil)))
+  :group 'riece-channel)
+
+(defcustom riece-blink-parens nil
+  "Should we blink matching parenthesis in the command buffer?"
+  :type 'boolean
+  :group 'riece-options)
+
+(defcustom riece-quit-message nil
+  "Default signoff message."
+  :type '(radio (string :tag "Signoff message"))
+  :group 'riece-options)
+
+(defcustom riece-gather-channel-modes t
+  "If non-nil, gather channel modes when we join a channel."
+  :type 'boolean
+  :group 'riece-options)
+
+(defcustom riece-connection-timeout 60
+  "Default timeout interval."
+  :type 'integer
+  :group 'riece-server)
+  
+(defcustom riece-buffer-dispose-function #'bury-buffer
+  "Function called after the buffer was disposed."
+  :type 'function
+  :group 'riece-options)
+
+(defcustom riece-format-time-function #'current-time-string
+  "Function to convert the specified time to the human readable form."
+  :type 'function
+  :group 'riece-options)
+
+(provide 'riece-options)
+
+;;; riece-options.el ends here
diff --git a/lisp/riece-server.el b/lisp/riece-server.el
new file mode 100644 (file)
index 0000000..4762802
--- /dev/null
@@ -0,0 +1,245 @@
+;;; riece-server.el --- functions to open and close servers
+;; Copyright (C) 1998-2003 Daiki Ueno
+
+;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Created: 1998-09-28
+;; Keywords: IRC, riece
+
+;; This file is part of Riece.
+
+;; 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.
+
+;;; Code:
+
+(require 'riece-options)
+(require 'riece-globals)               ;for server local variables.
+(require 'riece-misc)                  ;riece-process-send-string, etc.
+(require 'riece-coding)                        ;riece-default-coding-system
+(require 'riece-identity)
+(require 'riece-display)
+
+(eval-and-compile
+  (defvar riece-server-keyword-map
+    '((:host)
+      (:service 6667)
+      (:nickname riece-nickname)
+      (:username riece-username)
+      (:password)
+      (:function #'open-network-stream)
+      (:coding-system riece-default-coding-system))
+    "Mapping from keywords to default values.
+All keywords that can be used must be listed here."))
+
+(defmacro riece-server-keyword-bind (plist &rest body)
+  "Return a `let' form that binds all variables in PLIST.
+After this is done, BODY will be executed in the scope
+of the `let' form.
+
+The variables bound and their default values are described by
+the `riece-server-keyword-map' variable."
+  `(let ,(mapcar
+         (lambda (keyword)
+           (list (intern (substring (symbol-name (car keyword)) 1))
+                 (if (cadr keyword)
+                     `(or (plist-get ,plist ',(car keyword))
+                          ,(cadr keyword))
+                   `(plist-get ,plist ',(car keyword)))))
+         riece-server-keyword-map)
+     ,@body))
+
+(put 'riece-server-keyword-bind 'lisp-indent-function 1)
+(put 'riece-server-keyword-bind 'edebug-form-spec '(form body))
+
+(defun riece-start-server (server &optional server-name)
+  "Open network stream to remote irc server.
+If optional argument CONFIRM is non-nil, ask the host that the server
+is running on."
+  (if server-name
+      (message "Connecting to IRC server on %s..." server-name)
+    (message "Connecting to IRC server..."))
+  (prog1 (riece-open-server server server-name)
+    (if server-name
+       (message "Connecting to IRC server on %s...done" server-name)
+      (message "Connecting to IRC server...done"))))
+
+(defun riece-clear-system ()
+  (while riece-buffer-list
+    (if (and (get-buffer (car riece-buffer-list))
+            (buffer-live-p (car riece-buffer-list)))
+       (funcall riece-buffer-dispose-function (car riece-buffer-list)))
+    (setq riece-buffer-list (cdr riece-buffer-list)))
+  (setq riece-channel-buffer-alist nil
+       riece-user-list-buffer-alist nil
+       riece-current-channels nil
+       riece-current-channel nil
+       riece-channel-indicator "None"
+       riece-channel-list-indicator "No channel")
+  (delete-other-windows))
+
+(defun riece-server-parse-string (string)
+  "Convert a STRING set as `riece-server' and return a property list."
+  (when (or (string-match "^\\[\\([^]]+\\)\\]:?\\([0-9]*\\)" string)
+           (string-match "^\\([^:]+\\):?\\([0-9]*\\)" string))
+    (let ((host (match-string 1 string))
+         (service (match-string 2 string))
+         (password (substring string (match-end 0)))
+         plist)
+      (push `(:host ,host) plist)
+      (unless (equal service "")
+       (push `(:service ,(string-to-int service)) plist))
+      (unless (equal password "")
+       (push `(:password ,(substring password 1)) plist))
+      (apply #'nconc plist))))
+
+(defun riece-server-name-to-server (server-name)
+  (let ((entry (assoc server-name riece-server-alist)))
+    (if entry
+       (unless (listp (cdr entry))
+         (setcdr entry (riece-server-parse-string (cdr entry))))
+      (setq entry (cons server-name (riece-server-parse-string server-name)))
+      (push entry riece-server-alist)
+      (setq riece-save-variables-are-dirty t))
+    (cdr entry)))
+
+(defun riece-open-server (server server-name)
+  "Open chat server on HOST.
+If HOST is nil, use value of environment variable \"IRCSERVER\".
+If optional argument SERVICE is non-nil, open by the service name."
+  (riece-server-keyword-bind server
+    (let* (selective-display
+          (coding-system-for-read 'binary)
+          (coding-system-for-write 'binary)
+          (process
+           (funcall function "IRC" (if server-name
+                                       (format " *IRC*%s" server-name)
+                                     " *IRC*")
+                    host service)))
+      (riece-reset-process-buffer process)
+      (set-process-sentinel process 'riece-sentinel)
+      (set-process-filter process 'riece-filter)
+      (if (or password
+             riece-reconnect-with-password)
+         (riece-process-send-string process
+                                    (format "PASS %s\r\n"
+                                            (or password
+                                                (riece-read-passwd
+                                                 "Password: ")))))
+      (setq riece-reconnect-with-password nil)
+      (riece-process-send-string process
+                                (format "USER %s * * :%s\r\n"
+                                        (user-real-login-name)
+                                        (or username
+                                            "No information given")))
+      (riece-process-send-string process (format "NICK %s\r\n" nickname))
+      (with-current-buffer (process-buffer process)
+       (setq riece-last-nickname riece-real-nickname
+             riece-nick-accepted 'sent
+             riece-coding-system coding-system))
+      process)))
+
+(defun riece-reset-process-buffer (process)
+  (save-excursion
+    (set-buffer (process-buffer process))
+    (if (fboundp 'set-buffer-multibyte)
+       (set-buffer-multibyte nil))
+    (kill-all-local-variables)
+    (make-local-variable 'riece-real-nickname)
+    (make-local-variable 'riece-last-nickname)
+    (make-local-variable 'riece-nick-accepted)
+    (make-local-variable 'riece-real-server-name)
+    (make-local-variable 'riece-real-userhost)
+    (make-local-variable 'riece-user-at-host)
+    (make-local-variable 'riece-user-at-host-type)
+    (make-local-variable 'riece-supported-user-modes)
+    (make-local-variable 'riece-supported-channel-modes)
+    (make-local-variable 'riece-channel-filter)
+    (make-local-variable 'riece-server-name)
+    (make-local-variable 'riece-read-point)
+    (setq riece-read-point (point-min))
+    (make-local-variable 'riece-obarray)
+    (setq riece-obarray (make-vector riece-obarray-size 0))
+    (make-local-variable 'riece-coding-system)
+    (buffer-disable-undo)
+    (erase-buffer)))
+
+(defun riece-close-server-process (process &optional quit-message)
+  (if (eq 'riece-filter (process-filter process))
+      (set-process-filter process nil))
+  (if (eq 'riece-sentinel (process-sentinel process))
+      (set-process-sentinel process nil))
+  (when (memq (process-status process) '(open run))
+    (riece-process-send-string process
+                              (if quit-message
+                                  (format "QUIT :%s\r\n" quit-message)
+                                "QUIT\r\n"))
+    (delete-process process)
+    (unless riece-debug
+      (kill-buffer (process-buffer process)))))
+
+(eval-when-compile
+  (autoload 'riece-exit "riece"))
+(defun riece-close-server (server-name &optional quit-message)
+  ;; Remove channels which belong to the server.
+  (let ((riece-overriding-server-name server-name)
+       (channels riece-current-channels))
+    (while channels
+      (if (equal (riece-identity-server (car channels))
+                server-name)
+         (riece-part-channel (car channels)))
+      (setq channels (cdr channels)))
+    (riece-redisplay-buffers))
+  ;; Close now.
+  (let (process)
+    (if server-name
+       (let ((entry (assoc server-name riece-server-process-alist)))
+         (setq process (cdr entry)
+               riece-server-process-alist
+               (delq entry riece-server-process-alist)))
+      (setq process riece-server-process
+           riece-server-process nil))
+    (riece-close-server-process process quit-message)
+    ;; If no server process is available, exit.
+    (if (and (null riece-server-process)
+            (null riece-server-process-alist))
+       (riece-exit))))
+
+(defun riece-close-all-server (&optional quit-message)
+  (let ((process-list
+        (delq nil (cons riece-server-process
+                        (mapcar #'cdr riece-server-process-alist)))))
+    (while process-list
+      (riece-close-server-process (car process-list) quit-message)
+      (setq process-list (cdr process-list)))
+    (setq riece-server-process nil
+         riece-server-process-alist nil)
+    (riece-exit)))
+
+(defun riece-server-opened (&optional server-name)
+  (let ((processes
+        (delq nil
+              (if server-name
+                  (cdr (assoc server-name riece-server-process-alist))
+                (cons riece-server-process
+                      (mapcar #'cdr riece-server-process-alist))))))
+    (catch 'found
+      (while processes
+       (if (memq (process-status (car processes)) '(open run))
+           (throw 'found t))
+       (setq processes (cdr processes))))))
+
+(provide 'riece-server)
+
+;;; riece-server.el ends here
diff --git a/lisp/riece-user.el b/lisp/riece-user.el
new file mode 100644 (file)
index 0000000..e584b74
--- /dev/null
@@ -0,0 +1,145 @@
+;;; riece-user.el --- a user object
+;; Copyright (C) 1998-2003 Daiki Ueno
+
+;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Keywords: IRC, riece
+
+;; This file is part of Riece.
+
+;; 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.
+
+;;; Code:
+
+(eval-when-compile (require 'riece-inlines))   ;string-assoc-ignore-case, etc.
+
+(require 'riece-identity)
+
+(defconst riece-user-regexp
+  "[][\\\\`_^{|}A-Za-z][][\\\\`_^{|}A-Za-z0-9-]\\{0,8\\}")
+
+;;; User object:
+(defun riece-find-user (name)
+  "Get a user object named NAME from the server buffer."
+  (riece-with-server-buffer
+   (let ((symbol (intern-soft (downcase (riece-identity-prefix name))
+                             riece-obarray)))
+     (if symbol
+        (symbol-value symbol)))))
+
+(defun riece-forget-user (name)
+  (riece-with-server-buffer
+   (let ((symbol (intern-soft (downcase (riece-identity-prefix name)))))
+     (when symbol
+       (makunbound symbol)
+       (unintern (symbol-name symbol) riece-obarray)))))
+
+(defun riece-rename-user (old-name new-name)
+  (riece-with-server-buffer
+   (let ((symbol (intern-soft (downcase (riece-identity-prefix old-name))
+                             riece-obarray)))
+     (when symbol
+       (set (intern (downcase (riece-identity-prefix new-name))
+                   riece-obarray)
+           (symbol-value symbol))
+       (makunbound symbol)
+       (unintern (symbol-name symbol) riece-obarray)))))
+
+(defun riece-make-user (&optional channels user-at-host modes away)
+  "Make an instance of user object.
+Arguments are appropriate to joined channels, user-at-host, mode, and
+away status, respectively."
+  (vector channels user-at-host modes away))
+
+(defun riece-get-user (name)
+  (riece-with-server-buffer
+   (let ((symbol (intern-soft (downcase (riece-identity-prefix name))
+                             riece-obarray)))
+     (if symbol
+        (symbol-value symbol)
+       (set (intern (downcase (riece-identity-prefix name)) riece-obarray)
+           (riece-make-user))))))
+
+(defun riece-user-channels (user)
+  "Return joined channels of USER."
+  (aref user 0))
+
+(defun riece-user-user-at-host (user)
+  "Return the user-at-host of USER."
+  (aref user 1))
+
+(defun riece-user-modes (user)
+  "Return the modes of USER."
+  (aref user 2))
+
+(defun riece-user-away (user)
+  "Return t, if USER has been marked as away."
+  (aref user 3))
+
+(defun riece-user-set-channels (user value)
+  "Set the joined channels of USER to VALUE."
+  (aset user 0 value))
+
+(defun riece-user-set-user-at-host (user value)
+  "Set the user-at-host of USER to VALUE."
+  (aset user 1 value))
+
+(defun riece-user-set-modes (user value)
+  "Set the modes of USER to VALUE."
+  (aset user 2 value))
+
+(defun riece-user-set-away (user value)
+  "Set the away status of USER to VALUE."
+  (aset user 3 value))
+
+(defun riece-user-get-channels (&optional name)
+  (riece-user-channels
+   (riece-get-user (or name riece-real-nickname))))
+
+(defun riece-user-get-user-at-host (&optional name)
+  (riece-user-user-at-host
+   (riece-get-user (or name riece-real-nickname))))
+
+(defun riece-user-get-modes (&optional name)
+  (riece-user-modes
+   (riece-get-user (or name riece-real-nickname))))
+
+(defun riece-user-get-away (&optional name)
+  (riece-user-away
+   (riece-get-user (or name riece-real-nickname))))
+
+(defun riece-user-toggle-channel (name channel flag)
+  "Add or remove the joined channel of user."
+  (let* ((user (riece-get-user (or name (riece-current-nickname))))
+        (channels (riece-user-channels user)))
+    (if flag
+       (unless (memq channel channels)
+         (riece-user-set-channels user (cons channel channels)))
+      (if (setq channel (car (member channel channels)))
+         (riece-user-set-channels user (delq channel channels))))))
+
+(defun riece-user-toggle-mode (name mode flag)
+  "Add or remove user MODE of user."
+  (let* ((user (riece-get-user (or name (riece-current-nickname))))
+        (modes (riece-user-modes user)))
+    (if flag
+       (unless (memq mode modes)
+         (riece-user-set-modes user (cons mode modes)))
+      (if (memq mode modes)
+         (riece-user-set-modes user (delq mode modes))))))
+
+(provide 'riece-user)
+
+;;; riece-user.el ends here
diff --git a/lisp/riece-version.el b/lisp/riece-version.el
new file mode 100644 (file)
index 0000000..ecab4ff
--- /dev/null
@@ -0,0 +1,108 @@
+;;; riece-version.el --- version information about Riece
+;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+;;        Free Software Foundation, Inc.
+;; Copyright (C) 1998-2003 Daiki Ueno
+
+;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Created: 1998-09-28
+;; Keywords: IRC, riece
+
+;; This file is part of Riece.
+
+;; 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.
+
+;;; Code:
+
+;; NOTE: Most part of this file is copied from Gnus.
+
+(defcustom riece-user-agent 'emacs-riece-type
+  "Which information should be exposed in the User-Agent header.
+
+It can be one of the symbols `riece' \(show only Riece version\), `emacs-riece'
+\(show only Emacs and Riece versions\), `emacs-riece-config' \(same as
+`emacs-riece' plus system configuration\), `emacs-riece-type' \(same as
+`emacs-riece' plus system type\) or a custom string.  If you set it to a
+string, be sure to use a valid format, see RFC 2616."
+  :group 'riece-options
+  :type '(choice
+         (item :tag "Show Riece and Emacs versions and system type"
+               emacs-riece-type)
+         (item :tag "Show Riece and Emacs versions and system configuration"
+               emacs-riece-config)
+         (item :tag "Show Riece and Emacs versions" emacs-riece)
+         (item :tag "Show only Riece version" riece)
+         (string :tag "Other")))
+
+(defconst riece-product-name "Riece")
+
+(defconst riece-version-number "0.0.1"
+  "Version number for this version of Riece.")
+
+(defconst riece-version (format "Riece v%s" riece-version-number)
+  "Version string for this version of Riece.")
+
+(eval-when-compile
+  (defvar xemacs-codename))
+
+(defun riece-extended-version ()
+  "Stringified Riece version and Emacs version.
+See the variable `riece-user-agent'."
+  (interactive)
+  (let* ((riece-v
+         (concat riece-product-name "/"
+                 (prin1-to-string riece-version-number t)))
+        (system-v
+         (cond
+          ((eq riece-user-agent 'emacs-riece-config)
+           system-configuration)
+          ((eq riece-user-agent 'emacs-riece-type)
+           (symbol-name system-type))
+          (t nil)))
+        (emacs-v
+         (cond
+          ((eq riece-user-agent 'riece)
+           nil)
+          ((string-match "^\\(\\([.0-9]+\\)*\\)\\.[0-9]+$" emacs-version)
+           (concat "Emacs/" (match-string 1 emacs-version)
+                   (if system-v
+                       (concat " (" system-v ")")
+                     "")))
+          ((string-match
+            "\\([A-Z]*[Mm][Aa][Cc][Ss]\\)[^(]*\\(\\((beta.*)\\|'\\)\\)?"
+            emacs-version)
+           (concat
+            (match-string 1 emacs-version)
+            (format "/%d.%d" emacs-major-version emacs-minor-version)
+            (if (match-beginning 3)
+                (match-string 3 emacs-version)
+              "")
+            (if (boundp 'xemacs-codename)
+                (concat
+                 " (" xemacs-codename
+                 (if system-v
+                     (concat ", " system-v ")")
+                   ")"))
+              "")))
+          (t emacs-version))))
+    (if (stringp riece-user-agent)
+       riece-user-agent
+      (concat riece-v
+             (when emacs-v
+               (concat " " emacs-v))))))
+
+(provide 'riece-version)
+
+;;; riece-version.el ends here
diff --git a/lisp/riece-xemacs.el b/lisp/riece-xemacs.el
new file mode 100644 (file)
index 0000000..055fa7c
--- /dev/null
@@ -0,0 +1,75 @@
+;;; riece-xemacs.el --- XEmacs specific functions
+;; Copyright (C) 1998-2003 Daiki Ueno
+
+;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Keywords: emulation
+
+;; This file is part of Riece.
+
+;; 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.
+
+;;; Code:
+
+(require 'riece-compat)
+
+(defun riece-xemacs-hide-modeline ()
+  "Remove modeline from current window."
+  (set-specifier has-modeline-p nil (current-buffer)))
+
+(when (featurep 'scrollbar)
+  (defun riece-xemacs-hide-scrollbars ()
+    (if (boundp 'horizontal-scrollbar-visible-p)
+       (set-specifier horizontal-scrollbar-visible-p nil (current-buffer))
+      (if (boundp 'scrollbar-height)
+         (set-specifier scrollbar-height 0 (current-buffer)))))
+  (add-hook 'riece-user-list-mode-hook 'riece-xemacs-hide-scrollbars)
+  (add-hook 'riece-channel-list-mode-hook 'riece-xemacs-hide-scrollbars))
+
+(add-hook 'riece-user-list-mode-hook 'riece-xemacs-hide-modeline)
+(add-hook 'riece-channel-list-mode-hook 'riece-xemacs-hide-modeline)
+
+(defun riece-xemacs-mode-line-buffer-identification (line)
+  "Decorate 1st        element of `mode-line-buffer-identification' LINE.
+Modify whole identification by side effect."
+  (let ((id (car line)) chop)
+    (if (and (stringp id) (string-match "^Riece:" id))
+       (progn
+         (setq chop (match-end 0))
+         (nconc
+          (list
+           (cons (copy-extent modeline-buffer-id-left-extent)
+                 (substring id 0 chop))
+           (cons (copy-extent modeline-buffer-id-right-extent)
+                 (substring id chop)))
+          (cdr line)))
+      line)))
+
+(defun riece-xemacs-simplify-modeline-format ()
+  "Remove unnecessary information from `modeline-format'."
+  (setq modeline-format
+       (remrassq 'modeline-modified
+                 (delq 'modeline-multibyte-status
+                       (copy-sequence mode-line-format)))))
+
+(defalias 'riece-mode-line-buffer-identification
+  'riece-xemacs-mode-line-buffer-identification)
+
+(defalias 'riece-simplify-mode-line-format
+  'riece-xemacs-simplify-modeline-format)
+
+(provide 'riece-xemacs)
+
+;;; riece-xemacs.el ends here
diff --git a/lisp/riece.el b/lisp/riece.el
new file mode 100644 (file)
index 0000000..dd7e2c9
--- /dev/null
@@ -0,0 +1,416 @@
+;;; riece.el --- IRC client for Emacsen
+;; Copyright (C) 1998-2003 Daiki Ueno
+
+;; Author: Daiki Ueno <ueno@unixuser.org>
+;; Created: 1998-09-28
+;; Keywords: IRC, riece
+
+;; This file is part of Riece.
+
+;; 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.
+
+;;; Code:
+
+(eval-when-compile (require 'riece-inlines))
+
+(if (featurep 'xemacs)
+    (require 'riece-xemacs)
+  (require 'riece-emacs))
+
+(require 'riece-filter)
+(require 'riece-highlight)
+(require 'riece-display)
+(require 'riece-server)
+(require 'riece-compat)
+(require 'riece-commands)
+
+(defvar riece-channel-list-mode-map (make-sparse-keymap))
+(defvar riece-user-list-mode-map (make-sparse-keymap))
+
+(defvar riece-dialogue-mode-map
+  (let ((keymap (make-keymap)))
+    (suppress-keymap keymap 'nodigit)
+    keymap))
+
+(defvar riece-command-mode-map (make-keymap))
+(defvar riece-command-map (make-sparse-keymap))
+
+(defvar riece-command-mode-syntax-table nil)
+
+(put 'riece-command-mode 'mode-class 'special)
+(put 'riece-dialogue-mode 'mode-class 'special)
+(put 'riece-channel-list-mode 'mode-class 'special)
+(put 'riece-user-list-mode 'mode-class 'special)
+(put 'riece-channel-mode 'derived-mode-parent 'riece-dialogue-mode)
+(put 'riece-others-mode 'derived-mode-parent 'riece-dialogue-mode)
+
+(defvar riece-buffer-mode-alist
+  '((riece-dialogue-buffer . riece-dialogue-mode)
+    (riece-others-buffer . riece-others-mode)
+    (riece-channel-list-buffer . riece-channel-list-mode)
+    (riece-private-buffer . riece-dialogue-mode)
+    (riece-wallops-buffer)))
+    
+(defvar riece-select-keys
+  '("1" riece-command-switch-to-channel-by-number-1
+    "2" riece-command-switch-to-channel-by-number-2
+    "3" riece-command-switch-to-channel-by-number-3
+    "4" riece-command-switch-to-channel-by-number-4
+    "5" riece-command-switch-to-channel-by-number-5
+    "6" riece-command-switch-to-channel-by-number-6
+    "7" riece-command-switch-to-channel-by-number-7
+    "8" riece-command-switch-to-channel-by-number-8
+    "9" riece-command-switch-to-channel-by-number-9
+    "0" riece-command-switch-to-channel-by-number-10
+    "\C-c1" riece-command-switch-to-channel-by-number-11
+    "\C-c2" riece-command-switch-to-channel-by-number-12
+    "\C-c3" riece-command-switch-to-channel-by-number-13
+    "\C-c4" riece-command-switch-to-channel-by-number-14
+    "\C-c5" riece-command-switch-to-channel-by-number-15
+    "\C-c6" riece-command-switch-to-channel-by-number-16
+    "\C-c7" riece-command-switch-to-channel-by-number-17
+    "\C-c8" riece-command-switch-to-channel-by-number-18
+    "\C-c9" riece-command-switch-to-channel-by-number-19
+    "\C-c0" riece-command-switch-to-channel-by-number-20))
+
+;;; Keymap macros. -- borrowed from `gnus-util.el'.
+(defmacro riece-local-set-keys (&rest plist)
+  "Set the keys in PLIST in the current keymap."
+  `(riece-define-keys-1 (current-local-map) ',plist))
+
+(defmacro riece-define-keys (keymap &rest plist)
+  "Assign KEYMAP keys from PLIST."
+  `(riece-define-keys-1 ',keymap ',plist))
+
+(defmacro riece-define-keys-safe (keymap &rest plist)
+  "Assign KEYMAP keys from PLIST without overwriting previous definitions."
+  `(riece-define-keys-1 ',keymap ',plist t))
+
+(put 'riece-define-keys 'lisp-indent-function 1)
+(put 'riece-define-keys-safe 'lisp-indent-function 1)
+(put 'riece-local-set-keys 'lisp-indent-function 1)
+
+(defun riece-define-keys-1 (keymap plist &optional safe)
+  "Assign KEYMAP keys from PLIST.
+If optional argument SAFE is nil, overwrite previous definitions."
+  (unless keymap
+    (error "Can't set keys in a null keymap"))
+  (cond
+   ((symbolp keymap)
+    (setq keymap (symbol-value keymap)))
+   ((keymapp keymap))
+   ((listp keymap)
+    (set (car keymap) nil)
+    (define-prefix-command (car keymap))
+    (define-key (symbol-value (nth 2 keymap)) (nth 1 keymap) (car keymap))
+    (setq keymap (symbol-value (car keymap)))))
+  (let (key)
+    (while plist
+      (when (symbolp (setq key (pop plist)))
+       (setq key (symbol-value key)))
+      (if (or (not safe)
+             (eq (lookup-key keymap key) 'undefined))
+         (define-key keymap key (pop plist))
+       (pop plist)))))
+
+(when t
+  (riece-define-keys riece-dialogue-mode-map
+    "\177" scroll-down
+    [delete] scroll-down
+    [backspace] scroll-down
+    [return] scroll-up
+    " " scroll-up
+    "$" end-of-buffer
+    "/" riece-command-raw
+    ">" end-of-buffer
+    "<" beginning-of-buffer
+    "\C-ta" riece-command-toggle-away
+    "c" riece-command-select-command-buffer
+    "f" riece-command-finger
+    "\C-tf" riece-command-toggle-freeze
+    "\C-to" riece-command-toggle-own-freeze
+    "\C-tu" riece-command-toggle-user-list-buffer-mode
+    "\C-tc" riece-command-toggle-channel-buffer-mode
+    "i" riece-command-invite
+    "j" riece-command-join
+    "\C-k" riece-command-kick
+    "l" riece-command-list
+    "m" riece-dialogue-enter-message
+    "M" riece-command-change-mode
+    "n" riece-command-change-nickname
+    "o" other-window
+    "O" riece-command-open-server
+    "C" riece-command-close-server
+    "M" riece-command-universal-server-name-argument
+    "q" riece-command-quit
+    "r" riece-command-configure-windows
+    "x" riece-command-copy-region
+    "t" riece-command-topic)
+
+  (riece-define-keys riece-command-mode-map
+    "\r" riece-command-enter-message
+    [tab] riece-command-complete
+    [(meta control c) >] riece-command-push
+    [(meta control c) <] riece-command-pop)
+
+  (riece-define-keys (riece-command-map "\C-c" riece-command-mode-map)
+    "\177" riece-command-scroll-down
+    [delete] riece-command-scroll-down
+    [backspace] riece-command-scroll-down
+    " " riece-command-scroll-up
+    "$" riece-command-end-of-buffer
+    ">" riece-command-next-channel
+    "<" riece-command-previous-channel
+    "\C-j" riece-command-next-channel
+    "\C-n" riece-command-names
+    "l" riece-command-list
+    "\C-m" riece-command-change-mode
+    "o" riece-command-set-operators
+    "\C-p" riece-command-part
+    "r" riece-command-configure-windows
+    "v" riece-command-set-voices)
+  (set-keymap-parent riece-command-map riece-dialogue-mode-map)
+
+  (riece-define-keys riece-user-list-mode-map
+    "o" riece-command-set-operators
+    "v" riece-command-set-voices
+    "f" riece-command-finger
+    " " riece-command-nick-scroll-up
+    "\177" riece-command-nick-scroll-down
+    [delete] riece-command-nick-scroll-down
+    [backspace] riece-command-nick-scroll-down
+    "c" riece-command-select-command-buffer)
+
+  (riece-define-keys riece-channel-list-mode-map
+    ">" riece-command-next-channel
+    "<" riece-command-previous-channel
+    "u" riece-command-unread-channel
+    "o" other-window
+    "c" riece-command-select-command-buffer)
+
+  (riece-define-keys-1 riece-dialogue-mode-map riece-select-keys)
+  (riece-define-keys-1 riece-channel-list-mode-map riece-select-keys))
+
+(defun riece-read-variables-files (&optional file)
+  "Read variables FILEs."
+  (or (file-directory-p riece-directory)
+      (make-directory riece-directory))
+  (let ((files (if file
+                  (setq riece-variables-file file
+                        riece-variables-files (list file))
+                riece-variables-files)))
+    (while files
+      (condition-case nil
+         (load (expand-file-name (car files)))
+       (file-error nil))
+      (setq files (cdr files)))))
+
+(defvar print-quoted)
+(defvar print-escape-multibyte)
+(defun riece-save-variables-files ()
+  "Save current settings to `riece-variables-file'."
+  (with-temp-file riece-saved-variables-file
+    (let ((print-quoted t)
+         (print-readably t)
+         print-escape-multibyte
+         print-level
+         print-length
+         (variables riece-saved-forms))
+      (while variables
+       (prin1 `(setq ,(car variables)
+                     ',(symbol-value (car variables)))
+              (current-buffer))
+       (insert "\n")
+       (setq variables (cdr variables)))))
+  (setq riece-save-variables-are-dirty nil))
+
+;;;###autoload
+(defun riece (&optional confirm)
+  "Connect to the IRC server and start chatting.
+If optional argument CONFIRM is non-nil, ask which IRC server to connect.
+If already connected, just pop up the windows."
+  (interactive "P")
+  (riece-read-variables-files
+   (car command-line-args-left))
+  (pop command-line-args-left)
+  (run-hooks 'riece-after-load-startup-hook)
+  (if (riece-server-opened)
+      (riece-configure-windows)
+    (switch-to-buffer (riece-get-buffer-create riece-command-buffer))
+    (unless (eq major-mode 'riece-command-mode)
+      (riece-command-mode))
+    (if (or confirm (null riece-server))
+       (setq riece-server (completing-read "Server: " riece-server-alist)))
+    (if (stringp riece-server)
+       (setq riece-server (riece-server-name-to-server riece-server)))
+    (setq riece-server-process (riece-start-server riece-server))
+    (riece-create-buffers)
+    (riece-configure-windows)
+    (let ((channel-list riece-startup-channel-list))
+      (while channel-list
+       (if (listp (car channel-list))
+           (riece-command-join (car (car channel-list))
+                               (cadr (car channel-list)))
+         (riece-command-join (car channel-list)))
+       (setq channel-list (cdr channel-list))))
+    (run-hooks 'riece-startup-hook)
+    (message "%s" (substitute-command-keys
+                  "Type \\[describe-mode] for help"))))
+
+(defun riece-exit ()
+  (setq riece-server nil)
+  (if riece-save-variables-are-dirty
+      (riece-save-variables-files))
+  (riece-clear-system)
+  (run-hooks 'riece-exit-hook))
+
+(defun riece-command-mode ()
+  "Major mode for Riece.  Normal edit function are available.
+Typing Return or Linefeed enters the current line in the dialogue.
+The following special commands are available:
+For a list of the generic commands type \\[riece-command-generic] ? RET.
+\\{riece-command-mode-map}"
+  (interactive)
+  (kill-all-local-variables)
+
+  (setq major-mode 'riece-command-mode
+       mode-name "Commands"
+       riece-away-indicator "-"
+       riece-freeze-indicator "-"
+       riece-own-freeze-indicator "-"
+       mode-line-buffer-identification
+       (riece-mode-line-buffer-identification
+        '("Riece: "
+          mode-line-modified
+          riece-away-indicator
+          "-- " riece-current-channel " " riece-real-nickname)))
+  (riece-simplify-mode-line-format)
+  (use-local-map riece-command-mode-map)
+
+  (unless riece-command-mode-syntax-table
+    (setq riece-command-mode-syntax-table
+         (copy-syntax-table (syntax-table)))
+    (set-syntax-table riece-command-mode-syntax-table)
+    (mapcar
+     (lambda (c) (modify-syntax-entry c "w"))
+     "^[]{}'`"))
+
+  (run-hooks 'riece-command-mode-hook))
+  
+(defun riece-dialogue-mode ()
+  "Major mode for displaying the IRC dialogue.
+All normal editing commands are turned off.
+Instead, these commands are available:
+\\{riece-dialogue-mode-map}"
+  (kill-all-local-variables)
+
+  (make-local-variable 'riece-freeze)
+  (make-local-variable 'riece-freeze-indicator)
+  (make-local-variable 'riece-own-freeze)
+  (make-local-variable 'riece-own-freeze-indicator)
+  (make-local-variable 'tab-stop-list)
+
+  (setq riece-freeze riece-default-freeze
+       riece-freeze-indicator (if riece-freeze "F" "-")
+       riece-own-freeze riece-default-own-freeze
+       riece-own-freeze-indicator (if riece-own-freeze "M" "-")
+
+       major-mode 'riece-dialogue-mode
+       mode-name "Dialogue"
+       mode-line-buffer-identification
+       (riece-mode-line-buffer-identification
+        '("Riece: "
+          mode-line-modified
+          riece-away-indicator
+          riece-freeze-indicator
+          riece-own-freeze-indicator
+          " " riece-channel-list-indicator " "))
+       buffer-read-only t
+       tab-stop-list riece-tab-stop-list)
+  (riece-simplify-mode-line-format)
+  (use-local-map riece-dialogue-mode-map)
+  (buffer-disable-undo)
+  (run-hooks 'riece-dialogue-mode-hook))
+
+(define-derived-mode riece-others-mode riece-dialogue-mode
+  "Others"
+  "Major mode for displaying the IRC others message except current channel.
+All normal editing commands are turned off.
+Instead, these commands are available:
+\\{riece-others-mode-map}")
+
+(define-derived-mode riece-channel-mode riece-dialogue-mode
+  "Channel"
+  "Major mode for displaying the IRC current channel buffer.
+All normal editing commands are turned off.
+Instead, these commands are available:
+\\{riece-channel-mode-map}"
+  (setq mode-line-buffer-identification
+       (riece-mode-line-buffer-identification
+        '("Riece: "
+          mode-line-modified
+          riece-away-indicator
+          riece-freeze-indicator
+          riece-own-freeze-indicator
+          " "
+          riece-channel-indicator))))
+
+(defun riece-channel-list-mode ()
+  "Major mode for displaying channel list.
+All normal editing commands are turned off."
+  (kill-all-local-variables)
+  (setq major-mode 'riece-channel-list-mode
+        mode-name "Channels"
+       mode-line-buffer-identification
+       (riece-mode-line-buffer-identification '("Riece: "))
+       truncate-lines t
+       buffer-read-only t)
+  (use-local-map riece-channel-list-mode-map)
+  (run-hooks 'riece-channel-list-mode-hook))
+
+(defun riece-user-list-mode ()
+  "Major mode for displaying members in the IRC current channel buffer.
+All normal editing commands are turned off.
+Instead, these commands are available:
+\\{riece-user-list-mode-map}"
+  (kill-all-local-variables)
+  (setq mode-line-modified "--- "
+        major-mode 'riece-user-list-mode
+        mode-name "Riece Channel member"
+       mode-line-buffer-identification
+       (riece-mode-line-buffer-identification
+        '("Riece: " riece-channel-indicator " "))
+       truncate-lines t
+       buffer-read-only t)
+  (if (boundp 'transient-mark-mode)
+      (set (make-local-variable 'transient-mark-mode) t))
+  (use-local-map riece-user-list-mode-map)
+  (run-hooks 'riece-user-list-mode-hook))
+
+(defun riece-create-buffers ()
+  (let ((alist riece-buffer-mode-alist))
+    (while alist
+      (save-excursion
+       (set-buffer (riece-get-buffer-create
+                    (symbol-value (car (car alist)))))
+       (unless (or (null (cdr (car alist)))
+                   (eq major-mode (cdr (car alist))))
+         (funcall (cdr (car alist))))
+       (setq alist (cdr alist))))))
+
+(provide 'riece)
+
+;;; riece.el ends here