emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Hymie! <hymie@lactose.homelinux.net>
To: emacs-orgmode@gnu.org
Subject: Re: org-crypt: Secure encrypted message against inadvertent change
Date: Tue, 8 Sep 2015 14:48:14 +0000 (UTC)	[thread overview]
Message-ID: <loom.20150908T164526-885@post.gmane.org> (raw)
In-Reply-To: 3105448.huDFGUVVHr@linux-k2bd.site

AW <alexander.willand <at> 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)

      parent reply	other threads:[~2015-09-08 14:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-23 21:31 org-crypt: Secure encrypted message against inadvertent change AW
2015-08-23 22:32 ` gershman
2015-08-23 23:54 ` John Kitchin
2015-08-24 18:42   ` AW
2015-08-26 21:04     ` AW
2015-09-08 14:48     ` Hymie! [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20150908T164526-885@post.gmane.org \
    --to=hymie@lactose.homelinux.net \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).