From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Riley Newsgroups: gmane.emacs.help Subject: Re: epa when using emacs daemon / delaying function call until after emacsclient frame is opened Date: Wed, 22 Jun 2011 17:38:58 +0200 Organization: aich tea tea pea dicky riley dot net Message-ID: References: Reply-To: help-gnu-emacs@gnu.org NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1308757801 5880 80.91.229.12 (22 Jun 2011 15:50:01 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 22 Jun 2011 15:50:01 +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 Jun 22 17:49:57 2011 Return-path: Envelope-to: geh-help-gnu-emacs@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 1QZPgi-0005ZW-Tx for geh-help-gnu-emacs@m.gmane.org; Wed, 22 Jun 2011 17:49:57 +0200 Original-Received: from localhost ([::1]:57121 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZPgi-0003kO-8M for geh-help-gnu-emacs@m.gmane.org; Wed, 22 Jun 2011 11:49:56 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:59778) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZPWC-0001av-8c for help-gnu-emacs@gnu.org; Wed, 22 Jun 2011 11:39:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QZPWA-0001rE-TQ for help-gnu-emacs@gnu.org; Wed, 22 Jun 2011 11:39:04 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:37683) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZPWA-0001qo-E5 for help-gnu-emacs@gnu.org; Wed, 22 Jun 2011 11:39:02 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QZPW3-0007mB-Qj for help-gnu-emacs@gnu.org; Wed, 22 Jun 2011 17:38:55 +0200 Original-Received: from 85.183.18.158 ([85.183.18.158]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 22 Jun 2011 17:38:55 +0200 Original-Received: from rileyrg by 85.183.18.158 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 22 Jun 2011 17:38:55 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 40 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 85.183.18.158 Mail-Copies-To: never User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:GSbGUVssePJ0cUacPkmwOD5yISI= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 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:81398 Archived-At: Benjamin Slade writes: > Context: I run emacs as a daemon. > > Problem: I have an emacs module (gmail-notifier) loading on > emacs-startup in my .emacs which makes reference to a private file > stored as a .gpg. Since this tries to load on start-up, it asks for > the encryption password on startup. The problem with this is (1) it > doesn't actually work: for some reason I get a "wrong number of > arguments error" and (2) even if it did work, it would be > inconvenient, since I have the emacs daemon autoload on boot-up. > > What would seem ideal is to only have the .gpg loaded once an > emacsclient frame is opened. This page (http:// > splash-of-open-sauce.blogspot.com/2011/02/ > securing-your-private-email-credentials_7309.html ) discusses a > similar situation, and suggests doing something like this: > > > (defun load-secure-config(frame) > (require 'my-config "my-config.gpg")) > > > > (add-hook 'after-make-frame-functions 'load-secure-config) > > Essentially putting the reference to the .gpg file in a function which is only called once the "make-frame-functions" have run. > > > > This seems like a good solution but didn't work for me. Using it resulted in emacs completely freezing as soon as I opened an emacsclient frame. > > Is there another way of delaying the calling of a function until after an emacsclient is opened? Just FYI that was my article and I ended up giving up.... Weak I know ;) I start emacs daemon when I first start emacs and use the gpg agent and gtk-pinentry.