Remove arch-tags from all files, since these are no longer needed.
[gnus] / lisp / nnimap.el
index a330b26..73242fb 100644 (file)
 
 ;;; Code:
 
+;; For Emacs < 22.2.
+(eval-and-compile
+  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
+
 (require 'imap)
 (require 'nnoo)
 (require 'nnmail)
@@ -810,12 +814,17 @@ If EXAMINE is non-nil the group is selected read-only."
            (nnheader-nov-delete-outside-range low high))))
       'nov)))
 
+(declare-function netrc-parse "netrc" (file))
+(declare-function netrc-machine-user-or-password "netrc"
+                 (mode authinfo-file-or-list machines ports defaults))
+
 (defun nnimap-open-connection (server)
   ;; Note: `nnimap-open-server' that calls this function binds
   ;; `imap-logout-timeout' to `nnimap-logout-timeout'.
   (if (not (imap-open nnimap-address nnimap-server-port nnimap-stream
                      nnimap-authenticator nnimap-server-buffer))
       (nnheader-report 'nnimap "Can't open connection to server %s" server)
+    (require 'netrc)
     (unless (or (imap-capability 'IMAP4 nnimap-server-buffer)
                (imap-capability 'IMAP4rev1 nnimap-server-buffer))
       (imap-close nnimap-server-buffer)
@@ -826,7 +835,7 @@ If EXAMINE is non-nil the group is selected read-only."
           (port (if nnimap-server-port
                     (int-to-string nnimap-server-port)
                   "imap"))
-          (auth-info 
+          (auth-info
            (auth-source-user-or-password '("login" "password") server port))
           (auth-user (nth 0 auth-info))
           (auth-passwd (nth 1 auth-info))
@@ -1490,8 +1499,8 @@ function is generally only called when Gnus is shutting down."
       (nnimap-before-find-minmax-bugworkaround)
       (dolist (pattern (nnimap-pattern-to-list-arguments
                        nnimap-list-pattern))
-       (dolist (mbx (imap-mailbox-lsub (cdr pattern) (car pattern) nil
-                                       nnimap-server-buffer))
+       (dolist (mbx (funcall nnimap-request-list-method (cdr pattern) (car pattern) nil
+                              nnimap-server-buffer))
          (or (catch 'found
                (dolist (mailbox (imap-mailbox-get 'list-flags mbx
                                                   nnimap-server-buffer))
@@ -1862,5 +1871,4 @@ be used in a STORE FLAGS command."
 
 (provide 'nnimap)
 
-;; arch-tag: 2b001f20-3ff9-4094-a0ad-46807c1ba70b
 ;;; nnimap.el ends here