[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] What sport should I practice today, random TODO generator: bugfi
From: |
Sebastien Vauban |
Subject: |
Re: [O] What sport should I practice today, random TODO generator: bugfixing help requested |
Date: |
Wed, 28 Dec 2011 07:56:56 +0100 |
User-agent: |
Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.91 (windows-nt) |
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