From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.devel Subject: Re: nnimap-user setting? Date: Thu, 14 Apr 2011 10:05:39 -0500 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <87zkns98l8.fsf@lifelogs.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1302794421 30430 80.91.229.12 (14 Apr 2011 15:20:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 14 Apr 2011 15:20:21 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 14 17:20:14 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QAOL7-0006zX-Tc for ged-emacs-devel@m.gmane.org; Thu, 14 Apr 2011 17:20:14 +0200 Original-Received: from localhost ([::1]:59691 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QAOL7-0008Eo-DC for ged-emacs-devel@m.gmane.org; Thu, 14 Apr 2011 11:20:13 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:37999) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QAOL4-0008Ei-HU for emacs-devel@gnu.org; Thu, 14 Apr 2011 11:20:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QAOL3-0007BO-Cl for emacs-devel@gnu.org; Thu, 14 Apr 2011 11:20:10 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:46784) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QAOL3-0007BJ-2J for emacs-devel@gnu.org; Thu, 14 Apr 2011 11:20:09 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QAOL1-0006v9-Q2 for emacs-devel@gnu.org; Thu, 14 Apr 2011 17:20:07 +0200 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 ; Thu, 14 Apr 2011 17:20:07 +0200 Original-Received: from tzz by 38.98.147.130 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 14 Apr 2011 17:20:07 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 51 Original-X-Complaints-To: usenet@dough.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.110016 (No Gnus v0.16) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:PZxYli/JXVzOKjLdTx78yelD2OQ= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:138483 Archived-At: --=-=-= Content-Type: text/plain On Wed, 13 Apr 2011 14:22:47 -0300 Stefan Monnier wrote: SM> I'm apparently among the very few users who resist the temptation to SM> save their IMAP password into the authinfo file, but I find that in such SM> a case it is annoying to have to confirm the user name each and SM> every time. SM> So I think a patch like the one below would make sense (tho re-using SM> nnimap-authenticator to store the user name would work as well). Maybe it's better to use this new `nnimap-user' backend variable directly. IOW, if it's set, it should override anything from auth-source, and the auth-source search should not use `nnimap-user', just the host and the ports. WDYT? Ted --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=nnimap-user.patch diff --git a/lisp/nnimap.el b/lisp/nnimap.el index afdea18..1cf275d 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -55,6 +55,9 @@ (nnoo-declare nnimap) +(defvoo nnimap-user nil + "Username to use for authentication to the IMAP server. Overrides the username obtained from auth-source-search.") + (defvoo nnimap-address nil "The address of the IMAP server.") @@ -412,7 +415,8 @@ textual parts.") (setq nnimap-object nil) (let ((nnimap-inhibit-logging t)) (setq login-result - (nnimap-login (car credentials) (cadr credentials)))) + (nnimap-login (or nnimap-user (car credentials)) + (cadr credentials)))) (if (car login-result) (progn ;; Save the credentials if a save function exists --=-=-=--