Function: org-read-agenda-file-list

org-read-agenda-file-list is a byte-compiled function defined in org.el.gz.

Signature

(org-read-agenda-file-list &optional PAIR-WITH-EXPANSION)

Documentation

Read the list of agenda files from a file.

If PAIR-WITH-EXPANSION is t return pairs with un-expanded filenames, used by org-store-new-agenda-file-list to write back un-expanded file names.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org.el.gz
(defun org-read-agenda-file-list (&optional pair-with-expansion)
  "Read the list of agenda files from a file.
If PAIR-WITH-EXPANSION is t return pairs with un-expanded
filenames, used by `org-store-new-agenda-file-list' to write back
un-expanded file names."
  (when (file-directory-p org-agenda-files)
    (error "`org-agenda-files' cannot be a single directory"))
  (when (stringp org-agenda-files)
    (with-temp-buffer
      (insert-file-contents org-agenda-files)
      (mapcar
       (lambda (f)
	 (let ((e (expand-file-name (substitute-in-file-name f)
				    org-directory)))
	   (if pair-with-expansion
	       (cons e f)
	     e)))
       (org-split-string (buffer-string) "[ \t\r\n]*?[\r\n][ \t\r\n]*")))))