From 34af80e7d779870cd57754f5ed80cede8fcb709e Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 24 Jun 2008 16:52:11 -0600 Subject: [PATCH] Column View maxlevel Incorrectly Terminates Loop When using maxlevel, column view exporting is aborted when the first headline below maxlevel is reached. This prevents any remaining headlines that are at or above maxlevel from being rendered. The documentation suggests that it is actually used to export a column view for all headlines that are at or above the value of maxlevel. This patch adjusts the loop condition so that it no longer checks maxlevel, and moves the maxlevel condition inside the loop. With this change, all headlines at or above maxlevel are correctly exported. --- lisp/org-colview.el | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lisp/org-colview.el b/lisp/org-colview.el index 7b32b59..42b6e91 100644 --- a/lisp/org-colview.el +++ b/lisp/org-colview.el @@ -1013,13 +1013,13 @@ of fields." (let* ((title (mapcar 'cadr org-columns-current-fmt-compiled)) (n (length title)) row tbl) (goto-char (point-min)) - (while (and (re-search-forward "^\\(\\*+\\) " nil t) - (or (null maxlevel) - (>= maxlevel - (if org-odd-levels-only - (/ (1+ (length (match-string 1))) 2) - (length (match-string 1)))))) - (when (get-char-property (match-beginning 0) 'org-columns-key) + (while (re-search-forward "^\\(\\*+\\) " nil t) + (when (and (or (null maxlevel) + (>= maxlevel + (if org-odd-levels-only + (/ (1+ (length (match-string 1))) 2) + (length (match-string 1))))) + (get-char-property (match-beginning 0) 'org-columns-key)) (setq row nil) (loop for i from 0 to (1- n) do (push (or (get-char-property (+ (match-beginning 0) i) 'org-columns-value-modified) -- 1.5.5.3