From a6e0f1fa2e9cddd05d119dd4657b20f587998254 Mon Sep 17 00:00:00 2001 From: ueno Date: Wed, 17 Dec 2003 00:28:04 +0000 Subject: [PATCH] * riece-identity.el: Don't require 'riece-compat. (riece-identity-prefix-case-table): Abolish. (riece-identity-prefix-case-pair-alist): New constant. (riece-identity-canonicalize-prefix): Don't use case-table. * riece-emacs.el (riece-set-case-syntax-pair): Abolish. (riece-copy-case-table): Abolish. * riece-xmacs.el (riece-set-case-syntax-pair): Abolish. (riece-copy-case-table): Abolish. --- lisp/ChangeLog | 12 ++++++++++++ lisp/riece-emacs.el | 6 ------ lisp/riece-identity.el | 45 ++++++++++++++++++++++----------------------- lisp/riece-xemacs.el | 17 ----------------- 4 files changed, 34 insertions(+), 46 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9c4371d..64bd3e8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,15 @@ +2003-12-17 Daiki Ueno + + * riece-identity.el: Don't require 'riece-compat. + (riece-identity-prefix-case-table): Abolish. + (riece-identity-prefix-case-pair-alist): New constant. + (riece-identity-canonicalize-prefix): Don't use case-table. + + * riece-emacs.el (riece-set-case-syntax-pair): Abolish. + (riece-copy-case-table): Abolish. + * riece-xmacs.el (riece-set-case-syntax-pair): Abolish. + (riece-copy-case-table): Abolish. + 2003-12-15 Daiki Ueno * riece-options.el: Require 'riece-version. diff --git a/lisp/riece-emacs.el b/lisp/riece-emacs.el index bb03c31..825ee57 100644 --- a/lisp/riece-emacs.el +++ b/lisp/riece-emacs.el @@ -24,12 +24,6 @@ ;;; Code: -(defalias 'riece-set-case-syntax-pair - 'set-case-syntax-pair) - -(defalias 'riece-copy-case-table - 'copy-case-table) - ;;; stolen (and renamed) from gnus-ems.el. ;;; In GNU Emacs, user can intercept whole mouse tracking events by ;;; assigning [mouse-X]. In XEmacs, however, which causes different diff --git a/lisp/riece-identity.el b/lisp/riece-identity.el index f7a48cb..89e0e21 100644 --- a/lisp/riece-identity.el +++ b/lisp/riece-identity.el @@ -26,19 +26,22 @@ (require 'riece-globals) (require 'riece-coding) -(require 'riece-compat) ;riece-set-case-syntax-pair (defvar riece-abbrev-identity-string-function nil) (defvar riece-expand-identity-string-function nil) -(defvar riece-identity-prefix-case-table - (let ((table (riece-copy-case-table (standard-case-table)))) - (riece-set-case-syntax-pair ?\[ ?{ table) - (riece-set-case-syntax-pair ?\] ?} table) - (riece-set-case-syntax-pair ?\\ ?| table) - (riece-set-case-syntax-pair ?~ ?^ table) - table)) - +(defconst riece-identity-prefix-case-pair-alist + '((?\[ . ?{) + (?\] . ?}) + (?\\ . ?|) + (?~ . ?^)) + "An alist used to canonicalize identity-prefix. +RFC2812, 2.2 \"Character codes\" says: + Because of IRC's Scandinavian origin, the characters {}|^ are + considered to be the lower case equivalents of the characters []\~, + respectively. This is a critical issue when determining the + equivalence of two nicknames or channel names.") + (defun riece-identity-prefix (identity) "Return the component sans its server from IDENTITY." (aref identity 0)) @@ -61,20 +64,16 @@ (riece-identity-server ident2)))) (defun riece-identity-canonicalize-prefix (prefix) - "Canonicalize identity PREFIX. -This function downcases PREFIX with Scandinavian alphabet rule. - -RFC2812, 2.2 \"Character codes\" says: - Because of IRC's Scandinavian origin, the characters {}|^ are - considered to be the lower case equivalents of the characters []\~, - respectively. This is a critical issue when determining the - equivalence of two nicknames or channel names." - (let ((old-table (current-case-table))) - (unwind-protect - (progn - (set-case-table riece-identity-prefix-case-table) - (downcase prefix)) - (set-case-table old-table)))) + "Canonicalize identity PREFIX." + (let ((i 0) + c) + (setq prefix (copy-sequence prefix)) + (while (< i (length prefix)) + (if (setq c (cdr (assq (aref prefix i) + riece-identity-prefix-case-pair-alist))) + (aset prefix i c)) + (setq i (1+ i))) + prefix)) (defun riece-identity-equal-no-server (prefix1 prefix2) "Return t, if IDENT1 and IDENT2 is equal without server part." diff --git a/lisp/riece-xemacs.el b/lisp/riece-xemacs.el index d1ea150..1bab726 100644 --- a/lisp/riece-xemacs.el +++ b/lisp/riece-xemacs.el @@ -49,23 +49,6 @@ (defalias 'riece-simplify-mode-line-format 'riece-xemacs-simplify-modeline-format) -(if (fboundp 'put-case-table-pair) - (defalias 'riece-set-case-syntax-pair - 'put-case-table-pair) - ;; In XEmacs 21.1, case-table is a list of strings. - (defun riece-set-case-syntax-pair (uc lc case-table) - (aset (car case-table) (char-to-int uc) lc) - (if (nth 1 case-table) - (aset (nth 1 case-table) (char-to-int lc) uc)) - (if (nth 2 case-table) - (aset (nth 2 case-table) (char-to-int uc) lc)))) - -(if (fboundp 'copy-case-table) - (defalias 'riece-copy-case-table 'copy-case-table) - ;; In XEmacs 21.1, case-table is a list of strings. - (defun riece-copy-case-table (case-table) - (mapcar #'copy-sequence case-table))) - ;;; stolen (and renamed) from gnus-xmas.el. ;;; In GNU Emacs, user can intercept whole mouse tracking events by ;;; assigning [mouse-X]. In XEmacs, however, which causes different -- 1.7.10.4