From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/67748 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.gnus.general Subject: Re: nnimap-authinfo-file customization proposes "inline" format Date: Mon, 03 Nov 2008 15:02:52 -0600 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <86zlkg1q0z.fsf@lifelogs.com> References: <87prlhg5n2.fsf@gmail.com> <86ej1w650q.fsf@lifelogs.com> <87mygk4ndz.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1225746227 1268 80.91.229.12 (3 Nov 2008 21:03:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 3 Nov 2008 21:03:47 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M16199@lists.math.uh.edu Mon Nov 03 22:04:50 2008 connect(): Connection refused Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1Kx6bJ-00042B-Sq for ding-account@gmane.org; Mon, 03 Nov 2008 22:04:42 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1Kx6Zr-0007yz-CH; Mon, 03 Nov 2008 15:03:11 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1Kx6Zp-0007yj-Sb for ding@lists.math.uh.edu; Mon, 03 Nov 2008 15:03:09 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.69) (envelope-from ) id 1Kx6Zn-0003me-Cx for ding@lists.math.uh.edu; Mon, 03 Nov 2008 15:03:09 -0600 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1Kx6Zw-0000ge-00 for ; Mon, 03 Nov 2008 22:03:16 +0100 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Kx6Zh-0002nd-FC for ding@gnus.org; Mon, 03 Nov 2008 21:03:01 +0000 Original-Received: from 38.98.147.130 ([38.98.147.130]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 03 Nov 2008 21:03:01 +0000 Original-Received: from tzz by 38.98.147.130 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 03 Nov 2008 21:03:01 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 148 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 38.98.147.130 X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6;d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:pZMmPS/ATBcBJAsh3C8rSG6yRsA= X-Spam-Score: -1.5 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:67748 Archived-At: On Fri, 31 Oct 2008 19:42:32 +0100 Paul R wrote: PR> M-x customize-variable RET nnimap-authinfo-file RET PR> From 'Value menu' choose "inline", then INS a new entry. PR> Save it, try to use it : That won't work, because netrc-parse expects PR> a file name and nothing else. Can you try the following patch? Thanks Ted Index: netrc.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/netrc.el,v retrieving revision 7.25 diff -c -r7.25 netrc.el *** netrc.el 11 Jun 2008 14:19:44 -0000 7.25 --- netrc.el 3 Nov 2008 21:01:40 -0000 *************** *** 59,119 **** (defun netrc-parse (file) (interactive "fFile to Parse: ") "Parse FILE and return a list of all entries in the file." ! (when (file-exists-p file) ! (with-temp-buffer ! (let ((tokens '("machine" "default" "login" ! "password" "account" "macdef" "force" ! "port")) ! (encryption-model (when (netrc-bound-and-true-p encrypt-file-alist) ! (encrypt-find-model file))) ! alist elem result pair) ! (if encryption-model ! (encrypt-insert-file-contents file encryption-model) ! (insert-file-contents file)) ! (goto-char (point-min)) ! ;; Go through the file, line by line. ! (while (not (eobp)) ! (narrow-to-region (point) (point-at-eol)) ! ;; For each line, get the tokens and values. (while (not (eobp)) ! (skip-chars-forward "\t ") ! ;; Skip lines that begin with a "#". ! (if (eq (char-after) ?#) ! (goto-char (point-max)) ! (unless (eobp) ! (setq elem ! (if (= (following-char) ?\") ! (read (current-buffer)) ! (buffer-substring ! (point) (progn (skip-chars-forward "^\t ") ! (point))))) ! (cond ! ((equal elem "macdef") ! ;; We skip past the macro definition. ! (widen) ! (while (and (zerop (forward-line 1)) ! (looking-at "$"))) ! (narrow-to-region (point) (point))) ! ((member elem tokens) ! ;; Tokens that don't have a following value are ignored, ! ;; except "default". ! (when (and pair (or (cdr pair) ! (equal (car pair) "default"))) ! (push pair alist)) ! (setq pair (list elem))) ! (t ! ;; Values that haven't got a preceding token are ignored. ! (when pair ! (setcdr pair elem) ! (push pair alist) ! (setq pair nil))))))) ! (when alist ! (push (nreverse alist) result)) ! (setq alist nil ! pair nil) ! (widen) ! (forward-line 1)) ! (nreverse result))))) (defun netrc-machine (list machine &optional port defaultport) "Return the netrc values from LIST for MACHINE or for the default entry. --- 59,121 ---- (defun netrc-parse (file) (interactive "fFile to Parse: ") "Parse FILE and return a list of all entries in the file." ! (if (listp file) ! file ! (when (file-exists-p file) ! (with-temp-buffer ! (let ((tokens '("machine" "default" "login" ! "password" "account" "macdef" "force" ! "port")) ! (encryption-model (when (netrc-bound-and-true-p encrypt-file-alist) ! (encrypt-find-model file))) ! alist elem result pair) ! (if encryption-model ! (encrypt-insert-file-contents file encryption-model) ! (insert-file-contents file)) ! (goto-char (point-min)) ! ;; Go through the file, line by line. (while (not (eobp)) ! (narrow-to-region (point) (point-at-eol)) ! ;; For each line, get the tokens and values. ! (while (not (eobp)) ! (skip-chars-forward "\t ") ! ;; Skip lines that begin with a "#". ! (if (eq (char-after) ?#) ! (goto-char (point-max)) ! (unless (eobp) ! (setq elem ! (if (= (following-char) ?\") ! (read (current-buffer)) ! (buffer-substring ! (point) (progn (skip-chars-forward "^\t ") ! (point))))) ! (cond ! ((equal elem "macdef") ! ;; We skip past the macro definition. ! (widen) ! (while (and (zerop (forward-line 1)) ! (looking-at "$"))) ! (narrow-to-region (point) (point))) ! ((member elem tokens) ! ;; Tokens that don't have a following value are ignored, ! ;; except "default". ! (when (and pair (or (cdr pair) ! (equal (car pair) "default"))) ! (push pair alist)) ! (setq pair (list elem))) ! (t ! ;; Values that haven't got a preceding token are ignored. ! (when pair ! (setcdr pair elem) ! (push pair alist) ! (setq pair nil))))))) ! (when alist ! (push (nreverse alist) result)) ! (setq alist nil ! pair nil) ! (widen) ! (forward-line 1)) ! (nreverse result)))))) (defun netrc-machine (list machine &optional port defaultport) "Return the netrc values from LIST for MACHINE or for the default entry.