From mboxrd@z Thu Jan 1 00:00:00 1970 From: andrea Subject: Re: Restructure my org-life Date: Wed, 02 Dec 2009 15:45:13 +0100 Message-ID: References: <87skdfcuf3.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NFqSg-0006ug-OZ for emacs-orgmode@gnu.org; Wed, 02 Dec 2009 09:45:47 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NFqSb-0006si-Sn for emacs-orgmode@gnu.org; Wed, 02 Dec 2009 09:45:45 -0500 Received: from [199.232.76.173] (port=46791 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFqSZ-0006sQ-M3 for emacs-orgmode@gnu.org; Wed, 02 Dec 2009 09:45:39 -0500 Received: from lo.gmane.org ([80.91.229.12]:45317) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NFqSZ-00015E-5n for emacs-orgmode@gnu.org; Wed, 02 Dec 2009 09:45:39 -0500 Received: from list by lo.gmane.org with local (Exim 4.50) id 1NFqSV-0003ad-Cw for emacs-orgmode@gnu.org; Wed, 02 Dec 2009 15:45:35 +0100 Received: from 47-138.eduroam.rwth-aachen.de ([134.61.47.138]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 02 Dec 2009 15:45:35 +0100 Received: from andrea.crotti.0 by 47-138.eduroam.rwth-aachen.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 02 Dec 2009 15:45:35 +0100 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: emacs-orgmode@gnu.org Xavier Maillard writes: > Care to share it with us ? > Of course with pleasure, it's quite simple but very nice --8<---------------cut here---------------start------------->8--- (defun org-add-eventually() "Adding a file to org-agenda when saved" (interactive) (if (string= major-mode "org-mode") (org-agenda-file-to-front))) ;;TODO: Check if a file is contained in some subdirectories (add-hook 'before-save-hook 'org-add-eventually) --8<---------------cut here---------------end--------------->8--- org-agenda-file-to-front as someone said use the customization thing, so your agenda-files variable will be written at the end of .emacs/init.el or wherever you have it. It works quite well, then if you remove some files the next time you see the agenda it will just ask you if you want to remove them from the agenda as well, fairly simple then. See http://github.com/AndreaCrotti/Emacs-conf/blob/master/.emacs.d/conf/org.el for my full emacs configuration (that file linked is only for org-mode).