aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Dominik2006-11-17 16:06:50 +0000
committerCarsten Dominik2006-11-17 16:06:50 +0000
commit22a54481cf90c00bed180a83bfaf2bb6cce7c501 (patch)
tree73269b00633fdaefd22bdd0975c45662eb10c839
parent1063e165e007906e05d74b89556e300e19f2f671 (diff)
downloademacs-22a54481cf90c00bed180a83bfaf2bb6cce7c501.tar.gz
emacs-22a54481cf90c00bed180a83bfaf2bb6cce7c501.zip
* textmodes/org.el (org-fix-decoded-time): New function.
(org-display-custom-time): Use `org-fix-decoded-time'.
-rw-r--r--lisp/textmodes/org.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/lisp/textmodes/org.el b/lisp/textmodes/org.el
index 30e72ebfe4b..30326066504 100644
--- a/lisp/textmodes/org.el
+++ b/lisp/textmodes/org.el
@@ -6112,6 +6112,7 @@ The command returns the inserted time stamp."
6112 (with-hm (and (nth 1 t1) (nth 2 t1))) 6112 (with-hm (and (nth 1 t1) (nth 2 t1)))
6113 (inactive (= (char-before (1- beg)) ?\[)) 6113 (inactive (= (char-before (1- beg)) ?\[))
6114 (tf (funcall (if with-hm 'cdr 'car) org-time-stamp-custom-formats)) 6114 (tf (funcall (if with-hm 'cdr 'car) org-time-stamp-custom-formats))
6115 (time (org-fix-decoded-time t1))
6115 (time (mapcar (lambda (x) (or x 0)) t1)) 6116 (time (mapcar (lambda (x) (or x 0)) t1))
6116 (str (org-add-props 6117 (str (org-add-props
6117 (format-time-string 6118 (format-time-string
@@ -6127,6 +6128,12 @@ The command returns the inserted time stamp."
6127 (put-text-property beg end 'end-glyph (make-glyph str))) 6128 (put-text-property beg end 'end-glyph (make-glyph str)))
6128 (put-text-property beg end 'display str)))) 6129 (put-text-property beg end 'display str))))
6129 6130
6131(defun org-fix-decoded-time (time)
6132 "Set 0 instead of nil for the first 6 elements of time.
6133Don't touch the rest."
6134 (let ((n 0))
6135 (mapcar (lambda (x) (if (< (setq n (1+ n)) 7) (or x 0) x)) time)))
6136
6130(defun org-days-to-time (timestamp-string) 6137(defun org-days-to-time (timestamp-string)
6131 "Difference between TIMESTAMP-STRING and now in days." 6138 "Difference between TIMESTAMP-STRING and now in days."
6132 (- (time-to-days (org-time-string-to-time timestamp-string)) 6139 (- (time-to-days (org-time-string-to-time timestamp-string))