From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pieter Praet Subject: Re: disable "org-decrypt: auto-save-mode may cause leakage" Date: Thu, 14 Jul 2011 17:50:30 +0200 Message-ID: <878vs0zws9.fsf@praet.org> References: <2011-07-14T14-11-51@devnull.Karl-Voit.at> <20110714131745.GC2823@soloJazz.com> <80hb6pgezl.fsf@somewhere.org> <87bowxym68.fsf@praet.org> <808vs0hqj1.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:52059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QhOBU-0003Tf-1b for emacs-orgmode@gnu.org; Thu, 14 Jul 2011 11:50:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QhOBP-0002e1-Tg for emacs-orgmode@gnu.org; Thu, 14 Jul 2011 11:50:39 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:58526) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QhOBP-0002dw-Fa for emacs-orgmode@gnu.org; Thu, 14 Jul 2011 11:50:35 -0400 Received: by wyg36 with SMTP id 36so307348wyg.0 for ; Thu, 14 Jul 2011 08:50:34 -0700 (PDT) In-Reply-To: <808vs0hqj1.fsf@somewhere.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Sebastien Vauban , emacs-orgmode@gnu.org On Thu, 14 Jul 2011 16:42:58 +0200, "Sebastien Vauban" wrote: > Hi Pieter, >=20 > Pieter Praet wrote: > > On Thu, 14 Jul 2011 15:37:34 +0200, "Sebastien Vauban" wrote: > >> Juan Pechiar wrote: > >> > On Thu, Jul 14, 2011 at 02:22:32PM +0200, Karl Voit wrote: > >> >> How can I auto-answer the question from the subject line with =C2= =ABn=C2=BB > >> >> (per default) any time it is asked? > >> > > >> > You can customize this behaviour via > >> > > >> > org-crypt-disable-auto-save > >> > > >> > You probably have it set to 'ask'. > >>=20 > >> So did I. This is the default. > >>=20 > >> > Options exist for always enabling/disabling auto save, and for encry= pting > >> > the auto-saved version automatically. > >> > > >> > M-x customize-variable RET org-crypt-disable-auto-save RET > >>=20 > >> Shouldn't its default value better be set to 'encrypt? > > > > I don't think so. > > > > It only re-encrypts entries which are tagged :crypt: (or whatever you > > have `org-crypt-tag-matcher' set to), so I'd prefer users to be "forced" > > to at least read the docstring so as not to be using it with a false > > sense of security. > > > > Though this could be easily solved by automatically tagging entries upon > > encryption, I think it's more "considerate" to simply (ask to) disable > > `auto-save-mode' for the current buffer, as it's quite annoying to have > > an entry get re-encrypted while you're in the middle of typing somethin= g. >=20 > This is more clear to me, and makes a lot of sense. >=20 > Though, what I find annoying, and the OP as well, is to be asked that que= stion > for buffers which do not contain any encrypted entry. Would it be possibl= e to > scan the buffer for such entries, and only ask the user when the buffer is > potentially exposed? AFAIK, that should already be the case. Even when running with the following config... #+BEGIN_SRC emacs-lisp (add-hook 'find-file-hook 'org-decrypt-entries) #+END_SRC ... the user shouldn't get prompted needlessly, because `org-decrypt-entrie= s' applies `org-decrypt-entry' (which does the `auto-save-mode' check) *only* to entries with a tag matching `org-crypt-tag-matcher' [1]. So prompting should only occur for buffers for which `auto-save-mode' is enabled AND which contain one or more entries tagged with `crypt' (regardless of whether the entry is actually encrypted, but that's beside the point) UNLESS running `org-decrypt-entry' (auto-)manually for each buffer. I suspect it's a user config issue. > Best regards, > Seb >=20 > --=20 > Sebastien Vauban >=20 >=20 Peace --=20 Pieter [1] lisp/org-crypt.el:241