Function: org-dblock-write:columnview
org-dblock-write:columnview is an autoloaded and byte-compiled
function defined in org-colview.el.gz.
Signature
(org-dblock-write:columnview PARAMS)
Documentation
Write the column view table.
PARAMS is a property list of parameters:
:id (mandatory)
The ID property of the entry where the columns view should be
built. When the symbol local, call locally. When global
call column view with the cursor at the beginning of the
buffer (usually this means that the whole buffer switches to
column view). When "file:path/to/file.org", invoke column
view at the start of that file. Otherwise, the ID is located
using org-id-find.
:exclude-tags
List of tags to exclude from column view table.
:format
When non-nil, specify the column view format to use.
:hlines
When non-nil, insert a hline before each item. When
a number, insert a hline before each level inferior or equal
to that number.
:indent
When non-nil, indent each ITEM field according to its level.
:match
When set to a string, use this as a tags/property match filter.
:maxlevel
When set to a number, don't capture headlines below this level.
:skip-empty-rows
When non-nil, skip rows where all specifiers other than ITEM
are empty.
:vlines
When non-nil, make each column a column group to enforce
vertical lines.
:link
Link the item headlines in the table to their origins.
:formatter
A function to format the data and insert it into the
buffer. Overrides the default formatting function set in
org-columns-dblock-formatter.
Source Code
;; Defined in /usr/src/emacs/lisp/org/org-colview.el.gz
;;;###autoload
(defun org-dblock-write:columnview (params)
"Write the column view table.
PARAMS is a property list of parameters:
`:id' (mandatory)
The ID property of the entry where the columns view should be
built. When the symbol `local', call locally. When `global'
call column view with the cursor at the beginning of the
buffer (usually this means that the whole buffer switches to
column view). When \"file:path/to/file.org\", invoke column
view at the start of that file. Otherwise, the ID is located
using `org-id-find'.
`:exclude-tags'
List of tags to exclude from column view table.
`:format'
When non-nil, specify the column view format to use.
`:hlines'
When non-nil, insert a hline before each item. When
a number, insert a hline before each level inferior or equal
to that number.
`:indent'
When non-nil, indent each ITEM field according to its level.
`:match'
When set to a string, use this as a tags/property match filter.
`:maxlevel'
When set to a number, don't capture headlines below this level.
`:skip-empty-rows'
When non-nil, skip rows where all specifiers other than ITEM
are empty.
`:vlines'
When non-nil, make each column a column group to enforce
vertical lines.
`:link'
Link the item headlines in the table to their origins.
`:formatter'
A function to format the data and insert it into the
buffer. Overrides the default formatting function set in
`org-columns-dblock-formatter'."
(let ((table
(let ((id (plist-get params :id))
view-file view-pos)
(pcase id
(`global nil)
((or `local `nil) (setq view-pos (point)))
((and (let id-string (format "%s" id))
(guard (string-match "^file:\\(.*\\)" id-string)))
(setq view-file (match-string-no-properties 1 id-string))
(unless (file-exists-p view-file)
(user-error "No such file: %S" id-string)))
((and (let idpos (org-find-entry-with-id id)) (guard idpos))
(setq view-pos idpos))
((let `(,filename . ,position) (org-id-find id))
(setq view-file filename)
(setq view-pos position))
(_ (user-error "Cannot find entry with :ID: %s" id)))
(with-current-buffer (if view-file (org-get-agenda-file-buffer view-file)
(current-buffer))
(org-with-wide-buffer
(when view-pos (goto-char view-pos))
(org-columns--capture-view (plist-get params :maxlevel)
(plist-get params :match)
(plist-get params :skip-empty-rows)
(plist-get params :exclude-tags)
(plist-get params :format)
view-pos)))))
(formatter (or (plist-get params :formatter)
org-columns-dblock-formatter
#'org-columns-dblock-write-default)))
(funcall formatter (point) table params)))