Commits

Anonymous committed 805e433

Sync riece with upstream version 2.0.2

Comments (0)

Files changed (35)

 Riece is mainly written by Daiki Ueno <ueno@unixuser.org>.
 
 The development of Riece has started to redesign the Liece IRC client.
-Liece is based on Irchat (version 3.01) which has been distributed
-under GNU General Public License version 1 or later.  Liece was mainly
-written by the same author of Riece.  Tor Lillqvist <tml@iki.fi> is
-the original author of Irchat.  See doc/irchat-copyright.el for the
-original copyright statement of Irchat.
+Liece was mainly written by the same author of Riece.  Liece is based
+on Irchat (version 3.01) which has been distributed under GNU General
+Public License version 1 or later.  Tor Lillqvist <tml@iki.fi> is the
+original author of Irchat.  The current Riece source code, however,
+doesn't contain any code from Irchat.  For the historical reason, the
+original copyright statement of Irchat is filed under
+doc/irchat-copyright.el.
 
 Riece has many code borrowed from other GPL'ed elisp packages such as
 Gnus, Emacs-w3m, ECB, and SEMI.  I would like to thank the developers
 TAKAHASHI Kaoru  <kaoru@kaisei.org>
 OHASHI Akira  <bg66@koka-in.org>
 Yoichi NAKAYAMA  <yoichi@geiin.org>
+Masatake YAMATO <jet@gyve.org> (riece-yank.el)
+Steve Youngs <steve@sxemacs.org> (riece-xfaceb.el)
+2005-11-19  Daiki Ueno  <ueno@unixuser.org>
+
+	* Riece: Version 2.0.2 released.
+	* configure.ac: Bump up version to 2.0.2.
+
+2005-09-29  Daiki Ueno  <ueno@unixuser.org>
+
+	* Riece: Version 2.0.1 released.
+	* configure.ac: Bump up version to 2.0.1.
+
 2005-08-31  Norbert Koch  <viteno@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.20 released.
 # This XEmacs package contains the riece IRC client package
 
 VERSION = 1.20
-AUTHOR_VERSION = 2.0.0
+AUTHOR_VERSION = 2.0.2
 MAINTAINER = Daiki Ueno <ueno@unixuser.org>
 PACKAGE = riece
 PKG_TYPE = regular
-REQUIRES = xemacs-base mail-lib
+REQUIRES = xemacs-base mail-lib bbdb
 CATEGORY = standard
 
 include ../../Local.rules.inc
 
-ELCS = lisp/riece-000.elc lisp/riece-200.elc lisp/riece-300.elc		      \
-	lisp/riece-400.elc lisp/riece-500.elc lisp/riece-addon-modules.elc    \
-	lisp/riece-addon.elc lisp/riece-alias.elc lisp/riece-async.elc	      \
-	lisp/riece-biff.elc lisp/riece-button.elc lisp/riece-channel.elc      \
-	lisp/riece-coding.elc lisp/riece-commands.elc lisp/riece-compat.elc   \
-	lisp/riece-complete.elc lisp/riece-ctcp.elc lisp/riece-ctlseq.elc     \
-	lisp/riece-debug.elc lisp/riece-display.elc lisp/riece-doctor.elc     \
-	lisp/riece-eval-ruby.elc lisp/riece-eval.elc lisp/riece-filter.elc    \
-	lisp/riece-foolproof.elc lisp/riece-globals.elc lisp/riece-google.elc \
-	lisp/riece-guess.elc lisp/riece-handle.elc lisp/riece-hangman.elc     \
-	lisp/riece-highlight.elc lisp/riece-history.elc lisp/riece-icon.elc   \
-	lisp/riece-identity.elc lisp/riece-ignore.elc lisp/riece-irc.elc      \
-	lisp/riece-kakasi.elc lisp/riece-keepalive.elc lisp/riece-keyword.elc \
-	lisp/riece-layout.elc lisp/riece-log.elc lisp/riece-lsdb.elc	      \
-	lisp/riece-menu.elc lisp/riece-message.elc lisp/riece-mini.elc	      \
-	lisp/riece-misc.elc lisp/riece-mode.elc lisp/riece-naming.elc	      \
-	lisp/riece-options.elc lisp/riece-rdcc.elc lisp/riece-ruby.elc	      \
-	lisp/riece-server.elc lisp/riece-shrink-buffer.elc		      \
-	lisp/riece-signal.elc lisp/riece-toolbar.elc lisp/riece-unread.elc    \
-	lisp/riece-url.elc lisp/riece-user.elc lisp/riece-version.elc	      \
-	lisp/riece-xemacs.elc lisp/riece-xface.elc lisp/riece-yank.elc	      \
-	lisp/riece.elc
+ELCS = lisp/riece-000.elc lisp/riece-200.elc lisp/riece-300.elc	      \
+lisp/riece-400.elc lisp/riece-500.elc lisp/riece-addon-modules.elc    \
+lisp/riece-addon.elc lisp/riece-alias.elc lisp/riece-async.elc	      \
+lisp/riece-biff.elc lisp/riece-button.elc lisp/riece-cache.elc	      \
+lisp/riece-channel.elc lisp/riece-coding.elc lisp/riece-commands.elc  \
+lisp/riece-compat.elc lisp/riece-complete.elc lisp/riece-ctcp.elc     \
+lisp/riece-ctlseq.elc lisp/riece-debug.elc lisp/riece-develop.elc     \
+lisp/riece-display.elc lisp/riece-doctor.elc lisp/riece-eval-ruby.elc \
+lisp/riece-eval.elc lisp/riece-filter.elc lisp/riece-foolproof.elc    \
+lisp/riece-globals.elc lisp/riece-google.elc lisp/riece-guess.elc     \
+lisp/riece-handle.elc lisp/riece-hangman.elc lisp/riece-highlight.elc \
+lisp/riece-history.elc lisp/riece-icon.elc lisp/riece-identity.elc    \
+lisp/riece-ignore.elc lisp/riece-irc.elc lisp/riece-kakasi.elc	      \
+lisp/riece-keepalive.elc lisp/riece-keyword.elc lisp/riece-layout.elc \
+lisp/riece-log.elc lisp/riece-lsdb.elc lisp/riece-menu.elc	      \
+lisp/riece-message.elc lisp/riece-mini.elc lisp/riece-misc.elc	      \
+lisp/riece-mode.elc lisp/riece-naming.elc lisp/riece-options.elc      \
+lisp/riece-rdcc.elc lisp/riece-ruby.elc lisp/riece-server.elc	      \
+lisp/riece-shrink-buffer.elc lisp/riece-signal.elc		      \
+lisp/riece-toolbar.elc lisp/riece-unread.elc lisp/riece-url.elc	      \
+lisp/riece-user.elc lisp/riece-version.elc lisp/riece-xemacs.elc      \
+lisp/riece-xface.elc lisp/riece-xfaceb.elc lisp/riece-yank.elc
 
 EXTRA_SOURCES = lisp/riece-emacs.el lisp/riece-ndcc.el \
 	lisp/riece-skk-kakutei.el lisp/url-riece.el
