~ubuntu-branches/ubuntu/karmic/emacs-snapshot/karmic

« back to all changes in this revision

Viewing changes to lisp/gnus/mail-source.el

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2009-04-05 09:14:30 UTC
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: james.westby@ubuntu.com-20090405091430-nw07lynn2arotjbe
Tags: upstream-20090320
ImportĀ upstreamĀ versionĀ 20090320

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
;;; mail-source.el --- functions for fetching mail
2
2
 
3
3
;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004,
4
 
;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
4
;;   2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
5
5
 
6
6
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
7
7
;; Keywords: news, mail
453
453
(put 'mail-source-bind 'lisp-indent-function 1)
454
454
(put 'mail-source-bind 'edebug-form-spec '(sexp body))
455
455
 
 
456
;; TODO: use the list format for auth-source-user-or-password modes
456
457
(defun mail-source-set-1 (source)
457
458
  (let* ((type (pop source))
458
459
         (defaults (cdr (assq type mail-source-keyword-map)))
459
 
         default value keyword user-auth pass-auth)
 
460
         default value keyword auth-info user-auth pass-auth)
460
461
    (while (setq default (pop defaults))
461
462
      ;; for each default :SYMBOL, set SYMBOL to the plist value for :SYMBOL
462
463
      ;; using `mail-source-value' to evaluate the plist value
469
470
            ((and
470
471
             (eq keyword :user)
471
472
             (setq user-auth 
472
 
                   (auth-source-user-or-password
473
 
                    "login"
474
 
                    ;; this is "host" in auth-sources
475
 
                    (if (boundp 'server) (symbol-value 'server) "")
476
 
                    type)))
 
473
                   (nth 0 (auth-source-user-or-password
 
474
                           '("login" "password")
 
475
                           ;; this is "host" in auth-sources
 
476
                           (if (boundp 'server) (symbol-value 'server) "")
 
477
                           type))))
477
478
             user-auth)
478
479
            ((and
479
 
             (eq keyword :password)
480
 
             (setq pass-auth 
481
 
                   (auth-source-user-or-password
482
 
                    "password"
483
 
                    ;; this is "host" in auth-sources
484
 
                    (if (boundp 'server) (symbol-value 'server) "")
485
 
                    type)))
 
480
              (eq keyword :password)
 
481
              (setq pass-auth
 
482
                    (nth 1
 
483
                         (auth-source-user-or-password
 
484
                          '("login" "password")
 
485
                          ;; this is "host" in auth-sources
 
486
                          (if (boundp 'server) (symbol-value 'server) "")
 
487
                          type))))
486
488
             pass-auth)
487
489
            (t (if (setq value (plist-get source keyword))
488
490
                 (mail-source-value value)