Вопрос

How do I fill a column with dates in org-mode and specify the period between them? I'm after being able to produce something along the lines of:

|Date      |Event  |
|----------+-------|  
|2014-03-10|Event 1|  
|2013-03-17|Event 2|  
|2013-03-21|Event 3|  
|and so on |       | 
Это было полезно?

Решение

Try using the tiny package.

This snippet:

m\n7||%(date "2013-03-21" (* x 7))|Event %(1+ x)|

on C-; expands to:

|2013-03-21 Thu|Event 1|
|2013-03-28 Thu|Event 2|
|2013-04-04 Thu|Event 3|
|2013-04-11 Thu|Event 4|
|2013-04-18 Thu|Event 5|
|2013-04-25 Thu|Event 6|
|2013-05-02 Thu|Event 7|
|2013-05-09 Thu|Event 8|

It's more or less intuitive if you know Elisp - the snippet above is a shorthand for:

(mapconcat
 (lambda(x)
   (let ((lst (list x)))
     (format "|%s|Event %s|"
             (tiny-date "2013-03-21" (* x 7))
             (1+ x))))
 (number-sequence 0 7)
 "\n")
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top