summaryrefslogtreecommitdiff
path: root/lisp/net/netrc.el
diff options
context:
space:
mode:
authorGnus developers <ding@gnus.org>2010-12-13 22:29:12 +0000
committerKatsumi Yamaoka <yamaoka@jpl.org>2010-12-13 22:29:12 +0000
commit7410c2700a7c3256a117ce9d1d3dbcd934a57589 (patch)
treefcc0cca3c89e1a46e5cfb8813403afd877612c82 /lisp/net/netrc.el
parentbc5576723b2ddaa0b4cb6a6ba368fa71bc5a8a0c (diff)
downloademacs-7410c2700a7c3256a117ce9d1d3dbcd934a57589.tar.gz
Merge changes made in Gnus trunk.
nnir.el (nnir-run-imap): Return article list in UID order. gnus-start.el (gnus-auto-subscribed-groups): Add nnimap to the list of automatically subscribed groups. (gnus-auto-subscribed-categories): New variable. (gnus-matches-options-n): Use it. (gnus-default-subscribed-newsgroups): Remove unused variable. (gnus-start-draft-setup): Message a bit less. gnus-agent.el (gnus-agentize): Don't create the queue group automatically on startup. It'll be created later, if needed. gnus-start.el (gnus-1): Clarify comment. (gnus-matches-options-n): Fix typo in last change. (gnus-1): Don't create the nndrafts group twice. (gnus-setup-news): There's no need to read the active file here, since that's done again later on a per-backend basis. (gnus-start-draft-setup): Make sure that the new group is started out empty. netrc.el (netrc-point-at-eol): Remove the unused netrc-point-at-old and netrc-bound-and-true-p bindings. (netrc-parse): Cache the netrc contents.
Diffstat (limited to 'lisp/net/netrc.el')
-rw-r--r--lisp/net/netrc.el26
1 files changed, 13 insertions, 13 deletions
diff --git a/lisp/net/netrc.el b/lisp/net/netrc.el
index ff0b52c2b96..989470becad 100644
--- a/lisp/net/netrc.el
+++ b/lisp/net/netrc.el
@@ -34,18 +34,6 @@
;;; .netrc and .authinfo rc parsing
;;;
-(defalias 'netrc-point-at-eol
- (if (fboundp 'point-at-eol)
- 'point-at-eol
- 'line-end-position))
-(eval-when-compile
- ;; This is unnecessary in the compiled version as it is a macro.
- (if (fboundp 'bound-and-true-p)
- (defalias 'netrc-bound-and-true-p 'bound-and-true-p)
- (defmacro netrc-bound-and-true-p (var)
- "Return the value of symbol VAR if it is bound, else nil."
- `(and (boundp (quote ,var)) ,var))))
-
(defgroup netrc nil
"Netrc configuration."
:group 'comm)
@@ -58,12 +46,15 @@
(defvar netrc-services-file "/etc/services"
"The name of the services file.")
+(defvar netrc-cache nil)
+
(defun netrc-parse (&optional file)
(interactive "fFile to Parse: ")
"Parse FILE and return a list of all entries in the file."
(unless file
(setq file netrc-file))
(if (listp file)
+ ;; We got already parsed contents; just return it.
file
(when (file-exists-p file)
(with-temp-buffer
@@ -71,7 +62,16 @@
"password" "account" "macdef" "force"
"port"))
alist elem result pair)
- (insert-file-contents file)
+ (if (and netrc-cache
+ (equal (car netrc-cache) (nth 5 (file-attributes file))))
+ ;; Store the contents of the file heavily encrypted in memory.
+ (insert (base64-decode-string (rot13-string (cdr netrc-cache))))
+ (insert-file-contents file)
+ (when (string-match "\\.gpg\\'" file)
+ (setq netrc-cache (cons (nth 5 (file-attributes file))
+ (rot13-string
+ (base64-encode-string
+ (buffer-string)))))))
(goto-char (point-min))
;; Go through the file, line by line.
(while (not (eobp))