emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Peter Jones <mlists@pmade.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Column View maxlevel Incorrectly Terminates Loop
Date: Tue, 24 Jun 2008 16:54:45 -0600	[thread overview]
Message-ID: <m2mylav3yi.fsf@pmade.com> (raw)

[-- 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

                 reply	other threads:[~2008-06-24 22:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2mylav3yi.fsf@pmade.com \
    --to=mlists@pmade.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).