From: "Piotr Zielinski" <piotr.zielinski@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Added support for <tomorrow> as a time specification in tag maching engine, and fixed <today>.
Date: Sun, 16 Nov 2008 22:10:30 +0000 [thread overview]
Message-ID: <3c12eb8d0811161410j542154e7nf99ac54074717125@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0006-Added-support-for-tomorrow-as-a-time-specification.patch --]
[-- Type: text/x-patch; name=0006-Added-support-for-tomorrow-as-a-time-specification.patch, Size: 1196 bytes --]
From a5aa4cceb272185eb05c858a042a2b2a2991c095 Mon Sep 17 00:00:00 2001
From: Piotr Zielinski <piotr.zielinski@gmail.com>
Date: Sun, 16 Nov 2008 20:27:30 +0000
Subject: [PATCH] Added support for <tomorrow> as a time specification in tag maching
engine, and fixed <today>.
---
lisp/org.el | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/lisp/org.el b/lisp/org.el
index a598673..c2f4dc9 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -9256,11 +9256,16 @@ it as a time string and apply `float-time' to it. f S is nil, just return 0."
(error 0.)))
(t 0.)))
+(defun org-time-today ()
+ "Returns the float number of seconds since the beginning of the
+epoch to the beginning of today (00:00)"
+ (float-time (apply 'encode-time (append '(0 0 0) (nthcdr 3 (decode-time))))))
+
(defun org-matcher-time (s)
(cond
- ((equal s "<now>") (float-time))
- ((equal s "<today>")
- (float-time (append '(0 0 0) (nthcdr 3 (decode-time)))))
+ ((string= s "<now>") (float-time))
+ ((string= s "<today>") (org-time-today))
+ ((string= s "<tomorrow>") (+ 86400.0 (org-time-today)))
(t (org-2ft s))))
(defun org-match-any-p (re list)
--
1.5.2.5
[-- Attachment #3: Type: text/plain, Size: 204 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
next reply other threads:[~2008-11-16 22:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-16 22:10 Piotr Zielinski [this message]
2008-11-17 6:21 ` [PATCH] Added support for <tomorrow> as a time specification in tag maching engine, and fixed <today> Carsten Dominik
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=3c12eb8d0811161410j542154e7nf99ac54074717125@mail.gmail.com \
--to=piotr.zielinski@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 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.