From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Richard Subject: org-time-stamp adds "repeater" where there is none. Date: Fri, 13 Feb 2015 17:01:52 +0100 Message-ID: <87zj8hol5b.fsf@yahoo.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38766) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMIgK-0004pt-Ph for emacs-orgmode@gnu.org; Fri, 13 Feb 2015 11:01:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YMIgG-00089i-Jf for emacs-orgmode@gnu.org; Fri, 13 Feb 2015 11:01:28 -0500 Received: from mxin.ulb.ac.be ([164.15.128.112]:61362) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMIgG-00089W-E7 for emacs-orgmode@gnu.org; Fri, 13 Feb 2015 11:01:24 -0500 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Consider the following line: <2015-02-13 ven.> (10h-13h) Hiting C-c . RET with point on the timestamp gives <2015-02-13 ven. -13h> (10h-13h) which is not expected. Please consider the patch below >From 688851438f363eaa86dcfe2acfb779d6c22adc16 Mon Sep 17 00:00:00 2001 From: Nicolas Richard Date: Fri, 13 Feb 2015 16:57:59 +0100 Subject: [PATCH] * lisp/org.el (org-time-stamp): Restrict to timestamp when determining repeater. --- lisp/org.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 7c2419d..6a0e4c6 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -16149,12 +16149,13 @@ (defun org-time-stamp (arg &optional inactive) (apply 'encode-time (org-parse-time-string (match-string 1))) (current-time))) (default-input (and ts (org-get-compact-tod ts))) - (repeater (save-excursion - (save-match-data - (beginning-of-line) - (when (re-search-forward + (repeater (save-match-data + (with-temp-buffer + (insert ts) + (goto-char (point-min)) + (when (re-search-forward "\\([.+-]+[0-9]+[hdwmy] ?\\)+" ;;\\(?:[/ ][-+]?[0-9]+[hdwmy]\\)?\\) ?" - (save-excursion (progn (end-of-line) (point))) t) + nil t) (match-string 0))))) org-time-was-given org-end-time-was-given time) (cond -- 2.1.4