From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: [PATCH] org-insert-time-stamp: fix value of org-last-inserted-timestamp Date: Sun, 25 Jul 2010 06:46:47 -0400 Message-ID: <87tynn8zpj.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=34692 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Od18a-0006JC-1T for emacs-orgmode@gnu.org; Sun, 25 Jul 2010 09:21:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Od18W-0003S1-RS for emacs-orgmode@gnu.org; Sun, 25 Jul 2010 09:21:03 -0400 Received: from out1.smtp.messagingengine.com ([66.111.4.25]:38355) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Od18W-0003Rj-Mw for emacs-orgmode@gnu.org; Sun, 25 Jul 2010 09:21:00 -0400 Received: from archdesk (adsl-99-56-122-69.dsl.klmzmi.sbcglobal.net [99.56.122.69]) by mail.messagingengine.com (Postfix) with ESMTPSA id C62E04F5565 for ; Sun, 25 Jul 2010 09:20:57 -0400 (EDT) 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: 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