From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard G Riley Subject: Re: Include other files? Date: Fri, 02 Nov 2007 15:24:42 +0100 Message-ID: References: <873avod72y.fsf@bzg.ath.cx> 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 1InxS6-0006fZ-8W for emacs-orgmode@gnu.org; Fri, 02 Nov 2007 10:24:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1InxS4-0006b6-6X for emacs-orgmode@gnu.org; Fri, 02 Nov 2007 10:24:49 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1InxS4-0006ae-1Q for emacs-orgmode@gnu.org; Fri, 02 Nov 2007 10:24:48 -0400 Received: from nf-out-0910.google.com ([64.233.182.188]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1InxS3-0003nL-Mk for emacs-orgmode@gnu.org; Fri, 02 Nov 2007 10:24:47 -0400 Received: by nf-out-0910.google.com with SMTP id f5so910739nfh for ; Fri, 02 Nov 2007 07:24:46 -0700 (PDT) In-Reply-To: <873avod72y.fsf@bzg.ath.cx> (Bastien's message of "Fri\, 02 Nov 2007 15\:01\:57 +0000") 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: Bastien Cc: emacs-orgmode@gnu.org Bastien writes: > Richard G Riley 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.