From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/77499 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.gnus.general Subject: Re: auth-source-search Date: Fri, 04 Mar 2011 08:55:11 -0600 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <87pqq77x68.fsf@lifelogs.com> References: <87zkpbzwar.fsf@lifelogs.com> <6eoc5r6vrq.fsf@news.eternal-september.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1299250550 4357 80.91.229.12 (4 Mar 2011 14:55:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 4 Mar 2011 14:55:50 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M25822@lists.math.uh.edu Fri Mar 04 15:55:46 2011 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.69) (envelope-from ) id 1PvWPy-0005Jq-5R for ding-account@gmane.org; Fri, 04 Mar 2011 15:55:46 +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 1PvWPj-0002E2-42; Fri, 04 Mar 2011 08:55:31 -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 1PvWPh-0002Dg-HX for ding@lists.math.uh.edu; Fri, 04 Mar 2011 08:55:29 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1PvWPe-0005Mi-8x for ding@lists.math.uh.edu; Fri, 04 Mar 2011 08:55:27 -0600 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1PvWPd-0004Su-JX for ding@gnus.org; Fri, 04 Mar 2011 15:55:25 +0100 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PvWPd-00059c-BY for ding@gnus.org; Fri, 04 Mar 2011 15:55:25 +0100 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 ; Fri, 04 Mar 2011 15:55:25 +0100 Original-Received: from tzz by 38.98.147.130 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 04 Mar 2011 15:55:25 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 48 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.110014 (No Gnus v0.14) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:xMTHZuGvBTPa1sWLyi946szEa2M= X-Spam-Score: -0.7 (/) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:77499 Archived-At: (btw, you have the list name as "nognus" but that's only the name of the current Gnus release) On Fri, 04 Mar 2011 11:10:49 +0100 Richard Riley wrote: RR> Since this is probably such a required thing for anything needing RR> passwords (erc, identica, gnus, git etc etc), would not a RR> "auth-password" function make sense? That's what `auth-source-user-or-password' did and it was not so good. A simple API hides the underlying complexity of the multiple backends and tokens that auth-source.el supports. Since the consumers of the auth-source API are other packages and not the end users, it makes sense to keep the API flexible and powerful. There is only one (interactive) function in auth-source.el (`auth-source-forget-all-cached') currently and that's intentional. In your example with org-mode, it's better to add the auth-source query in org-mode itself instead of asking the user to do the query. The complexity can then be hidden and abstracted in whatever way makes sense for org-mode specifically. org-mode should not require you, the user, to do an auth-source query. So maybe for user convenience I can provide a wrapper like `auth-source-pick-first-secret' but I am seriously concerned that such a wrapper will grow in complexity and "convenience" until its complexity overwhelms its utility. I would like some more feedback. RR> I struggled for ages to get this to work ;) Its not my code per se above RR> but the results of collaboration on #emacs where more than one person RR> other than me was baffled by the complexity of docstring. Most of the complexity has to do with creation and not searching. I will, as I said, provide examples of the common searches. The #emacs crowd should feel free to submit bug reports or improvement suggestions/patches. I promise to consider them carefully, but can't help anyone if their complaints are on an IRC channel. RR> Your code above is even more complex from my point of view - and I see RR> why since you detect the secret type. But the code above would almost RR> certainly benefit by being part of the API. My code is also more complex because it doesn't assume anything will work properly :) It belongs in a package instead of at the user level. Ted