aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader <[email protected]>2008-04-29 01:03:33 +0000
committerMiles Bader <[email protected]>2008-04-29 01:03:33 +0000
commit8336c9624933cf25c89798f162b55164073a66d9 (patch)
tree4b6526b5e7f2a8638373ced401ac4219987440d2
parent20d4381e4b811eeb3f28e15157d9a31eb7e48421 (diff)
Merge from gnus--devo--0
Revision: [email protected]/emacs--devo--0--patch-1131
-rw-r--r--lisp/gnus/ChangeLog15
-rw-r--r--lisp/gnus/gnus-registry.el5
-rw-r--r--lisp/gnus/mail-source.el45
3 files changed, 46 insertions, 19 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index d5f72bc484..ba91471a62 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,18 @@
+2008-04-28 Teodor Zlatanov <[email protected]>
+
+ * mail-source.el (mail-source-set-1, mail-source-bind): Moved
+ auth-source code out of the macro to clean it up and fix bugs.
+
+2008-04-26 Teodor Zlatanov <[email protected]>
+
+ * gnus-registry.el (gnus-registry-split-fancy-with-parent): Don't split
+ by sender if it's equal to user-mail-address, it's likely to be
+ useless.
+
+ * mail-source.el (mail-source-bind): Don't use user or password if they
+ are not bound. Unintern them if they are nil. Don't use server unless
+ it's bound, and default it to empty string otherwise.
+
2008-04-25 Teodor Zlatanov <[email protected]>
* mail-source.el: Load auth-source.el.
diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el
index 93ee0efce8..281c29c87a 100644
--- a/lisp/gnus/gnus-registry.el
+++ b/lisp/gnus/gnus-registry.el
@@ -523,8 +523,9 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
"references" refstr found found)))
;; else: there were no matches, now try the extra tracking by sender
- ((and (gnus-registry-track-sender-p)
- sender)
+ ((and (gnus-registry-track-sender-p)
+ sender
+ (not (equal sender user-mail-address)))
(maphash
(lambda (key value)
(let ((this-sender (cdr
diff --git a/lisp/gnus/mail-source.el b/lisp/gnus/mail-source.el
index d8633b7a6a..248fcaac88 100644
--- a/lisp/gnus/mail-source.el
+++ b/lisp/gnus/mail-source.el
@@ -451,19 +451,7 @@ 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)))
- ,@body)))
+ ,@body))
(put 'mail-source-bind 'lisp-indent-function 1)
(put 'mail-source-bind 'edebug-form-spec '(sexp body))
@@ -471,14 +459,37 @@ the `mail-source-keyword-map' variable."
(defun mail-source-set-1 (source)
(let* ((type (pop source))
(defaults (cdr (assq type mail-source-keyword-map)))
- default value keyword)
+ default value keyword user-auth pass-auth)
(while (setq default (pop defaults))
;; for each default :SYMBOL, set SYMBOL to the plist value for :SYMBOL
;; using `mail-source-value' to evaluate the plist value
(set (mail-source-strip-keyword (setq keyword (car default)))
- (if (setq value (plist-get source keyword))
- (mail-source-value value)
- (mail-source-value (cadr default)))))))
+ ;; note the following reasons for this structure:
+ ;; 1) the auth-sources user and password override everything
+ ;; 2) it avoids macros, so it's cleaner
+ ;; 3) it falls through to the mail-sources and then default values
+ (cond
+ ((and
+ (eq keyword :user)
+ (setq user-auth
+ (auth-source-user-or-password
+ "login"
+ ;; this is "host" in auth-sources
+ (if (boundp 'server) (symbol-value 'server) "")
+ type)))
+ user-auth)
+ ((and
+ (eq keyword :password)
+ (setq pass-auth
+ (auth-source-user-or-password
+ "password"
+ ;; this is "host" in auth-sources
+ (if (boundp 'server) (symbol-value 'server) "")
+ type)))
+ pass-auth)
+ (t (if (setq value (plist-get source keyword))
+ (mail-source-value value)
+ (mail-source-value (cadr default)))))))))
(eval-and-compile
(defun mail-source-bind-common-1 ()