From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rasmus Newsgroups: gmane.emacs.help Subject: Re: correct way to anticipate decryption failures Date: Wed, 16 Sep 2015 01:06:36 +0200 Message-ID: <87mvwn8epv.fsf@gmx.us> References: <87y4g78fkh.fsf@gmx.us> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1442358438 15836 80.91.229.3 (15 Sep 2015 23:07:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Sep 2015 23:07:18 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 16 01:07:05 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZbzJX-0003GF-OE for geh-help-gnu-emacs@m.gmane.org; Wed, 16 Sep 2015 01:07:03 +0200 Original-Received: from localhost ([::1]:46323 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbzJX-0005lu-1p for geh-help-gnu-emacs@m.gmane.org; Tue, 15 Sep 2015 19:07:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49581) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbzJK-0005lc-Kf for help-gnu-emacs@gnu.org; Tue, 15 Sep 2015 19:06:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbzJH-0005zW-7N for help-gnu-emacs@gnu.org; Tue, 15 Sep 2015 19:06:50 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:50037) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbzJG-0005yv-WF for help-gnu-emacs@gnu.org; Tue, 15 Sep 2015 19:06:47 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZbzJD-0002pv-38 for help-gnu-emacs@gnu.org; Wed, 16 Sep 2015 01:06:43 +0200 Original-Received: from tsn109-201-154-180.dyn.nltelcom.net ([109.201.154.180]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 16 Sep 2015 01:06:43 +0200 Original-Received: from rasmus by tsn109-201-154-180.dyn.nltelcom.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 16 Sep 2015 01:06:43 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 38 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: tsn109-201-154-180.dyn.nltelcom.net Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAtCAMAAADflBjwAAAATlBMVEUAAAAAAgAQAgAMAPsU FwAVIAAANAAwMQD7AADBIABOTwASYwBucACObQCKdwCCgQF1iwBomgBLqgAdvwCZmGcK3ACwsEYF /QC/wk/s7QDaAG5EAAAAAXRSTlMAQObYZgAAAAlwSFlzAAAewQAAHsEBw2lUUwAAAg1JREFUSMe1 ldG2oyAMRY1FpaCAUG5u//9HJwHUVsVxHiartaySDYckxKbZDNjyE5o7BqDUQF+l7gLCWgWW7PYO xZi74/9+v2F88/M28EvAz+/PfeBBwOPx+I/Ai4DX68UA/Ouh4V5M2RNKKi4TTkke2azNTwL4j/pG Qij7bb1iWghRq4lPM9ZOqJMyO5zsAbvFHVqPZJC02SMB4zjwWnk+OIch/g3gTfK8wdlhtjpgTBZu DIaJPFvoPwAr9giQABNwipG8I+oOYnCoe3QXgAtIShzGGHtoMbpIwOwqAG7mKb2tZT2BHrECkOQs yXA50Ig5RSeqAp0ftH4aLgVQEYPWDegQakApPCkl/xg6EXebC0lkLTylbKlOQ4onL6IMcqjP8sDT 5B+di7R61/cpcjHO1laBVsones9RzbegJT1pfaqCM0DKOVdD8qbUU6BMtVqbctxyw0Awai707ACl SE7Ies67h0yf9XIYt8TTHvXDxuSEaJYzmSwIjimG75s6jm5GX8JJCVscygB2EkE4Mlz8x484FGDX EaFLeor/sDaBtVHtXgOQLvIaz7XvLBeP7RvwIdDtL8Cwum0jq77SCKMxxi/AwWhyF7YiaTrzpgOU Kj4CS5GGuO41djStUxWfAOg5uI5uhnV5lBN+0svp9k/TtHQxgG1U7fpt3gEFwPYavnyrBO+DVgHu Ajd8/gAFdzaQIg/inAAAAABJRU5ErkJggg== User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:VETBidQtHKhEabe0YqXwyJVSxDU= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:107221 Archived-At: John Mastro writes: > Rasmus wrote: >> What is the correct way to handle decryption errors when using >> auth-source? I have something like, > >> >> (auth-source-search :host "worldwide.net" >> :user "rasmus" >> :max 1 :require '(:user :secret)) >> >> This throws a decryption error when I haven't plugged in my (physical) >> security token. >> >> Depending on the arguments, sometimes this is called at init time causing >> my daemon window to vanish, which is sort of annoying. >> >> Should I ignore-errors or is there a better way to test if I'm currently >> able to decrypt .authinfo.gpg? Could I re-throw the warning without it >> being an error? > > You can probably use `with-demoted-errors'. Something like: > > (with-demoted-errors "Auth source error: %s" > (auth-source-search :host "worldwide.net" > :user "rasmus" > :max 1 :require '(:user :secret))) Indeed, this works nicely, emacs -q --eval "(progn (require 'auth-source) (with-demoted-errors \"Auth source error: %s\" (auth-source-search :host \"worldwide.net\" :user \"rasmus\" :max 1 :require '(:user :secret))))" Thanks! Rasmus -- It was you, Jezebel, it was you