emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Column View maxlevel Incorrectly Terminates Loop
@ 2008-06-24 22:54 Peter Jones
  0 siblings, 0 replies; only message in thread
From: Peter Jones @ 2008-06-24 22:54 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 540 bytes --]

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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: maxlevel.diff --]
[-- Type: text/x-patch, Size: 1980 bytes --]

From 34af80e7d779870cd57754f5ed80cede8fcb709e Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@pmade.com>
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


[-- Attachment #3: Type: text/plain, Size: 65 bytes --]


-- 
Peter Jones, http://pmade.com
pmade inc.  Louisville, CO US

[-- Attachment #4: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-06-24 22:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-24 22:54 [PATCH] Column View maxlevel Incorrectly Terminates Loop Peter Jones

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).