emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs lisp/net/imap.el lisp/net/netrc.el lisp/g...


From: Miles Bader
Subject: [Emacs-diffs] emacs lisp/net/imap.el lisp/net/netrc.el lisp/g...
Date: Thu, 05 Feb 2009 02:34:37 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Miles Bader <miles>     09/02/05 02:34:37

Modified files:
        lisp/net       : imap.el netrc.el 
        lisp/gnus      : ChangeLog nnimap.el mail-source.el nntp.el 
                         auth-source.el 
        lisp           : ChangeLog 
        etc            : GNUS-NEWS 
        doc/misc       : ChangeLog gnus-news.texi 

Log message:
        Merge from gnus--devo--0
        
        Revision: address@hidden/emacs--devo--0--patch-1537

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/net/imap.el?cvsroot=emacs&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/net/netrc.el?cvsroot=emacs&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/gnus/ChangeLog?cvsroot=emacs&r1=1.793&r2=1.794
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/gnus/nnimap.el?cvsroot=emacs&r1=1.55&r2=1.56
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/gnus/mail-source.el?cvsroot=emacs&r1=1.45&r2=1.46
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/gnus/nntp.el?cvsroot=emacs&r1=1.46&r2=1.47
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/gnus/auth-source.el?cvsroot=emacs&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.15255&r2=1.15256
http://cvs.savannah.gnu.org/viewcvs/emacs/etc/GNUS-NEWS?cvsroot=emacs&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/emacs/doc/misc/ChangeLog?cvsroot=emacs&r1=1.248&r2=1.249
http://cvs.savannah.gnu.org/viewcvs/emacs/doc/misc/gnus-news.texi?cvsroot=emacs&r1=1.10&r2=1.11

