From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/76719 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.gnus.general Subject: Re: auth-source.el and eieio Date: Mon, 14 Feb 2011 10:54:16 -0600 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <87hbc6sgjr.fsf@lifelogs.com> References: <87d3mv3pzp.fsf@gmx.de> <87y65iskm2.fsf@lifelogs.com> <87hbc6k48p.fsf@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1297702482 28451 80.91.229.12 (14 Feb 2011 16:54:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 14 Feb 2011 16:54:42 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M25061@lists.math.uh.edu Mon Feb 14 17:54:38 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 1Pp1h7-0003YL-P4 for ding-account@gmane.org; Mon, 14 Feb 2011 17:54:38 +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 1Pp1h1-0002GG-Qe; Mon, 14 Feb 2011 10:54: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 1Pp1h0-0002Fw-9M for ding@lists.math.uh.edu; Mon, 14 Feb 2011 10:54:30 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1Pp1gy-0003sb-Qe for ding@lists.math.uh.edu; Mon, 14 Feb 2011 10:54:29 -0600 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1Pp1gy-0005es-36 for ding@gnus.org; Mon, 14 Feb 2011 17:54:28 +0100 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Pp1gx-0003S3-KW for ding@gnus.org; Mon, 14 Feb 2011 17:54:27 +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 ; Mon, 14 Feb 2011 17:54:27 +0100 Original-Received: from tzz by 38.98.147.130 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 14 Feb 2011 17:54:27 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 61 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.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:2OHQVNG2oqpbdP8eSNt+/aRqH5Q= X-Spam-Score: -0.7 (/) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:76719 Archived-At: --=-=-= Content-Type: text/plain On Mon, 14 Feb 2011 16:47:18 +0100 Michael Albinus wrote: MA> Ted Zlatanov writes: >> It's all autoloaded, so the user will get an error when he searches. I >> can do an assert in `auth-source-secrets-search' to fail early or fail >> even earlier in `auth-source-backend-parse'. WDYT? MA> If there are no compilation errors, I believe it is OK to fail with a MA> meaningful message. MA> However, it gives the burden to the user to initialize auth-sources MA> depending on availability of secrets.el. So maybe it is more convenient MA> to ignore :secrets entries in such a case, raising a warning (with MA> confirmation to continue). Something like this, except using another warning facility besides `auth-source-do-debug'? I assume (featurep 'secrets) will work even if autoloading is used. Ted --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=auth-nosecrets.patch diff --git a/lisp/auth-source.el b/lisp/auth-source.el index 0692dbb..6a2e500 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el @@ -312,12 +312,19 @@ If the value is not a list, symmetric encryption will be used." (setq source (or (secrets-get-alias (symbol-name source)) "Login"))) - (auth-source-backend - (format "Secrets API (%s)" source) - :source source - :type 'secrets - :search-function 'auth-source-secrets-search - :create-function 'auth-source-secrets-create))) + (if (featurep 'secrets) + (auth-source-backend + (format "Secrets API (%s)" source) + :source source + :type 'secrets + :search-function 'auth-source-secrets-search + :create-function 'auth-source-secrets-create) + (auth-source-do-debug + "auth-source-backend-parse: no Secrets API, ignoring spec: %S" entry) + (auth-source-backend + (format "Ignored Secrets API (%s)" source) + :source "" + :type 'ignore)))) ;; none of them (t --=-=-=--