From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: [PATCH] Wash output of org-encrypt-entry, take 3 Date: Sun, 20 Mar 2011 17:10:49 -0400 Message-ID: <8739mhebvq.fsf@norang.ca> References: <87bp182hiw.fsf@wanadoo.es> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=52595 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q1Ptn-0000KA-1z for emacs-orgmode@gnu.org; Sun, 20 Mar 2011 17:10:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q1Ptk-0001VZ-QY for emacs-orgmode@gnu.org; Sun, 20 Mar 2011 17:10:54 -0400 Received: from mho-02-ewr.mailhop.org ([204.13.248.72]:52902) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q1Ptk-0001VO-NM for emacs-orgmode@gnu.org; Sun, 20 Mar 2011 17:10:52 -0400 In-Reply-To: <87bp182hiw.fsf@wanadoo.es> (=?utf-8?Q?=22=C3=93scar?= Fuentes"'s message of "Fri, 18 Mar 2011 23:25:11 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: =?utf-8?Q?=C3=93scar?= Fuentes Cc: emacs-orgmode@gnu.org =C3=93scar Fuentes writes: > With a gpg executable with default settings, org-encrypt-entry produces > output like this: > > -----BEGIN PGP MESSAGE----- > Version: GnuPG v1.4.10 (GNU/Linux) > > jA0EAwMCBWZVym6QMPVgyTxreTb1AEL3uTO+qCh2lR9/Qxk4nEMpPr9/RwNk95Gb > slUra9X+N+qSWghEHvvxY0Ol8Yw9Ko4n7JVhHFs=3D > =3DE4vw > -----END PGP MESSAGE----- > > The first line (Version:...) can change from machine to machine and over > time (as gpg is updated with a new version.) This is problematic when > the file is stored under version control, because as you decrypt and > encrypt an entry that line will change and create differences among the > file on the workspace and the file stored on VC. > > Second, the empty line just wastes space and it is plain ugly once we > remove the first one with the Version text. > > Finally, on some systems (mostly Windows) depending on how your Emacs > and gpg are configured, ^M characters may appear at the end of every > line of gpg output once it is inserted on the Emacs buffer. This happens > when the buffer uses Unix line-endings but gpg uses DOS line-endings. > > The patch removes all that junk from the encrypted text just before it > is inserted on the buffer. > > I'm assuming that the transformations made by this patch are > uncontroversial and desirable. If anyone actually prefers to keep that > noise on his encrypted org entries, an alternative implementation that > uses a configurable list of regexps is trivial to implement, but then > every user would have to do some job for achieving the same result. Other than the typo in the docstring this patch seems to work as advertised with my minimal testing on GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0) of 2010-12-11 on raven, modified by Debian Regards, --=20 Bernt