Gnus development mailing list
 help / color / mirror / Atom feed
* gnus-sync and automated GPG encryption
@ 2012-07-16 22:30 Matt Ford
  2012-07-18 13:50 ` Ted Zlatanov
  0 siblings, 1 reply; 4+ messages in thread
From: Matt Ford @ 2012-07-16 22:30 UTC (permalink / raw)
  To: ding

Hi Again!

Thought I might ask separately how I might achieve this, not strictly
gnus related, functionality.  I want gnus-sync to not ask me which key to
use when saving it's data buffer via Tramp and Epa.

As the file is generated in a temp buffer and written the
epa-file-encrypt-to variable has not been read in from the header of the
file (wot I normally do).  And this variable seems somehow a protected
local thingy... (don't know enough elisp to understand what this
means)... I can't seem to set it.

Any thoughts how I might achieve the goal?

Cheers,

-- 
Matt




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: gnus-sync and automated GPG encryption
  2012-07-16 22:30 gnus-sync and automated GPG encryption Matt Ford
@ 2012-07-18 13:50 ` Ted Zlatanov
  2012-07-29 12:10   ` Matt Ford
  0 siblings, 1 reply; 4+ messages in thread
From: Ted Zlatanov @ 2012-07-18 13:50 UTC (permalink / raw)
  To: Matt Ford; +Cc: ding

On Mon, 16 Jul 2012 23:30:40 +0100 Matt Ford <matt@dancingfrog.co.uk> wrote: 

MF> Thought I might ask separately how I might achieve this, not strictly
MF> gnus related, functionality.  I want gnus-sync to not ask me which key to
MF> use when saving it's data buffer via Tramp and Epa.

MF> As the file is generated in a temp buffer and written the
MF> epa-file-encrypt-to variable has not been read in from the header of the
MF> file (wot I normally do).  And this variable seems somehow a protected
MF> local thingy... (don't know enough elisp to understand what this
MF> means)... I can't seem to set it.

I use a passphrase (symmetric encryption) and let EPA cache it, so
unfortunately I don't know.  If you don't get an answer here, try emacs-devel.

Ted



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: gnus-sync and automated GPG encryption
  2012-07-18 13:50 ` Ted Zlatanov
@ 2012-07-29 12:10   ` Matt Ford
  2012-12-23  2:06     ` Ted Zlatanov
  0 siblings, 1 reply; 4+ messages in thread
From: Matt Ford @ 2012-07-29 12:10 UTC (permalink / raw)
  To: ding

I sorted this if anyone is interested...basically one has to declare the
epa-file-encrypt variable as local for it to be picked up by tramp and epa.

So in your gnus config you can do this
(setq gnus-sync-crypt-key "Matt Ford")

and providing you patch gnus-sync-save to with the below, if you try and
save a file with a gpg extension it will be encrypted using the key that
matches (and it will be transparent if you use gpg-agent).

diff --git a/site-elisp/gnus/gnus-sync.el b/site-elisp/gnus/gnus-sync.el
index eb11676..a5a8524 100644
--- a/site-elisp/gnus/gnus-sync.el
+++ b/site-elisp/gnus/gnus-sync.el
@@ -755,6 +755,8 @@ With a prefix, FORCE is set and all groups will be saved."
     (let ((gnus-sync-newsrc-loader (gnus-sync-newsrc-loader-builder)))
       (with-temp-file gnus-sync-backend
         (progn
+          (setq epa-file-encrypt-to gnus-sync-crypt-key)
+          (make-local-variable 'epa-file-encrypt-to)
           (let ((coding-system-for-write gnus-ding-file-coding-system)
                 (standard-output (current-buffer)))
             (princ (format ";; -*- mode:emacs-lisp; coding: %s; -*-\n"

-- 
Matt




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: gnus-sync and automated GPG encryption
  2012-07-29 12:10   ` Matt Ford
@ 2012-12-23  2:06     ` Ted Zlatanov
  0 siblings, 0 replies; 4+ messages in thread
From: Ted Zlatanov @ 2012-12-23  2:06 UTC (permalink / raw)
  To: ding

On Sun, 29 Jul 2012 13:10:54 +0100 Matt Ford <matt@dancingfrog.co.uk> wrote: 

MF> I sorted this if anyone is interested...basically one has to declare the
MF> epa-file-encrypt variable as local for it to be picked up by tramp and epa.

MF> So in your gnus config you can do this
MF> (setq gnus-sync-crypt-key "Matt Ford")

MF> and providing you patch gnus-sync-save to with the below, if you try and
MF> save a file with a gpg extension it will be encrypted using the key that
MF> matches (and it will be transparent if you use gpg-agent).

MF> diff --git a/site-elisp/gnus/gnus-sync.el b/site-elisp/gnus/gnus-sync.el
MF> index eb11676..a5a8524 100644
MF> --- a/site-elisp/gnus/gnus-sync.el
MF> +++ b/site-elisp/gnus/gnus-sync.el
MF> @@ -755,6 +755,8 @@ With a prefix, FORCE is set and all groups will be saved."
MF>      (let ((gnus-sync-newsrc-loader (gnus-sync-newsrc-loader-builder)))
MF>        (with-temp-file gnus-sync-backend
MF>          (progn
MF> +          (setq epa-file-encrypt-to gnus-sync-crypt-key)
MF> +          (make-local-variable 'epa-file-encrypt-to)
MF>            (let ((coding-system-for-write gnus-ding-file-coding-system)
MF>                  (standard-output (current-buffer)))
MF>              (princ (format ";; -*- mode:emacs-lisp; coding: %s; -*-\n"

Thanks, Matt.  I committed a patch from Philipp Haselwarter today that
does this with a defcustom.  Check it out and let me know if it works
for you (I think it's the same as what you show, except for naming and
defcustom).

Ted




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-12-23  2:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-16 22:30 gnus-sync and automated GPG encryption Matt Ford
2012-07-18 13:50 ` Ted Zlatanov
2012-07-29 12:10   ` Matt Ford
2012-12-23  2:06     ` Ted Zlatanov

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 NNTP newsgroup(s).