From 5a63156b0165304104dcdc4b16437ec08e81f6d6 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Mon, 21 Jan 2019 21:45:10 +0100 Subject: [PATCH] org-element: Parse secondary strings in read-only documents * lisp/org-element.el (org-element-parse-secondary-string): Parse secondary strings in read-only documents. Reported-by: Michael Brand --- lisp/org-element.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/org-element.el b/lisp/org-element.el index 8d16aa5e8..9188b3fbe 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -4095,8 +4095,9 @@ If STRING is the empty string or nil, return nil." (ignore-errors (if (symbolp v) (makunbound v) (set (make-local-variable (car v)) (cdr v))))) - (insert string) - (restore-buffer-modified-p nil) + ;; Transferring local variables may put the temporary buffer + ;; into a read-only state. Make sure we can insert STRING. + (let ((inhibit-read-only t)) (insert string)) (org-element--parse-objects (point-min) (point-max) nil restriction parent))))))