Add some require's to suppress compile warning.
[riece] / lisp / riece-alias.el
index 81362e7..aa1266d 100644 (file)
@@ -1,4 +1,4 @@
-;;; riece-alias.el --- define aliases of names
+;;; riece-alias.el --- define aliases for IRC names
 ;; Copyright (C) 1998-2003 Daiki Ueno
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 ;; Boston, MA 02111-1307, USA.
 
-;; This add-on allows you to define aliases for IRC names.
+;;; Commentary:
+
+;; NOTE: This is an add-on module for Riece.
 
-;; To use, add the following line to your ~/.riece/init.el:
-;; (add-to-list 'riece-addons 'riece-alias)
+;; This add-on allows you to define aliases for IRC names.
 
-;; For example, if you want to define an alias `#l' for `#Liece', you
+;; For example, if you want to define an alias `#r' for `#riece', you
 ;; can customize riece-alias-alist as follows:
-;; (setq riece-alias-alist '(("#Liece" . "#l")))
+;; (setq riece-alias-alist '(("#riece" . "#r")))
 
 ;;; Code:
 
@@ -36,7 +37,7 @@
 (require 'riece-signal)
 
 (defgroup riece-alias nil
-  "Define aliases of names"
+  "Aliases of channel/user names."
   :prefix "riece-"
   :group 'riece)
 
@@ -50,7 +51,7 @@
   :type 'boolean
   :group 'riece-alias)
 
-(defcustom riece-alias-alternate-separator nil
+(defcustom riece-alias-alternate-separator "@"
   "A string to separate prefix and server."
   :type '(choice (const nil) string)
   :group 'riece-alias)
@@ -63,7 +64,7 @@
 (defvar riece-alias-enabled nil)
 
 (defconst riece-alias-description
-  "Define aliases of channel/user names")
+  "Define aliases for IRC names.")
 
 (defun riece-alias-abbrev-percent-hack (string)
   (if (string-match (concat "^#\\([^ ]+\\):"
   (if riece-alias-alternate-separator
       (setq string (riece-alias-abbrev-alternate-separator string)))
   (let ((alist riece-alias-alist))
-    (catch 'done
-      (while alist
-       (if (equal (car (car alist)) string)
-           (throw 'done (cdr (car alist))))
-       (setq alist (cdr alist)))
-      string)))
+    (while alist
+      (if (equal (car (car alist)) string)
+         (setq string (cdr (car alist))
+               alist nil)
+       (setq alist (cdr alist)))))
+  (copy-sequence string))
 
 (defun riece-alias-expand-identity-string (string)
   (let ((alist riece-alias-alist))
-    (catch 'done
-      (while alist
-       (if (equal (cdr (car alist)) string)
-           (throw 'done (car (car alist))))
-       (setq alist (cdr alist)))
-      string))
+    (while alist
+      (if (equal (cdr (car alist)) string)
+         (setq string (car (car alist))
+               alist nil)
+       (setq alist (cdr alist)))))
   (if riece-alias-alternate-separator
       (setq string (riece-alias-expand-alternate-separator string)))
   (if riece-alias-enable-percent-hack
-      (setq string (riece-alias-expand-percent-hack string))))
+      (setq string (riece-alias-expand-percent-hack string)))
+  (copy-sequence string))
 
 (defun riece-alias-insinuate ()
   )