From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard G Riley Subject: Re: Include files on export Date: Wed, 02 Jul 2008 21:10:15 +0200 Message-ID: <38prpwt84o.fsf@richardriley.net> References: <7D0B737B-4C69-44E8-B0AA-F553403EE07B@uva.nl> 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 1KE7ig-0002RT-6r for emacs-orgmode@gnu.org; Wed, 02 Jul 2008 15:10:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KE7ie-0002QR-U3 for emacs-orgmode@gnu.org; Wed, 02 Jul 2008 15:10:21 -0400 Received: from [199.232.76.173] (port=38717 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KE7ie-0002QB-Os for emacs-orgmode@gnu.org; Wed, 02 Jul 2008 15:10:20 -0400 Received: from fg-out-1718.google.com ([72.14.220.157]:45808) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KE7ie-0006u5-AI for emacs-orgmode@gnu.org; Wed, 02 Jul 2008 15:10:20 -0400 Received: by fg-out-1718.google.com with SMTP id l26so185355fgb.30 for ; Wed, 02 Jul 2008 12:10:19 -0700 (PDT) In-Reply-To: <7D0B737B-4C69-44E8-B0AA-F553403EE07B@uva.nl> (Carsten Dominik's message of "Wed, 2 Jul 2008 11:48:48 -0700") 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: Carsten Dominik Cc: org-mode , Richard G Riley Carsten Dominik writes: > On Jul 2, 2008, at 11:21 AM, Richard G Riley wrote: > >> >> How can I include text into a sub level e.g an unordered list? I >> really >> dont want to inclide the list delimiter in the text file itself since >> this text can be included elsewhere too. >> >> + Title >> + list item 1 >> #+INCLUDE: "~/docs/cv/references/cpd.org" >> >> here I want the include to be list item 2. > > This is untested. > > In .emacs > > (require 'org-eval) > (defun org-include-as-list-item (file ind bullet) > "Include FILE with indentation IND and BULLET into the current file" > (let ((i1 (concat (make-string ind ?\ ) bullet " ")) > (i2 (concat "\n" (make-string (+ 2 ind) ?\ ))) > (text (with-temp-buffer > (insert-file-contents file) > (buffer-string)))) > (concat "\n" i1 (mapconcat 'identity (org-split-string text "\n") > i2) > "\n"))) > > In the Org file: > > > > * test > > + Title > + list item 1 > (org-include-as-list-item "inc.ttt" 10 "+") > > > HTH > > - Carsten Could I suggest a different approach? Possibly have a parameter which is a prefix text on the include line? e.g #+INCLUDE: "~/docs/cv/references/cpd.org" :prefix " + " The you dont need to hard code bullets and indentation. There is probably a more suitable syntax than above.