emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-mode and remind integration
@ 2008-12-31 11:53 Daniel Martins
  2009-01-09  8:17 ` Carsten Dominik
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Martins @ 2008-12-31 11:53 UTC (permalink / raw)
  To: Carsten Dominik, Emacs-orgmode, bastien.guerry


[-- Attachment #1.1: Type: text/plain, Size: 1608 bytes --]

I changed from planner-el to org-mode after reading Sachas comments and some
videos: mostly Carsten and Russell ones.

However I use remind a lot. I like wyrd for remote operation and I have
remind - diary - ical and planner-el very integrated.

I think that org-mode would be improved from using remind. The ical ->
org-mode could be done using the longer path

ical -> remind -> diary -> org-mode

Via

ical -> remind:  http://wiki.43folders.com/index.php/*ICal2Rem*

remind -> diary:   Sacha's rem2diary

diary -> org-mode:  (setq org-agenda-include-diary t)


the reverse path could be directly

org-mode -> ical

.reminders.org.deadline
 .reminders.org.scheduled

However if I want to add all my appts in
.reminders.org.deadline and
 .reminders.org.scheduled
  from inside org-mode

I think that

org2rem

is lacking a few features

1. It does not work with priorities since

*** TODO  [#A] something
    DEADLINE: <2009-01-05>

generates

REM 30 Dec 2008 MSG [#A] something

which yields problems with remind parser

org2rem should eliminate the priorities at all

REM 30 Dec 2008 MSG something

or eliminate the brackets
REM 30 Dec 2008 MSG #A something


2. timed deadlines are not included
*** TODO  something
    DEADLINE: <2008-12-31 Wed 19:00>


generates
REM 31 Dec 2008 MSG something%

and should generate

REM 31 Dec 2008 AT 19:00 MSG something%



I tried to send an emacs bug report but as I do not use Emacs for sending
email (yet!).  It seems that the bug was not reported.

I must also admit that gnus always frightened me!

First thanks for all the good work done with org-mode


Daniel

[-- Attachment #1.2: Type: text/html, Size: 2107 bytes --]

[-- Attachment #2: 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	[flat|nested] 9+ messages in thread

* Re: org-mode and remind integration
  2008-12-31 11:53 org-mode and remind integration Daniel Martins
@ 2009-01-09  8:17 ` Carsten Dominik
  2009-01-09  8:57   ` Daniel Martins
  0 siblings, 1 reply; 9+ messages in thread
From: Carsten Dominik @ 2009-01-09  8:17 UTC (permalink / raw)
  To: Daniel Martins; +Cc: bastien.guerry, Emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1878 bytes --]

Is any action happening on this?  Is someone trying to fix org2rem?

- Carsten

On Dec 31, 2008, at 12:53 PM, Daniel Martins wrote:

>
> I changed from planner-el to org-mode after reading Sachas comments  
> and some videos: mostly Carsten and Russell ones.
>
> However I use remind a lot. I like wyrd for remote operation and I  
> have remind - diary - ical and planner-el very integrated.
>
> I think that org-mode would be improved from using remind. The ical - 
> > org-mode could be done using the longer path
>
> ical -> remind -> diary -> org-mode
>
> Via
>
> ical -> remind:  http://wiki.43folders.com/index.php/ICal2Rem
>
> remind -> diary:   Sacha's rem2diary
>
> diary -> org-mode:  (setq org-agenda-include-diary t)
>
>
> the reverse path could be directly
>
> org-mode -> ical
>
> .reminders.org.deadline
>  .reminders.org.scheduled
>
> However if I want to add all my appts in
> .reminders.org.deadline and
>  .reminders.org.scheduled
>   from inside org-mode
>
> I think that
>
> org2rem
>
> is lacking a few features
>
> 1. It does not work with priorities since
>
> *** TODO  [#A] something
>     DEADLINE: <2009-01-05>
>
> generates
>
> REM 30 Dec 2008 MSG [#A] something
>
> which yields problems with remind parser
>
> org2rem should eliminate the priorities at all
>
> REM 30 Dec 2008 MSG something
>
> or eliminate the brackets
> REM 30 Dec 2008 MSG #A something
>
>
> 2. timed deadlines are not included
> *** TODO  something
>     DEADLINE: <2008-12-31 Wed 19:00>
>
>
> generates
> REM 31 Dec 2008 MSG something%
>
> and should generate
>
> REM 31 Dec 2008 AT 19:00 MSG something%
>
>
>
> I tried to send an emacs bug report but as I do not use Emacs for  
> sending email (yet!).  It seems that the bug was not reported.
>
> I must also admit that gnus always frightened me!
>
> First thanks for all the good work done with org-mode
>
>
> Daniel
>
>


[-- Attachment #1.2: Type: text/html, Size: 2465 bytes --]

[-- Attachment #2: 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	[flat|nested] 9+ messages in thread

* Re: org-mode and remind integration
  2009-01-09  8:17 ` Carsten Dominik
