+2004-11-22 Daiki Ueno <ueno@unixuser.org>
+
+ * test/test-riece-alias.el (test-riece-alias-alist-1): New test case.
+ (test-riece-alias-alist-2): New test case.
+
+ * riece-alias.el (riece-alias-abbrev-identity-string): Fixed
+ riece-alias-alist handling.
+ (riece-alias-expand-identity-string): Ditto.
+
2004-11-21 Daiki Ueno <ueno@unixuser.org>
* riece-options.el (riece-shrink-buffer-remove-lines): New user option.
(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)))))
+ 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)))
+ string)
(defun riece-alias-insinuate ()
)
(riece-alias-expand-percent-hack "%riece")
"#riece:*.jp"))))
+(luna-define-method test-riece-alias-alist-1 ((case test-riece-alias))
+ (let ((riece-alias-alist '(("#riece" . "#r"))))
+ (lunit-assert
+ (equal
+ (riece-alias-abbrev-identity-string "#riece")
+ "#r"))
+ (lunit-assert
+ (equal
+ (riece-alias-expand-identity-string "#r")
+ "#riece"))))
+
+(luna-define-method test-riece-alias-alist-2 ((case test-riece-alias))
+ (let ((riece-alias-alist '(("%riece" . "%r")))
+ (riece-alias-percent-hack-mask "*.jp"))
+ (lunit-assert
+ (equal
+ (riece-alias-abbrev-identity-string "#riece:*.jp")
+ "%r"))
+ (lunit-assert
+ (equal
+ (riece-alias-expand-identity-string "%r")
+ "#riece:*.jp"))))
+
(luna-define-method test-riece-alias-altsep-1 ((case test-riece-alias))
(let ((riece-alias-alternate-separator "@"))
(lunit-assert