;;; org-colview.el --- Column View in Org-mode
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
+;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 7.4
+;; Version: 7.7
;;
;; This file is part of GNU Emacs.
;;
(color (list :foreground (face-attribute ref-face :foreground)))
(face (list color 'org-column ref-face))
(face1 (list color 'org-agenda-column-dateline ref-face))
- (pl (or (get-text-property (point-at-bol) 'prefix-length) 0))
(cphr (get-text-property (point-at-bol) 'org-complex-heading-regexp))
pom property ass width f string ov column val modval s2 title calc)
;; Check if the entry is in another buffer.
title (nth 1 column)
ass (if (equal property "ITEM")
(cons "ITEM"
- (save-match-data
+ ;; When in a buffer, get the whole line,
+ ;; we'll clean it later…
+ (if (org-mode-p)
+ (save-match-data
+ (org-no-properties
+ (org-remove-tabs
+ (buffer-substring-no-properties
+ (point-at-bol) (point-at-eol)))))
+ ;; In agenda, just get the `txt' property
(org-no-properties
- (org-remove-tabs
- (buffer-substring-no-properties
- (point-at-bol) (point-at-eol))))))
+ (org-get-at-bol 'txt))))
(assoc property props))
width (or (cdr (assoc property org-columns-current-maxwidths))
(nth 2 column)
((equal property "ITEM")
(if (org-mode-p)
(org-columns-cleanup-item
- val org-columns-current-fmt-compiled)
- (org-agenda-columns-cleanup-item
- val pl cphr org-columns-current-fmt-compiled)))
+ val org-columns-current-fmt-compiled)))
((and calc (functionp calc)
(not (string= val ""))
(not (get-text-property 0 'org-computed val)))
t t s)))
s)
-(defvar org-agenda-columns-remove-prefix-from-item)
-
-(defun org-agenda-columns-cleanup-item (item pl cphr fmt)
- "Cleanup the time property for agenda column view.
-See also the variable `org-agenda-columns-remove-prefix-from-item'."
- (let* ((org-complex-heading-regexp cphr)
- (prefix (substring item 0 pl))
- (rest (substring item pl))
- (fake (concat "* " rest))
- (cleaned (org-trim (substring (org-columns-cleanup-item fake fmt) 1))))
- (if org-agenda-columns-remove-prefix-from-item
- cleaned
- (concat prefix cleaned))))
-
(defun org-columns-show-value ()
"Show the full value of the property."
(interactive)
((equal major-mode 'org-agenda-mode)
(org-columns-eval eval)
;; The following let preserves the current format, and makes sure
- ;; that in only a single file things need to be upated.
+ ;; that in only a single file things need to be updated.
(let* ((org-agenda-overriding-columns-format org-columns-current-fmt)
(buffer (marker-buffer pom))
(org-agenda-contributing-files
((equal major-mode 'org-agenda-mode)
(org-columns-eval '(org-entry-put pom key nval))
;; The following let preserves the current format, and makes sure
- ;; that in only a single file things need to be upated.
+ ;; that in only a single file things need to be updated.
(let* ((org-agenda-overriding-columns-format org-columns-current-fmt)
(buffer (marker-buffer pom))
(org-agenda-contributing-files
(save-restriction
(narrow-to-region beg end)
(org-clock-sum))))
- (while (re-search-forward (concat "^" outline-regexp) end t)
+ (while (re-search-forward org-outline-regexp-bol end t)
(if (and org-columns-skip-archived-trees
(looking-at (concat ".*:" org-archive-tag ":")))
(org-end-of-subtree t)
(defun org-columns-compute (property)
"Sum the values of property PROPERTY hierarchically, for the entire buffer."
(interactive)
- (let* ((re (concat "^" outline-regexp))
+ (let* ((re org-outline-regexp-bol)
(lmax 30) ; Does anyone use deeper levels???
(lvals (make-vector lmax nil))
(lflag (make-vector lmax nil))
(provide 'org-colview)
-;; arch-tag: 61f5128d-747c-4983-9479-e3871fa3d73c
+
;;; org-colview.el ends here