[gnus git] branch master updated: n0-13-38-g6677267

Ted Zlatanov <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  66772678b44e84b0f293b159875266ee1b964325 (commit)
      from  dcb73950e208a620704faf2a3d2fcb7c952e4288 (commit)


- Log -----------------------------------------------------------------
commit 66772678b44e84b0f293b159875266ee1b964325
Author: Ted Zlatanov <[email protected]>
Date:   Thu Feb 24 10:26:29 2011 -0600

    Improve save prompts and allow option to never save.
    
    * auth-source.el (auth-source-never-save): Add customizable option to
    never save info.
    (auth-source-netrc-create): Use it and improve save prompts.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 851c1c5..d1dae6c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -8,6 +8,8 @@
 	user-login-name.  Use `auth-source-creation-prompts' and some default
 	prompts for user, host, port, and password (the default generic prompt
 	remains ugly).
+	(auth-source-never-save): Add customizable option to never save info.
+	(auth-source-netrc-create): Use it and improve save prompts.
 
 2011-02-24  Katsumi Yamaoka  <[email protected]>
 
diff --git a/lisp/auth-source.el b/lisp/auth-source.el
index 02852ad..233b028 100644
--- a/lisp/auth-source.el
+++ b/lisp/auth-source.el
@@ -152,6 +152,12 @@ let-binding."
 
 (make-obsolete 'auth-source-hide-passwords nil "Emacs 24.1")
 
+(defcustom auth-source-never-save nil
+  "If set, auth-source will never ask to save."
+  :group 'auth-source
+  :version "23.2" ;; No Gnus
+  :type `boolean)
+
 (defvar auth-source-magic "auth-source-magic ")
 
 (defcustom auth-source-do-cache t
@@ -1074,22 +1080,41 @@ See `auth-source-search' for details on SPEC."
       (goto-char (point-max))
 
       ;; ask AFTER we've successfully opened the file
-      (let ((prompt (format "Add to file %s? %s: "
+      (let ((prompt (format "Save auth info to file %s? %s: "
                             file
-                            "(y)es/(n)o but use it/(e)dit line/(s)kip file"))
-            done k)
+                            "y/n/N/e/?"))
+            (done auth-source-never-save)
+            (bufname "*auth-source Help*")
+            k)
         (while (not done)
 	  (message "%s" prompt)
           (setq k (read-char))
           (case k
             (?y (setq done t))
+            (?? (with-output-to-temp-buffer bufname
+                  (princ
+                   (concat "(y)es, save\n"
+                           "(n)o but use the info\n"
+                           "(N)o and don't ask to save again\n"
+                           "(e)dit the line."))
+                  (set-buffer bufname)
+                  (help-mode)
+                  (help-print-return-message)))
             (?n (setq add ""
                       done t))
-            (?s (setq add ""
-                      done 'skip))
+            (?N (setq add ""
+                      done t
+                      auth-source-never-save t))
             (?e (setq add (read-string "Line to add: " add)))
             (t nil)))
 
+        (when (get-buffer-window bufname)
+          (delete-window (get-buffer-window bufname)))
+
+        ;; make sure the info is not saved
+        (when auth-source-never-save
+          (setq add ""))
+
         (when (< 0 (length add))
           (progn
             (unless (bolp)

-----------------------------------------------------------------------
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      |    2 ++
 lisp/auth-source.el |   35 ++++++++++++++++++++++++++++++-----
 2 files changed, 32 insertions(+), 5 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.