diff options
| author | Gnus developers | 2010-12-13 22:29:12 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2010-12-13 22:29:12 +0000 |
| commit | 7410c2700a7c3256a117ce9d1d3dbcd934a57589 (patch) | |
| tree | fcc0cca3c89e1a46e5cfb8813403afd877612c82 /lisp/net | |
| parent | bc5576723b2ddaa0b4cb6a6ba368fa71bc5a8a0c (diff) | |
| download | emacs-7410c2700a7c3256a117ce9d1d3dbcd934a57589.tar.gz emacs-7410c2700a7c3256a117ce9d1d3dbcd934a57589.zip | |
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')
| -rw-r--r-- | lisp/net/netrc.el | 26 |
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 @@ | |||
| 34 | ;;; .netrc and .authinfo rc parsing | 34 | ;;; .netrc and .authinfo rc parsing |
| 35 | ;;; | 35 | ;;; |
| 36 | 36 | ||
| 37 | (defalias 'netrc-point-at-eol | ||
| 38 | (if (fboundp 'point-at-eol) | ||
| 39 | 'point-at-eol | ||
| 40 | 'line-end-position)) | ||
| 41 | (eval-when-compile | ||
| 42 | ;; This is unnecessary in the compiled version as it is a macro. | ||
| 43 | (if (fboundp 'bound-and-true-p) | ||
| 44 | (defalias 'netrc-bound-and-true-p 'bound-and-true-p) | ||
| 45 | (defmacro netrc-bound-and-true-p (var) | ||
| 46 | "Return the value of symbol VAR if it is bound, else nil." | ||
| 47 | `(and (boundp (quote ,var)) ,var)))) | ||
| 48 | |||
| 49 | (defgroup netrc nil | 37 | (defgroup netrc nil |
| 50 | "Netrc configuration." | 38 | "Netrc configuration." |
| 51 | :group 'comm) | 39 | :group 'comm) |
| @@ -58,12 +46,15 @@ | |||
| 58 | (defvar netrc-services-file "/etc/services" | 46 | (defvar netrc-services-file "/etc/services" |
| 59 | "The name of the services file.") | 47 | "The name of the services file.") |
| 60 | 48 | ||
| 49 | (defvar netrc-cache nil) | ||
| 50 | |||
| 61 | (defun netrc-parse (&optional file) | 51 | (defun netrc-parse (&optional file) |
| 62 | (interactive "fFile to Parse: ") | 52 | (interactive "fFile to Parse: ") |
| 63 | "Parse FILE and return a list of all entries in the file." | 53 | "Parse FILE and return a list of all entries in the file." |
| 64 | (unless file | 54 | (unless file |
| 65 | (setq file netrc-file)) | 55 | (setq file netrc-file)) |
| 66 | (if (listp file) | 56 | (if (listp file) |
| 57 | ;; We got already parsed contents; just return it. | ||
| 67 | file | 58 | file |
| 68 | (when (file-exists-p file) | 59 | (when (file-exists-p file) |
| 69 | (with-temp-buffer | 60 | (with-temp-buffer |
| @@ -71,7 +62,16 @@ | |||
| 71 | "password" "account" "macdef" "force" | 62 | "password" "account" "macdef" "force" |
| 72 | "port")) | 63 | "port")) |
| 73 | alist elem result pair) | 64 | alist elem result pair) |
| 74 | (insert-file-contents file) | 65 | (if (and netrc-cache |
| 66 | (equal (car netrc-cache) (nth 5 (file-attributes file)))) | ||
| 67 | ;; Store the contents of the file heavily encrypted in memory. | ||
| 68 | (insert (base64-decode-string (rot13-string (cdr netrc-cache)))) | ||
| 69 | (insert-file-contents file) | ||
| 70 | (when (string-match "\\.gpg\\'" file) | ||
| 71 | (setq netrc-cache (cons (nth 5 (file-attributes file)) | ||
| 72 | (rot13-string | ||
| 73 | (base64-encode-string | ||
| 74 | (buffer-string))))))) | ||
| 75 | (goto-char (point-min)) | 75 | (goto-char (point-min)) |
| 76 | ;; Go through the file, line by line. | 76 | ;; Go through the file, line by line. |
| 77 | (while (not (eobp)) | 77 | (while (not (eobp)) |