emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Stefan Kamphausen <skampi@gmx.net>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Removing org files after opening agenda
Date: Sat, 3 Nov 2007 22:26:00 +0100	[thread overview]
Message-ID: <1BA3586F-B545-4685-ABB6-1B5105B0DEA7@science.uva.nl> (raw)
In-Reply-To: <85hck4hl48.fsf@usenet.my.skamphausen.de>


On  2Nov2007, at 1:45 PM, Stefan Kamphausen wrote:

> 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

      parent reply	other threads:[~2007-11-03 21:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-02 12:45 Removing org files after opening agenda Stefan Kamphausen
2007-11-02 15:22 ` Bastien
2007-11-02 15:48 ` Eddward DeVilla
2007-11-03 21:26 ` Carsten Dominik [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1BA3586F-B545-4685-ABB6-1B5105B0DEA7@science.uva.nl \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=skampi@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).