From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Removing org files after opening agenda Date: Sat, 3 Nov 2007 22:26:00 +0100 Message-ID: <1BA3586F-B545-4685-ABB6-1B5105B0DEA7@science.uva.nl> References: <85hck4hl48.fsf@usenet.my.skamphausen.de> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IoQVJ-0001VL-OO for emacs-orgmode@gnu.org; Sat, 03 Nov 2007 17:26:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IoQVI-0001Ux-R6 for emacs-orgmode@gnu.org; Sat, 03 Nov 2007 17:26:05 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IoQVI-0001Uu-Lu for emacs-orgmode@gnu.org; Sat, 03 Nov 2007 17:26:04 -0400 Received: from nf-out-0910.google.com ([64.233.182.185]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IoQVG-0002m6-KE for emacs-orgmode@gnu.org; Sat, 03 Nov 2007 17:26:02 -0400 Received: by nf-out-0910.google.com with SMTP id f5so1198445nfh for ; Sat, 03 Nov 2007 14:26:01 -0700 (PDT) In-Reply-To: <85hck4hl48.fsf@usenet.my.skamphausen.de> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Stefan Kamphausen Cc: emacs-orgmode 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