- (string-match "@+" string index))
- (setq length (- (match-end 0) (match-beginning 0))
- string (replace-match (make-string (/ length 2) ?@)
- nil nil 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 "")
- prefix
- (while (string-match "@@" server index)
- (setq server (replace-match "@" nil nil server)
- index (1- (match-end 0))))
- (concat prefix " " server))))
+ (string-match
+ (concat (regexp-quote riece-alias-alternate-separator)
+ (regexp-quote riece-alias-alternate-separator)
+ "\\|\\("
+ (regexp-quote riece-alias-alternate-separator)
+ "\\)")
+ string index))
+ (if (match-beginning 1) ;found a separator
+ (setq prefix (substring string 0 (match-beginning 1))
+ index (match-end 1))
+ (setq string (replace-match riece-alias-alternate-separator
+ nil t string)
+ index (- (match-end 0)
+ (length riece-alias-alternate-separator)))))
+ (if (null prefix)
+ string
+ (setq server (substring string index)
+ index 0)
+ (if (equal 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 (- (match-end 0)
+ (length riece-alias-alternate-separator))))
+ (concat prefix " " server)))))