emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bzg@gnu.org>
To: Tom <adatgyujto@gmail.com>
Cc: emacs-orgmode@gnu.org
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	[thread overview]
Message-ID: <87obmcctcu.fsf@gnu.org> (raw)
In-Reply-To: <loom.20120815T114643-171@post.gmane.org> (Tom's message of "Wed, 15 Aug 2012 09:50:13 +0000 (UTC)")

[-- Attachment #1: Type: text/plain, Size: 321 bytes --]

Tom <adatgyujto@gmail.com> 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,


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fix-read-date-prefer-futur.patch --]
[-- Type: text/x-patch, Size: 1110 bytes --]

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))))

[-- Attachment #3: Type: text/plain, Size: 14 bytes --]


-- 
 Bastien

  reply	other threads:[~2012-08-15 11:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-12 10:02 org-read-date-prefer-future should prefer next week if the given time is before now Tom
2012-08-15  9:20 ` Bastien
2012-08-15  9:50   ` Tom
2012-08-15 11:00     ` Bastien [this message]
2012-08-16  7:43       ` Bastien

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87obmcctcu.fsf@gnu.org \
    --to=bzg@gnu.org \
    --cc=adatgyujto@gmail.com \
    --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 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).