branch: externals/org
commit f95c31800a0271123e19e89c16e585bd746334ae
Author: Ihor Radchenko <[email protected]>
Commit: Ihor Radchenko <[email protected]>
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 <[email protected]>
Link: https://orgmode.org/list/[email protected]
---
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