emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] org-insert-time-stamp: fix value of org-last-inserted-timestamp
@ 2010-07-25 10:46 Matt Lundin
  2010-07-31  8:31 ` Patchwork: Patch 170 Accepted Bastien Guerry
  0 siblings, 1 reply; 2+ messages in thread
From: Matt Lundin @ 2010-07-25 10:46 UTC (permalink / raw)
  To: Org Mode

* 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).
---
 lisp/org.el |    6 ++----
 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)))
 
-- 
1.7.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Patchwork: Patch 170 Accepted
  2010-07-25 10:46 [PATCH] org-insert-time-stamp: fix value of org-last-inserted-timestamp Matt Lundin
@ 2010-07-31  8:31 ` Bastien Guerry
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien Guerry @ 2010-07-31  8:31 UTC (permalink / raw)
  To: emacs-orgmode

Patch 170 (http://patchwork.newartisans.com/patch/170/) is now Accepted.

This relates to the following submission:

http://mid.gmane.org/%3C87tynn8zpj.fsf%40fastmail.fm%3E

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-07-31  8:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-25 10:46 [PATCH] org-insert-time-stamp: fix value of org-last-inserted-timestamp Matt Lundin
2010-07-31  8:31 ` Patchwork: Patch 170 Accepted Bastien Guerry

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).