[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Include files on export

From: Carsten Dominik
Subject: Re: [Orgmode] Include files on export
Date: Wed, 2 Jul 2008 11:48:48 -0700

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)
(concat "\n" i1 (mapconcat 'identity (org-split-string text "\n") i2)

In the Org file:

* test

+ Title
 + list item 1
   <lisp>(org-include-as-list-item "inc.ttt" 10 "+")</lisp>


- Carsten

reply via email to

[Prev in Thread] Current Thread [Next in Thread]