From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bar tomas Newsgroups: gmane.emacs.help Subject: Re: Setting file extensions to be handled by gpg encryption problem Date: Thu, 4 Nov 2010 12:24:50 +0000 Message-ID: References: <8739rh48iz.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1288873523 10222 80.91.229.12 (4 Nov 2010 12:25:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 4 Nov 2010 12:25:23 +0000 (UTC) Cc: emacs-help To: Bruno Tavernier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 04 13:25:19 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PDysX-00020h-Eq for geh-help-gnu-emacs@m.gmane.org; Thu, 04 Nov 2010 13:25:17 +0100 Original-Received: from localhost ([127.0.0.1]:59302 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PDysW-00083i-W8 for geh-help-gnu-emacs@m.gmane.org; Thu, 04 Nov 2010 08:25:17 -0400 Original-Received: from [140.186.70.92] (port=49875 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PDys8-00083R-Ns for help-gnu-emacs@gnu.org; Thu, 04 Nov 2010 08:24:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PDys7-0003t3-Ll for help-gnu-emacs@gnu.org; Thu, 04 Nov 2010 08:24:52 -0400 Original-Received: from mail-gy0-f169.google.com ([209.85.160.169]:57463) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PDys7-0003sx-Hx for help-gnu-emacs@gnu.org; Thu, 04 Nov 2010 08:24:51 -0400 Original-Received: by gyd8 with SMTP id 8so1070181gyd.0 for ; Thu, 04 Nov 2010 05:24:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=abhBhmve4TdYISF+p86IZOLBnRfYF9AaMGOvXBL3ilc=; b=gmFJK1FgBZEooC6eaQ195kbYXBZPXgDUVSVIMK6SQ+fID0m6WZ+mcqMedVxNQvmxzT 759FQvmSBnBqC9ey3AUeL6SJHLQqgt0NLa+Gm/qB3sZPG2g0GmlVV7RTotrwWTlCGGdE jYA/2VNLqO/CQuZffztI+KW/pLZ31lt5xlIz0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=x4nD97vGvzwJLaJmg/BQnTo/rLddafBxCAecM4n3mB3a0GYp7VAWpK8+E3kcWuc81M sZ6LnCUvO3Gt0V9Z49QbBxCBUkr9StO+GahMXUcXZZNSEkNKt1GWFPUr3pUuBv2Mqg6/ C7+OALxbKwHEcd4zmpk5qdpXILJ32zVhTFkso= Original-Received: by 10.42.219.69 with SMTP id ht5mr256295icb.354.1288873490833; Thu, 04 Nov 2010 05:24:50 -0700 (PDT) Original-Received: by 10.42.179.132 with HTTP; Thu, 4 Nov 2010 05:24:50 -0700 (PDT) In-Reply-To: <8739rh48iz.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:75289 Archived-At: Many thanks! I defined it in custom-set-variables in the .emacs init file, as suggested in your post and now it works directly: (custom-set-variables '(epa-file-name-regexp "\\.txt$")) Thanks again. On Thu, Nov 4, 2010 at 11:45 AM, Bruno Tavernier wrote: > Hi Tomas, > >> I'm using gpg to encrypt files and I would like that files with 'txt' >> extension be treated like 'gpg' files. >> I read in the doc that this can be controlled with the variable >> epa-file-name-regexp >> So I added the following line at the end of my .emacs file >> >> (setq epa-file-name-regexp "\\.txt$") >> >> But this has absolutely no effect. I mean, if I create a txt file with >> emacs, when I save it I would like for emacs to ask for an encryption >> paraphrase, but it does not. > > I just tried, it indeed does not work with that line only. > You have then to call `epa-file-name-regexp-update' to make it works. > > cf describe-variable epa-file-name-regexp > ,---- > | epa-file-name-regexp is a variable defined in `epa-hook.el'. > | Its value is > | "\\.gpg\\(~\\|\\.~[0-9]+~\\)?\\'" > | > | Documentation: > | Regexp which matches filenames to be encrypted with GnuPG. > | > | If you set this outside Custom while epa-file is already enabled, you > | have to call `epa-file-name-regexp-update' after setting it to > | properly update file-name-handler-alist. =A0Setting this through Custom > | does that automatically. > `---- > > -- > Bruno >