From: Mark Wooding Date: Mon, 21 Mar 2016 02:18:24 +0000 (+0000) Subject: el/dot-emacs.el: Add a (lightly modified) `nntp-open-authinfo-kludge'. X-Git-Url: https://git.distorted.org.uk/~mdw/profile/commitdiff_plain/4d5799eb030cc5ca0fad368fc0538d72c80e9fa7?ds=inline el/dot-emacs.el: Add a (lightly modified) `nntp-open-authinfo-kludge'. The original is by Richard Kettlewell, http://www.greenend.org.uk/rjk/tech/authinfo.html I've changed it a bit, to be able to set the magic `NNTPAUTH' variable differently for different Gnus select methods. --- diff --git a/el/dot-emacs.el b/el/dot-emacs.el index e50d773..b307dc2 100644 --- a/el/dot-emacs.el +++ b/el/dot-emacs.el @@ -508,6 +508,27 @@ so that it can be used for convenient filtering." (setenv "REAL_MOVEMAIL" try)) (setq path (cdr path))))) +;; AUTHINFO GENERIC kludge. + +(defvar nntp-authinfo-generic nil + "Set to the `NNTPAUTH' string to pass on to `authinfo-kludge'. + +Use this to arrange for per-server settings.") + +(defun nntp-open-authinfo-kludge (buffer) + "Open a connection to SERVER using `authinfo-kludge'." + (let ((proc (start-process "nntpd" buffer + "env" (concat "NNTPAUTH=" + (or nntp-authinfo-generic + (getenv "NNTPAUTH") + (error "NNTPAUTH unset"))) + "authinfo-kludge" nntp-address))) + (set-buffer buffer) + (nntp-wait-for-string "^\r*200") + (beginning-of-line) + (delete-region (point-min) (point)) + proc)) + (eval-after-load "erc" '(load "~/.ercrc.el"))