Browse Source

Column view: Exclude archived trees, for speed.

Carsten Dominik 16 years ago
parent
commit
d9d7398edd
5 changed files with 20 additions and 2 deletions
  1. 4 0
      doc/org.texi
  2. 2 0
      lisp/ChangeLog
  3. 4 1
      lisp/org-colview-xemacs.el
  4. 4 1
      lisp/org-colview.el
  5. 6 0
      lisp/org.el

+ 4 - 0
doc/org.texi

@@ -1092,6 +1092,10 @@ temporarily included.
 Archived trees are not exported (@pxref{Exporting}), only the headline
 is.  Configure the details using the variable
 @code{org-export-with-archived-trees}.
+@item
+@vindex org-columns-skip-arrchived-trees
+Archived trees are excluded from column view unless the variable
+@code{org-columns-skip-arrchived-trees} is configured to @code{nil}.
 @end itemize
 
 The following commands help managing the ARCHIVE tag:

+ 2 - 0
lisp/ChangeLog

@@ -1,5 +1,7 @@
 2009-03-21  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org.el (org-columns-skip-arrchived-trees): New option.
+
 	* org-agenda.el (org-agenda-export-html-style): Define color for
 	org-agenda-done face.
 	(org-search-view, org-agenda-get-todos, org-agenda-get-progress)

+ 4 - 1
lisp/org-colview-xemacs.el

@@ -855,7 +855,10 @@ around it."
 	    (narrow-to-region beg end)
 	    (org-clock-sum))))
       (while (re-search-forward (concat "^" outline-regexp) end t)
-	(push (cons (org-current-line) (org-entry-properties)) cache))
+	(if (and org-columns-skip-arrchived-trees
+		 (looking-at (concat ".*:" org-archive-tag ":")))
+	    (org-end-of-subtree t)
+	  (push (cons (org-current-line) (org-entry-properties)) cache)))
       (when cache
 	(setq maxwidths (org-columns-get-autowidth-alist fmt cache))
 	(org-set-local 'org-columns-current-maxwidths maxwidths)

+ 4 - 1
lisp/org-colview.el

@@ -673,7 +673,10 @@ around it."
 	    (narrow-to-region beg end)
 	    (org-clock-sum))))
       (while (re-search-forward (concat "^" outline-regexp) end t)
-	(push (cons (org-current-line) (org-entry-properties)) cache))
+	(if (and org-columns-skip-arrchived-trees
+		 (looking-at (concat ".*:" org-archive-tag ":")))
+	    (org-end-of-subtree t)
+	  (push (cons (org-current-line) (org-entry-properties)) cache)))
       (when cache
 	(setq maxwidths (org-columns-get-autowidth-alist fmt cache))
 	(org-set-local 'org-columns-current-maxwidths maxwidths)

+ 6 - 0
lisp/org.el

@@ -3066,6 +3066,12 @@ Instead, use the key `v' to cycle the archives-mode in the agenda."
   :group 'org-agenda-skip
   :type 'boolean)
 
+(defcustom org-columns-skip-arrchived-trees t
+  "Non-nil means, irgnore archived trees when creating column view."
+  :group 'org-archive
+  :group 'org-properties
+  :type 'boolean)
+
 (defcustom org-cycle-open-archived-trees nil
   "Non-nil means, `org-cycle' will open archived trees.
 An archived tree is a tree marked with the tag ARCHIVE.