From: Lars Ingebrigtsen Date: Thu, 17 Feb 2011 23:00:43 +0000 (-0800) Subject: Delete duplicate server names when getting credentials. X-Git-Url: https://cgit.sxemacs.org/?p=gnus;a=commitdiff_plain;h=a0faaaf767280ba530f2c5c76fd25087581f62b8 Delete duplicate server names when getting credentials. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 16247e096..d5fa15d01 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,7 +1,15 @@ +2011-02-17 Lars Ingebrigtsen + + * nnimap.el (nnimap-open-connection-1): Delete duplicate server names + when getting credentials. + + * gnus-util.el (gnus-delete-duplicates): New function. + 2011-02-17 Teodor Zlatanov * nnimap.el (nnimap-credentials): Instead of picking the first port as - a creation default, pass the whole port list down. It will be completed. + a creation default, pass the whole port list down. It will be + completed. * auth-source.el (auth-source-search): Updated docs to talk about multiple creation choices. diff --git a/lisp/gnus-util.el b/lisp/gnus-util.el index 67c49096b..42dbd5948 100644 --- a/lisp/gnus-util.el +++ b/lisp/gnus-util.el @@ -871,6 +871,15 @@ Bind `print-quoted' and `print-readably' to t, and `print-length' and (when (file-exists-p file) (delete-file file))) +(defun gnus-delete-duplicates (list) + "Remove duplicate entries from LIST." + (let ((result nil)) + (while list + (unless (member (car list) result) + (push (car list) result)) + (pop list)) + (nreverse result))) + (defun gnus-delete-directory (directory) "Delete files in DIRECTORY. Subdirectories remain. If there's no subdirectory, delete DIRECTORY as well." diff --git a/lisp/nnimap.el b/lisp/nnimap.el index 24125467e..7f8ecc171 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -384,9 +384,10 @@ textual parts.") ;; Look for the credentials based on ;; the virtual server name and the address (nnimap-credentials - (list - nnimap-address - (nnoo-current-server 'nnimap)) + (gnus-delete-duplicates + (list + nnimap-address + (nnoo-current-server 'nnimap))) ports)))) (setq nnimap-object nil) (let ((nnimap-inhibit-logging t))