Discussion:
[Orgmode] Removing org files after opening agenda
Stefan Kamphausen
2007-11-02 12:45:11 UTC
Permalink
Hi,

when opening an agenda for TODO items (via M-x org-agenda t) all files
from org-agenda-files will be opened. This clutters the buffer space
and I think the buffers should be killed after reading their contents.

Probably I could do it myself using org-finalize-agenda-hook but it
may be worth thinking about a general solution. And maybe I am
missing something?

The simple approach, to close all buffers associated with files in
org-agenda-files, is obviously not what one wants, instead only those
opened transparently should be removed afterwards.

What do you think?

Kind Regards
Stefan
--
Stefan Kamphausen --- http://www.skamphausen.de
a blessed +42 regexp of confusion (weapon in hand)
You hit. The format string crumbles and turns to dust.
Bastien
2007-11-02 15:22:57 UTC
Permalink
Post by Stefan Kamphausen
The simple approach, to close all buffers associated with files in
org-agenda-files, is obviously not what one wants, instead only those
opened transparently should be removed afterwards.
While we may come up with an org-specific solution at some point, you
might also be interested in tempbuf.el:

http://www.emacswiki.org/cgi-bin/wiki?TempbufMode

I didn't try it with

(add-hook 'find-file-hooks 'turn-on-tempbuf-mode)

but tempbuf.el explicitely says it might be worth the try...

HTH,
--
Bastien
Eddward DeVilla
2007-11-02 15:48:43 UTC
Permalink
Actually, this is how I load all my org files in one shot. It did
annoy me once upon a time.

Edd
Post by Stefan Kamphausen
Hi,
when opening an agenda for TODO items (via M-x org-agenda t) all files
from org-agenda-files will be opened. This clutters the buffer space
and I think the buffers should be killed after reading their contents.
Probably I could do it myself using org-finalize-agenda-hook but it
may be worth thinking about a general solution. And maybe I am
missing something?
The simple approach, to close all buffers associated with files in
org-agenda-files, is obviously not what one wants, instead only those
opened transparently should be removed afterwards.
What do you think?
Kind Regards
Stefan
--
Stefan Kamphausen --- http://www.skamphausen.de
a blessed +42 regexp of confusion (weapon in hand)
You hit. The format string crumbles and turns to dust.
_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Carsten Dominik
2007-11-03 21:26:00 UTC
Permalink
Post by Stefan Kamphausen
Hi,
when opening an agenda for TODO items (via M-x org-agenda t) all files
from org-agenda-files will be opened. This clutters the buffer space
and I think the buffers should be killed after reading their contents.
Probably I could do it myself using org-finalize-agenda-hook but it
may be worth thinking about a general solution. And maybe I am
missing something?
The simple approach, to close all buffers associated with files in
org-agenda-files, is obviously not what one wants, instead only those
opened transparently should be removed afterwards.
What do you think?
Org-mode does remove all those buffers when you exit the agenda
with "x" instead of "q". Then all buffers loaded for constructing
the TODO list
will be removed. Buffers that were already present before the agenda
was constructed are not removed. If buffers have been modified,
you will be asked if you want to save them.

Org-mode is not removing the buffers immediately after constructing
the list, because it assumes that while working with the list you
will still
need them for lookup purposes.

If you insist on immediately getting rid of the buffers,
you can put something like this into the org-finalize-agenda-hook:

(add-hook 'org-finalize-agenda-hook
(lambda ()
(org-release-buffers org-agenda-new-buffers)
(setq org-agenda-new-buffers nil)))


- Carsten

Continue reading on narkive:
Loading...