From: Matt Lundin <mdl@imapmail.org>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: [PATCH] org-insert-time-stamp: fix value of org-last-inserted-timestamp
Date: Sun, 25 Jul 2010 06:46:47 -0400 [thread overview]
Message-ID: <87tynn8zpj.fsf@fastmail.fm> (raw)
* 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
next reply other threads:[~2010-07-25 13:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-25 10:46 Matt Lundin [this message]
2010-07-31 8:31 ` Patchwork: Patch 170 Accepted Bastien Guerry
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87tynn8zpj.fsf@fastmail.fm \
--to=mdl@imapmail.org \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.