From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Jones Subject: [PATCH] Column View maxlevel Incorrectly Terminates Loop Date: Tue, 24 Jun 2008 16:54:45 -0600 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KBHPW-00079H-GX for emacs-orgmode@gnu.org; Tue, 24 Jun 2008 18:54:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KBHPV-000795-2F for emacs-orgmode@gnu.org; Tue, 24 Jun 2008 18:54:50 -0400 Received: from [199.232.76.173] (port=52540 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KBHPU-000792-Qw for emacs-orgmode@gnu.org; Tue, 24 Jun 2008 18:54:48 -0400 Received: from hnrelay-1.lvcm.net ([24.234.0.67]:33862) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KBHPU-0000Jh-9k for emacs-orgmode@gnu.org; Tue, 24 Jun 2008 18:54:48 -0400 Received: from localhost (localhost [127.0.0.1]) by hnrelay-1.lvcm.net (Postfix) with ESMTP id DD56E3F612 for ; Tue, 24 Jun 2008 15:54:45 -0700 (PDT) Received: from hnrelay-1.lvcm.net ([127.0.0.1]) by localhost (hnrelay-1.lvcm.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 05633-07 for ; Tue, 24 Jun 2008 15:54:45 -0700 (PDT) Received: from montecarlo-auth.coxhn.net (24-234-116-214.ptp.lvcm.net [24.234.116.214]) by hnrelay-1.lvcm.net (Postfix) with ESMTP id 58F0C3F60E for ; Tue, 24 Jun 2008 15:54:45 -0700 (PDT) Received: from [70.165.220.208] (helo=skinny.local.pmade.com) by montecarlo-auth.coxhn.net with esmtp (Exim 3.34 #1) id 1KBHPR-00036g-00 for emacs-orgmode@gnu.org; Tue, 24 Jun 2008 15:54:45 -0700 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= 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. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=maxlevel.diff >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 --=-=-= -- Peter Jones, http://pmade.com pmade inc. Louisville, CO US --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --=-=-=--