Patches:
Index: lisp/net/imap.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/net/imap.el,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- lisp/net/imap.el    9 Jan 2009 03:01:53 -0000       1.17
+++ lisp/net/imap.el    5 Feb 2009 02:34:34 -0000       1.18
@@ -1798,25 +1798,38 @@
 of the UIDS specification, and the cdr is the one which works with
 Exchange 2007 or, potentially, other buggy servers.
 See `imap-enable-exchange-bug-workaround'."
-  ;; We don't unconditionally use the alternative (valid) form, since
-  ;; this is said to be significantly inefficient.  The first time we
-  ;; get here for a given, we'll try the canonical form.  If we get
-  ;; the known error from the buggy server, set the flag
-  ;; buffer-locally (to account for connections to multiple servers),
-  ;; then re-try with the alternative UIDS spec.
+  ;; The first time we get here for a given, we'll try the canonical
+  ;; form.  If we get the known error from the buggy server, set the
+  ;; flag buffer-locally (to account for connections to multiple
+  ;; servers), then re-try with the alternative UIDS spec.  We don't
+  ;; unconditionally use the alternative form, since the
+  ;; currently-used alternatives are seriously inefficient with some
+  ;; servers (although they are valid).
+  ;;
+  ;; FIXME:  Maybe it would be cleaner to have a flag to not signal
+  ;; the error (which otherwise gives a message), and test
+  ;; `imap-failed-tags'.  Also, Other IMAP clients use other forms of
+  ;; request which work with Exchange, e.g. Claws does "UID FETCH 1:*
+  ;; (UID)" rather than "FETCH UID 1,*".  Is there a good reason not
+  ;; to do the same?
   (condition-case data
+      ;; Binding `debug-on-error' allows us to get the error from
+      ;; `imap-parse-response' -- it's normally caught by Emacs around
+      ;; execution of a process filter.
+      (let ((debug-on-error t))
       (imap-fetch (if imap-enable-exchange-bug-workaround
                      (cdr uids)
                    (car uids))
-                 props receive nouidfetch buffer)
+                   props receive nouidfetch buffer))
     (error
      (if (and (not imap-enable-exchange-bug-workaround)
-             (string-match
-              "The specified message set is invalid"
+             ;; This is the Exchange 2007 response.  It may be more
+             ;; robust just to check for a BAD response to the
+             ;; attempted fetch.
+             (string-match "The specified message set is invalid"
               (cadr data)))
         (with-current-buffer (or buffer (current-buffer))
-          (set (make-local-variable
-                'imap-enable-exchange-bug-workaround)
+          (set (make-local-variable 'imap-enable-exchange-bug-workaround)
                t)
           (imap-fetch (cdr uids) props receive nouidfetch))
        (signal (car data) (cdr data))))))
@@ -3027,6 +3040,7 @@
          imap-list-to-message-set
          imap-fetch-asynch
          imap-fetch
+         imap-fetch-safe
          imap-message-put
          imap-message-get
          imap-message-map

Index: lisp/net/netrc.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/net/netrc.el,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- lisp/net/netrc.el   5 Jan 2009 03:22:45 -0000       1.19
+++ lisp/net/netrc.el   5 Feb 2009 02:34:34 -0000       1.20
@@ -158,11 +158,22 @@
        (ports (or ports '(nil)))
        (defaults (or defaults '(nil)))
        info)
+    (if (listp mode)
+       (setq info 
+             (mapcar 
+              (lambda (mode-element) 
+                (netrc-machine-user-or-password
+                 mode-element
+                 authinfo-list
+                 machines
+                 ports
+                 defaults))
+              mode))
     (dolist (machine machines)
       (dolist (default defaults)
        (dolist (port ports)
          (let ((alist (netrc-machine authinfo-list machine port default)))
-           (setq info (or (netrc-get alist mode) info))))))
+             (setq info (or (netrc-get alist mode) info)))))))
     info))
 
 (defun netrc-get (alist type)

Index: lisp/gnus/ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/gnus/ChangeLog,v
retrieving revision 1.793
retrieving revision 1.794
diff -u -b -r1.793 -r1.794
--- lisp/gnus/ChangeLog 31 Jan 2009 02:57:13 -0000      1.793
+++ lisp/gnus/ChangeLog 5 Feb 2009 02:34:34 -0000       1.794
@@ -3,6 +3,25 @@
        * gnus-sum.el (gnus-summary-next-article): XEmacs-friendly version of
        2009-01-09 change.
 
+2009-01-26  Teodor Zlatanov  <address@hidden>
+
+       * auth-source.el (auth-source-forget-user-or-password): Clarify docs.
+       (auth-source-forget-all-cached): New convenience function.
+       (auth-source-user-or-password): Accept list of modes or a single mode.
+
+       * mail-source.el (mail-source-bind, mail-source-set-1): Use list of
+       auth-source modes.
+
+       * nnimap.el (nnimap-open-connection): Use list of
+       auth-source modes.
+
+       * nntp.el (nntp-send-authinfo): Use list of
+       auth-source modes.
+
+2009-01-26  Teodor Zlatanov  <address@hidden>
+
+       * nntp.el (nntp-send-authinfo): 
+
 2009-01-16  Teodor Zlatanov  <address@hidden>
 
        * auth-source.el: Update docs to reflect epa-file-enable is to be used

Index: lisp/gnus/nnimap.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/gnus/nnimap.el,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -b -r1.55 -r1.56
--- lisp/gnus/nnimap.el 9 Jan 2009 03:01:51 -0000       1.55
+++ lisp/gnus/nnimap.el 5 Feb 2009 02:34:34 -0000       1.56
@@ -805,8 +805,12 @@
           (port (if nnimap-server-port
                     (int-to-string nnimap-server-port)
                   "imap"))
+          (auth-info 
+           (auth-source-user-or-password '("login" "password") server port))
+          (auth-user (nth 0 auth-info))
+          (auth-passwd (nth 1 auth-info))
           (user (or
-                 (auth-source-user-or-password "login" server port) ; this is 
preferred to netrc-*
+                 auth-user ; this is preferred to netrc-*
                  (netrc-machine-user-or-password
                   "login"
                   list
@@ -816,7 +820,7 @@
                   (list port)
                   (list "imap" "imaps" "143" "993"))))
           (passwd (or
-                   (auth-source-user-or-password "password" server port) ; 
this is preferred to netrc-*
+                   auth-passwd ; this is preferred to netrc-*
                    (netrc-machine-user-or-password
                     "password"
                     list

Index: lisp/gnus/mail-source.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/gnus/mail-source.el,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -b -r1.45 -r1.46
--- lisp/gnus/mail-source.el    5 Jan 2009 03:22:07 -0000       1.45
+++ lisp/gnus/mail-source.el    5 Feb 2009 02:34:34 -0000       1.46
@@ -453,10 +453,11 @@
 (put 'mail-source-bind 'lisp-indent-function 1)
 (put 'mail-source-bind 'edebug-form-spec '(sexp body))
 
+;; TODO: use the list format for auth-source-user-or-password modes
 (defun mail-source-set-1 (source)
   (let* ((type (pop source))
         (defaults (cdr (assq type mail-source-keyword-map)))
-        default value keyword user-auth pass-auth)
+        default value keyword auth-info 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
@@ -469,20 +470,21 @@
            ((and
             (eq keyword :user)
             (setq user-auth 
-                  (auth-source-user-or-password
-                   "login"
+                  (nth 0 (auth-source-user-or-password
+                          '("login" "password")
                    ;; this is "host" in auth-sources
                    (if (boundp 'server) (symbol-value 'server) "")
-                   type)))
+                          type))))
             user-auth)
            ((and
             (eq keyword :password)
             (setq pass-auth 
+                   (nth 1
                   (auth-source-user-or-password
-                   "password"
+                         '("login" "password")
                    ;; this is "host" in auth-sources
                    (if (boundp 'server) (symbol-value 'server) "")
-                   type)))
+                         type))))
             pass-auth)
            (t (if (setq value (plist-get source keyword))
                 (mail-source-value value)

Index: lisp/gnus/nntp.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/gnus/nntp.el,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -b -r1.46 -r1.47
--- lisp/gnus/nntp.el   5 Jan 2009 03:22:16 -0000       1.46
+++ lisp/gnus/nntp.el   5 Feb 2009 02:34:34 -0000       1.47
@@ -1179,14 +1179,18 @@
   (let* ((list (netrc-parse nntp-authinfo-file))
         (alist (netrc-machine list nntp-address "nntp"))
         (force (or (netrc-get alist "force") nntp-authinfo-force))
+        (auth-info 
+         (auth-source-user-or-password '("login" "password") nntp-address 
"nntp"))
+        (auth-user (nth 0 auth-info))
+        (auth-passwd (nth 1 auth-info))
         (user (or
                ;; this is preferred to netrc-*
-               (auth-source-user-or-password "login" nntp-address "nntp")
+               auth-user
                (netrc-get alist "login")
                nntp-authinfo-user))
         (passwd (or
                  ;; this is preferred to netrc-*
-                 (auth-source-user-or-password "password" nntp-address "nntp")
+                 auth-passwd
                  (netrc-get alist "password"))))
     (when (or (not send-if-force)
              force)

Index: lisp/gnus/auth-source.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/gnus/auth-source.el,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- lisp/gnus/auth-source.el    19 Jan 2009 01:06:28 -0000      1.12
+++ lisp/gnus/auth-source.el    5 Feb 2009 02:34:35 -0000       1.13
@@ -163,12 +163,20 @@
   (interactive "slogin/password: \nsHost: \nsProtocol: \n") ;for testing
   (remhash (format "%s %s:%s" mode host protocol) auth-source-cache))
 
+(defun auth-source-forget-all-cached ()
+  "Forget all cached auth-source authentication tokens."
+  (interactive)
+  (setq auth-source-cache (make-hash-table :test 'equal)))
+
 (defun auth-source-user-or-password (mode host protocol)
-  "Find user or password (from the string MODE) matching HOST and PROTOCOL."
+  "Find MODE (string or list of strings) matching HOST and PROTOCOL.
+MODE can be \"login\" or \"password\" for example."
   (gnus-message 9
                "auth-source-user-or-password: get %s for %s (%s)"
                mode host protocol)
-  (let* ((cname (format "%s %s:%s" mode host protocol))
+  (let* ((listy (listp mode))
+        (mode (if listy mode (list mode)))
+        (cname (format "%s %s:%s" mode host protocol))
         (found (gethash cname auth-source-cache)))
     (if found
        (progn
@@ -176,7 +184,7 @@
                        "auth-source-user-or-password: cached %s=%s for %s (%s)"
                        mode
                        ;; don't show the password
-                       (if (equal mode "password") "SECRET" found)
+                       (if (member "password" mode) "SECRET" found)
                        host protocol)
          found)
       (dolist (choice (auth-source-pick host protocol))
@@ -191,8 +199,9 @@
                        "auth-source-user-or-password: found %s=%s for %s (%s)"
                        mode
                        ;; don't show the password
-                       (if (equal mode "password") "SECRET" found)
+                       (if (member "password" mode) "SECRET" found)
                        host protocol)
+         (setq found (if listy found (car-safe found)))
          (when auth-source-do-cache
            (puthash cname found auth-source-cache)))
        (return found)))))

Index: lisp/ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.15255
retrieving revision 1.15256
diff -u -b -r1.15255 -r1.15256
--- lisp/ChangeLog      4 Feb 2009 10:46:14 -0000       1.15255
+++ lisp/ChangeLog      5 Feb 2009 02:34:35 -0000       1.15256
@@ -1,3 +1,13 @@
+2009-02-04  Dave Love  <address@hidden>
+
+       * net/imap.el (imap-fetch-safe): Bind debug-on-error.
+       (imap-debug): Add imap-fetch-safe.
+
+2009-02-04  Teodor Zlatanov  <address@hidden>
+
+       * net/netrc.el (netrc-machine-user-or-password): Use list of
+       auth-source modes.
+
 2009-02-04  Nick Roberts  <address@hidden>
 
        * vc-svn.el (vc-svn-diff): Revert previous change but add a test

Index: etc/GNUS-NEWS
===================================================================
RCS file: /cvsroot/emacs/emacs/etc/GNUS-NEWS,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- etc/GNUS-NEWS       8 Jan 2009 05:11:57 -0000       1.22
+++ etc/GNUS-NEWS       5 Feb 2009 02:34:36 -0000       1.23
@@ -83,7 +83,7 @@
 
 ** International host names (IDNA) can now be decoded inside article bodies
 using `W i' (`gnus-summary-idna-message').  This requires that GNU Libidn
-(<http://www.gnu.org/software/libidn/>) has been installed.
+(`http://www.gnu.org/software/libidn/') has been installed.
 
 ** The non-ASCII group names handling has been much improved.  The back
 ends that fully support non-ASCII group names are now `nntp', `nnml',
@@ -131,7 +131,7 @@
 
 ** You can replace MIME parts with external bodies.  See
 `gnus-mime-replace-part' and `gnus-article-replace-part'.  *Note MIME
-Commands::, *Note Using MIME::.
+Commands::, *note Using MIME::.
 
 ** The option `mm-fill-flowed' can be used to disable treatment of
 format=flowed messages.  Also, flowed text is disabled when sending

Index: doc/misc/ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/doc/misc/ChangeLog,v
retrieving revision 1.248
retrieving revision 1.249
diff -u -b -r1.248 -r1.249
--- doc/misc/ChangeLog  2 Feb 2009 21:00:46 -0000       1.248
+++ doc/misc/ChangeLog  5 Feb 2009 02:34:37 -0000       1.249
@@ -1,3 +1,7 @@
+2009-02-04  Reiner Steib  <address@hidden>
+
+       * gnus-news.texi: Print version about Incoming*.
+
 2009-02-02  Carsten Dominik  <address@hidden>
 
        * org.texi (Structure editing, Handling links)

Index: doc/misc/gnus-news.texi
===================================================================
RCS file: /cvsroot/emacs/emacs/doc/misc/gnus-news.texi,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- doc/misc/gnus-news.texi     8 Jan 2009 05:29:10 -0000       1.10
+++ doc/misc/gnus-news.texi     5 Feb 2009 02:34:37 -0000       1.11
@@ -91,7 +91,7 @@
 Old intermediate incoming mail files (@file{Incoming*}) are deleted
 after a couple of days, not immediately.  @xref{Mail Source
 Customization}.
address@hidden New in Gnus 5.10.10 / No Gnus 0.8
+(New in Gnus 5.10.10 / No Gnus 0.8)
 @c This entry is also present in the node "Oort Gnus".
 
 @end itemize




reply via email to

[Prev in Thread] Current Thread [Next in Thread]