From mboxrd@z Thu Jan 1 00:00:00 1970 From: AW Subject: Re: org-crypt: Secure encrypted message against inadvertent change Date: Wed, 26 Aug 2015 23:04:54 +0200 Message-ID: <13855782.d1tDLqu5dT@linux-k2bd.site> 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]:47117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUhsf-0005xS-1Q for emacs-orgmode@gnu.org; Wed, 26 Aug 2015 17:05:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUhsa-0001pf-1E for emacs-orgmode@gnu.org; Wed, 26 Aug 2015 17:05:12 -0400 Received: from mailout12.t-online.de ([194.25.134.22]:47416) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUhsZ-0001lS-RI for emacs-orgmode@gnu.org; Wed, 26 Aug 2015 17:05:07 -0400 Received: from fwd34.aul.t-online.de (fwd34.aul.t-online.de [172.20.26.145]) by mailout12.t-online.de (Postfix) with SMTP id 301FC3A7A8A for ; Wed, 26 Aug 2015 23:05:06 +0200 (CEST) In-Reply-To: <3105448.huDFGUVVHr@linux-k2bd.site> 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 Am Montag, 24. August 2015, 20:42:01 schrieb AW: > Am Sonntag, 23. August 2015, 19:54:51 schrieb John Kitchin: > > I am not sure if you put the comment on this post: > > http://kitchingroup.cheme.cmu.edu/blog/2014/09/13/Make-some-org-sections-r > > ea d-only/ > > > > but it is possible to setup a hook that makes headings read-only. You > > could do that for headings tagged crypt, for example. > > 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. > > =================== > > (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!")) > > > (defun org-remove-readonly () > (interactive) > (org-map-entries > (lambda () > (let* ((element (org-element-at-point)) > (begin (org-element-property :begin element)) > (end (org-element-property :end element)) > (inhibit-read-only t)) > (remove-text-properties begin (- end 1) '(read-only t)))) > "crypt")) > > (add-hook 'org-mode-hook 'org-mark-readonly) > > > =================== > > Thus before I can use "org-decrypt-entry" I have to put the cursor under the > headline with the tag ":crypt:" and call "org-remove-readonly". > > I S U G G E S T to put this into org-crypt and change the commands org- > decrypt-entry and org-encrypt-entry: Encrypted text shall be read-only, and > org-decrypt-entry removes this. > > Sorry, I'm a user without knowledge of Lisp, unfortunately I can't do that > myself. But it would be a valuable improvement of org-crypt. I wrote to the person mentioned in org-crypt.el as maintainer and received the message that he no longer uses org-mode and no longer maintains org-crypt.el. What a pity, org-mode is better than ever.