emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Include other files?
@ 2007-11-02  1:15 Richard G Riley
  2007-11-02 15:01 ` Bastien
  0 siblings, 1 reply; 3+ messages in thread
From: Richard G Riley @ 2007-11-02  1:15 UTC (permalink / raw)
  To: org-mode


Due to permissions and security issues I wish to spread my tasks over
separate files.

Is it possible to maybe "include" header files which have to org
directives?

e.g I might like to share the following between two different org
files:

common.inc:

#+SEQ_TODO: TODO(t) WAITING(w@) INPROGRESS(p@) | DONE(d) CANCELLED(x@) DELEGATED(l@)
#+SEQ_TODO: apple(a) | orange(d)

todo.org:

#+include common.inc

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Include other files?
  2007-11-02 15:01 ` Bastien
@ 2007-11-02 14:24   ` Richard G Riley
  0 siblings, 0 replies; 3+ messages in thread
From: Richard G Riley @ 2007-11-02 14:24 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Bastien <bzg@altern.org> writes:

> Richard G Riley <rileyrgdev@googlemail.com> writes:
>
>> common.inc:
>>
>> #+SEQ_TODO: TODO(t) WAITING(w@) INPROGRESS(p@) | DONE(d) CANCELLED(x@) DELEGATED(l@)
>> #+SEQ_TODO: apple(a) | orange(d)
>>
>> todo.org:
>>
>> #+include common.inc
>
> This is not that straitforward, because org needs to read options like
> #+SEQ_TODO before being able to fontify the buffer correctly.
>
> But you can use a dynamic block for that:
>
> (defun org-dblock-write:insert-file (params)
>   "Insert a header from a file."
>   (let ((file (plist-get params :file)))
>     (if (file-exists-p file)
> 	(insert-file-contents file)
>       (error "File %s cannot be found" file))))
>
> Then at the beginning of your file:
>
> #+BEGIN: insert-file :file "~/org/my-header.org"
> #+END:

Wonderful stuff.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Include other files?
  2007-11-02  1:15 Include other files? Richard G Riley
@ 2007-11-02 15:01 ` Bastien
  2007-11-02 14:24   ` Richard G Riley
  0 siblings, 1 reply; 3+ messages in thread
From: Bastien @ 2007-11-02 15:01 UTC (permalink / raw)
  To: emacs-orgmode

Richard G Riley <rileyrgdev@googlemail.com> writes:

> common.inc:
>
> #+SEQ_TODO: TODO(t) WAITING(w@) INPROGRESS(p@) | DONE(d) CANCELLED(x@) DELEGATED(l@)
> #+SEQ_TODO: apple(a) | orange(d)
>
> todo.org:
>
> #+include common.inc

This is not that straitforward, because org needs to read options like
#+SEQ_TODO before being able to fontify the buffer correctly.

But you can use a dynamic block for that:

(defun org-dblock-write:insert-file (params)
  "Insert a header from a file."
  (let ((file (plist-get params :file)))
    (if (file-exists-p file)
	(insert-file-contents file)
      (error "File %s cannot be found" file))))

Then at the beginning of your file:

#+BEGIN: insert-file :file "~/org/my-header.org"
#+END:

-- 
Bastien

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-11-02 14:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-02  1:15 Include other files? Richard G Riley
2007-11-02 15:01 ` Bastien
2007-11-02 14:24   ` Richard G Riley

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).