From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pieter Praet Subject: Re: [PATCH] org-crypt: only warn about auto-save-mode when running org-decrypt Date: Tue, 28 Jun 2011 08:55:46 +0200 Message-ID: <87k4c6fnrh.fsf@praet.org> References: <87hb7febzu.fsf@gnu.org> <1308949422-30288-1-git-send-email-pieter@praet.org> <11546.1308952204@alphaville.dokosmarshall.org> <8762ntjdwr.fsf@praet.org> <87pqlzutfl.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([140.186.70.92]:54098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QbSDV-0002AZ-9K for emacs-orgmode@gnu.org; Tue, 28 Jun 2011 02:56:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QbSDT-0006MN-5T for emacs-orgmode@gnu.org; Tue, 28 Jun 2011 02:56:13 -0400 Received: from mail-ww0-f49.google.com ([74.125.82.49]:44633) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QbSDS-0006MD-Q3 for emacs-orgmode@gnu.org; Tue, 28 Jun 2011 02:56:11 -0400 Received: by wwf22 with SMTP id 22so4332164wwf.30 for ; Mon, 27 Jun 2011 23:56:09 -0700 (PDT) In-Reply-To: <87pqlzutfl.fsf@gnu.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: Bastien Cc: Dave Abrahams , Nick Dokos , emacs-orgmode@gnu.org On Mon, 27 Jun 2011 18:31:58 +0200, Bastien wrote: > Hi Pieter, > > Thanks for the patch at the end of this thread. > > Pieter Praet writes: > > > Ideally, we'd have a defcustom `org-crypt-auto-save' with the following options: > > - 'ask : Ask the user whether or not to decrypt the entry. > > - 'disable : Disable auto-save-mode for the current buffer before decrypting. > > - 'ignore : Decrypt the entry regardless. > > - 'encrypt : Re-encrypt the entries before auto-save kicks in. > > > > I've implemented this, but it fails miserably: > > > > Since the function `auto-save-mode' doesn't set an buffer-local > > var to indicate whether or not it's enabled for the current buffer, we > > can only check for `auto-save-default'. > > I think we should first ask emacs-devel to fix this, then implement your > clean solution. Would you like to report this problem? No need. It appears I'm a veritable moron, with apologies to the Emacs folks. 2 lessons I've learned today: - DON'T test this stuff in a *scratch* buffer (seriously...) - DO consume sufficient quantities of coffee (IOW, org-encrypt-entries doesn't encrypt entries unless they're *tagged* to be) > I'm not confident in disabling auto-save-mode globally by default, this > would surprise users -- even with a **BiG WaRnInG** message. No worries, it's buffer-local. And I've now changed the default to "ask first, shoot in the foot later". > What do you think? "I should send my patch" comes to mind :) Traffic allowing (lots of sweaty tourists on the road), it should be there in T-10sec. > -- > Bastien Peace -- Pieter