diff lisp/net/netrc.el @ 110586:867180d035b0

auth-source.el (auth-source-create): Query the user for whether to store the credentials. auth-source.el: Require netrc. nnml.el (nnml-open-nov): Don't return dead buffers. gnus-picon.el (gnus-picon-xbm): Removed obsolete face. gnus-picon.el (gnus-picon-insert-glyph): Make the background white. gnus-art.el (gnus-treatment-function-alist): Insert picons after doing the header highlightling.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Sun, 26 Sep 2010 13:25:35 +0000
parents b3141c4861e2
children 3b9bd3888ee9
line wrap: on
line diff
--- a/lisp/net/netrc.el	Sun Sep 26 12:47:09 2010 +0000
+++ b/lisp/net/netrc.el	Sun Sep 26 13:25:35 2010 +0000
@@ -220,6 +220,17 @@
 			  (eq type (car (cddr service)))))))
     (cadr service)))
 
+(defun netrc-store-data (file host port user password)
+  (with-temp-buffer
+    (when (file-exists-p file)
+      (insert-file-contents file))
+    (goto-char (point-max))
+    (unless (bolp)
+      (insert "\n"))
+    (insert (format "machine %s login %s password %s port %s\n"
+		    host user password port))
+    (write-region (point-min) (point-max) file nil 'silent)))
+
 ;;;###autoload
 (defun netrc-credentials (machine &rest ports)
   "Return a user name/password pair.