2004-11-05 Daiki Ueno <ueno@unixuser.org>
+ * riece-alias.el (riece-alias-alternate-separator): New user
+ option.
+ (riece-alias-use-atmark): Abolished.
+ (riece-alias-escape-alternate-separator): Renamed from
+ riece-alias-escape-atmark; use riece-alias-alternate-separator
+ instead of hard-coded "@".
+ (riece-alias-abbrev-alternate-separator): Renamed from
+ riece-alias-abbrev-atmark; use riece-alias-alternate-separator
+ instead of hard-coded "@".
+ (riece-alias-expand-alternate-separator): Renamed from
+ riece-alias-expand-atmark; use riece-alias-alternate-separator
+ instead of hard-coded "@".
+
+2004-11-05 Daiki Ueno <ueno@unixuser.org>
+
* riece-alias.el (riece-alias-abbrev-atmark): Don't append "@" to
a channel on default server.
:type 'boolean
:group 'riece-alias)
-(defcustom riece-alias-use-atmark nil
- "If non-nil, use atmark to separate prefix and server."
- :type 'boolean
+(defcustom riece-alias-alternate-separator nil
+ "A string to separate prefix and server."
+ :type '(choice (const nil) string)
:group 'riece-alias)
(defcustom riece-alias-alist nil
nil nil string)
string))
-(defun riece-alias-escape-atmark (string)
+(defun riece-alias-escape-alternate-separator (string)
(let ((index 0))
- (while (string-match "@" string index)
+ (while (string-match (regexp-quote riece-alias-alternate-separator)
+ string index)
(setq index (1+ (match-end 0))
- string (replace-match "@@" nil nil string)))
+ string (replace-match (concat riece-alias-alternate-separator
+ riece-alias-alternate-separator)
+ nil t string)))
string))
-(defun riece-alias-abbrev-atmark (string)
+(defun riece-alias-abbrev-alternate-separator (string)
(if (string-match " " string)
(let ((prefix (substring string 0 (match-beginning 0)))
(server (substring string (match-end 0))))
- (concat (riece-alias-escape-atmark prefix) "@"
- (riece-alias-escape-atmark server)))
- (riece-alias-escape-atmark string)))
+ (concat (riece-alias-escape-alternate-separator prefix)
+ riece-alias-alternate-separator
+ (riece-alias-escape-alternate-separator server)))
+ (riece-alias-escape-alternate-separator string)))
-(defun riece-alias-expand-atmark (string)
+(defun riece-alias-expand-alternate-separator (string)
(let ((index 0)
prefix
server
length)
(while (and (null prefix)
- (string-match "@+" string index))
+ (string-match
+ (concat (regexp-quote riece-alias-alternate-separator) "+")
+ string index))
(setq length (- (match-end 0) (match-beginning 0))
- string (replace-match (make-string (/ length 2) ?@)
- nil nil string)
+ string (replace-match
+ (mapconcat #'identity
+ (make-list (/ length 2)
+ riece-alias-alternate-separator)
+ "")
+ nil t string)
index (+ (match-beginning 0) (/ length 2)))
(unless (zerop (% length 2))
(setq prefix (substring string 0 index))))
(setq server (substring string index)
index 0)
(if (equal server "")
- (while (string-match "@@" server index)
- (setq server (replace-match "@" nil nil server)
+ (while (string-match (regexp-quote
+ (concat riece-alias-alternate-separator
+ riece-alias-alternate-separator))
+ server index)
+ (setq server (replace-match
+ riece-alias-alternate-separator
+ nil t server)
index (1- (match-end 0))))
(concat prefix " " server)))))
(defun riece-alias-abbrev-identity-string (string)
(if riece-alias-enable-percent-hack
(setq string (riece-alias-abbrev-percent-hack string)))
- (if riece-alias-use-atmark
- (setq string (riece-alias-abbrev-atmark string)))
+ (if riece-alias-alternate-separator
+ (setq string (riece-alias-abbrev-alternate-separator string)))
(let ((alist riece-alias-alist))
(catch 'done
(while alist
(defun riece-alias-expand-identity-string (string)
(if riece-alias-enable-percent-hack
(setq string (riece-alias-expand-percent-hack string)))
- (if riece-alias-use-atmark
- (setq string (riece-alias-expand-atmark string)))
+ (if riece-alias-alternate-separator
+ (setq string (riece-alias-expand-alternate-separator string)))
(let ((alist riece-alias-alist))
(catch 'done
(while alist