* [PATCH] Added support for <tomorrow> as a time specification in tag maching engine, and fixed <today>.
@ 2008-11-16 22:10 Piotr Zielinski
2008-11-17 6:21 ` Carsten Dominik
0 siblings, 1 reply; 2+ messages in thread
From: Piotr Zielinski @ 2008-11-16 22:10 UTC (permalink / raw)
To: emacs-orgmode
[-- 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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Added support for <tomorrow> as a time specification in tag maching engine, and fixed <today>.
2008-11-16 22:10 [PATCH] Added support for <tomorrow> as a time specification in tag maching engine, and fixed <today> Piotr Zielinski
@ 2008-11-17 6:21 ` Carsten Dominik
0 siblings, 0 replies; 2+ messages in thread
From: Carsten Dominik @ 2008-11-17 6:21 UTC (permalink / raw)
To: Piotr Zielinski; +Cc: emacs-orgmode
Hi Piotr,
how nice to hear from you and to find out that you are still around,
using Org-mode.
I have applied your patch, thanks.
- Carsten
On Nov 16, 2008, at 11:10 PM, Piotr Zielinski wrote:
>
> <0006-Added-support-for-tomorrow-as-a-time-
> specification.patch>_______________________________________________
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-11-17 7:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-16 22:10 [PATCH] Added support for <tomorrow> as a time specification in tag maching engine, and fixed <today> Piotr Zielinski
2008-11-17 6:21 ` Carsten Dominik
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).