Function: org-macro--collect-macros

org-macro--collect-macros is a byte-compiled function defined in org-macro.el.gz.

Signature

(org-macro--collect-macros)

Documentation

Collect macro definitions in current buffer and setup files.

Return an alist containing all macro templates found.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-macro.el.gz
(defun org-macro--collect-macros ()
  "Collect macro definitions in current buffer and setup files.
Return an alist containing all macro templates found."
  (let ((templates
         `(("author" . ,(org-macro--find-keyword-value "AUTHOR" t))
	   ("email" . ,(org-macro--find-keyword-value "EMAIL"))
	   ("title" . ,(org-macro--find-keyword-value "TITLE" t))
	   ("date" . ,(org-macro--find-date)))))
    (pcase (org-collect-keywords '("MACRO"))
      (`(("MACRO" . ,values))
       (dolist (value values)
	 (when (string-match "^\\(\\S-+\\)[ \t]*" value)
	   (let ((name (match-string 1 value))
		 (definition (substring value (match-end 0))))
             (push (cons name definition) templates))))))
    templates))