+* Major changes in 2.0.2
+
+** Fixed C-c l (riece-command-list) behavior.  It didn't display
+   channel TOPIC correctly. (ueno)
+
+** Don't alter case of user/channel names when completing user
+   input. (ueno)
+
+* Major changes in 2.0.1
+
+** If there is a message in previously selected channel, Riece 2.0.0
+   doesn't treat it as an unread channel.  2.0.1 fixes it. (ueno)
+
+** New add-on riece-xfaceb.el, which displays X-Face/Colour Face in
+   IRC buffers. (Steve Youngs)
+
 * Major changes in 2.0.0
 
 ** Support multiple coding-systems on a server.
 * For details of changes, see the file ChangeLog.
 
 Local variables:
+mode: text
 mode: outline
 paragraph-separate: "[  
 end:
+* Riece 2.0.2 $B$N<g$JJQ99E@(B
+
+** C-c l (riece-command-list) $B$G!"%A%c%s%M%k$N%H%T%C%/$NBe$o$j$K;22C<T(B
+   $B?t$,I=<($5$l$k%P%0$r=$@5(B (ueno)
+
+** $B%K%C%/%M!<%`$d%A%c%s%M%kL>$NJd408uJd$NI=<($GBgJ8;z>.J8;z$rJ]B8$9$k(B
+   $B$h$&$K$7$?(B (ueno)
+
+* Riece 2.0.1 $B$N<g$JJQ99E@(B
+
+** $BD>A0$KA*Br$7$F$$$?%A%c%s%M%k$KL$FI%a%C%;!<%8$,$"$k>l9g$K(B unread $B%^!<(B
+   $B%/$,I=<($5$l$J$$IT6q9g$N=$@5(B (ueno)
+
+** $B?75,%"%I%*%s(B riece-xfaceb.el $B$rF3F~!#(BBBDB $B$+$i(B X-Face/Face $B$r8!:w$7!"(B
+   $B%f!<%60lMw$KI=<($9$k(B (Steve Youngs)
+
 * Riece 2.0.0 $B$N<g$JJQ99E@(B
 
 ** $B%A%c%s%M%kKh$K%(%s%3!<%G%#%s%0$r;XDj$G$-$k$h$&$K$7$?(B (ueno)
 * For details of changes, see the file ChangeLog.
 
 Local variables:
+mode: text
 mode: outline
 paragraph-separate: "[  
 coding: iso-2022-jp
 AC_INIT
 AC_CONFIG_SRCDIR([configure.ac])
 AC_PREREQ(2.59)
-AM_INIT_AUTOMAKE(riece, 2.0.0)
+AM_INIT_AUTOMAKE(riece, 2.0.2)
 
 AC_CHECK_EMACS
 AC_PATH_LISPDIR
 - <module-name>-insinuate
   Called on initialization of this module.
 
+- <module-name>-uninstall (optional)
+  Called on uninstallation of this module.
+
 - <module-name>-enable (optional)
   Called when this add-on is enabled.
 
 - <$B%b%8%e!<%kL>(B>-insinuate
   $B=i4|2==hM}$r9T$$$^$9(B
 
+- <$B%b%8%e!<%kL>(B>-uninstall ($B%*%W%7%g%s(B)
+  $B%"%I%*%s$r%"%s%$%s%9%H!<%k$9$k$H8F$P$l$^$9(B
+
 - <$B%b%8%e!<%kL>(B>-enable ($B%*%W%7%g%s(B)
   $B%"%I%*%s$NM-8z$K$9$k$H8F$P$l$^$9(B
 

doc/riece-en.texi

 @setfilename riece-en.info
 @settitle Riece -- An IRC client for Emacsen --
 @c %**end of header
-@set VERSION 2.0.0
+@set VERSION 2.0.2
 @c @documentlanguage en
 
 @dircategory GNU Emacs Lisp

doc/riece-ja.texi

 @setfilename riece-ja.info
 @settitle Riece -- An IRC client for Emacsen --
 @c %**end of header
-@set VERSION 2.0.0
+@set VERSION 2.0.2
 @c @documentlanguage ja
 
 @dircategory GNU Emacs Lisp
 		riece-addon-modules
 		riece-addon
 		riece-ruby
+		riece-cache
 
 		riece-mode
 		;; riece-identity -+-> riece-channel
+2005-11-19  Daiki Ueno  <ueno@unixuser.org>
+
+	* Riece: Version 2.0.2 released.
+	* configure.ac: Bump up version to 2.0.2.
+
+2005-11-19  Daiki Ueno  <ueno@unixuser.org>
+
+	* riece-alias.el (riece-alias-alternate-separator): Changed from
+	"@" -> "%".
+
+	* test/test-riece-cache.el: New test cases.
+	* test/Makefile.am (EXTRA_DIST): Added test-riece-cache.el.
+
+	* Makefile.am (EXTRA_DIST): Added riece-cache.el.
+
+	* riece-commands.el (riece-command-part-channel): Signal an error
+	if TARGET server has not opened.
+
+	* riece-channel.el: Require 'riece-cache.
+	(riece-find-channel): Increase priority of given channel name in
+	riece-channel-cache.
+	(riece-forget-channel): Remove given channel name from
+	riece-channel-cache.
+	(riece-get-channel): Register given channel name in
+	riece-channel-cache (if it is being added to riece-channel-obarray.)
+	* riece-server.el (riece-reset-process-buffer): Initialize
+	riece-channel-cache.
+	* riece-options.el (riece-channel-cache-max-size): New user
+	option.
+	* riece-misc.el (riece-get-channels-on-server): Get channel names
+	from riece-channel-cache.
+	* riece-globals.el (riece-channel-cache): New variable.
+
+2005-11-18  Daiki Ueno  <ueno@unixuser.org>
+
+	* riece-cache.el: Renamed from riece-lru.el.
+
+2005-11-18  Daiki Ueno  <ueno@unixuser.org>
+
+	* riece-user.el: Require 'riece-lru.
+	(riece-find-user): Increase priority of given username in
+	riece-user-lru.
+	(riece-forget-user): Remove given username from riece-user-lru.
+	(riece-rename-user): Rename given username in riece-user-lru.
+	(riece-get-user): Register given username in riece-user-lru (if
+	it is being added to riece-user-obarray.)
+	* riece-server.el: Require 'riece-lru.
+	(riece-reset-process-buffer): Initialize riece-user-lru.
+	* riece-options.el (riece-user-lru-max-size): New user option.
+	* riece-misc.el: Require 'riece-lru.
+	(riece-get-users-on-server): Get usernames from riece-user-lru.
+	* riece-globals.el (riece-user-lru): New variable.
+	* COMPILE (riece-modules): Added riece-lru.
+	* riece-lru.el: New file.
+
+	* riece-develop.el: New file.
+
+2005-10-27  Masatake YAMATO  <jet@gyve.org>
+
+	* url-riece.el (url-irc-riece): Use `server-name'
+	to create an argument for `riece-parse-identity'.
+	`server' was used.
+
+2005-09-29  Daiki Ueno  <ueno@unixuser.org>
+
+	* Riece: Version 2.0.1 released.
+	* configure.ac: Bump up version to 2.0.1.
+
+2005-09-11  Daiki Ueno  <ueno@unixuser.org>
+
+	* riece-addon.el (riece-command-list-addons): Adjust width of 2nd
+	column to the length of the longest add-on name.
+
+2005-09-10  Daiki Ueno  <ueno@unixuser.org>
+
+	* riece-alias.el (riece-alias-abbrev-identity-string): Compare car
+	of riece-alias-alist with identities case insensitively.
+
+2005-09-05  Daiki Ueno  <ueno@unixuser.org>
+
+	* Makefile.am (EXTRA_DIST): Added riece-xfaceb.el.
+	* riece-addon-modules.el (riece-addon-modules): Added riece-xfaceb.
+
+2005-09-03  Steve Youngs  <steve@sxemacs.org>
+
+	* riece-xfaceb.el: New file.  Display X-Face and colour Face
+	images in IRC buffer, getting the image data from BBDB records.
+
+2005-08-31  Daiki Ueno  <ueno@unixuser.org>
+
+	* riece-unread.el (riece-unread-requires): Require 'riece-history.
+
 2005-08-29  Daiki Ueno  <ueno@unixuser.org>
 
 	* Riece: Version 2.0.0 released.
 	* test/test-riece-log.el
 	(test-riece-log-display-message-function): Enable riece-log addon.
 
-	* test/test-riece-ruby.el (lunit-test-case-teardown): Rest
+	* test/test-riece-ruby.el (lunit-test-case-teardown): Reset
 	riece-ruby-output-handler-alist and riece-ruby-output-queue-alist.
 
 	* riece-server.el (riece-server-keyword-map): Abolished
 
 EXTRA_DIST = COMPILE ChangeLog ChangeLog.Liece \
 	riece-000.el riece-200.el riece-300.el riece-400.el riece-500.el \
-	riece-addon-modules.el riece-addon.el riece-channel.el \
+	riece-addon-modules.el riece-addon.el riece-cache.el riece-channel.el \
 	riece-coding.el riece-commands.el riece-compat.el riece-complete.el \
 	riece-debug.el riece-display.el riece-emacs.el riece-filter.el \
 	riece-globals.el riece-handle.el riece-highlight.el riece-identity.el \
 	riece-ctlseq.el riece-ignore.el riece-hangman.el riece-biff.el \
 	riece-kakasi.el riece-foolproof.el riece-yank.el riece-toolbar.el \
 	riece-eval.el riece-google.el riece-keepalive.el riece-eval-ruby.el \
-	riece-shrink-buffer.el url-riece.el \
+	riece-shrink-buffer.el riece-xfaceb.el url-riece.el \
 	riece-command-previous-channel.xpm riece-command-next-channel.xpm \
 	riece-submit-bug-report.xpm \
 	server.rb aproxy.rb

lisp/riece-300.el

     (setq parameters (riece-split-parameters
 		      (riece-decoded-string-for-identity decoded
 							 channel-identity))
-	  topic (nth 1 parameters))
+	  topic (nth 2 parameters))
     (riece-channel-set-topic (riece-get-channel channel) topic)
     (riece-insert-info buffer (concat visible " users, topic: " topic "\n"))
     (riece-insert-info

lisp/riece-addon-modules.el

     (riece-unread . "Mark channels where new messages arrived.")
     (riece-url . "Collect URL in IRC buffers.")
     (riece-xface . "Display X-Face in IRC buffers.")
+    (riece-xfaceb . "Display X-Face & Colour Face images in IRC buffers \(BBDB\).")
     (riece-yank . "Enter the element of kill-ring.")))
 
 (provide 'riece-addon-modules)

lisp/riece-addon.el

 	buffer-read-only
 	(pointer riece-addon-dependencies)
 	module-description-alist
-	description point)
+	description point longest)
     (while pointer
       (setq description (intern-soft (concat (symbol-name (car (car pointer)))
 					     "-description"))
       (setq pointer (cdr pointer)))
     (erase-buffer)
     (riece-kill-all-overlays)
+    (setq pointer module-description-alist
+	  longest "")
+    (while pointer
+      (if (> (length (symbol-name (car (car pointer))))
+	     (length longest))
+	  (setq longest (symbol-name (car (car pointer)))))
+      (setq pointer (cdr pointer)))
     (setq pointer (sort module-description-alist
 			(lambda (entry1 entry2)
 			  (string-lessp (symbol-name (car entry1))
 					(symbol-name (car entry2))))))
     (while pointer
       (setq point (point))
-      (insert (format "%c %-15S %s\n"
+      (insert (format (format "%%c %%-%dS %%s\n" (length longest))
 		      (if (not (featurep (car (car pointer))))
 			  ? 
 			(if (not (get (car (car pointer))

lisp/riece-alias.el

   :type 'boolean
   :group 'riece-alias)
 
-(defcustom riece-alias-alternate-separator "@"
+(defcustom riece-alias-alternate-separator "%"
   "A string to separate prefix and server."
   :type '(choice (const nil) string)
   :group 'riece-alias)
       (setq string (riece-alias-abbrev-alternate-separator string)))
   (let ((alist riece-alias-alist))
     (while alist
-      (if (equal (car (car alist)) string)
+      (if (equal (downcase (car (car alist))) (downcase string))
 	  (setq string (cdr (car alist))
 		alist nil)
 	(setq alist (cdr alist)))))
 (defun riece-alias-expand-identity-string (string)
   (let ((alist riece-alias-alist))
     (while alist
-      (if (equal (cdr (car alist)) string)
+      (if (equal (downcase (cdr (car alist))) (downcase string))
 	  (setq string (car (car alist))
 		alist nil)
 	(setq alist (cdr alist)))))

lisp/riece-async.el

 assumed that the file is in the same directory of this file.")
 
 (defvar riece-async-server-program-arguments
-  (list "-s" riece-async-buffer-size
+  (list "-s" (number-to-string riece-async-buffer-size)
 	"-b" riece-async-backup-file)
   "Command line arguments passed to `riece-async-server-program'.")
 

lisp/riece-cache.el

+;;; riece-cache.el --- LRU cache
+;; Copyright (C) 1998-2005 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:
+
+(defun riece-cache-make-node (key value &optional previous next)
+  "Make riece-cache-node object."
+  (vector key value previous next))
+
+(defun riece-cache-node-key (node)
+  "Return key of NODE."
+  (aref node 0))
+
+(defun riece-cache-node-value (node)
+  "Return value of NODE."
+  (aref node 1))
+
+(defun riece-cache-node-set-value (node value)
+  "Set value of NODE to VALUE."
+  (aset node 1 value))
+
+(defun riece-cache-node-next (node)
+  "Return next of NODE."
+  (aref node 3))
+
+(defun riece-cache-node-set-next (node next)
+  "Set next of NODE to NEXT."
+  (aset node 3 next))
+
+(defun riece-cache-node-previous (node)
+  "Return previous of NODE."
+  (aref node 2))
+
+(defun riece-cache-node-set-previous (node previous)
+  "Set previous of NODE to PREVIOUS."
+  (aset node 2 previous))
+
+(defun riece-make-cache (max-length)
+  "Make riece-cache object."
+  (vector max-length (make-vector (* max-length 2) 0) 0 nil nil))
+
+(defun riece-cache-max-length (cache)
+  "Return max-length of CACHE."
+  (aref cache 0))
+
+(defun riece-cache-hash-obarray (cache)
+  "Return hash-obarray of CACHE."
+  (aref cache 1))
+
+(defun riece-cache-hash-length (cache)
+  "Return hash-length of CACHE."
+  (aref cache 2))
+
+(defun riece-cache-set-hash-length (cache hash-length)
+  "Set hash-length of CACHE to HASH-LENGTH."
+  (aset cache 2 hash-length))
+
+(defun riece-cache-first (cache)
+  "Return first of CACHE."
+  (aref cache 3))
+
+(defun riece-cache-set-first (cache first)
+  "Set first of CACHE to FIRST."
+  (aset cache 3 first))
+
+(defun riece-cache-last (cache)
+  "Return last of CACHE."
+  (aref cache 4))
+
+(defun riece-cache-set-last (cache last)
+  "Set last of CACHE to LAST."
+  (aset cache 4 last))
+
+(defun riece-cache-contains (cache key)
+  "Return t if CACHE contains an entry whose key is KEY."
+  (intern-soft key (riece-cache-hash-obarray cache)))
+
+(defun riece-cache-get (cache key)
+  "Return the value associated with KEY in CACHE.
+If KEY is not associated in CACHE, it returns nil."
+  (let ((node (riece-cache-get-node cache key)))
+    (if node
+	(riece-cache-node-value node))))
+
+(defun riece-cache-get-node (cache key)
+  "Return a node object associcated with KEY in CACHE.
+If KEY is not associated in CACHE, it returns nil."
+  (let ((symbol (intern-soft key (riece-cache-hash-obarray cache)))
+	previous next last node)
+    (when symbol
+      (setq node (symbol-value symbol)
+	    previous (riece-cache-node-previous node)
+	    next (riece-cache-node-next node)
+	    last (riece-cache-last cache))
+      (if previous
+	  (riece-cache-node-set-next previous next))
+      (if next
+	  (riece-cache-node-set-previous next previous))
+      (riece-cache-node-set-next node nil)
+      (riece-cache-node-set-previous node last)
+      (riece-cache-node-set-next last node)
+      (riece-cache-set-last cache node)
+      (if (and (eq node (riece-cache-first cache)) next)
+	  (riece-cache-set-first cache next))
+      node)))
+
+(defun riece-cache-delete (cache key)
+  "Remove an entry from CACHE whose key is KEY."
+  (let ((symbol (intern-soft key (riece-cache-hash-obarray cache)))
+	previous next node)
+    (when symbol
+      (setq node (symbol-value symbol)
+	    previous (riece-cache-node-previous node)
+	    next (riece-cache-node-next node))
+      (if previous
+	  (riece-cache-node-set-next previous next))
+      (if next
+	  (riece-cache-node-set-previous next previous))
+      (if (eq (riece-cache-last cache) node)
+	  (riece-cache-set-last cache previous))
+      (if (eq (riece-cache-first cache) node)
+	  (riece-cache-set-first cache next))
+      (unintern symbol (riece-cache-hash-obarray cache))
+      (riece-cache-set-hash-length cache
+				       (1- (riece-cache-hash-length cache)))
+      (riece-cache-node-value node))))
+
+(defun riece-cache-set (cache key value)
+  "Associate KEY with VALUE in CACHE."
+  (let ((node (riece-cache-get-node cache key)))
+    (if node
+	(riece-cache-node-set-value node value)
+      (if (>= (riece-cache-hash-length cache)
+	      (riece-cache-max-length cache))
+	  (riece-cache-delete cache (riece-cache-node-key
+				 (riece-cache-first cache))))
+      (setq node (riece-cache-make-node key value (riece-cache-last cache)))
+      (set (intern key (riece-cache-hash-obarray cache)) node)
+      (riece-cache-set-hash-length cache
+				       (1+ (riece-cache-hash-length cache)))
+      (unless (riece-cache-first cache)
+	(riece-cache-set-first cache node))
+      (when (riece-cache-last cache)
+	(riece-cache-node-set-next (riece-cache-last cache) node)
+	(riece-cache-node-set-previous node (riece-cache-last cache)))
+      (riece-cache-set-last cache node))))
+
+(provide 'riece-cache)
+
+;;; riece-cache.el ends here

lisp/riece-channel.el

 (require 'riece-globals)
 (require 'riece-identity)
 (require 'riece-mode)
+(require 'riece-cache)
 
 ;;; Channel object:
 (defun riece-find-channel (name)
   "Get a channel object named NAME from the server buffer."
+  (riece-cache-get riece-channel-cache name)
   (let ((symbol (intern-soft (riece-identity-canonicalize-prefix name)
 			     riece-channel-obarray)))
     (if symbol
 	(symbol-value symbol))))
 
 (defun riece-forget-channel (name)
+  (riece-cache-delete riece-channel-cache name)
   (let ((symbol (intern-soft (riece-identity-canonicalize-prefix name)
 			     riece-channel-obarray)))
     (when symbol
   (let ((symbol (intern-soft (riece-identity-canonicalize-prefix name)
 			     riece-channel-obarray)))
     (if symbol
-	(symbol-value symbol)
+	(progn
+	  (riece-cache-get riece-channel-cache name)
+	  (symbol-value symbol))
+      (riece-cache-set riece-channel-cache name name)
       (set (intern (riece-identity-canonicalize-prefix name)
 		   riece-channel-obarray)
 	   (riece-make-channel nil nil nil nil nil nil nil)))))

lisp/riece-commands.el

 
 (defun riece-command-part-channel (target message)
   (let ((process (riece-server-process (riece-identity-server target))))
+    (unless process
+      (error "%s" (substitute-command-keys
+		   "Type \\[riece-command-open-server] to open server.")))
     (riece-send-string (if message
 			   (format "PART %s :%s\r\n"
 				   (riece-identity-prefix target)

lisp/riece-develop.el

+(defun riece-insert-struct-template (prefix struct)
+  (interactive "sPrefix: 
+sStruct: ")
+  (let (attributes
+	optional-attributes
+	name
+	pointer
+	arglist
+	strings
+	(index 0))
+    (if (and prefix
+	     (not (string-match "-\\'" prefix)))
+	(setq prefix (concat prefix "-")))
+    (catch 'finish
+      (while t
+	(setq name (read-from-minibuffer "Attribute: "))
+	(if (equal name "")
+	    (throw 'finish nil))
+	(setq attributes
+	      (cons (vector name
+			    (y-or-n-p "Optional? ")
+			    (y-or-n-p "Readable? ")
+			    (y-or-n-p "Writable? "))
+		    attributes))))
+    (setq attributes (nreverse attributes)
+	  pointer (cons (vector "" nil nil nil)  attributes))
+    (while (cdr pointer)
+      (if (aref (car (cdr pointer)) 1)
+	  (progn
+	    (setq optional-attributes (cons (car (cdr pointer))
+					    optional-attributes))
+	    (setcdr pointer (nthcdr 2 pointer)))
+	(setq pointer (cdr pointer))))
+    (setq optional-attributes (nreverse optional-attributes)
+	  arglist (mapconcat (lambda (attribute)
+			       (aref attribute 0))
+			     attributes " "))
+    (if optional-attributes
+	(setq arglist (concat arglist " &optional "
+			      (mapconcat (lambda (attribute)
+					   (aref attribute 0))
+					 optional-attributes " "))))
+    (setq strings (list (format "\
+\(defun %smake-%s (%s)
+  \"Make %s%s object.\"
+  (vector %s))"
+				prefix struct arglist
+				prefix struct
+				(mapconcat (lambda (attribute)
+					     (aref attribute 0))
+					   (append attributes
+						   optional-attributes)
+					   " "))))
+    (setq pointer (append attributes optional-attributes))
+    (while pointer
+      (if (aref (car pointer) 2)
+	  (setq strings (cons (format "\
+\(defun %s%s-%s (%s)
+  \"Return %s of %s.\"
+  (aref %s %d))"
+				      prefix struct (aref (car pointer) 0)
+				      struct
+				      (aref (car pointer) 0)
+				      (upcase struct)
+				      struct index)
+			      strings)))
+      (if (aref (car pointer) 3)
+	  (setq strings (cons (format "\
+\(defun %s%s-set-%s (%s %s)
+  \"Set %s of %s to %s.\"
+  (aset %s %d %s))"
+				      prefix struct (aref (car pointer) 0)
+				      struct (aref (car pointer) 0)
+				      (aref (car pointer) 0)
+				      (upcase struct)
+				      (upcase (aref (car pointer) 0))
+				      struct index (aref (car pointer) 0))
+			      strings)))
+      (setq pointer (cdr pointer)
+	    index (1+ index)))
+    (insert (mapconcat #'identity (nreverse strings) "\n\n"))))

lisp/riece-globals.el

 (defvar riece-coding-system nil
   "Coding system for process I/O.
 Local to the server buffers.")
+(defvar riece-channel-cache nil
+  "Cache of channel names.
+Local to the server buffers.")
+(defvar riece-user-cache nil
+  "Cache of usernames.
+Local to the server buffers.")
 
 ;;; Variables local to the channel buffers:
 (defvar riece-freeze nil

lisp/riece-irc.el

 		      (quit
 		       (if (equal server-name "")
 			   (message "Password: Quit")
-			 (message "Password for %s: " server-name))
+			 (message "Password for %s: Quit" server-name))
 		       'quit)))
 	    (setq riece-reconnect-with-password nil)))
       (if (eq password 'quit)

lisp/riece-misc.el

 (require 'riece-server)
 (require 'riece-user)
 (require 'riece-mode)
+(require 'riece-cache)
 
 (defun riece-get-buffer-create (name &optional init-major-mode)
   (let ((buffer (get-buffer name)))
 	 (setq identities
 	       (cons (riece-make-identity (symbol-name user) server-name)
 		     identities)))
-       riece-user-obarray)
+       (riece-cache-hash-obarray riece-user-cache))
       identities)))
 
 (defun riece-get-channels-on-server (server-name)
 	 (setq identities
 	       (cons (riece-make-identity (symbol-name channel) server-name)
 		     identities)))
-       riece-channel-obarray)
+       (riece-cache-hash-obarray riece-channel-cache))
       identities)))
 
 (defun riece-get-identities-on-server (server-name)

lisp/riece-options.el

   :type 'function
   :group 'riece-server)
 
+(defcustom riece-user-cache-max-size 512
+  "Maximum size of cache of usernames."
+  :type 'integer
+  :group 'riece-server)
+
+(defcustom riece-channel-cache-max-size 512
+  "Maximum size of cache of channel names."
+  :type 'integer
+  :group 'riece-server)
+
 (defcustom riece-channel-buffer-mode t
   "When non-nil, Riece will display a channel buffer."
   :type 'boolean

lisp/riece-server.el

 (require 'riece-coding)			;riece-default-coding-system
 (require 'riece-identity)
 (require 'riece-compat)
+(require 'riece-cache)
 
 (eval-and-compile
   (defvar riece-server-keyword-map
   (let* ((server-name (if identity
 			  (riece-identity-server identity)
 			(riece-current-server-name)))
-	 (process (riece-server-process server-name))
-	 coding-system)
+	 (process (riece-server-process server-name)))
     (unless process
       (error "%s" (substitute-command-keys
 		   "Type \\[riece-command-open-server] to open server.")))
     (make-local-variable 'riece-channel-obarray)
     (setq riece-channel-obarray (make-vector riece-channel-obarray-size 0))
     (make-local-variable 'riece-coding-system)
+    (make-local-variable 'riece-channel-cache)
+    (setq riece-channel-cache (riece-make-cache riece-channel-cache-max-size))
+    (make-local-variable 'riece-user-cache)
+    (setq riece-user-cache (riece-make-cache riece-user-cache-max-size))
     (buffer-disable-undo)
     (erase-buffer)))
 

lisp/riece-unread.el

   (let (requires)
     (if (memq 'riece-highlight riece-addons)
 	(setq requires (cons 'riece-highlight requires)))
+    ;; To override riece-history's channel mark in the channel list buffer.
+    (if (memq 'riece-history riece-addons)
+	(setq requires (cons 'riece-history requires)))
 ;;;    (if (memq 'riece-guess riece-addons)
 ;;;	(setq requires (cons 'riece-guess requires)))
     requires))

lisp/riece-user.el

 
 (require 'riece-identity)
 (require 'riece-mode)
+(require 'riece-cache)
 
 ;;; User object:
 (defun riece-find-user (name)
   "Get a user object named NAME from the server buffer."
+  (riece-cache-get riece-user-cache name)
   (let ((symbol (intern-soft (riece-identity-canonicalize-prefix name)
 			     riece-user-obarray)))
-     (if symbol
-	 (symbol-value symbol))))
+    (if symbol
+	(symbol-value symbol))))
 
 (defun riece-forget-user (name)
+  (riece-cache-delete riece-user-cache name)
   (let ((symbol (intern-soft (riece-identity-canonicalize-prefix name))))
     (when symbol
       (makunbound symbol)
       (unintern (symbol-name symbol) riece-user-obarray))))
 
 (defun riece-rename-user (old-name new-name)
+  (riece-cache-delete riece-user-cache old-name)
+  (riece-cache-set riece-user-cache new-name new-name)
   (unless (equal (riece-identity-canonicalize-prefix old-name)
 		 (riece-identity-canonicalize-prefix new-name))
     (let ((symbol (intern-soft (riece-identity-canonicalize-prefix old-name)
   (let ((symbol (intern-soft (riece-identity-canonicalize-prefix name)
 			     riece-user-obarray)))
      (if symbol
-	 (symbol-value symbol)
+	 (progn
+	   (riece-cache-get riece-user-cache name)
+	   (symbol-value symbol))
+       (riece-cache-set riece-user-cache name name)
        (set (intern (riece-identity-canonicalize-prefix name)
 		    riece-user-obarray)
 	    (riece-make-user nil nil nil nil nil)))))

lisp/riece-version.el

 
 (defconst riece-product-name "Riece")
 
-(defconst riece-version-number "2.0.0"
+(defconst riece-version-number "2.0.2"
   "Version number for this version of Riece.")
 
 (defconst riece-version (format "Riece v%s" riece-version-number)

lisp/riece-xfaceb.el

+;;; riece-xfaceb.el --- display X-Face/Colour Face in IRC buffers
+;; Copyright (C) 2005 Daiki Ueno
+
+;; Author: Steve Youngs <steve@sxemacs.org>
+;; Created: 2005-09-03
+;; 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.
+
+;;; Commentary:
+
+;; NOTE: This is an add-on module for Riece.  It is adapted from
+;; `riece-xface' but gets the image data from BBDB instead of LSDB.
+
+;; This add-on displays either X-Face or colour Face images in the
+;; Riece "Users" buffers.  The image data comes from entries in a BBDB
+;; db.  Consequently it does require a little setting up in BBDB...
+
+;; BBDB Setup:
+
+;; You need a new field called "ircnick" for each IRC contact that is
+;; in your BBDB.  Its value is the IRC nickname of the contact (what
+;; is listed in the Riece "Users" buffer).
+
+;;   M-x bbdb-insert-new-field RET ircnick RET
+;;   answer `yes' to the prompt about the field not being defined
+;;   then give it a value which will be that record's IRC nickname
+
+;; Then you'll need to collect X-Face: and Face: headers from your mail.
+;; To do that see: <http://www.emacswiki.org/cgi-bin/wiki/BbdbFaces>
+
+;;; Code:
+
+(require 'riece-identity)
+(require 'riece-globals)
+(require 'riece-display)
+
+(ignore-errors
+  (autoload 'bbdb-records "bbdb")
+  (autoload 'bbdb-record-getprop "bbdb"))
+
+(defconst riece-xfaceb-description
+  "Display X-Face & Colour Face images in IRC buffers \(BBDB\).")
+
+(defcustom riece-xfaceb-prefer-cface-to-xface (featurep 'png)
+  "*When non-nil, display colour face images instead of X-Face."
+  :type 'boolean
+  :group 'riece-looks)
+
+(defun riece-xfaceb-face-to-png (face)
+  "Base64 decode a Face header into a PNG.
+Returns a string."
+  (with-temp-buffer
+    (insert face)
+    (base64-decode-region (point-min) (point-max))
+    (buffer-string)))
+
+(defun riece-xfaceb-update-user-list-buffer ()
+  "Add X-Face or Colour Face images to channel users' buffer."
+  (when (get 'riece-xfaceb 'riece-addon-enabled)
+    (let ((users (ignore-errors 
+		   (riece-with-server-buffer
+		       (riece-identity-server riece-current-channel)
+		     (riece-channel-get-users (riece-identity-prefix
+					       riece-current-channel)))))
+	  all-records cface xface nick name record)
+      (while users
+	(setq name (caar users))
+	(setq all-records (bbdb-records))
+	(while all-records
+	  (setq record (car all-records)
+		nick (bbdb-record-getprop record 'ircnick)
+		xface (bbdb-record-getprop record 'face)
+		cface (bbdb-record-getprop record 'cface))
+	  (when (and (equal nick name)
+		     (or xface cface))
+	    (with-current-buffer riece-user-list-buffer
+	      (goto-char (point-min))
+	      (re-search-forward (regexp-quote name) nil t)
+	      (beginning-of-line)
+	      (when (and xface
+			 (or (not riece-xfaceb-prefer-cface-to-xface)
+			     (not cface)))
+		(set-extent-begin-glyph
+		 (extent-at (point))
+		 (make-glyph (list (vector 'xface
+					   :data (concat "X-Face: " xface)
+					   :foreground "black"
+					   :background "white")))))
+	      (when (and (featurep 'png)
+			 riece-xfaceb-prefer-cface-to-xface
+			 cface)
+		(set-extent-begin-glyph
+		 (extent-at (point))
+		 (make-glyph (list (vector 'png
+					   :data (riece-xfaceb-face-to-png cface)))))))
+	    ;; We have a match, get out of the inner loop
+	    (setq all-records nil))
+	  (setq all-records (cdr all-records)))
+	(setq users (cdr users))))))
+
+(defun riece-xfaceb-requires ()
+  )
+
+(defun riece-xfaceb-user-list-mode-hook ()
+  (add-hook 'riece-update-buffer-functions
+	    'riece-xfaceb-update-user-list-buffer t t))
+
+(defun riece-xfaceb-insinuate ()
+  (if riece-user-list-buffer
+      (with-current-buffer riece-user-list-buffer
+	(riece-xfaceb-user-list-mode-hook)))
+  (add-hook 'riece-user-list-mode-hook
+	    'riece-xfaceb-user-list-mode-hook))
+
+(defun riece-xfaceb-uninstall ()
+  (if riece-user-list-buffer
+      (with-current-buffer riece-user-list-buffer
+	(remove-hook 'riece-update-buffer-functions
+		     'riece-xfaceb-update-user-list-buffer t)))
+  (remove-hook 'riece-user-list-mode-hook
+	       'riece-xfaceb-user-list-mode-hook))
+
+(defun riece-xfaceb-enable ()
+  (if riece-current-channel
+      (riece-emit-signal 'user-list-changed riece-current-channel)))
+
+(defun riece-xfaceb-disable ()
+  (if riece-current-channel
+      (riece-emit-signal 'user-list-changed riece-current-channel)))
+
+(provide 'riece-xfaceb)
+
+;;; riece-xfaceb.el ends here
+

lisp/test/Makefile.am

 EXTRA_DIST = luna.el lunit.el lunit-report.el \
-	test-riece-addon.el test-riece-alias.el \
+	test-riece-addon.el test-riece-alias.el test-riece-cache.el \
 	test-riece-eval.el test-riece-log.el test-riece-shrink-buffer.el \
 	test-riece-url.el test-riece-yank.el

lisp/test/test-riece-cache.el

+(require 'riece-cache)
+
+(luna-define-class test-riece-cache (lunit-test-case))
+
+(luna-define-method test-riece-cache-get-set ((case test-riece-cache))
+  (let ((cache (riece-make-cache 3)))
+    (riece-cache-set cache "0" 0)
+    (lunit-assert-2
+     case
+     (= (riece-cache-get cache "0") 0))))
+
+(luna-define-method test-riece-cache-set-overflow ((case test-riece-cache))
+  (let ((cache (riece-make-cache 3)))
+    (riece-cache-set cache "0" 0)
+    (lunit-assert-2
+     case
+     (= (riece-cache-hash-length cache)	1))
+    (riece-cache-set cache "1" 1)
+    (lunit-assert-2
+     case
+     (= (riece-cache-hash-length cache)	2))
+    (riece-cache-set cache "2" 2)
+    (lunit-assert-2
+     case
+     (= (riece-cache-hash-length cache)	3))
+    (riece-cache-set cache "3" 3)
+    (lunit-assert-2
+     case
+     (= (riece-cache-hash-length cache)	3))
+    (lunit-assert-2
+     case
+     (null (riece-cache-get cache "0")))))
+
+(luna-define-method test-riece-cache-get-increase-key ((case test-riece-cache))
+  (let ((cache (riece-make-cache 3)))
+    (riece-cache-set cache "0" 0)
+    (riece-cache-set cache "1" 1)
+    (riece-cache-set cache "2" 2)
+    (lunit-assert-2
+     case
+     (equal (riece-cache-node-key (riece-cache-first cache)) "0"))
+    (lunit-assert-2
+     case
+     (equal (riece-cache-node-key (riece-cache-last cache)) "2"))
+    (riece-cache-get cache "1")
+    (lunit-assert-2
+     case
+     (equal (riece-cache-node-key (riece-cache-last cache)) "1"))))
+
+(luna-define-method test-riece-cache-delete ((case test-riece-cache))
+  (let ((cache (riece-make-cache 3)))
+    (riece-cache-set cache "0" 0)
+    (riece-cache-set cache "1" 1)
+    (riece-cache-set cache "2" 2)
+    (riece-cache-delete cache "1")
+    (lunit-assert-2
+     case
+     (= (riece-cache-hash-length cache) 2))
+    (lunit-assert-2
+     case
+     (null (riece-cache-get cache "1")))
+    (riece-cache-set cache "1" 1)
+    (riece-cache-delete cache "0")
+    (lunit-assert-2
+     case
+     (= (riece-cache-hash-length cache) 2))
+    (lunit-assert-2
+     case
+     (null (riece-cache-get cache "0")))
+    (riece-cache-set cache "0" 0)
+    (riece-cache-delete cache "2")
+    (lunit-assert-2
+     case
+     (= (riece-cache-hash-length cache) 2))
+    (lunit-assert-2
+     case
+     (null (riece-cache-get cache "2")))))

lisp/url-riece.el

-;;; url-riece --- Adapting `riece' to `url-irc'
+;;; url-riece.el --- Adapting `riece' to `url-irc'
 ;; Copyright (C) 2004 Masatake YAMATO
 
 ;; Author: Masatake YAMATO <jet@gyve.org>
 	(riece-command-join 
 	 (riece-parse-identity (if (string= server-name "")
 				   channel
-				 (format "%s %s" channel server)))))
+				 (format "%s %s" channel server-name)))))
       ;; Show the windows
       (riece)))))
 ; (url-irc-riece "localhost" nil "#mandara" "jetgx" nil)
    filename FILENAME
    md5sum MD5SUM
    size SIZE
-   provides (riece-compat riece-xemacs riece-globals riece-options riece-debug riece-version riece-coding riece-complete riece-addon-modules riece-addon riece-ruby riece-mode riece-identity riece-channel riece-user riece-misc riece-signal riece-layout riece-display riece-server riece-naming riece-message riece-filter riece-handle riece-000 riece-200 riece-300 riece-400 riece-500 riece-commands riece-irc riece riece-alias riece-async riece-biff riece-button riece-ctcp riece-ctlseq riece-doctor riece-eval-ruby riece-eval riece-foolproof riece-google riece-guess riece-hangman riece-highlight riece-history riece-icon riece-ignore riece-kakasi riece-keepalive riece-keyword riece-log riece-lsdb riece-menu riece-mini riece-rdcc riece-shrink-buffer riece-skk-kakutei riece-toolbar riece-unread riece-url riece-xface riece-yank)
+   provides (riece-compat riece-xemacs riece-globals riece-options riece-debug riece-version riece-coding riece-complete riece-addon-modules riece-addon riece-ruby riece-cache riece-mode riece-identity riece-channel riece-user riece-misc riece-signal riece-layout riece-display riece-server riece-naming riece-message riece-filter riece-handle riece-000 riece-200 riece-300 riece-400 riece-500 riece-commands riece-irc riece riece-alias riece-async riece-biff riece-button riece-ctcp riece-ctlseq riece-doctor riece-eval-ruby riece-eval riece-foolproof riece-google riece-guess riece-hangman riece-highlight riece-history riece-icon riece-ignore riece-kakasi riece-keepalive riece-keyword riece-log riece-lsdb riece-menu riece-mini riece-rdcc riece-shrink-buffer riece-skk-kakutei riece-toolbar riece-unread riece-url riece-xface riece-xfaceb riece-yank)
    requires (REQUIRES)
    type regular
 ))