From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Include files on export Date: Wed, 2 Jul 2008 11:48:48 -0700 Message-ID: <7D0B737B-4C69-44E8-B0AA-F553403EE07B@uva.nl> References: Mime-Version: 1.0 (Apple Message framework v924) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KE7Nv-00089y-5y for emacs-orgmode@gnu.org; Wed, 02 Jul 2008 14:48:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KE7Nt-00088K-G8 for emacs-orgmode@gnu.org; Wed, 02 Jul 2008 14:48:54 -0400 Received: from [199.232.76.173] (port=46254 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KE7Nt-00088C-BW for emacs-orgmode@gnu.org; Wed, 02 Jul 2008 14:48:53 -0400 Received: from korteweg.uva.nl ([146.50.98.70]:16646) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KE7Ns-0003ux-9M for emacs-orgmode@gnu.org; Wed, 02 Jul 2008 14:48:52 -0400 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: Richard G Riley Cc: org-mode 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