From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hymie! Subject: Re: org-crypt: Secure encrypted message against inadvertent change Date: Tue, 8 Sep 2015 14:48:14 +0000 (UTC) Message-ID: References: <3216867.MOJ3RImYQA@linux-k2bd.site> <3105448.huDFGUVVHr@linux-k2bd.site> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZKCF-00023m-EB for emacs-orgmode@gnu.org; Tue, 08 Sep 2015 10:48:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZKCC-0003xN-Nd for emacs-orgmode@gnu.org; Tue, 08 Sep 2015 10:48:31 -0400 Received: from plane.gmane.org ([80.91.229.3]:55660) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZKCC-0003wd-H0 for emacs-orgmode@gnu.org; Tue, 08 Sep 2015 10:48:28 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZZKC4-0000e2-CJ for emacs-orgmode@gnu.org; Tue, 08 Sep 2015 16:48:20 +0200 Received: from 128.183.234.14 ([128.183.234.14]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 08 Sep 2015 16:48:20 +0200 Received: from hymie by 128.183.234.14 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 08 Sep 2015 16:48:20 +0200 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: emacs-orgmode@gnu.org AW t-online.de> writes: > Dear John, > > thank you. I simply changed "read_only" to "crypt" in the functions you > developed. This functions prevent a change of encrypted text, which I think is > really an improvment. This is awesome. But I have a follow-up questions. This function marks my buffer as "modified". Is there any way to automatically have the org-mark-readonly function turn off the modified flag? This isn't a major problem, just a nicety. --hymie! > > (defun org-mark-readonly () > (interactive) > (org-map-entries > (lambda () > (let* ((element (org-element-at-point)) > (begin (org-element-property :begin element)) > (end (org-element-property :end element))) > (add-text-properties begin (- end 1) '(read-only t)))) > "crypt") > (message "Made readonly!")) > > (add-hook 'org-mode-hook 'org-mark-readonly)