emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r103407: Merge changes made in Gnus t


From: Katsumi Yamaoka
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r103407: Merge changes made in Gnus trunk.
Date: Wed, 23 Feb 2011 22:59:34 +0000
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 103407
author: Gnus developers <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Wed 2011-02-23 22:59:34 +0000
message:
  Merge changes made in Gnus trunk.
  
  gnus-art.el (article-make-date-line): Ignore errors if time is invalid and 
not convertible.
   (article-make-date-line): Only add lapsed time if time is not nil.
  auth-source.el (auth-source-netrc-element-or-first): New function to DTRT for 
parameter extraction.
   (auth-source-netrc-create): Use it and fix multiple parameter print bug.  
Use the default passed from above (given-default) or the built-in 
(user-login-name for :user).
modified:
  lisp/gnus/ChangeLog
  lisp/gnus/auth-source.el
  lisp/gnus/gnus-art.el
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2011-02-23 14:34:44 +0000
+++ b/lisp/gnus/ChangeLog       2011-02-23 22:59:34 +0000
@@ -1,7 +1,18 @@
+2011-02-23  Julien Danjou  <address@hidden>
+
+       * gnus-art.el (article-make-date-line): Ignore errors if time is
+       invalid and not convertible.
+       (article-make-date-line): Only add lapsed time if time is not nil.
+
 2011-02-23  Teodor Zlatanov  <address@hidden>
 
        * auth-source.el (auth-source-netrc-create): Use `read-char' instead of
        `read-char-choice' for backwards compatibility.
+       (auth-source-netrc-element-or-first): New function to DTRT for
+       parameter extraction.
+       (auth-source-netrc-create): Use it and fix multiple parameter print
+       bug.  Use the default passed from above (given-default) or the
+       built-in (user-login-name for :user).
 
 2011-02-23  Lars Ingebrigtsen  <address@hidden>
 

=== modified file 'lisp/gnus/auth-source.el'
--- a/lisp/gnus/auth-source.el  2011-02-23 14:34:44 +0000
+++ b/lisp/gnus/auth-source.el  2011-02-23 22:59:34 +0000
@@ -898,6 +898,11 @@
                             (plist-put spec :create nil)))))
     results))
 
+(defun auth-source-netrc-element-or-first (v)
+  (if (listp v)
+      (nth 0 v)
+    v))
+
 ;;; (auth-source-search :host "nonesuch" :type 'netrc :max 1 :create t)
 ;;; (auth-source-search :host "nonesuch" :type 'netrc :max 1 :create t 
:create-extra-keys '((A "default A") (B)))
 
@@ -943,9 +948,7 @@
     (dolist (r required)
       (let* ((data (aget valist r))
              ;; take the first element if the data is a list
-             (data (if (listp data)
-                       (nth 0 data)
-                     data))
+             (data (auth-source-netrc-element-or-first data))
              ;; this is the default to be offered
              (given-default (aget auth-source-creation-defaults r))
              ;; the default supplementals are simple: for the user,
@@ -961,10 +964,22 @@
                ((and (null data) (eq r 'secret))
                 ;; special case prompt for passwords
                 (read-passwd (format "Password for address@hidden:%s: "
-                                     (or (aget valist 'user) "[any user]")
-                                     (or (aget valist 'host) "[any host]")
-                                     (or (aget valist 'port) "[any port]"))))
-               (t data)))
+                                     (or
+                                      (auth-source-netrc-element-or-first
+                                       (aget valist 'user))
+                                      (plist-get artificial :user)
+                                      "[any user]")
+                                     (or
+                                      (auth-source-netrc-element-or-first
+                                       (aget valist 'host))
+                                      (plist-get artificial :host)
+                                      "[any host]")
+                                     (or
+                                      (auth-source-netrc-element-or-first
+                                       (aget valist 'port))
+                                      (plist-get artificial :port)
+                                      "[any port]"))))
+               (t (or data default))))
 
         (when data
           (setq artificial (plist-put artificial

=== modified file 'lisp/gnus/gnus-art.el'
--- a/lisp/gnus/gnus-art.el     2011-02-22 13:31:15 +0000
+++ b/lisp/gnus/gnus-art.el     2011-02-23 22:59:34 +0000
@@ -3463,7 +3463,7 @@
                             combined-lapsed))
     (error "Unknown conversion type: %s" type))
   (condition-case ()
-      (let ((time (date-to-time date)))
+      (let ((time (ignore-errors (date-to-time date))))
        (cond
         ;; Convert to the local timezone.
         ((eq type 'local)
@@ -3515,6 +3515,7 @@
                (segments 3)
                lapsed-string)
            (while (and
+                    time
                    (setq lapsed-string
                          (concat " (" (article-lapsed-string time segments) 
")"))
                    (> (+ (length date-string)


reply via email to

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