emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] Embedded code


From: Eric Schulte
Subject: Re: [Orgmode] Embedded code
Date: Fri, 21 Jan 2011 19:05:04 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>
> I have a few elementary questions I hope someone can bother to answer:
>
> 1. It seems that when org prints a list, it automatically formats it into a
> table.  In lisp, what's a proper way of converting a list to a string so I
> can have more control over the format?  My first attempts were unsuccessful.
>

There are a variety of ways to convert lists to strings, look at the
`format' function for printing any elisp value to a string.  You can
also use something like the following to convert a list to a string

#+begin_src emacs-lisp
  (mapconcat (lambda (el) (format "%S" el)) '(1 2 3 4 5 6) "\t")
#+end_src

>
> 2. I'd like to use Org's macros to replace
>
> #+begin_src
> (tagged "foo")
> #+end_src
>
> with
>
> {{{(tagged "foo")}}}
>
> but Org macros only expand on export.  Would it be feasible to change the
> macro functionality and hook into file loading?  Or is there some other way
> I can slim these down to be terse?
>

You can use the inline code syntax for very small blocks, e.g.

  src_emacs-lisp{(tagged "foo")}

See http://orgmode.org/manual/Structure-of-code-blocks.html

Cheers -- Eric



reply via email to

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