summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Lundin <mdl@imapmail.org>2010-07-25 15:46:47 +0000
committerBastien Guerry <bzg@altern.org>2010-07-31 10:31:30 +0200
commitf08a5eaa06b8b090101d53cd8c239086b7b074e2 (patch)
tree497d1983db59e24f396c8b50804a18dfc8bdb1b7
parentd3c82cc7574908cf399c65c185617500a7304c02 (diff)
downloadorg-mode-f08a5eaa06b8b090101d53cd8c239086b7b074e2.tar.gz
org-insert-time-stamp: fix value of org-last-inserted-timestamp
* lisp/org.el (org-insert-time-stamp): Fix org-insert-time-stamp so that the value of org-last-inserted-timestamp includes time range. Previously, org-last-inserted-timestamp included only the beginning of a time range (e.g., 10:00 instead of 10:00-12:00). This caused parsing problems elsewhere, such as when rescheduling items with repeating timestamps and a time range (the repeater was removed during rescheduling).
-rw-r--r--lisp/org.el6
1 files changed, 2 insertions, 4 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 53d47f1..41c3e90 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -14556,7 +14556,6 @@ The command returns the inserted time stamp."
stamp)
(if inactive (setq fmt (concat "[" (substring fmt 1 -1) "]")))
(insert-before-markers (or pre ""))
- (insert-before-markers (setq stamp (format-time-string fmt time)))
(when (listp extra)
(setq extra (car extra))
(if (and (stringp extra)
@@ -14566,9 +14565,8 @@ The command returns the inserted time stamp."
(string-to-number (match-string 2 extra))))
(setq extra nil)))
(when extra
- (backward-char 1)
- (insert-before-markers extra)
- (forward-char 1))
+ (setq fmt (concat (substring fmt 0 -1) extra (substring fmt -1))))
+ (insert-before-markers (setq stamp (format-time-string fmt time)))
(insert-before-markers (or post ""))
(setq org-last-inserted-timestamp stamp)))