From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ido Magal Subject: Re: Embedded code Date: Fri, 21 Jan 2011 18:10:50 -0800 Message-ID: References: <2324250583714673900@unknownmsgid> <87aaizhz23.fsf@gmail.com> <4D3554AC.1060303@gmail.com> <8762tmfa74.fsf@gmail.com> <871v4a2b15.fsf@gmail.com> <87oc79elrj.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1314622745==" Return-path: Received: from [140.186.70.92] (port=34841 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PgSwc-0005yB-Bg for emacs-orgmode@gnu.org; Fri, 21 Jan 2011 21:11:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PgSwa-0005iY-Lx for emacs-orgmode@gnu.org; Fri, 21 Jan 2011 21:11:14 -0500 Received: from mail-wy0-f169.google.com ([74.125.82.169]:58043) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PgSwa-0005iF-BL for emacs-orgmode@gnu.org; Fri, 21 Jan 2011 21:11:12 -0500 Received: by wyj26 with SMTP id 26so2679701wyj.0 for ; Fri, 21 Jan 2011 18:11:11 -0800 (PST) In-Reply-To: <87oc79elrj.fsf@gmail.com> 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: Eric Schulte Cc: emacs-orgmode@gnu.org, Rainer M Krug --===============1314622745== Content-Type: multipart/alternative; boundary=001485f0a01067d78f049a65e158 --001485f0a01067d78f049a65e158 Content-Type: text/plain; charset=UTF-8 Perfect! Thanks on both counts. On Fri, Jan 21, 2011 at 18:05, Eric Schulte wrote: > > > > 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 > --001485f0a01067d78f049a65e158 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Perfect! =C2=A0Thanks on both counts.

On Fri, Jan 21, 2011 at 18:05, Eric Schulte <schulte.eric@gmail.com&g= t; wrote:
>
> 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 i= nto a
> table. =C2=A0In lisp, what's a proper way of converting a list to = a string so I
> can have more control over the format? =C2=A0My first attempts were un= successful.
>

There are a variety of ways to convert lists to strings, look at the<= br> `format' function for printing any elisp value to a string. =C2=A0You c= an
also use something like the following to convert a list to a string

#+begin_src emacs-lisp
=C2=A0(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. =C2=A0Would it be feasible to ch= ange the
> macro functionality and hook into file loading? =C2=A0Or 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.

=C2=A0src_emacs-lisp{(tagged "foo")}

See http://orgmode.org/manual/Structure-of-code-blocks.html<= br>
Cheers -- Eric

--001485f0a01067d78f049a65e158-- --===============1314622745== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1314622745==--