From ecd0d989963e5405b6ebf7ba77d3e42b0b4510eb Mon Sep 17 00:00:00 2001 From: kaoru Date: Fri, 25 Feb 2005 19:17:16 +0000 Subject: [PATCH] * riece-globals.el (riece-obarray-size, riece-obarray): Abolish. (riece-channel-obarray-size, riece-user-obarray-size) (riece-channel-obaary, riece-user-obarray): New variables. * riece-user.el (riece-find-user, riece-forget-user) (riece-rename-user, riece-get-user): Use `riece-user-obarray' instead of `riece-user-obarray'. * riece-channel.el (riece-find-channel, riece-forget-channel) (riece-get-channel): Use `riece-channel-obarray' instead of `riece-obarray'. * riece-misc.el (riece-get-identities-on-server): Ditto. * riece-server.el (riece-reset-process-buffer): Ditto. --- lisp/ChangeLog | 14 ++++++++++++++ lisp/riece-channel.el | 10 +++++----- lisp/riece-globals.el | 14 ++++++++++---- lisp/riece-misc.el | 12 +++++++++--- lisp/riece-server.el | 6 ++++-- lisp/riece-user.el | 14 +++++++------- 6 files changed, 49 insertions(+), 21 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0ca347c..a43c610 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,17 @@ +2005-02-25 TAKAHASHI Kaoru + + * riece-globals.el (riece-obarray-size, riece-obarray): Abolish. + (riece-channel-obarray-size, riece-user-obarray-size) + (riece-channel-obaary, riece-user-obarray): New variables. + * riece-user.el (riece-find-user, riece-forget-user) + (riece-rename-user, riece-get-user): Use `riece-user-obarray' + instead of `riece-user-obarray'. + * riece-channel.el (riece-find-channel, riece-forget-channel) + (riece-get-channel): Use `riece-channel-obarray' instead of + `riece-obarray'. + * riece-misc.el (riece-get-identities-on-server): Ditto. + * riece-server.el (riece-reset-process-buffer): Ditto. + 2005-02-24 Daiki Ueno * riece-unread.el (riece-unread-after-switch-to-channel-function): diff --git a/lisp/riece-channel.el b/lisp/riece-channel.el index a59b7ed..2536e5b 100644 --- a/lisp/riece-channel.el +++ b/lisp/riece-channel.el @@ -33,16 +33,16 @@ (defun riece-find-channel (name) "Get a channel object named NAME from the server buffer." (let ((symbol (intern-soft (riece-identity-canonicalize-prefix name) - riece-obarray))) + riece-channel-obarray))) (if symbol (symbol-value symbol)))) (defun riece-forget-channel (name) (let ((symbol (intern-soft (riece-identity-canonicalize-prefix name) - riece-obarray))) + riece-channel-obarray))) (when symbol (makunbound symbol) - (unintern (symbol-name symbol) riece-obarray)))) + (unintern (symbol-name symbol) riece-channel-obarray)))) (defun riece-make-channel (users topic modes banned invited uninvited key) "Make an instance of channel object. @@ -53,11 +53,11 @@ respectively." (defun riece-get-channel (name) (let ((symbol (intern-soft (riece-identity-canonicalize-prefix name) - riece-obarray))) + riece-channel-obarray))) (if symbol (symbol-value symbol) (set (intern (riece-identity-canonicalize-prefix name) - riece-obarray) + riece-channel-obarray) (riece-make-channel nil nil nil nil nil nil nil))))) (defun riece-channel-users (channel) diff --git a/lisp/riece-globals.el b/lisp/riece-globals.el index a4addfa..56fb58b 100644 --- a/lisp/riece-globals.el +++ b/lisp/riece-globals.el @@ -65,8 +65,11 @@ (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.") +(defvar riece-user-obarray-size 1327 + "The size of obarray used by riece on username space.") + +(defvar riece-channel-obarray-size 103 + "The size of obarray used by riece on channelname space.") ;;; Variables local to the server buffers: (defvar riece-server-name nil @@ -117,8 +120,11 @@ Local to the server buffers.") (defvar riece-last-send-time nil "Timestamp of the last send. Local to the server buffers.") -(defvar riece-obarray nil - "Namespace of the IRC world. +(defvar riece-user-obarray nil + "USER namespace of the IRC world. +Local to the server buffers.") +(defvar riece-channel-obarray nil + "Channel namespace of the IRC world. Local to the server buffers.") (defvar riece-coding-system nil "Coding system for process I/O. diff --git a/lisp/riece-misc.el b/lisp/riece-misc.el index 2e2a912..bc1e2c9 100644 --- a/lisp/riece-misc.el +++ b/lisp/riece-misc.el @@ -223,11 +223,17 @@ (riece-with-server-buffer server-name (let (identities) (mapatoms - (lambda (atom) + (lambda (channel) (setq identities - (cons (riece-make-identity (symbol-name atom) server-name) + (cons (riece-make-identity (symbol-name channel) server-name) identities))) - riece-obarray) + riece-channel-obarray) + (mapatoms + (lambda (user) + (setq identities + (cons (riece-make-identity (symbol-name user) server-name) + identities))) + riece-user-obarray) identities))) (defun riece-check-channel-commands-are-usable (&optional channel) diff --git a/lisp/riece-server.el b/lisp/riece-server.el index 39c1610..3204193 100644 --- a/lisp/riece-server.el +++ b/lisp/riece-server.el @@ -259,8 +259,10 @@ the `riece-server-keyword-map' variable." (setq riece-send-size 0) (make-local-variable 'riece-last-send-time) (setq riece-last-send-time '(0 0 0)) - (make-local-variable 'riece-obarray) - (setq riece-obarray (make-vector riece-obarray-size 0)) + (make-local-variable 'riece-user-obarray) + (setq riece-user-obarray (make-vector riece-user-obarray-size 0)) + (make-local-variable 'riece-channel-obarray) + (setq riece-channel-obarray (make-vector riece-channel-obarray-size 0)) (make-local-variable 'riece-coding-system) (buffer-disable-undo) (erase-buffer))) diff --git a/lisp/riece-user.el b/lisp/riece-user.el index 8a3f974..9ad4ee1 100644 --- a/lisp/riece-user.el +++ b/lisp/riece-user.el @@ -30,7 +30,7 @@ (defun riece-find-user (name) "Get a user object named NAME from the server buffer." (let ((symbol (intern-soft (riece-identity-canonicalize-prefix name) - riece-obarray))) + riece-user-obarray))) (if symbol (symbol-value symbol)))) @@ -38,19 +38,19 @@ (let ((symbol (intern-soft (riece-identity-canonicalize-prefix name)))) (when symbol (makunbound symbol) - (unintern (symbol-name symbol) riece-obarray)))) + (unintern (symbol-name symbol) riece-user-obarray)))) (defun riece-rename-user (old-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) - riece-obarray))) + riece-user-obarray))) (when symbol (set (intern (riece-identity-canonicalize-prefix new-name) - riece-obarray) + riece-user-obarray) (symbol-value symbol)) (makunbound symbol) - (unintern (symbol-name symbol) riece-obarray))))) + (unintern (symbol-name symbol) riece-user-obarray))))) (defun riece-make-user (channels user-at-host modes away operator) "Make an instance of user object. @@ -60,11 +60,11 @@ away status, respectively." (defun riece-get-user (name) (let ((symbol (intern-soft (riece-identity-canonicalize-prefix name) - riece-obarray))) + riece-user-obarray))) (if symbol (symbol-value symbol) (set (intern (riece-identity-canonicalize-prefix name) - riece-obarray) + riece-user-obarray) (riece-make-user nil nil nil nil nil))))) (defun riece-user-channels (user) -- 1.7.10.4