[O] Newbie question

2018-08-01 Thread Henrik Frisk
Hi,

I'm new with Scheme and new with org babel so excuse me if I am missing
something obvious.
I have this bit of (simplified) Scheme code to generate a list of lists:

#+name: chromatic
#+begin_src scheme :noweb yes
  (map (lambda (x)
 (cond ((< x 4) (list 0 1))
   ((equal? x 4) (list 2 0))
   ((> x 4) (list 1 1
   (list 0 1 2 3 4 5 6 7 8 9 10 11))
#+end_src

It appears to be working fine outputting a table such as

#+RESULTS:
| 0 | 1 |
| 0 | 1 |
| 0 | 1 |
 ...

For another function in Lilypond, also in scheme I need it to be a (list
(list 0 1) (list 0 1)...) as in the variable seq below:

 #+begin_src scheme :noweb yes
 $(let ((random-state (seed->random-state (current-time)))
   (seq (list (list 0 0) (list 0 1/2) (list 1 0) (list 1 1/2) (list 2
0) (list 3 0) (list 3 1/2) (list 4 0) (list 4 1/2) (list 5 0) (list 5 1/2)
(list 6 0
   (make-sequential-music
(map (lambda (x p)
   (let ((idx (random 12 random-state)))
 (make-music 'NoteEvent
'duration (ly:make-duration 2 0 1/1)
'pitch (ly:make-pitch 0 (car p) (car (cdr p))
   (make-list (length seq)) seq)))
 #+end_src

I can do:

(seq <>)

if alist is:

#+name: alist
#+begin_src scheme
  (list (list 0 0) (list 0 1/2) (list 1 0) (list 1 1/2) (list 2 0)
(list 3 0) (list 3 1/2) (list 4 0) (list 4 1/2) (list 5 0) (list 5 1/2)
(list 6 0))
#+end_src

but what I would like to be able to do is to have have the noweb reference
be to the 'chromatic' function above as in:

(seq <>)

but that doesn't work. Maybe what I am trying to do is not possible, maybe
there is a limitation on ob-lilypond, but it seems to me that the result of
my function chromatic above spits out ((0 1) (0 1)... ) and that this is
the cause it doesn't work.

Again, I am really new to this...

The workaround I am doing is to format the output of chromatic into a
proper list och lists and then add it by noweb reference.

Any hints welcome.
/Henrik


Re: [O] Newbie question: how to get a report of DONE items

2015-01-23 Thread J. David Boyd
Pete Siemsen  writes:

> I'm a newbie, just switching to org-mode.
>
> For work, I have to produce quarterly reports that list what I've
> done. I want a report of all the items that were closed within a given
> date range.
>
> I could write some code to do this, but I suspect org-made comes with
> something close :-)
>
> -- Pete


Look on the screen after you hit Ctl-c a.

Dave




[O] Newbie question: how to get a report of DONE items

2015-01-15 Thread Pete Siemsen
I'm a newbie, just switching to org-mode.

For work, I have to produce quarterly reports that list what I've done. I
want a report of all the items that were closed within a given date range.

I could write some code to do this, but I suspect org-made comes with
something close :-)

-- Pete


Re: [O] Newbie question

2013-02-08 Thread Ken
On Fri, Feb 08, 2013 at 01:15:19PM +, Julian Burgos wrote:
> Hi Ken,
> 
> If you do   you will get an active timestamp with date
> and time.  will give you an inactive timestamp with date
> and time.
> I also have this code in my .emacs file, so whenever I create a
> headline I get an inactive timestamp automatically.  It should be
> easy to change to get an active timestamp if you want.
> 
> ;--
> ;Creating new headlines insert inactive timestamps automatically
> 
> (defun bh/insert-inactive-timestamp ()
> (interactive)
> (org-insert-time-stamp nil t t nil nil nil))
> 
> (defun bh/insert-heading-inactive-timestamp ()
> (save-excursion
> (org-return)
> (org-cycle)
> (bh/insert-inactive-timestamp)))
> 
> (add-hook 'org-insert-heading-hook 'bh/insert-heading-inactive-timestamp)
> ;-
> 
> Enjoy!

Thanks, Julian. I much appreciate this.

Ken


> 
> -- 
> Julian Mariano Burgos, PhD
> Hafrannsóknastofnunin/Marine Research Institute
> Skúlagata 4, 121 Reykjavík, Iceland
> Sími/Telephone : +354-5752037
> Bréfsími/Telefax:  +354-5752001
> Netfang/Email: jul...@hafro.is
> 
> 
> 
> On 02/08/2013 12:50 PM, Ken wrote:
> >Hello all,
> >
> >I am a relative newbie to org-mode. Right now I use it for todo lists, I
> >use it in conjunction with the diary, and I use it for
> >journaling/note-taking. I am sure I am only using it fo a quarter or
> >less of what it can be used for. Anyway, my question is rather simple.
> > will allow you to insert a date. However, in my journal I use a
> >full timestamp. Is there any way using a defined set of keys to insert a
> >current TIMESTAMP on an entry (say as in a journal entry)?
> >
> >Thank you
> >Ken
> >
> >
> 
> 

-- 
Work consists of whatever a body is obliged to do.
Play consists of whatever a body is not obliged to do.
-- Mark Twain



Re: [O] Newbie question

2013-02-08 Thread Nick Dokos
Ken  wrote:

> Hello all,
> 
> I am a relative newbie to org-mode. Right now I use it for todo lists, I
> use it in conjunction with the diary, and I use it for
> journaling/note-taking. I am sure I am only using it fo a quarter or
> less of what it can be used for. Anyway, my question is rather simple.
>  will allow you to insert a date. However, in my journal I use a
> full timestamp. Is there any way using a defined set of keys to insert a
> current TIMESTAMP on an entry (say as in a journal entry)?
> 

This (and many other questions) is answered in the manual: for this one,
see section 8.2, "Creating timestamps". The manual is available online
e.g.

http://orgmode.org/org.html#Dates-and-Times

but I generally prefer to look up things locally, using emacs's info
system. For example, evaluate the following in emacs:

(info "(org) Creating timestamps")

Nick



Re: [O] Newbie question

2013-02-08 Thread Julian Burgos

Hi Ken,

If you do   you will get an active timestamp with date and 
time.  will give you an inactive timestamp with date and time.
I also have this code in my .emacs file, so whenever I create a headline 
I get an inactive timestamp automatically.  It should be easy to change 
to get an active timestamp if you want.


;--
;Creating new headlines insert inactive timestamps automatically

(defun bh/insert-inactive-timestamp ()
(interactive)
(org-insert-time-stamp nil t t nil nil nil))

(defun bh/insert-heading-inactive-timestamp ()
(save-excursion
(org-return)
(org-cycle)
(bh/insert-inactive-timestamp)))

(add-hook 'org-insert-heading-hook 'bh/insert-heading-inactive-timestamp)
;-

Enjoy!

--
Julian Mariano Burgos, PhD
Hafrannsóknastofnunin/Marine Research Institute
Skúlagata 4, 121 Reykjavík, Iceland
Sími/Telephone : +354-5752037
Bréfsími/Telefax:  +354-5752001
Netfang/Email: jul...@hafro.is



On 02/08/2013 12:50 PM, Ken wrote:

Hello all,

I am a relative newbie to org-mode. Right now I use it for todo lists, I
use it in conjunction with the diary, and I use it for
journaling/note-taking. I am sure I am only using it fo a quarter or
less of what it can be used for. Anyway, my question is rather simple.
 will allow you to insert a date. However, in my journal I use a
full timestamp. Is there any way using a defined set of keys to insert a
current TIMESTAMP on an entry (say as in a journal entry)?

Thank you
Ken








[O] Newbie question

2013-02-08 Thread Ken
Hello all,

I am a relative newbie to org-mode. Right now I use it for todo lists, I
use it in conjunction with the diary, and I use it for
journaling/note-taking. I am sure I am only using it fo a quarter or
less of what it can be used for. Anyway, my question is rather simple.
 will allow you to insert a date. However, in my journal I use a
full timestamp. Is there any way using a defined set of keys to insert a
current TIMESTAMP on an entry (say as in a journal entry)?

Thank you
Ken


-- 
The only thing better than love is milk.