emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Adding org files


From: Stephan Schmitt
Subject: Re: [Orgmode] Adding org files
Date: Tue, 10 Nov 2009 14:13:22 +0100
User-agent: Thunderbird 2.0.0.23 (X11/20090817)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]