From: Teodor Zlatanov Date: Sat, 26 Apr 2008 12:47:15 +0000 (+0000) Subject: (mail-source-bind): Don't use user or password if they X-Git-Url: https://cgit.sxemacs.org/?a=commitdiff_plain;h=fd7dbe74c8f940bb8a55cb73e01aff7c7b6ebfd9;hp=8e6fc1ea1ab5162906621cac37ef3c626198dfdb;p=gnus (mail-source-bind): Don't use user or password if they are not bound. Unintern them if they are nil. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d87d5d0c3..8f3e3a1d9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2008-04-26 Teodor Zlatanov + + * mail-source.el (mail-source-bind): Don't use user or password if they + are not bound. Unintern them if they are nil. + 2008-04-25 Teodor Zlatanov * mail-source.el: Load auth-source.el. diff --git a/lisp/mail-source.el b/lisp/mail-source.el index d8633b7a6..65626b0bc 100644 --- a/lisp/mail-source.el +++ b/lisp/mail-source.el @@ -451,18 +451,24 @@ The variables bound and their default values are described by the `mail-source-keyword-map' variable." `(let* ,(mail-source-bind-1 (car type-source)) (mail-source-set-1 ,(cadr type-source)) - (let ((user (or - (auth-source-user-or-password - "login" - server ; this is "host" in auth-sources - ',(car type-source)) - user)) - (password (or - (auth-source-user-or-password - "password" - server ; this is "host" in auth-sources - ',(car type-source)) - password))) + (let ((user + (or + (auth-source-user-or-password + "login" + server ; this is "host" in auth-sources + ',(car type-source)) + (when (boundp 'user) (symbol-value 'user)))) + (password + (or + (auth-source-user-or-password + "password" + server ; this is "host" in auth-sources + ',(car type-source)) + (when (boundp 'user) (symbol-value 'user))))) + (unless user + (unintern 'user)) + (unless password + (unintern 'password)) ,@body))) (put 'mail-source-bind 'lisp-indent-function 1)