emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Sebastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: What sport should I practice today, random TODO generator: bugfixing help requested
Date: Wed, 28 Dec 2011 07:56:56 +0100	[thread overview]
Message-ID: <80obuttc93.fsf@somewhere.org> (raw)
In-Reply-To: 819AF3F5-81D1-45C8-AD5D-3E2E995E1E85@franz.sommerp.net

Hi Franz,

Franz Sommer wrote:
> I have a small lisp code block evaluation problem generating org-mode style output.
> Motivation and so on, see below. 
>
> Would appreciate the communities help. 
> Gladly will return feedback once my setup has advanced and you are interested.
>
> Tks in advance, Franz
>
>
> =======
> = Goal:=
> =======
> Hava a random (weekly) generator of activities and / or todo items. Think of
> everyday question like sports (shall I go cycling , swimming or running) May
> also be used for creativity teasers and any other kind of randomizable
> decission making.
>
>
> (see why here: 
> http://books.google.de/books?id=m5vQHbj2Vi0C&pg=PA71&dq=o+reilly+mind+hack+random&hl=de&sa=X&ei=4TH5Tv3lOcStsgaZ3dzgDw&ved=0CEMQ6AEwAg#v=onepage&q=o%20reilly%20mind%20hack%20random&f=false
> )
>
> =================================
> = Current Stage / Actual Debug Problem  =
> =================================
> I like to get 
> ** TODO running
> and not
> | ** TODO running :random: |
>
> What is wrong with my approach ?
> (Yes I am new to lisp, but I hope that does not matter here to much. )
>
> =======
> =Code:=
> =======
>
> #+headers: :results value varbatim replace 

                           ^ verbatim
                             or scalar

> #+begin_src emacs-lisp 
> 	(defun table '())
> 		(add-to-list 'table "** TODO running :random:")    ;; later on some scheduling and tracking properties will be added
> 		(add-to-list 'table "** TODO cycling :random:")
>
> 	(setq returnlist '() )
>
> 	;;later a loop shall be here to say make list of 5 items  )
>
> 		(add-to-list 'returnlist (nth (random (length table)) table)))
>
> (returnlist)
> #+end_src
>
> #+results:
> | ** TODO Cereals :random: |

Also, please note that, in order to be effectively replaced, your results
should maybe be wrapped in a =begin_result= block. See `:results wrap' for
this.

Best regards,
  Seb

-- 
Sebastien Vauban

      reply	other threads:[~2011-12-28  6:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-27  3:16 What sport should I practice today, random TODO generator: bugfixing help requested Franz Sommer
2011-12-28  6:56 ` Sebastien Vauban [this message]

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=80obuttc93.fsf@somewhere.org \
    --to=wxhgmqzgwmuf-genee64ty+gs+fvcfc7uqw@public.gmane.org \
    --cc=emacs-orgmode-mXXj517/zsQ@public.gmane.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).