From mboxrd@z Thu Jan 1 00:00:00 1970 From: Memnon Anon Subject: [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 Message-ID: <878w3zt0hf.fsf@mean.albasani.net> References: <874oerjgef.fsf@mean.albasani.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=45882 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1On7k7-00070d-4a for emacs-orgmode@gnu.org; Sun, 22 Aug 2010 06:25:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1On7k6-00010x-5M for emacs-orgmode@gnu.org; Sun, 22 Aug 2010 06:25:35 -0400 Received: from mail-ey0-f169.google.com ([209.85.215.169]:65292) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1On7k6-00010o-0U for emacs-orgmode@gnu.org; Sun, 22 Aug 2010 06:25:34 -0400 Received: by eyg7 with SMTP id 7so3055355eyg.0 for ; Sun, 22 Aug 2010 03:25:33 -0700 (PDT) In-Reply-To: <874oerjgef.fsf@mean.albasani.net> (Memnon Anon's message of "Thu, 19 Aug 2010 08:17:38 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Memnon Anon Cc: Org Mode 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