[gnus git] branch master updated: n0-13-31-gdcc8c1a
Ted Zlatanov <[email protected]>
| Newsgroups | gmane.emacs.gnus.cvs |
|---|---|
| Message-ID | <[email protected]> |
via dcc8c1aefc5eed4145e11416dfc0996e06833659 (commit)
from 70beebc3532354d81040855cd145540e0cc02701 (commit)
- Log -----------------------------------------------------------------
commit dcc8c1aefc5eed4145e11416dfc0996e06833659
Author: Ted Zlatanov <[email protected]>
Date: Wed Feb 23 08:46:32 2011 -0600
Fix multiple parameter print bug.
* 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.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b3f9a24..b8c543b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -2,6 +2,10 @@
* 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.
2011-02-23 Lars Ingebrigtsen <[email protected]>
diff --git a/lisp/auth-source.el b/lisp/auth-source.el
index 79f97f8..3081bc2 100644
--- a/lisp/auth-source.el
+++ b/lisp/auth-source.el
@@ -908,6 +908,11 @@ See `auth-source-search' for details on SPEC."
(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)))
@@ -953,9 +958,7 @@ See `auth-source-search' for details on SPEC."
(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,
@@ -971,9 +974,18 @@ See `auth-source-search' for details on SPEC."
((and (null data) (eq r 'secret))
;; special case prompt for passwords
(read-passwd (format "Password for %s@%s:%s: "
- (or (aget valist 'user) "[any user]")
- (or (aget valist 'host) "[any host]")
- (or (aget valist 'port) "[any port]"))))
+ (or
+ (auth-source-netrc-element-or-first
+ (aget valist 'user))
+ "[any user]")
+ (or
+ (auth-source-netrc-element-or-first
+ (aget valist 'host))
+ "[any host]")
+ (or
+ (auth-source-netrc-element-or-first
+ (aget valist 'port))
+ "[any port]"))))
(t data)))
(when data
-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.
Summary of changes:
lisp/ChangeLog | 4 ++++
lisp/auth-source.el | 24 ++++++++++++++++++------
2 files changed, 22 insertions(+), 6 deletions(-)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".
The branch, master has been updated
hooks/post-receive
--
Gnus Project