From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/77641 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.gnus.general Subject: Re: auth-source-search Date: Wed, 09 Mar 2011 09:39:48 -0600 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <87r5agpakb.fsf@lifelogs.com> References: <87zkpbzwar.fsf@lifelogs.com> <6eoc5r6vrq.fsf@news.eternal-september.org> <87pqq77x68.fsf@lifelogs.com> <87pqq225cf.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1299685233 31937 80.91.229.12 (9 Mar 2011 15:40:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 9 Mar 2011 15:40:33 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M25963@lists.math.uh.edu Wed Mar 09 16:40:29 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 1PxLUs-0004Zn-UY for ding-account@gmane.org; Wed, 09 Mar 2011 16:40:23 +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 1PxLUi-0001E5-P8; Wed, 09 Mar 2011 09:40:12 -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 1PxLUg-0001Di-QF for ding@lists.math.uh.edu; Wed, 09 Mar 2011 09:40:10 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1PxLUb-00036f-Qh for ding@lists.math.uh.edu; Wed, 09 Mar 2011 09:40:10 -0600 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1PxLUb-0002KV-3z for ding@gnus.org; Wed, 09 Mar 2011 16:40:05 +0100 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PxLUX-0004PH-Nr for ding@gnus.org; Wed, 09 Mar 2011 16:40:01 +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 ; Wed, 09 Mar 2011 16:40:01 +0100 Original-Received: from tzz by 38.98.147.130 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 09 Mar 2011 16:40:01 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 31 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:KABbehiqZo5Z+NA1jW2tGVo051E= X-Spam-Score: -0.7 (/) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:77641 Archived-At: On Mon, 07 Mar 2011 11:44:16 -0600 Ted Zlatanov wrote: TZ> On Sat, 05 Mar 2011 11:21:12 +0100 Lars Magne Ingebrigtsen wrote: LMI> Ted Zlatanov writes: >>> 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. LMI> I think it would make sense to add that, otherwise all the auth-source LMI> consumers will just implement their own, buggier versions of the same, LMI> probably. :-) TZ> Are you thinking of a wrapper around `auth-source-search' that gets TZ> :secret from the first result and evaluates it if it's a function? That TZ> seems OK. Or do you mean we need a separate query syntax? How about this implementation: (defun auth-source-pick-first-secret (spec) "Pick the first secret found from applying SPEC to `auth-source-search'." (let* ((result (nth 0 (apply 'auth-source-search spec))) (secret (plist-get result :secret))) (if (functionp secret) (funcall secret) secret))) Is that OK with you? Ted