From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Benjamin Slade Newsgroups: gmane.emacs.help Subject: epa when using emacs daemon / delaying function call until after emacsclient frame is opened Date: Wed, 22 Jun 2011 08:53:55 -0500 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0016e6dd8916d15fe004a64d4d07 X-Trace: dough.gmane.org 1308755625 23438 80.91.229.12 (22 Jun 2011 15:13:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 22 Jun 2011 15:13:45 +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:13:37 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 1QZP7Z-0001bz-KQ for geh-help-gnu-emacs@m.gmane.org; Wed, 22 Jun 2011 17:13:37 +0200 Original-Received: from localhost ([::1]:39172 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZP7Y-0003p3-GU for geh-help-gnu-emacs@m.gmane.org; Wed, 22 Jun 2011 11:13:36 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:42319) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZNsp-0001p5-Hp for help-gnu-emacs@gnu.org; Wed, 22 Jun 2011 09:54:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QZNsn-0001ZG-IV for help-gnu-emacs@gnu.org; Wed, 22 Jun 2011 09:54:19 -0400 Original-Received: from mail-ww0-f49.google.com ([74.125.82.49]:39101) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZNsn-0001Z6-2m for help-gnu-emacs@gnu.org; Wed, 22 Jun 2011 09:54:17 -0400 Original-Received: by wwf22 with SMTP id 22so683112wwf.30 for ; Wed, 22 Jun 2011 06:54:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=XqYyx7rH/N3ud2hwMvSg4NPIjbr/lQLQmb4G5hCBf00=; b=pKcrz3/PVeYQkAEFVv8RC+LbcSDP9+GGCzCXcPV0ByF2T+IIUAQauSHEhr8DREjE26 WfArS4tFpGMhzO8NEKHSLgrCHwRsGX7A2C0/PfY/ZLTMIKR/Yjd3fSH83ATWkZH2/oA7 ms3MQfeNX5bqgc1e6aJQPZ+i7yJRmpAJRWwb4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; b=Y5UtyCxUOiLI6k6TKf2quSyYWj5YPPzQ2+2TjciMWPkcfiO39VfNSOgBmIJhNkn1QB p//ZE3uvr88QonFSA1wESwkl6au7q/lSfOSGc12OeOg2KfLNSDAn6yZZCk+hS3SHqHmN gUz7rVaikuLj4huEeI1rO1/2pjCAS4+WNv6Ac= Original-Received: by 10.216.82.146 with SMTP id o18mr799008wee.7.1308750855102; Wed, 22 Jun 2011 06:54:15 -0700 (PDT) Original-Received: by 10.216.159.84 with HTTP; Wed, 22 Jun 2011 06:53:55 -0700 (PDT) X-Google-Sender-Auth: W53mqael_bJVUWhDr8ospjcFpL8 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.49 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:81397 Archived-At: --0016e6dd8916d15fe004a64d4d07 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Context: I run emacs as a daemon. Problem: I have an emacs module (gmail-notifier) loading on emacs-startup i= n 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-emai= l-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? --=20 ---------------------------------------------------------------------------= -------------------------- Benjamin Slade Dept. of Linguistics University of Illinois at Urbana-Champaign [ http://www.jnanam.net/slade/ ] St=C3=A6fcr=C3=A6ft & Vy=C4=81kara=E1=B9=87a (lingblog) - http://staefcraef= t.blogspot.com The Babbage Files (techblog) - http://babbagefiles.blogspot.com ---------------------------------------------------------------------------= -------------------------- *=E0=A4=AA*=E0=A4=B0=E0=A5=8B =E0=A4=BD=E0=A4=95=E0=A5=8D=E0=A4=B7=E0=A5= =91=E0=A4=95=E0=A4=BE*=E0=A4=AE=E0=A4=BE* =E0=A4=B9=E0=A4=BF *=E0=A4=A6=E0= =A5=87*=E0=A4=B5=E0=A4=BE=E0=A4=83 'The gods love the obscure.' (=C5=9Aatapathabr=C4=81ma=E1=B9=87a 6.1.1.= 2) --0016e6dd8916d15fe004a64d4d07 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Context: I run emacs as a daemon.

Problem: I have an emacs module (g= mail-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, i= t 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 o= f arguments error" and (2) even if it did work, it would be inconvenie= nt, since I have the emacs daemon autoload on boot-up.

What would seem ideal is to only have the .gpg loaded once an emacsclie= nt frame is opened. This page (http://s= plash-of-open-sauce.blogspot.com/2011/02/securing-your-private-email-creden= tials_7309.html ) discusses a similar situation, and suggests doing som= ething like this:

(defu=
n load-secure-config(frame)   (require 'my-config "my-co=
nfig.gpg"))

(add-hook 'after-make-frame-functions 'load-secure-config)
Essentially putt= ing 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 re= sulted in emacs completely freezing as soon as I opened an emacsclient fram= e.

Is there another way of delaying the calling of a function until = after an emacsclient is opened?


--
---------------------------------= --------------------------------------------------------------------
Benjamin Slade
Dept. of Linguistics
University of Illinois at Urbana-Champaign=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
[ http://www.jna= nam.net/slade/ ]=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0
=C2=A0=C2=A0
St=C3=A6fcr=C3=A6ft & Vy=C4=81kara=E1=B9=87a (lingblog) - http://staefcraeft.blogsp= ot.com
The Babbage Files (techblog) - http://babbagefiles.blogspot.com

---------------------------------------------------------------------------= --------------------------
=C2=A0 =E0=A4=AA=E0=A4=B0=E0=A5=8B =E0=A4=BD=E0=A4=95=E0=A5=8D=E0=A4= =B7=E0=A5=91=E0=A4=95=E0=A4=BE=E0=A4=AE=E0=A4=BE =E0=A4=B9=E0=A4=BF = =E0=A4=A6=E0=A5=87=E0=A4=B5=E0=A4=BE=E0=A4=83
=C2=A0 =C2=A0 'The gods love the obscure.' (=C5=9Aatapathabr=C4=81m= a=E1=B9=87a 6.1.1.2)
--0016e6dd8916d15fe004a64d4d07--