Function: org-agenda-get-represented-categories

org-agenda-get-represented-categories is a byte-compiled function defined in org-agenda.el.gz.

Signature

(org-agenda-get-represented-categories)

Documentation

Return a list of all categories used in this agenda buffer.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-agenda.el.gz
(defun org-agenda-get-represented-categories ()
  "Return a list of all categories used in this agenda buffer."
  (or org-agenda-represented-categories
      (when (derived-mode-p 'org-agenda-mode)
	(let ((pos (point-min)) categories)
	  (while (and (< pos (point-max))
		      (setq pos (next-single-property-change
				 pos 'org-category nil (point-max))))
	    (push (get-text-property pos 'org-category) categories))
	  (setq org-agenda-represented-categories
		;; Enclose category names with a hyphen in double
		;; quotes to process them specially in `org-agenda-filter'.
		(mapcar (lambda (s) (if (string-match-p "-" s) (format "\"%s\"" s) s))
			(nreverse (org-uniquify (delq nil categories)))))))))