branch: externals/org
commit f95c31800a0271123e19e89c16e585bd746334ae
Author: Ihor Radchenko <yanta...@posteo.net>
Commit: Ihor Radchenko <yanta...@posteo.net>

    org-agenda: Avoid errors when Org buffer has read-only text
    
    * lisp/org-agenda.el (org-agenda-finalize-entries): Strip read-only
    properties from text inserted into agenda buffers.  Agenda expect all
    the inserted text to be editable along the way.
    
    Reported-by: Rens Oliemans <ha...@rensoliemans.nl>
    Link: https://orgmode.org/list/87cyf22utr....@rensoliemans.nl
---
 lisp/org-agenda.el | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 6809d0ef30..93f32ff1e3 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -7360,6 +7360,15 @@ The optional argument TYPE tells the agenda type."
        (max-entries (cond ((listp org-agenda-max-entries)
                            (cdr (assoc type org-agenda-max-entries)))
                           (t org-agenda-max-entries))))
+    ;; Make sure that read-only is not set on entries.  Agenda expects
+    ;; all the inserted text to be editable, while e.g. column view
+    ;; may apply read-only text properties in org buffers.
+    (mapc (lambda (entry)
+            (remove-text-properties
+             0 (length entry)
+             '(read-only nil)
+             entry))
+          list)
     (when org-agenda-before-sorting-filter-function
       (setq list
            (delq nil

Reply via email to