[gnus git] branch master updated: =2= Merge branch 'master' of https://git.gnus.org/gnus ; Override password-cache-expiry with auth-source-cache-expiry.

Ted Zlatanov <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  0cc97fd66f9bbdb3df85918e912f5ce0dce3c902 (commit)
       via  963493a3578cd475e5434cd83b4042a61c5397e9 (commit)
      from  4bf6dfbeba571f84b1da5c34d2423e3059814ccf (commit)


- Log -----------------------------------------------------------------
commit 0cc97fd66f9bbdb3df85918e912f5ce0dce3c902
Merge: 963493a 4bf6dfb
Author: Ted Zlatanov <[email protected]>
Date:   Wed Feb 16 16:05:52 2011 -0600

    Merge branch 'master' of https://git.gnus.org/gnus


commit 963493a3578cd475e5434cd83b4042a61c5397e9
Author: Ted Zlatanov <[email protected]>
Date:   Wed Feb 16 16:05:19 2011 -0600

    Override password-cache-expiry with auth-source-cache-expiry.
    
    * auth-source.el (auth-source-cache-expiry): New variable to override
    `password-cache-expiry'.
    (auth-source-remember): Use it.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2577934..f7adaa1 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -4,6 +4,9 @@
 	result when the user doesn't want to write to the file.
 	(auth-source-netrc-search): Expect a synthetic result and proceed
 	accordingly.
+	(auth-source-cache-expiry): New variable to override
+	`password-cache-expiry'.
+	(auth-source-remember): Use it.
 
 	* nnimap.el (nnimap-credentials): Remove the `inhibit-create'
 	parameter.  Create entry if necessary by using :create t.
diff --git a/lisp/auth-source.el b/lisp/auth-source.el
index 29829eb..2b284e3 100644
--- a/lisp/auth-source.el
+++ b/lisp/auth-source.el
@@ -61,6 +61,18 @@
   :version "23.1" ;; No Gnus
   :group 'gnus)
 
+;;;###autoload
+(defcustom auth-source-cache-expiry 7200
+  "How many seconds passwords are cached, or nil to disable
+expiring.  Overrides `password-cache-expiry' through a
+let-binding."
+  :group 'auth-source
+  :type '(choice (const :tag "Never" nil)
+                 (const :tag "All Day" 86400)
+                 (const :tag "2 Hours" 7200)
+                 (const :tag "30 Minutes" 1800)
+                 (integer :tag "Seconds")))
+
 (defclass auth-source-backend ()
   ((type :initarg :type
          :initform 'netrc
@@ -588,8 +600,9 @@ Returns the deleted entries."
 
 (defun auth-source-remember (spec found)
   "Remember FOUND search results for SPEC."
+  (let ((password-cache-expiry auth-source-cache-expiry))
   (password-cache-add
-   (concat auth-source-magic (format "%S" spec)) found))
+     (concat auth-source-magic (format "%S" spec)) found)))
 
 (defun auth-source-recall (spec)
   "Recall FOUND search results for SPEC."

-----------------------------------------------------------------------
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      |    3 +++
 lisp/auth-source.el |   17 +++++++++++++++--
 2 files changed, 18 insertions(+), 2 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.