From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephan Schmitt Subject: Re: Adding org files Date: Tue, 10 Nov 2009 14:13:22 +0100 Message-ID: <4AF966F2.8030302@cs.tu-berlin.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N7qXP-00076a-Bs for emacs-orgmode@gnu.org; Tue, 10 Nov 2009 08:13:35 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N7qXJ-00074Q-MT for emacs-orgmode@gnu.org; Tue, 10 Nov 2009 08:13:34 -0500 Received: from [199.232.76.173] (port=55218 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N7qXJ-00074D-AN for emacs-orgmode@gnu.org; Tue, 10 Nov 2009 08:13:29 -0500 Received: from mail.cs.tu-berlin.de ([130.149.17.13]:59758) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N7qXI-0007tW-Ql for emacs-orgmode@gnu.org; Tue, 10 Nov 2009 08:13:29 -0500 Received: from localhost (localhost [127.0.0.1]) by localhost-12225.cs.tu-berlin.de (Postfix) with ESMTP id 207F335413 for ; Tue, 10 Nov 2009 14:13:25 +0100 (MET) In-Reply-To: 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: andrea Crotti Cc: emacs-orgmode@gnu.org Hi Andrea, andrea Crotti wrote: > 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? the function org-agenda-file-to-front calls the function customize-save-variable. find more information about the customization framework here: (info "(emacs)Customization") the customizations are stored per default in the emacs init file. > 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 > if you use (setq ...) you circumvent the customization framework and the variable is set only for the emacs session. don't know if this helps, otherwise rephrase your question, please. Greetings, Stephan