diff --git a/lisp/org-colview.el b/lisp/org-colview.el index 04d2b62..5645ed3 100644 --- a/lisp/org-colview.el +++ b/lisp/org-colview.el @@ -931,6 +931,7 @@ Don't set this, this is meant for dynamic scoping.") (defun org-columns-compute (property) "Sum the values of property PROPERTY hierarchically, for the entire buffer." (interactive) + (require 'org-inlinetask) (let* ((re org-outline-regexp-bol) (lmax 30) ; Does anyone use deeper levels??? (lvals (make-vector lmax nil)) @@ -942,7 +943,8 @@ Don't set this, this is meant for dynamic scoping.") (fun (nth 6 ass)) (calc (or (nth 7 ass) 'identity)) (beg org-columns-top-level-marker) - last-level val valflag flag end sumpos sum-alist sum str str1 useval) + (last-level org-inlinetask-min-level) + val valflag flag end sumpos sum-alist sum str str1 useval) (save-excursion ;; Find the region to compute (goto-char beg) @@ -951,16 +953,24 @@ Don't set this, this is meant for dynamic scoping.") ;; Walk the tree from the back and do the computations (while (re-search-backward re beg t) (setq sumpos (match-beginning 0) - last-level level + last-level (if (and (not (equal level 0) ) + (not (equal level org-inlinetask-min-level))) + level last-level) level (org-outline-level) val (org-entry-get nil property) valflag (and val (string-match "\\S-" val))) (cond ((< level last-level) ;; put the sum of lower levels here as a property - (setq sum (when (aref lvals last-level) + (setq sum (when (and + (not (equal last-level org-inlinetask-min-level)) + (aref lvals last-level)) (apply fun (aref lvals last-level))) - flag (aref lflag last-level) ; any valid entries from children? + sum2 (when (aref lvals org-inlinetask-min-level) + (apply fun (aref lvals org-inlinetask-min-level))) + sum (+ (or sum 0) (or sum2 0)) + flag (or (aref lflag last-level) ; any valid entries from children? + (aref lflag org-inlinetask-min-level)) ; or inline tasks? str (org-columns-number-to-string sum format printf) str1 (org-add-props (copy-sequence str) nil 'org-computed t 'face 'bold) useval (if flag str1 (if valflag val ""))