From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: org-read-date-prefer-future should prefer next week if the given time is before now Date: Wed, 15 Aug 2012 13:00:49 +0200 Message-ID: <87obmcctcu.fsf@gnu.org> References: <87sjbocy0c.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:47315) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1bKu-00009r-F4 for emacs-orgmode@gnu.org; Wed, 15 Aug 2012 07:00:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1bKt-0007A1-AS for emacs-orgmode@gnu.org; Wed, 15 Aug 2012 07:00:28 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:65462) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1bKt-00079r-3h for emacs-orgmode@gnu.org; Wed, 15 Aug 2012 07:00:27 -0400 Received: by wibhq4 with SMTP id hq4so4334449wib.12 for ; Wed, 15 Aug 2012 04:00:26 -0700 (PDT) In-Reply-To: (Tom's message of "Wed, 15 Aug 2012 09:50:13 +0000 (UTC)") 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: Tom Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Tom writes: > It is a consistency bug then. If thu 8am works in other cases > then it should not be the user's job to know which format to > use to achieve to desired result. Org should treat both > forms in the same way. Please try the attached patch and report other inconsistencies. Thanks, --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=fix-read-date-prefer-futur.patch diff --git a/lisp/org.el b/lisp/org.el index f605443..bf9f1f6 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -15558,10 +15558,11 @@ user." (setq ans "+0")) (when (setq delta (org-read-date-get-relative ans (current-time) org-def)) - (setq ans (replace-match "" t t ans) - deltan (car delta) - deltaw (nth 1 delta) - deltadef (nth 2 delta))) + (unless (save-match-data (string-match org-plain-time-of-day-regexp ans)) + (setq ans (replace-match "" t t ans) + deltan (car delta) + deltaw (nth 1 delta) + deltadef (nth 2 delta)))) ;; Check if there is an iso week date in there ;; If yes, store the info and postpone interpreting it until the rest @@ -15714,7 +15715,6 @@ user." ((equal deltaw "m") (setq month (+ month deltan))) ((equal deltaw "y") (setq year (+ year deltan))))) ((and wday (not (nth 3 tl))) - (setq futurep nil) ;; Weekday was given, but no day, so pick that day in the week ;; on or after the derived date. (setq wday1 (nth 6 (decode-time (encode-time 0 0 0 day month year)))) --=-=-= Content-Type: text/plain -- Bastien --=-=-=--