Browse Source

Pad clock times with zeros, apply face with better starting position

* lisp/org-agenda.el (org-agenda-add-time-grid-maybe): Pad clock times
with zeros.  Start applying face earlier.

Hello,

Here a tiny patch to:

- have padding with 0 for the clock time

- begin applying face org-time-grid from position 2, in order to be properly
  aligned with the rest of the agenda (you don't see that if you don't have a
  face with background color)
Sébastien Vauban 14 years ago
parent
commit
464bf73b74
1 changed files with 2 additions and 2 deletions
  1. 2 2
      lisp/org-agenda.el

+ 2 - 2
lisp/org-agenda.el

@@ -5135,13 +5135,13 @@ The modified list may contain inherited tags, and tags matched by
 	  (throw 'exit list))
 	  (throw 'exit list))
       (while (setq time (pop gridtimes))
       (while (setq time (pop gridtimes))
 	(unless (and remove (member time have))
 	(unless (and remove (member time have))
-	  (setq time (replace-regexp-in-string " " "0" (format "%4s" time)))
+	  (setq time (replace-regexp-in-string " " "0" (format "%04s" time)))
 	  (push (org-format-agenda-item
 	  (push (org-format-agenda-item
 		 nil string "" nil
 		 nil string "" nil
 		 (concat (substring time 0 -2) ":" (substring time -2)))
 		 (concat (substring time 0 -2) ":" (substring time -2)))
 		new)
 		new)
 	  (put-text-property
 	  (put-text-property
-	   1 (length (car new)) 'face 'org-time-grid (car new))))
+	   2 (length (car new)) 'face 'org-time-grid (car new))))
       (if (member 'time-up org-agenda-sorting-strategy-selected)
       (if (member 'time-up org-agenda-sorting-strategy-selected)
 	  (append new list)
 	  (append new list)
 	(append list new)))))
 	(append list new)))))