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 15:39:00 +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 1288886753 13555 80.91.229.12 (4 Nov 2010 16:05:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 4 Nov 2010 16:05:53 +0000 (UTC) To: emacs-help Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 04 17:05:48 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 1PE2Jw-0004NO-BL for geh-help-gnu-emacs@m.gmane.org; Thu, 04 Nov 2010 17:05:48 +0100 Original-Received: from localhost ([127.0.0.1]:46859 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PE2Jv-0004Lw-Pg for geh-help-gnu-emacs@m.gmane.org; Thu, 04 Nov 2010 12:05:47 -0400 Original-Received: from [140.186.70.92] (port=42848 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PE29M-0007ih-A9 for help-gnu-emacs@gnu.org; Thu, 04 Nov 2010 11:55:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PE1u1-0003Oj-Ri for help-gnu-emacs@gnu.org; Thu, 04 Nov 2010 11:39:03 -0400 Original-Received: from mail-px0-f169.google.com ([209.85.212.169]:62908) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PE1u1-0003Oa-LH for help-gnu-emacs@gnu.org; Thu, 04 Nov 2010 11:39:01 -0400 Original-Received: by pxi12 with SMTP id 12so290127pxi.0 for ; Thu, 04 Nov 2010 08:39:00 -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:content-type :content-transfer-encoding; bh=1JgjUTRSnxNOopGivXZIIwSCN002AQ3d3T14Sg8wqOY=; b=a8HY9FDARMEnzjxIbeh6sAZGOEpCfAPJzxGwyJ+8hYpo7p1bFBHR0bUSTuiSRO4xuw ZnjKWgRg9T8w2qh1xqAzvFXD21rQN6pxf3HEr8FPGQnK7iPX9E6YSg0MCIn6fQXcMQCm cSgUljC5WKYJ97FQP4iodzNWhTiuw27Qy9Jmo= 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 :content-type:content-transfer-encoding; b=Zaftmm93VEZSUfK+mq0IwXirFhPoNs1YXWfEJyKPfsJFXvNkkVighThcQUxOjwBwUv nfYbcGdN/ATT0140kSVw42hDadzFSlFC5BJIatWK3eXTw07IvKHg6ub5X7+OygCO9Ufu kKocyQ9zBa0NAfx2GQN5zqgasdROISJjlHxY0= Original-Received: by 10.42.229.3 with SMTP id jg3mr592699icb.19.1288885140462; Thu, 04 Nov 2010 08:39:00 -0700 (PDT) Original-Received: by 10.42.179.132 with HTTP; Thu, 4 Nov 2010 08:39:00 -0700 (PDT) In-Reply-To: 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:75291 Archived-At: Hi, I just realized that the problem of writing > (custom-set-variables > '(epa-file-name-regexp "\\.txt$")) as I put in my previous post to force emacs to treat txt files with gpg encryption is that files of extension gpg then do not trigger the gpg mode. I tried wrting a regular expression that would include both txt and gpg extension files like this: (custom-set-variables '(epa-file-name-regexp "\(\\.txt$\)\|\(\\.gpg$\)") ) But there must be an error in my regular expression, because it doesn't wor= k. Many thanks for any help pointing out my error On Thu, Nov 4, 2010 at 12:24 PM, bar tomas wrote: > 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 Custo= m >> | does that automatically. >> `---- >> >> -- >> Bruno >> >