* wl-address.el (wl-address-add-or-change): Don't add empty
authoryoichi <yoichi>
Sat, 3 Jan 2004 00:14:15 +0000 (00:14 +0000)
committeryoichi <yoichi>
Sat, 3 Jan 2004 00:14:15 +0000 (00:14 +0000)
address.

wl/ChangeLog
wl/wl-address.el

index 9573ae1..b2a62a9 100644 (file)
@@ -1,6 +1,8 @@
 2004-01-03  Yoichi NAKAYAMA  <yoichi@geiin.org>
 
        * wl-address.el (wl-address-delete): Avoid mis-deleting.
+       * wl-address.el (wl-address-add-or-change): Don't add empty
+       address.
 
 2004-01-01  TAKAHASHI Kaoru  <kaoru@kaisei.org>
 
index f204a44..f158400 100644 (file)
@@ -671,9 +671,16 @@ If already registerd, change it."
                                                the-realname)))
     (when change-address
       (setq new-addr (read-from-minibuffer "E-Mail: " address))
-      (if (and (not (string= address new-addr))
-              (assoc new-addr wl-address-list))
-         (error "'%s' already exists" new-addr)))
+      (cond
+       ((or (not (stringp address))
+           (string-match "^[ \t]*$" address))
+       (error "empty address"))
+       ((and (not (string= address new-addr))
+            (assoc new-addr wl-address-list))
+       (error "'%s' already exists" new-addr))
+       (t
+       ;; do nothing
+       )))
     ;; writing to ~/.address
     (let ((output-coding-system
           (mime-charset-to-coding-system wl-mime-charset)))