emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* agenda files list
@ 2009-10-20  3:15 Eraldo Helal
  2009-10-20  3:24 ` Eraldo Helal
  0 siblings, 1 reply; 2+ messages in thread
From: Eraldo Helal @ 2009-10-20  3:15 UTC (permalink / raw)
  To: Org-Mode

I would like to have a list of all agenda files
where each item links to its file.
This would be great for doing my weekly review since in my system all
agenda files need to be viewed weekly.
It could also be added to the agenda menu (C-c a) as an option.

Workaround:
Because I don't know how to get a nice looking list of all my agenda files...
shabble came up with some code which I modified and the result is below:

;; list all agenda-files (linking to them) in a new buffer
(defun list-agenda-files()
  "Create a list of all org-agenda files as org-mode links"
  (interactive)
  (let ((list-buf (get-buffer-create "*org-agenda-files*")))
    (with-current-buffer list-buf
      (erase-buffer)
      (insert "Agenda Files:\n")
      (dolist (file org-agenda-files)
        (let
	    ((desc (first (split-string (file-name-nondirectory file) "\\.org$"))))
	    (insert (concat "- [[" file "][" desc "]]\n"))
	)
      )
      (org-mode)
    )
    (switch-to-buffer list-buf))

If anyone else has use for this please give some feedback.
If someone could help us make this code more mature... please do the same.

Greetings,
Eraldo

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: agenda files list
  2009-10-20  3:15 agenda files list Eraldo Helal
@ 2009-10-20  3:24 ` Eraldo Helal
  0 siblings, 0 replies; 2+ messages in thread
From: Eraldo Helal @ 2009-10-20  3:24 UTC (permalink / raw)
  To: Org-Mode

code update:

;; list all agenda categories (linking to their files) in a new buffer
(defun orgx-list-agenda-files()
  "Create a list of all org-agenda files as org-mode links"
  (interactive)
  (let ((list-buf (get-buffer-create "*org-agenda-files*")))
    (with-current-buffer list-buf
      (erase-buffer)
      (insert "* Org Agenda Files\n")
      (dolist (file org-agenda-files)
        (let ((desc (file-name-sans-extension (file-name-nondirectory file))))
        (insert (concat "- [[" file "][" desc "]]\n")))))
    (switch-to-buffer list-buf))
  (org-mode)
  (goto-char (point-min))
  (org-cycle '(3)))

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-10-20  3:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-20  3:15 agenda files list Eraldo Helal
2009-10-20  3:24 ` Eraldo Helal

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).