summaryrefslogtreecommitdiff
path: root/lisp/org/org-colview.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/org/org-colview.el')
-rw-r--r--lisp/org/org-colview.el38
1 files changed, 21 insertions, 17 deletions
diff --git a/lisp/org/org-colview.el b/lisp/org/org-colview.el
index 2f039064404..9794382d8a4 100644
--- a/lisp/org/org-colview.el
+++ b/lisp/org/org-colview.el
@@ -2,7 +2,7 @@
;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
-;; Author: Carsten Dominik <carsten at orgmode dot org>
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: https://orgmode.org
;;
@@ -213,7 +213,7 @@ See `org-columns-summary-types' for details.")
(lambda () (interactive)
(org-columns-next-allowed-value nil i))))
-(easy-menu-define org-columns-menu org-columns-map "Org Column Menu"
+(easy-menu-define org-columns-menu org-columns-map "Org Column Menu."
'("Column"
["Edit property" org-columns-edit-value t]
["Next allowed value" org-columns-next-allowed-value t]
@@ -836,12 +836,11 @@ Also sets `org-columns-top-level-marker' to the new position."
(defun org-columns (&optional global columns-fmt-string)
"Turn on column view on an Org mode file.
-Column view applies to the whole buffer if point is before the
-first headline. Otherwise, it applies to the first ancestor
-setting \"COLUMNS\" property. If there is none, it defaults to
-the current headline. With a `\\[universal-argument]' prefix \
-argument, turn on column
-view for the whole buffer unconditionally.
+Column view applies to the whole buffer if point is before the first
+headline. Otherwise, it applies to the first ancestor setting
+\"COLUMNS\" property. If there is none, it defaults to the current
+headline. With a `\\[universal-argument]' prefix \ argument, GLOBAL,
+turn on column view for the whole buffer unconditionally.
When COLUMNS-FMT-STRING is non-nil, use it as the column format."
(interactive "P")
@@ -867,9 +866,8 @@ When COLUMNS-FMT-STRING is non-nil, use it as the column format."
(let ((cache
;; Collect contents of columns ahead of time so as to
;; compute their maximum width.
- (org-map-entries
- (lambda () (cons (point) (org-columns--collect-values)))
- nil nil (and org-columns-skip-archived-trees 'archive))))
+ (org-scan-tags
+ (lambda () (cons (point) (org-columns--collect-values))) t org--matcher-tags-todo-only)))
(when cache
(org-columns--set-widths cache)
(org-columns--display-here-title)
@@ -879,7 +877,8 @@ When COLUMNS-FMT-STRING is non-nil, use it as the column format."
(unless (local-variable-p 'org-colview-initial-truncate-line-value)
(setq-local org-colview-initial-truncate-line-value
truncate-lines))
- (setq truncate-lines t)
+ (if (not global-visual-line-mode)
+ (setq truncate-lines t))
(dolist (entry cache)
(goto-char (car entry))
(org-columns--display-here (cdr entry)))))))))
@@ -1165,7 +1164,11 @@ properties drawers."
(last-level lmax)
(property (car spec))
(printf (nth 4 spec))
- (operator (nth 3 spec))
+ ;; Special properties cannot be collected nor summarized, as
+ ;; they have their own way to be computed. Therefore, ignore
+ ;; any operator attached to them.
+ (operator (and (not (member property org-special-properties))
+ (nth 3 spec)))
(collect (and operator (org-columns--collect operator)))
(summarize (and operator (org-columns--summarize operator))))
(org-with-wide-buffer
@@ -1269,7 +1272,7 @@ When PRINTF is non-nil, use it to format the result."
"Summarize CHECK-BOXES with a check-box cookie."
(format "[%d/%d]"
(cl-count-if (lambda (b) (or (equal b "[X]")
- (string-match-p "\\[\\([1-9]\\)/\\1\\]" b)))
+ (string-match-p "\\[\\([1-9]\\)/\\1\\]" b)))
check-boxes)
(length check-boxes)))
@@ -1395,8 +1398,9 @@ other rows. Each row is a list of fields, as strings, or
(org-get-tags))))
(push (cons (org-reduced-level (org-current-level)) (nreverse row))
table)))))
- (or (and maxlevel (format "LEVEL<=%d" maxlevel))
- (and match match))
+ (if match
+ (concat match (and maxlevel (format "+LEVEL<=%d" maxlevel)))
+ (and maxlevel (format "LEVEL<=%d" maxlevel)))
(and local 'tree)
'archive 'comment)
(org-columns-quit)
@@ -1691,7 +1695,7 @@ This will add overlays to the date lines, to show the summary for each day."
(delq nil
(mapcar
(lambda (e) (org-string-nw-p
- (nth 1 (assoc spec e))))
+ (nth 1 (assoc spec e))))
entries)))
(final (if values
(funcall summarize values printf)