Function: org-cycle-agenda-files

org-cycle-agenda-files is an autoloaded, interactive and byte-compiled function defined in org.el.gz.

Signature

(org-cycle-agenda-files)

Documentation

Cycle through the files in org-agenda-files(var)/org-agenda-files(fun).

If the current buffer visits an agenda file, find the next one in the list. If the current buffer does not, find the first agenda file.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/org/org.el.gz
;;;###autoload
(defun org-cycle-agenda-files ()
  "Cycle through the files in `org-agenda-files'.
If the current buffer visits an agenda file, find the next one in the list.
If the current buffer does not, find the first agenda file."
  (interactive)
  (let* ((fs (or (org-agenda-files t)
		 (user-error "No agenda files")))
	 (files (copy-sequence fs))
	 (tcf (and buffer-file-name (file-truename buffer-file-name)))
	 file)
    (when tcf
      (while (and (setq file (pop files))
		  (not (equal (file-truename file) tcf)))))
    (find-file (car (or files fs)))
    (when (buffer-base-buffer) (pop-to-buffer-same-window (buffer-base-buffer)))))