From 06636f4b14b138a3d6ca5366af3b5744f06d9c55 Mon Sep 17 00:00:00 2001 From: tony Date: Thu, 11 Nov 2021 12:00:07 +0100 Subject: [PATCH] lisp/org-list.el: modify current indentation calculation in org-list-struct * lisp/org-list.el (org-list-struct): Don't use `current-indentation` to compute the current indentation in the loop that collects the org list informations. This change is necessary only in the case where you modify the `buffer-invisibility-spec` replacing `'(outline . t)` by `'outline` (in order to remove the `...` when headlines, list, etc are collapsed) by evaluating the following form: (remove-from-invisibility-spec '(outline . t)) (add-to-invisibility-spec 'outline) --- lisp/org-list.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/org-list.el b/lisp/org-list.el index b08e72eb2..025ae0086 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -684,7 +684,14 @@ Assume point is at an item." ;; position of items in END-LST-2. (catch 'exit (while t - (let ((ind (current-indentation))) + (let* ((current-indentation + (save-excursion + (save-match-data + (if (bolp) + (re-search-forward "^[[:blank:]]*") + (re-search-backward "^[[:blank:]]*")) + (- (match-end 0) (point-at-bol))))) + (ind current-indentation)) (cond ((>= (point) lim-down) ;; At downward limit: this is de facto the end of the -- 2.17.1