@ 2009-01-09  8:57   ` Daniel Martins
  2009-01-09 14:39     ` Olaf Dietsche
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Martins @ 2009-01-09  8:57 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: bastien.guerry, Emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 2507 bytes --]

Yes, I am.

My poor capabilibies on Emacs Lisp are constraining my efforts a bit.


I am sending the last version of org2rem which integrates timed reminds from
DEADLINE: and SCHEDULE: lines

I lack a way to add timestamps

Brackets are another problem with remind

Something like

**** Shop   [1/5] [60%]
    SCHEDULED: <2009-01-12 Mon +1w>
- [ ]  2 dvds
- [ ]  1 cd
- [ ]  1 disk
- [X] extra 1
- [X] extra 2

I opt to kill all the bracketed enclosed regions

REM 12 Jan 2009 MSG Shop   %

Since
REM 12 Jan 2009 MSG Shop 1/5 60% %

may generate a problem due to %

Daniel

2009/1/9 Carsten Dominik <dominik@science.uva.nl>

> Is any action happening on this?  Is someone trying to fix org2rem?
> - Carsten
>
> On Dec 31, 2008, at 12:53 PM, Daniel Martins wrote:
>
>
> I changed from planner-el to org-mode after reading Sachas comments and
> some videos: mostly Carsten and Russell ones.
>
> However I use remind a lot. I like wyrd for remote operation and I have
> remind - diary - ical and planner-el very integrated.
>
> I think that org-mode would be improved from using remind. The ical ->
> org-mode could be done using the longer path
>
> ical -> remind -> diary -> org-mode
>
> Via
>
> ical -> remind:  http://wiki.43folders.com/index.php/*ICal2Rem*
>
> remind -> diary:   Sacha's rem2diary
>
> diary -> org-mode:  (setq org-agenda-include-diary t)
>
>
> the reverse path could be directly
>
> org-mode -> ical
>
> .reminders.org.deadline
>  .reminders.org.scheduled
>
> However if I want to add all my appts in
> .reminders.org.deadline and
>  .reminders.org.scheduled
>   from inside org-mode
>
> I think that
>
> org2rem
>
> is lacking a few features
>
> 1. It does not work with priorities since
>
> *** TODO  [#A] something
>     DEADLINE: <2009-01-05>
>
> generates
>
> REM 30 Dec 2008 MSG [#A] something
>
> which yields problems with remind parser
>
> org2rem should eliminate the priorities at all
>
> REM 30 Dec 2008 MSG something
>
> or eliminate the brackets
> REM 30 Dec 2008 MSG #A something
>
>
> 2. timed deadlines are not included
> *** TODO  something
>     DEADLINE: <2008-12-31 Wed 19:00>
>
>
> generates
> REM 31 Dec 2008 MSG something%
>
> and should generate
>
> REM 31 Dec 2008 AT 19:00 MSG something%
>
>
>
> I tried to send an emacs bug report but as I do not use Emacs for sending
> email (yet!).  It seems that the bug was not reported.
>
> I must also admit that gnus always frightened me!
>
> First thanks for all the good work done with org-mode
>
>
> Daniel
>
>
>
>

[-- Attachment #1.2: Type: text/html, Size: 3498 bytes --]

[-- Attachment #2: org2rem.el --]
[-- Type: application/octet-stream, Size: 4285 bytes --]

;;; org2rem.el --- Convert org appointments into reminders

;; Copyright 2006 Bastien Guerry
;;
;; Author: bzg AT altern DOT fr
;; Version: $Id: org2rem.el,v 0.1 2006/12/04 09:21:03 guerry Exp guerry $
;; Keywords: org-mode remind reminder appointment diary calendar
;; X-URL: http://www.cognition.ens.fr/~guerry/u/org2rem.el

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, write to the Free Software
;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

;;; Commentary:

;; Not so much to say here.  Just try org2rem in your org-mode buffer.

;; Put this file into your load-path and the following into your ~/.emacs:
;;   (require 'org2rem)

;;; Code:

(provide 'org2rem)
(eval-when-compile
  (require 'cl))

(defvar org2rem-scheduled-reminders nil)
(defvar org2rem-deadline-reminders nil)
(defvar pure-time nil)
(defvar org2rem-scheduled-remind-file 
  "~/.reminders.org.scheduled")
(defvar org2rem-deadline-remind-file 
  "~/.reminders.org.deadline")

(defun org2rem-list-reminders (regexp)
  "Make a list of appointments. 
REGEXP is either SCHEDULED: or DEADLINE:."
  (save-excursion
    (goto-char (point-min))
    (while (re-search-forward 
	    (concat "^[ \t]*" regexp
		    "[ \t]*"  org-ts-regexp2) nil t)
      (let* ((system-time-locale "C") ;; make sure we use english dates
	     (year (string-to-number (match-string-no-properties 2)))
	     (month (string-to-number (match-string-no-properties 3)))
	     (day (string-to-number (match-string-no-properties 4)))
	     (encoded-time (encode-time 0 0 0 day month year))
	     (rem-time (format-time-string " %d %b %Y " encoded-time))
	     task rem-task)
	(save-excursion
	  (re-search-backward org-todo-line-regexp nil t)
	  (setq task
		(replace-regexp-in-string 
		 org-bracket-link-regexp 
		 "\\3" (match-string-no-properties 3)))

	  (if (string-match "[0-9]+:[0-9]+"  task) 
	      (save-excursion	      
	       (setq pure-time
		     (replace-regexp-in-string 
;;		      "[^0-9]*\\([0-9]+:[0-9]+\\).*" "\\1" 
		      ".*\\([0-9][0-9]:[0-9][0-9]\\).*" "\\1" 
;;		      ".*\\(\D\D:\D\D\\)+.*" "\\1" 
		      task)
		     ) 

	       (setq rem-time
		     (concat  rem-time " AT " pure-time " ")
		     )
	       )
	    )	      


;; ;; To maintain priority and list results [1/5]
;; 	  (setq task
;; 		(replace-regexp-in-string 
;; 		 "\\[\\(.*\\)\\]" "\\1" task))

;; deleting priority and list results [1/5]

	  (setq task
		(replace-regexp-in-string 
		 "\\[\\(.*\\)\\]" "" task))


	  (setq rem-task (concat "REM" rem-time "MSG "  task "%")
		)
	  (if (equal regexp org-scheduled-string)
	      (push rem-task org2rem-scheduled-reminders)
	    (push rem-task org2rem-deadline-reminders)))))))

(defun org2rem-write-file (file reminders)
  "Write reminders list to files."
  (with-temp-buffer
    (find-file file)
    (erase-buffer)
    (dolist (rem reminders)
      (insert rem "\n"))
    (write-file file)
    (kill-buffer (file-name-nondirectory file))))

(defun org2rem ()
  "Convert appointment from local org-mode buffer to reminders.
Store scheduled appointments in `org2rem-scheduled-remind-file'
and `org2rem-deadline-remind-file'."
  (interactive)
  (setq org2rem-scheduled-reminders nil)
  (setq org2rem-deadline-reminders nil)
  (save-window-excursion
    (org2rem-list-reminders org-scheduled-string)
    (org2rem-list-reminders org-deadline-string)
    (org2rem-write-file "~/.reminders.org.scheduled" 
			org2rem-scheduled-reminders)
    (org2rem-write-file "~/.reminders.org.deadline"
			org2rem-deadline-reminders)))


\f
;;;;##########################################################################
;;;;  User Options, Variables
;;;;##########################################################################





;;; org2rem.el ends here

[-- 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	[flat|nested] 9+ messages in thread

* Re: org-mode and remind integration
  2009-01-09  8:57   ` Daniel Martins
@ 2009-01-09 14:39     ` Olaf Dietsche
  2009-01-10 13:21       ` Daniel Martins
  0 siblings, 1 reply; 9+ messages in thread
From: Olaf Dietsche @ 2009-01-09 14:39 UTC (permalink / raw)
  To: Daniel Martins; +Cc: bastien.guerry, Emacs-orgmode

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

"Daniel Martins" <danielemc@gmail.com> writes:

> Yes, I am.
[...]
> I am sending the last version of org2rem which integrates timed reminds from
> DEADLINE: and SCHEDULE: lines
[...]
>
> 2009/1/9 Carsten Dominik <dominik@science.uva.nl>
>
>> Is any action happening on this?  Is someone trying to fix org2rem?
>> - Carsten

I have no idea of remind.

This is an untested patch, but you get the idea. Avoid global
variables, if you can. If you use global variables, you have
prerequisites and side effects, which complicate following the
code. This is not lisp specific.

Regards, Olaf


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Eliminate unnecessary globals --]
[-- Type: text/x-diff, Size: 2316 bytes --]

--- org2rem.el.orig	2009-01-09 12:47:39.000000000 +0100
+++ org2rem.el	2009-01-09 15:28:55.000000000 +0100
@@ -34,9 +34,6 @@
 (eval-when-compile
   (require 'cl))
 
-(defvar org2rem-scheduled-reminders nil)
-(defvar org2rem-deadline-reminders nil)
-(defvar pure-time nil)
 (defvar org2rem-scheduled-remind-file 
   "~/.reminders.org.scheduled")
 (defvar org2rem-deadline-remind-file 
@@ -45,6 +42,7 @@
 (defun org2rem-list-reminders (regexp)
   "Make a list of appointments. 
 REGEXP is either SCHEDULED: or DEADLINE:."
+  (let (reminders)
   (save-excursion
     (goto-char (point-min))
     (while (re-search-forward 
@@ -66,17 +64,17 @@
 
 	  (if (string-match "[0-9]+:[0-9]+"  task) 
 	      (save-excursion	      
-	       (setq pure-time
+		  (let ((pure-time
 		     (replace-regexp-in-string 
 ;;		      "[^0-9]*\\([0-9]+:[0-9]+\\).*" "\\1" 
 		      ".*\\([0-9][0-9]:[0-9][0-9]\\).*" "\\1" 
 ;;		      ".*\\(\D\D:\D\D\\)+.*" "\\1" 
 		      task)
-		     ) 
+			 ))
 
 	       (setq rem-time
 		     (concat  rem-time " AT " pure-time " ")
-		     )
+			  ))
 	       )
 	    )	      
 
@@ -95,9 +93,9 @@
 
 	  (setq rem-task (concat "REM" rem-time "MSG "  task "%")
 		)
-	  (if (equal regexp org-scheduled-string)
-	      (push rem-task org2rem-scheduled-reminders)
-	    (push rem-task org2rem-deadline-reminders)))))))
+	    (push rem-task reminders)))))
+    reminders))
+
 
 (defun org2rem-write-file (file reminders)
   "Write reminders list to files."
@@ -114,15 +112,13 @@
 Store scheduled appointments in `org2rem-scheduled-remind-file'
 and `org2rem-deadline-remind-file'."
   (interactive)
-  (setq org2rem-scheduled-reminders nil)
-  (setq org2rem-deadline-reminders nil)
+  (let ((org2rem-scheduled-reminders (org2rem-list-reminders org-scheduled-string))
+	(org2rem-deadline-reminders (org2rem-list-reminders org-deadline-string)))
   (save-window-excursion
-    (org2rem-list-reminders org-scheduled-string)
-    (org2rem-list-reminders org-deadline-string)
-    (org2rem-write-file "~/.reminders.org.scheduled" 
+      (org2rem-write-file org2rem-scheduled-remind-file 
 			org2rem-scheduled-reminders)
-    (org2rem-write-file "~/.reminders.org.deadline"
-			org2rem-deadline-reminders)))
+      (org2rem-write-file org2rem-deadline-remind-file
+			  org2rem-deadline-reminders))))
 
 
 \f

[-- 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	[flat|nested] 9+ messages in thread

* Re: org-mode and remind integration
  2009-01-09 14:39     ` Olaf Dietsche
@ 2009-01-10 13:21       ` Daniel Martins
  2009-01-10 21:18         ` Olaf Dietsche
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Martins @ 2009-01-10 13:21 UTC (permalink / raw)
  To: Olaf Dietsche; +Cc: bastien.guerry, Emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 2318 bytes --]

Olaf,

Thank you very much for your diff. I worked fine  and I learned a bit of
lisp.

Me, as an ex-Fortran77 programmer, am suffering a lot with emacs lisp.

After o couple of hours trying to catch all timestamps outside SCHEDULE: and
DEADLINE: lines I gave up and ask for help




Originally we had

    (org2rem-scheduled-reminders (org2rem-list-reminders
org-scheduled-string))
    (org2rem-deadline-reminders (org2rem-list-reminders
org-deadline-string))


I tried to catch all timestamps outside SCHEDULE: and DEADLINE:
using something like

    (org2rem-pure-timestamps-reminders
     (org2rem-list-reminders
          (concat  "\\(" org-deadline-string "\\|"
               org-scheduled-string  "\\)\\{0\\}")))


In te beginning I create

(defvar org2rem-pure-timestamps-remind-file
  "~/.reminders.org.pure-timestamps")

and at the end I add an extra line to export these reminds in a different
file
      (org2rem-write-file org2rem-scheduled-remind-file
              org2rem-scheduled-reminders)
      (org2rem-write-file org2rem-deadline-remind-file
              org2rem-deadline-reminders)
      (org2rem-write-file org2rem-pure-timestamps-remind-file
              org2rem-pure-timestamps-reminders)

I tried first to create a local variable


;;;     (org2rem-pure-timestamps-string
;;;           (concat  "\\(" org-deadline-string "\\|"
;;;                org-scheduled-string  "\\)\\{0\\}"))

;;;     (org2rem-pure-timestamps-reminders
;;;      (org2rem-list-reminders org2rem-pure-timestamps-string)
;;;      )

but it did not work either.




I am probably having

Any help for this stupid doubt?


Thank you

Daniel


2009/1/9 Olaf Dietsche
<olaf+list.orgmode@olafdietsche.de<olaf%2Blist.orgmode@olafdietsche.de>
>

> > Yes, I am.
> [...]
> > I am sending the last version of org2rem which integrates timed reminds
> from
> > DEADLINE: and SCHEDULE: lines
> [...]
> >
> > 2009/1/9 Carsten Dominik <dominik@science.uva.nl>
> >
> >> Is any action happening on this?  Is someone trying to fix org2rem?
> >> - Carsten
>
> I have no idea of remind.
>
> This is an untested patch, but you get the idea. Avoid global
> variables, if you can. If you use global variables, you have
> prerequisites and side effects, which complicate following the
> code. This is not lisp specific.
>
> Regards, Olaf
>
>

[-- Attachment #1.2: Type: text/html, Size: 3595 bytes --]

[-- Attachment #2: 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	[flat|nested] 9+ messages in thread

* Re: org-mode and remind integration
  2009-01-10 13:21       ` Daniel Martins
@ 2009-01-10 21:18         ` Olaf Dietsche
  2009-01-11 20:19           ` Daniel Martins
  0 siblings, 1 reply; 9+ messages in thread
From: Olaf Dietsche @ 2009-01-10 21:18 UTC (permalink / raw)
  To: Daniel Martins; +Cc: bastien.guerry, Emacs-orgmode

Hi Daniel,

"Daniel Martins" <danielemc@gmail.com> writes:

> Me, as an ex-Fortran77 programmer, am suffering a lot with emacs lisp.

With time, it'll get better.

> After o couple of hours trying to catch all timestamps outside SCHEDULE: and
> DEADLINE: lines I gave up and ask for help
[...]
> I tried to catch all timestamps outside SCHEDULE: and DEADLINE:
> using something like
>
>     (org2rem-pure-timestamps-reminders
>      (org2rem-list-reminders
>           (concat  "\\(" org-deadline-string "\\|"
>                org-scheduled-string  "\\)\\{0\\}")))
>
[...]
> I tried first to create a local variable
>
> ;;;     (org2rem-pure-timestamps-string
> ;;;           (concat  "\\(" org-deadline-string "\\|"
> ;;;                org-scheduled-string  "\\)\\{0\\}"))
>
> ;;;     (org2rem-pure-timestamps-reminders
> ;;;      (org2rem-list-reminders org2rem-pure-timestamps-string)
> ;;;      )
>
> but it did not work either.
>
> I am probably having
>
> Any help for this stupid doubt?

I don't think, this is a question of a local variable vs. inlining the
regexp. It's more a matter of an appropriate regular expression. Did
you try an empty string instead?

e.g.: (org2rem-pure-timestamps-reminders (org2rem-list-reminders ""))

Or did I miss your problem completely?

Regards, Olaf

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: org-mode and remind integration
  2009-01-10 21:18         ` Olaf Dietsche
@ 2009-01-11 20:19           ` Daniel Martins
  2009-01-13 21:06             ` Olaf Dietsche
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Martins @ 2009-01-11 20:19 UTC (permalink / raw)
  To: Olaf Dietsche; +Cc: bastien.guerry, Emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 2635 bytes --]

I did your test wuth a null regexp

It is a regexp problem!



Org-mode has two variables: org-deadline-string and org-scheduled-string
(see below)

and I want to match tasks which have a timestamp, ie satisfies the
org-ts-regexp2

BUT DO NOT  have org-deadline-string NOR org-scheduled-string

I tried


    (org2rem-pure-timestamps-string
          (concat  "\\(" org-deadline-string "\\|"
               org-scheduled-string  "\\)\\{0\\}"))


in order that a regexp such as

"\\(org-deadline-string\\|org-scheduled-string\\)\\{0\\}"

would match only zero {0} occurrences of
(org-deadline-string|org-scheduled-string)
but this seems to be a mistake.

Any hint??

Daniel





--- Details ---

org-deadline-string is a variable defined in `org.el'.
Its value is "DEADLINE:"


org-scheduled-string is a variable defined in `org.el'.
Its value is "SCHEDULED:"


org-ts-regexp2 is a variable defined in `org.el'.
Its value is
"<\\(\\([0-9]\\{4\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\) +\\([^]-+0-9>
\n ]*\\)\\( \\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\)\\)?\\)[^>\n]\\{0,16\\}>"

Documentation:
Regular expression matching time stamps, with groups.










2009/1/10 Olaf Dietsche
<olaf+list.orgmode@olafdietsche.de<olaf%2Blist.orgmode@olafdietsche.de>
>

> Hi Daniel,
>
> "Daniel Martins" <danielemc@gmail.com> writes:
>
> > Me, as an ex-Fortran77 programmer, am suffering a lot with emacs lisp.
>
> With time, it'll get better.
>
> > After o couple of hours trying to catch all timestamps outside SCHEDULE:
> and
> > DEADLINE: lines I gave up and ask for help
> [...]
> > I tried to catch all timestamps outside SCHEDULE: and DEADLINE:
> > using something like
> >
> >     (org2rem-pure-timestamps-reminders
> >      (org2rem-list-reminders
> >           (concat  "\\(" org-deadline-string "\\|"
> >                org-scheduled-string  "\\)\\{0\\}")))
> >
> [...]
> > I tried first to create a local variable
> >
> > ;;;     (org2rem-pure-timestamps-string
> > ;;;           (concat  "\\(" org-deadline-string "\\|"
> > ;;;                org-scheduled-string  "\\)\\{0\\}"))
> >
> > ;;;     (org2rem-pure-timestamps-reminders
> > ;;;      (org2rem-list-reminders org2rem-pure-timestamps-string)
> > ;;;      )
> >
> > but it did not work either.
> >
> > I am probably having
> >
> > Any help for this stupid doubt?
>
> I don't think, this is a question of a local variable vs. inlining the
> regexp. It's more a matter of an appropriate regular expression. Did
> you try an empty string instead?
>
> e.g.: (org2rem-pure-timestamps-reminders (org2rem-list-reminders ""))
>
> Or did I miss your problem completely?
>
> Regards, Olaf
>

[-- Attachment #1.2: Type: text/html, Size: 3921 bytes --]

[-- Attachment #2: 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	[flat|nested] 9+ messages in thread

* Re: org-mode and remind integration
  2009-01-11 20:19           ` Daniel Martins
@ 2009-01-13 21:06             ` Olaf Dietsche
  0 siblings, 0 replies; 9+ messages in thread
From: Olaf Dietsche @ 2009-01-13 21:06 UTC (permalink / raw)
  To: Daniel Martins; +Cc: bastien.guerry, Emacs-orgmode

"Daniel Martins" <danielemc@gmail.com> writes:

> I did your test wuth a null regexp
>
> It is a regexp problem!
>
> Org-mode has two variables: org-deadline-string and org-scheduled-string
> (see below)
>
> and I want to match tasks which have a timestamp, ie satisfies the
> org-ts-regexp2
>
> BUT DO NOT  have org-deadline-string NOR org-scheduled-string
>
> I tried
>
>     (org2rem-pure-timestamps-string
>           (concat  "\\(" org-deadline-string "\\|"
>                org-scheduled-string  "\\)\\{0\\}"))
>
> in order that a regexp such as
>
> "\\(org-deadline-string\\|org-scheduled-string\\)\\{0\\}"
>
> would match only zero {0} occurrences of
> (org-deadline-string|org-scheduled-string)
> but this seems to be a mistake.
>
> Any hint??

I can only suggest the empty regexp, as before:

     (org2rem-pure-timestamps-string "")

If this doesn't work, I don't know.

Regards, Olaf

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: org-mode and remind integration
@ 2009-02-11 14:23 Sharad Pratap
  0 siblings, 0 replies; 9+ messages in thread
From: Sharad Pratap @ 2009-02-11 14:23 UTC (permalink / raw)
  To: danielemc; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 355 bytes --]

Hi Daniel,

Your regular expression working fine!!, I have made few change with
same regular expression, and it has worked for me.

I wish `org2rem' could be as robust as `org-export-icalendar'.

Like me you also want orgmode outside editor, So I have added to
executable script `org2remind' and `show-agenda'.

-- 
Regard
        (`
        _) h a r a d

[-- Attachment #1.2: Type: text/html, Size: 457 bytes --]

[-- Attachment #2: org2rem.el.patch --]
[-- Type: text/x-patch, Size: 2355 bytes --]

--- org2rem.el.old	2009-01-09 09:00:48.000000000 +0000
+++ org2rem.el.new	2009-02-11 13:59:16.777712000 +0000
@@ -34,13 +34,21 @@
 (eval-when-compile
   (require 'cl))
 
+(defvar org2rem-pure-timestamps-string  ;we need it.
+ (concat  "\\(" org-deadline-string "\\|"
+          org-scheduled-string  "\\)\\{0\\}"))
+
 (defvar org2rem-scheduled-reminders nil)
 (defvar org2rem-deadline-reminders nil)
+(defvar org2rem-pure-timestamps-reminders nil)
+
 (defvar pure-time nil)
 (defvar org2rem-scheduled-remind-file 
   "~/.reminders.org.scheduled")
 (defvar org2rem-deadline-remind-file 
   "~/.reminders.org.deadline")
+(defvar org2rem-pure-timestamps-remind-file
+  "~/.reminders.org.pure-timestamps")
 
 (defun org2rem-list-reminders (regexp)
   "Make a list of appointments. 
@@ -95,9 +103,15 @@
 
 	  (setq rem-task (concat "REM" rem-time "MSG "  task "%")
 		)
-	  (if (equal regexp org-scheduled-string)
-	      (push rem-task org2rem-scheduled-reminders)
-	    (push rem-task org2rem-deadline-reminders)))))))
+
+          (cond
+           ((equal regexp org2rem-pure-timestamps-string)
+            (push rem-task org2rem-pure-timestamps-reminders))
+           ((equal regexp org-scheduled-string)
+            (push rem-task org2rem-scheduled-reminders))
+           ((equal regexp org-deadline-string)
+            (push rem-task org2rem-deadline-reminders))
+           ))))))
 
 (defun org2rem-write-file (file reminders)
   "Write reminders list to files."
@@ -116,13 +130,19 @@
   (interactive)
   (setq org2rem-scheduled-reminders nil)
   (setq org2rem-deadline-reminders nil)
+  (setq org2rem-pure-timestamps-string nil)
   (save-window-excursion
     (org2rem-list-reminders org-scheduled-string)
     (org2rem-list-reminders org-deadline-string)
-    (org2rem-write-file "~/.reminders.org.scheduled" 
+    (org2rem-list-reminders org2rem-pure-timestamps-string)
+
+    (org2rem-write-file org2rem-scheduled-remind-file ;"~/.reminders.org.scheduled" 
 			org2rem-scheduled-reminders)
-    (org2rem-write-file "~/.reminders.org.deadline"
-			org2rem-deadline-reminders)))
+    (org2rem-write-file org2rem-deadline-remind-file ;"~/.reminders.org.deadline"
+			org2rem-deadline-reminders)
+    (org2rem-write-file org2rem-pure-timestamps-remind-file ;"~/.reminders.org.pure-timestamps"
+			org2rem-pure-timestamps-reminders)
+    ))
 
 
 \f

[-- Attachment #3: org2remind --]
[-- Type: application/octet-stream, Size: 847 bytes --]

#! /usr/bin/emacs --script


(load-file "~/.emacs")
(require 'org2rem)

(defun org2remind ()
  "batch org2rem function"
  (setq org2rem-scheduled-reminders nil)
  (setq org2rem-deadline-reminders nil)
  (setq org2rem-pure-timestamps-string nil)
  (save-window-excursion
    (find-file "~/my/test.org")
    (org2rem-list-reminders org-scheduled-string)
    (org2rem-list-reminders org-deadline-string)
    (org2rem-list-reminders org2rem-pure-timestamps-string)

    (org2rem-write-file org2rem-scheduled-remind-file ;"~/.reminders.org.scheduled" 
			org2rem-scheduled-reminders)
    (org2rem-write-file org2rem-deadline-remind-file ;"~/.reminders.org.deadline"
			org2rem-deadline-reminders)
    (org2rem-write-file org2rem-pure-timestamps-remind-file ;"~/.reminders.org.pure-timestamps"
			org2rem-pure-timestamps-reminders)
    ))

(org2remind)

[-- Attachment #4: show-agenda --]
[-- Type: application/octet-stream, Size: 1611 bytes --]

#!/usr/bin/emacs --script
;;
;; be.el
;; 
;; Made by s
;; Login   <s@taj>
;; 
;; Started on  Wed Feb  4 21:51:00 2009 s
;; Last update Wed Feb 11 17:17:09 2009 Sharad Pratap


(setq
 european-calendar-style nil
 diary-mail-days 7 
 diary-file "~/.Organize/emacs/diary/diary")

(org-batch-agenda "a"
                  european-calendar-style nil
                  diary-mail-days 12
                  org-agenda-ndays 20
                  diary-file "~/.Organize/emacs/diary/diary"
                  org-agenda-files
                  (file-expand-wildcards "~/.Organize/emacs/org/*/*.org"))
;                   org-agenda-files
;                   (quote 
;                    (
;                     "~/.Organize/emacs/org/myself/test.org"
;                     )))
;                  )

;;;      emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr

;;; You may also modify parameters on the fly like this:

;;;      emacs -batch -l ~/.emacs                                      \
;;;         -eval '(org-batch-agenda "a"                               \
;;;                  org-agenda-ndays 300                              \
;;;                  org-agenda-include-diary nil                      \
;;;                  org-agenda-files (quote ("~/org/project.org")))'  \
;;;         | lpr

;;;     (org-batch-agenda "S")



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; from: http://www.mail-archive.com/emacs-orgmode@gnu.org/msg10679.html
;;emacs --batch --no-init-file -q  -l ~/.emacs.slim --eval "(progn
;;(org-agenda-list) (princ (buffer-string)))" 2> /dev/null

[-- Attachment #5: 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	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-02-11 14:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-31 11:53 org-mode and remind integration Daniel Martins
2009-01-09  8:17 ` Carsten Dominik
2009-01-09  8:57   ` Daniel Martins
2009-01-09 14:39     ` Olaf Dietsche
2009-01-10 13:21       ` Daniel Martins
2009-01-10 21:18         ` Olaf Dietsche
2009-01-11 20:19           ` Daniel Martins
2009-01-13 21:06             ` Olaf Dietsche
2009-02-11 14:23 Sharad Pratap

Code repositories for project(s) associated with this 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).