Carsten Dominik <[EMAIL PROTECTED]> 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 > <lisp>(org-include-as-list-item "inc.ttt" 10 "+")</lisp> > > > 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. _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode