Bind mail-source-string in webmail.
[gnus] / lisp / mail-source.el
index 0758fc9..309cf9a 100644 (file)
@@ -27,7 +27,8 @@
 
 (eval-when-compile (require 'cl))
 (eval-and-compile
-  (autoload 'pop3-movemail "pop3"))
+  (autoload 'pop3-movemail "pop3")
+  (autoload 'pop3-get-message-count "pop3"))
 (require 'format-spec)
 
 (defgroup mail-source nil
@@ -151,8 +152,8 @@ All keywords that can be used must be listed here."))
 
 (eval-and-compile
   (defun mail-source-strip-keyword (keyword)
-  "Strip the leading colon off the KEYWORD."
-  (intern (substring (symbol-name keyword) 1))))
+    "Strip the leading colon off the KEYWORD."
+    (intern (substring (symbol-name keyword) 1))))
 
 (eval-and-compile
   (defun mail-source-bind-1 (type)
@@ -444,7 +445,7 @@ If ARGS, PROMPT is used as an argument to `format'."
     (mail-source-run-script
      prescript
      (format-spec-make ?p password ?t mail-source-crash-box
-                                     ?s server ?P port ?u user)
+                      ?s server ?P port ?u user)
      prescript-delay)
     (let ((from (format "%s:%s:%s" server user port))
          (mail-source-string (format "pop:%s@%s" user server))
@@ -669,13 +670,14 @@ This only works when `display-time' is enabled."
 (defun mail-source-fetch-webmail (source callback)
   "Fetch for webmail source."
   (mail-source-bind (webmail source)
-    (when (eq authentication 'password)
-      (setq password
-           (or password
-               (mail-source-read-passwd
-                (format "Password for %s at %s: " user subtype)))))
-    (webmail-fetch mail-source-crash-box subtype user password)
-    (mail-source-callback callback (symbol-name subtype))))
+    (let ((mail-source-string (format "webmail:%s:%s" subtype user)))
+      (when (eq authentication 'password)
+       (setq password
+             (or password
+                 (mail-source-read-passwd
+                  (format "Password for %s at %s: " user subtype)))))
+      (webmail-fetch mail-source-crash-box subtype user password)
+      (mail-source-callback callback (symbol-name subtype)))))
 
 (provide 'mail-source)