aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGnus developers2011-02-23 22:59:34 +0000
committerKatsumi Yamaoka2011-02-23 22:59:34 +0000
commitfa41748c1425908789f9c5e5beab7b4850e8b279 (patch)
tree8a561ae5adfbbdf4b280b1a26f4be4b4449707c7
parent2c6584e8174f9ea276d0fae13e1a5f7d29f61d53 (diff)
downloademacs-fa41748c1425908789f9c5e5beab7b4850e8b279.tar.gz
emacs-fa41748c1425908789f9c5e5beab7b4850e8b279.zip
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).
-rw-r--r--lisp/gnus/ChangeLog11
-rw-r--r--lisp/gnus/auth-source.el29
-rw-r--r--lisp/gnus/gnus-art.el3
3 files changed, 35 insertions, 8 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 0d8dfe0ea91..45f0d68023d 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,7 +1,18 @@
12011-02-23 Julien Danjou <julien@danjou.info>
2
3 * gnus-art.el (article-make-date-line): Ignore errors if time is
4 invalid and not convertible.
5 (article-make-date-line): Only add lapsed time if time is not nil.
6
12011-02-23 Teodor Zlatanov <tzz@lifelogs.com> 72011-02-23 Teodor Zlatanov <tzz@lifelogs.com>
2 8
3 * auth-source.el (auth-source-netrc-create): Use `read-char' instead of 9 * auth-source.el (auth-source-netrc-create): Use `read-char' instead of
4 `read-char-choice' for backwards compatibility. 10 `read-char-choice' for backwards compatibility.
11 (auth-source-netrc-element-or-first): New function to DTRT for
12 parameter extraction.
13 (auth-source-netrc-create): Use it and fix multiple parameter print
14 bug. Use the default passed from above (given-default) or the
15 built-in (user-login-name for :user).
5 16
62011-02-23 Lars Ingebrigtsen <larsi@gnus.org> 172011-02-23 Lars Ingebrigtsen <larsi@gnus.org>
7 18
diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el
index d349022e7b7..a7f626c3cd3 100644
--- a/lisp/gnus/auth-source.el
+++ b/lisp/gnus/auth-source.el
@@ -898,6 +898,11 @@ See `auth-source-search' for details on SPEC."
898 (plist-put spec :create nil))))) 898 (plist-put spec :create nil)))))
899 results)) 899 results))
900 900
901(defun auth-source-netrc-element-or-first (v)
902 (if (listp v)
903 (nth 0 v)
904 v))
905
901;;; (auth-source-search :host "nonesuch" :type 'netrc :max 1 :create t) 906;;; (auth-source-search :host "nonesuch" :type 'netrc :max 1 :create t)
902;;; (auth-source-search :host "nonesuch" :type 'netrc :max 1 :create t :create-extra-keys '((A "default A") (B))) 907;;; (auth-source-search :host "nonesuch" :type 'netrc :max 1 :create t :create-extra-keys '((A "default A") (B)))
903 908
@@ -943,9 +948,7 @@ See `auth-source-search' for details on SPEC."
943 (dolist (r required) 948 (dolist (r required)
944 (let* ((data (aget valist r)) 949 (let* ((data (aget valist r))
945 ;; take the first element if the data is a list 950 ;; take the first element if the data is a list
946 (data (if (listp data) 951 (data (auth-source-netrc-element-or-first data))
947 (nth 0 data)
948 data))
949 ;; this is the default to be offered 952 ;; this is the default to be offered
950 (given-default (aget auth-source-creation-defaults r)) 953 (given-default (aget auth-source-creation-defaults r))
951 ;; the default supplementals are simple: for the user, 954 ;; the default supplementals are simple: for the user,
@@ -961,10 +964,22 @@ See `auth-source-search' for details on SPEC."
961 ((and (null data) (eq r 'secret)) 964 ((and (null data) (eq r 'secret))
962 ;; special case prompt for passwords 965 ;; special case prompt for passwords
963 (read-passwd (format "Password for %s@%s:%s: " 966 (read-passwd (format "Password for %s@%s:%s: "
964 (or (aget valist 'user) "[any user]") 967 (or
965 (or (aget valist 'host) "[any host]") 968 (auth-source-netrc-element-or-first
966 (or (aget valist 'port) "[any port]")))) 969 (aget valist 'user))
967 (t data))) 970 (plist-get artificial :user)
971 "[any user]")
972 (or
973 (auth-source-netrc-element-or-first
974 (aget valist 'host))
975 (plist-get artificial :host)
976 "[any host]")
977 (or
978 (auth-source-netrc-element-or-first
979 (aget valist 'port))
980 (plist-get artificial :port)
981 "[any port]"))))
982 (t (or data default))))
968 983
969 (when data 984 (when data
970 (setq artificial (plist-put artificial 985 (setq artificial (plist-put artificial
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 2a36c43130c..5b3489a72ee 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -3463,7 +3463,7 @@ possible values."
3463 combined-lapsed)) 3463 combined-lapsed))
3464 (error "Unknown conversion type: %s" type)) 3464 (error "Unknown conversion type: %s" type))
3465 (condition-case () 3465 (condition-case ()
3466 (let ((time (date-to-time date))) 3466 (let ((time (ignore-errors (date-to-time date))))
3467 (cond 3467 (cond
3468 ;; Convert to the local timezone. 3468 ;; Convert to the local timezone.
3469 ((eq type 'local) 3469 ((eq type 'local)
@@ -3515,6 +3515,7 @@ possible values."
3515 (segments 3) 3515 (segments 3)
3516 lapsed-string) 3516 lapsed-string)
3517 (while (and 3517 (while (and
3518 time
3518 (setq lapsed-string 3519 (setq lapsed-string
3519 (concat " (" (article-lapsed-string time segments) ")")) 3520 (concat " (" (article-lapsed-string time segments) ")"))
3520 (> (+ (length date-string) 3521 (> (+ (length date-string)