+2005-11-19 Daiki Ueno <ueno@unixuser.org>
+
+ * 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.
(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
- is being added to riece-user-obarray.)
-
+ 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.
(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)))))
(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.")
(setq identities
(cons (riece-make-identity (symbol-name channel) server-name)
identities)))
- riece-channel-obarray)
+ (riece-cache-map-hash-obarray riece-channel-cache))
identities)))
(defun riece-get-identities-on-server (server-name)
: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
(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)
(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)