Function: org-columns-compile-format

org-columns-compile-format is a byte-compiled function defined in org-colview.el.gz.

Signature

(org-columns-compile-format FMT)

Documentation

Turn a column format string FMT into an alist of specifications.

The alist has one entry for each column in the format. The elements of that list are:
property the property name, as an upper-case string
title the title field for the columns, as a string
width the column width in characters, can be nil for automatic width
operator the summary operator, as a string, or nil
printf a printf format for computed values, as a string, or nil

This function updates org-columns-current-fmt-compiled.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-colview.el.gz
(defun org-columns-compile-format (fmt)
  "Turn a column format string FMT into an alist of specifications.

The alist has one entry for each column in the format.  The elements of
that list are:
property    the property name, as an upper-case string
title       the title field for the columns, as a string
width       the column width in characters, can be nil for automatic width
operator    the summary operator, as a string, or nil
printf      a printf format for computed values, as a string, or nil

This function updates `org-columns-current-fmt-compiled'."
  (setq org-columns-current-fmt-compiled nil)
  (let ((start 0))
    (while (string-match
	    "%\\([0-9]+\\)?\\([[:alnum:]_-]+\\)\\(?:(\\([^)]+\\))\\)?\
\\(?:{\\([^}]+\\)}\\)?\\s-*"
	    fmt start)
      (setq start (match-end 0))
      (let* ((width (and (match-end 1) (string-to-number (match-string 1 fmt))))
	     (prop (match-string-no-properties 2 fmt))
	     (title (or (match-string-no-properties 3 fmt) prop))
	     (operator (match-string-no-properties 4 fmt)))
	(push (if (not operator) (list (upcase prop) title width nil nil)
		(let (printf)
		  (when (string-match ";" operator)
		    (setq printf (substring operator (match-end 0)))
		    (setq operator (substring operator 0 (match-beginning 0))))
		  (list (upcase prop) title width operator printf)))
	      org-columns-current-fmt-compiled)))
    (setq org-columns-current-fmt-compiled
	  (nreverse org-columns-current-fmt-compiled))))