Fix read-only issue with capture
commitd8498a40e815d8604311e9844e6c75bbf074d026
authorCarsten Dominik <carsten.dominik@gmail.com>
Thu, 2 Sep 2010 09:34:26 +0000 (2 11:34 +0200)
committerCarsten Dominik <carsten.dominik@gmail.com>
Thu, 2 Sep 2010 09:35:21 +0000 (2 11:35 +0200)
tree47812a0b43db8ad29c51b8153075f196527e502f
parent411c82948996c0812d5c530467798f86dfea365c
Fix read-only issue with capture

* lisp/org-capture.el (org-capture): Remove read-only text properties
from capture text.
(org-capture-set-target-location): Throw an error if file+headline
target does not point into a file which is in Org mode.

Richard Riley writes:

> If I select a region in, in this case, an erc (emacs irc client)
> buffer in the read only section and then use my global keys to create
> a new item using the following "j" template while the text is still
> selected
>
> ("j" "Journal" entry
>  (file+datetree "journal.org")
>  "* %T %?\n  %i\n  %a")
>
> then I get the following backtrace :-
>
> Debugger entered--Lisp error: (error "Capture abort: (text-read-only)")
>  signal(error ("Capture abort: (text-read-only)"))
>  error("Capture abort: %s" (text-read-only))
>  byte-code("\301\302!\203\n
lisp/org-capture.el