emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Óscar Fuentes" <ofv@wanadoo.es>
To: emacs-orgmode@gnu.org
Subject: Wash output of org-encrypt-entry, take 2
Date: Fri, 18 Mar 2011 23:23:03 +0100	[thread overview]
Message-ID: <87fwqk2hmg.fsf@wanadoo.es> (raw)

With a gpg executable with default settings, org-encrypt-entry produces
output like this:

[2. text/plain]

Version: GnuPG v1.4.10 (GNU/Linux)


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.

                 reply	other threads:[~2011-03-18 22:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fwqk2hmg.fsf@wanadoo.es \
    --to=ofv@wanadoo.es \
    --cc=emacs-orgmode@gnu.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).