Silence the byte compiler
[gnus] / lisp / mail-source.el
index 9cc2e6a..51b9c91 100644 (file)
@@ -1,6 +1,6 @@
 ;;; mail-source.el --- functions for fetching mail
 
-;; Copyright (C) 1999-2013 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2014 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news, mail
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
-
 (require 'format-spec)
 (eval-when-compile
   (require 'cl)
@@ -809,6 +805,10 @@ Deleting old (> %s day(s)) incoming mail file `%s'." diff bfile)
      prescript-delay)
     (let ((from (format "%s:%s:%s" server user port))
          (mail-source-string (format "pop:%s@%s" user server))
+         (process-environment (if server
+                                  (cons (concat "MAILHOST=" server)
+                                        process-environment)
+                                process-environment))
          result)
       (when (eq authentication 'password)
        (setq password
@@ -816,8 +816,6 @@ Deleting old (> %s day(s)) incoming mail file `%s'." diff bfile)
                  (cdr (assoc from mail-source-password-cache))
                  (read-passwd
                   (format "Password for %s at %s: " user server)))))
-      (when server
-       (setenv "MAILHOST" server))
       (setq result
            (cond
             (program
@@ -877,6 +875,10 @@ Deleting old (> %s day(s)) incoming mail file `%s'." diff bfile)
   (mail-source-bind (pop source)
     (let ((from (format "%s:%s:%s" server user port))
          (mail-source-string (format "pop:%s@%s" user server))
+         (process-environment (if server
+                                  (cons (concat "MAILHOST=" server)
+                                        process-environment)
+                                process-environment))
          result)
       (when (eq authentication 'password)
        (setq password
@@ -886,8 +888,6 @@ Deleting old (> %s day(s)) incoming mail file `%s'." diff bfile)
                   (format "Password for %s at %s: " user server))))
        (unless (assoc from mail-source-password-cache)
          (push (cons from password) mail-source-password-cache)))
-      (when server
-       (setenv "MAILHOST" server))
       (setq result
            (cond
             ;; No easy way to check whether mail is waiting for these.