+2003-12-17 Daiki Ueno <ueno@unixuser.org>
+
+ * 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 <ueno@unixuser.org>
* riece-options.el: Require 'riece-version.
(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))
(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."
(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