emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Richard G Riley <rileyrgdev@googlemail.com>
To: Carsten Dominik <dominik@uva.nl>
Cc: org-mode <emacs-orgmode@gnu.org>,
	Richard G Riley <rileyrgdev@googlemail.com>
Subject: Re: Include files on export
Date: Wed, 02 Jul 2008 21:10:15 +0200	[thread overview]
Message-ID: <38prpwt84o.fsf@richardriley.net> (raw)
In-Reply-To: <7D0B737B-4C69-44E8-B0AA-F553403EE07B@uva.nl> (Carsten Dominik's message of "Wed, 2 Jul 2008 11:48:48 -0700")

Carsten Dominik <dominik@uva.nl> 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.

  reply	other threads:[~2008-07-02 19:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-02 18:21 Include files on export Richard G Riley
2008-07-02 18:48 ` Carsten Dominik
2008-07-02 19:10   ` Richard G Riley [this message]
2008-07-02 20:35     ` Carsten Dominik
2008-07-02 21:06       ` Richard G Riley
2008-07-02 21:10         ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=38prpwt84o.fsf@richardriley.net \
    --to=rileyrgdev@googlemail.com \
    --cc=dominik@uva.nl \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).