From 58c5c5882ccf7b0405ef5ac5ce6614078c0a97fe Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Sun, 20 Aug 2023 11:54:20 +0300 Subject: [PATCH] org-columns: Fix when adding spaces to headings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lisp/org-colview.el (org-columns): Use markers to store collected column headline value positions. This is necessary because `org-columns--display-here' may modify buffer, invalidating headline positions returned by `org-scan-tags'. Reported-by: Jakob Schöttl Link: https://orgmode.org/list/831f07e0-d86a-a0dc-c967-e48906f520a1@gmail.com --- lisp/org-colview.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org-colview.el b/lisp/org-colview.el index 9699be61b..10eba15e6 100644 --- a/lisp/org-colview.el +++ b/lisp/org-colview.el @@ -888,7 +888,7 @@ When COLUMNS-FMT-STRING is non-nil, use it as the column format." ;; Collect contents of columns ahead of time so as to ;; compute their maximum width. (org-scan-tags - (lambda () (cons (point) (org-columns--collect-values))) t org--matcher-tags-todo-only))) + (lambda () (cons (point-marker) (org-columns--collect-values))) t org--matcher-tags-todo-only))) (when cache (org-columns--set-widths cache) (org-columns--display-here-title) @@ -902,6 +902,7 @@ When COLUMNS-FMT-STRING is non-nil, use it as the column format." (setq truncate-lines t)) (dolist (entry cache) (goto-char (car entry)) + (move-marker (car entry) nil) (org-columns--display-here (cdr entry))))))))) (defun org-columns-new (&optional spec &rest attributes)