From mboxrd@z Thu Jan 1 00:00:00 1970 From: andrea Crotti Subject: Adding org files Date: Mon, 9 Nov 2009 14:14:23 +0000 (UTC) Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N7V1C-0006Jd-3q for emacs-orgmode@gnu.org; Mon, 09 Nov 2009 09:14:54 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N7V17-0006HL-HO for emacs-orgmode@gnu.org; Mon, 09 Nov 2009 09:14:53 -0500 Received: from [199.232.76.173] (port=54695 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N7V17-0006H8-7o for emacs-orgmode@gnu.org; Mon, 09 Nov 2009 09:14:49 -0500 Received: from lo.gmane.org ([80.91.229.12]:57866) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N7V16-0002qn-Oh for emacs-orgmode@gnu.org; Mon, 09 Nov 2009 09:14:49 -0500 Received: from list by lo.gmane.org with local (Exim 4.50) id 1N7V14-0007bL-3Y for emacs-orgmode@gnu.org; Mon, 09 Nov 2009 15:14:46 +0100 Received: from 47-131.eduroam.RWTH-Aachen.DE ([134.61.47.131]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 09 Nov 2009 15:14:46 +0100 Received: from andrea.crotti.0 by 47-131.eduroam.RWTH-Aachen.DE with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 09 Nov 2009 15:14:46 +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 I added this function to my org conf ;; We also want to check that this is actually in base directories (defun org-add-eventually() "Adding a file to org-agenda when saved, with" (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) Looks like it's working and it's really nice, but now I have something writing a very long list in my init.el (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(org-agenda-files (quote ("~/org/tobuy.org" "/Users/andrea/Documents/calzitex/documentazione/doc.org" "/U... Who is writing it? And by the way I was thinking exactly to a way to "pickle" the list every time I quit emacs. Given that I only add files with emacs when I restart it would be nice to just read the list instead of generating it. Is that sufficient to write a "(setq org-agenda-files "...") every time I save a new org-file or there are smarter ways (like pickling/marshalling for example)? Thanks