diff --git a/lisp/org.el b/lisp/org.el index 19b28a3..532da83 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -15379,7 +15379,7 @@ used by the agenda files. If ARCHIVE is `ifmode', do this only if (cond ((and (not unrestricted) (get 'org-agenda-files 'org-restrict))) ((stringp org-agenda-files) (org-read-agenda-file-list)) - ((listp org-agenda-files) org-agenda-files) + ((listp org-agenda-files) (org-expand-file-list)) (t (error "Invalid value of `org-agenda-files'"))))) (setq files (apply 'append (mapcar (lambda (f) @@ -15468,6 +15468,16 @@ un-expanded file names." e))) (org-split-string (buffer-string) "[ \t\r\n]*?[\r\n][ \t\r\n]*"))))) +(defun org-expand-file-list () + "Expand the list of agenda files in `org-agenda-files' with +`org-directory' as base directory." + (when (listp org-agenda-files) + (mapcar + (lambda (f) + (let ((e (expand-file-name + (substitute-in-file-name f) org-directory))) + e)) org-agenda-files))) + ;;;###autoload (defun org-cycle-agenda-files () "Cycle through the files in `org-agenda-files'.