[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] [Bug] : org-agenda-time-grid (was: Setting org-agenda-time-gri
From: |
Memnon Anon |
Subject: |
[Orgmode] [Bug] : org-agenda-time-grid (was: Setting org-agenda-time-grid: My day starts at midnight) |
Date: |
Sun, 22 Aug 2010 12:25:23 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Okay, resend in a more concise way.
! Problem:
,----
| (setq org-agenda-time-grid (quote
| ((daily weekly today require-timed) "----------------"
| ( 000 200 400 600 800 1000 1200 1400 1600 1800 2000 2200 2359))))
`----
-> args-out-of-range!
! Reason:
,----[ org-agenda-add-time-grid-maybe ]
| (while (setq time (pop gridtimes))
| (unless (and remove (member time have))
| => (setq time (int-to-string time))
| (push (org-format-agenda-item
| nil string "" nil
| => (concat (substring time 0 -2) ":" (substring time -2)))
| new)
| (put-text-property
| 1 (length (car new)) 'face 'org-time-grid (car new))))
`----
,----[ Analysis ]
| (setq time (int-to-string time)) => time= "0", so
| (substring time 0 -2) => args-out-of-range.
`----
! Possible Fix:
,----
| (unless (and remove (member time have))
| (setq time (int-to-string time))
| ;;MAN make sure time is at least 3 characters long or substring will fail
+ => (when (< (length time) 3) (setq time (concat "00" time)))
| (push (org-format-agenda-item
`----
! Questions:
,----
| a) Will this break anything I am not aware of yet?
| b) Is there a better way to achieve this?
`----
Memnon Anon