Re: [O] How to set up anniversaries/birthdays with org-contacts-anniversaries?

2011-11-08 Thread Marius Hofert
see here: 
http://stackoverflow.com/questions/8036948/how-to-set-up-birthdays-with-org-contacts-error-bad-sexp


On 2011-11-06, at 12:05 , Marius Hofert wrote:

 How can I set up anniversaries with org-contact?
 
 My agend.org file contains the following, as mentioned on the bottom of 
 http://julien.danjou.info/org-contacts.html
 
 #+STARTUP: showeverything
 * Birthdays
  %%(org-contacts-anniversaries)
 
 My contacts.org file contains (e.g.):
 
 * My contact   :my.tag:
 :PROPERTIES:
 :EMAIL:  my.cont...@my.address.org
 :URL:
 :WORK: 
 :HOME: 
 :MOBILE:
 :LOCATION:
 :BIRTHDAY: 2000-01-01
 :NOTE: 
 :END:
 
 When I access agenda view via C-c a a, I obtain:
 
 Bad sexp at line 3 in /Users/myusername/org/agenda.org: 
 (org-contacts-anniversaries) [7 times]
 
 Note that line three corresponds to %%(org-contacts-anniversaries)
 
 
 Cheers,
 
 Marius




Re: [O] How to set up anniversaries/birthdays with org-contacts-anniversaries?

2011-11-08 Thread Nick Dokos
Marius Hofert marius.hof...@math.ethz.ch wrote:

 see here: 
 http://stackoverflow.com/questions/8036948/how-to-set-up-birthdays-with-org-contacts-error-bad-sexp
 
 
 On 2011-11-06, at 12:05 , Marius Hofert wrote:
 
  How can I set up anniversaries with org-contact?
  
  My agend.org file contains the following, as mentioned on the bottom of 
  http://julien.danjou.info/org-contacts.html
  
  #+STARTUP: showeverything
  * Birthdays
   %%(org-contacts-anniversaries)
  
  My contacts.org file contains (e.g.):
  
  * My contact   :my.tag:
  :PROPERTIES:
  :EMAIL:  my.cont...@my.address.org
  :URL:
  :WORK: 
  :HOME: 
  :MOBILE:
  :LOCATION:
  :BIRTHDAY: 2000-01-01
  :NOTE: 
  :END:
  
  When I access agenda view via C-c a a, I obtain:
  
  Bad sexp at line 3 in /Users/myusername/org/agenda.org: 
  (org-contacts-anniversaries) [7 times]
  
  Note that line three corresponds to %%(org-contacts-anniversaries)
  

The org sexp handler issues this message whenever an error is signalled
when trying to evaluate the sexp.

In this case (as in most of these cases), the error is probably because
org-contacts-anniversaries is not defined, for whatever reason.

Try to eval

(org-contacts-anniversaries)

manually - what do you get? I get 

,
| Debugger entered--Lisp error: (void-function org-contacts-anniversaries)
|   (org-contacts-anniversaries)
|   eval((org-contacts-anniversaries) nil)
|   eval-last-sexp-1(nil)
|   eval-last-sexp(nil)
|   call-interactively(eval-last-sexp nil nil)
`

Then load org-contacts with

 (require 'org-contacts)

or similar, and try the eval again. I get nil as a result, but more
importantly, no error. Assuming that you get no error either, try the
agenda again.

Nick



Re: [O] How to set up anniversaries/birthdays with org-contacts-anniversaries?

2011-11-08 Thread Marius Hofert
 
 The org sexp handler issues this message whenever an error is signalled
 when trying to evaluate the sexp.
 
 In this case (as in most of these cases), the error is probably because
 org-contacts-anniversaries is not defined, for whatever reason.
 
 Try to eval
 
(org-contacts-anniversaries)
 
 manually - what do you get? I get 
 

via M-x org-contacts-anniversaries? I get No match

 ,
 | Debugger entered--Lisp error: (void-function org-contacts-anniversaries)
 |   (org-contacts-anniversaries)
 |   eval((org-contacts-anniversaries) nil)
 |   eval-last-sexp-1(nil)
 |   eval-last-sexp(nil)
 |   call-interactively(eval-last-sexp nil nil)
 `
 
 Then load org-contacts with
 
 (require 'org-contacts)

Yes, I already had this in .emacs (and obtained No match)

 
 or similar, and try the eval again. I get nil as a result, but more
 importantly, no error. Assuming that you get no error either, try the
 agenda again.
 
 Nick

I found out that the error happens due to either one of two reasons:
1) I have a :BIRTHDAY: tag which is 1970 or 2037
2) I have an empty :BIRTHDAY: tag
Have you seen my link to stackoverflow above? I got help there and finally 
realized that it's linked to the problem discussed here (involving posts of 
you, too):
http://thread.gmane.org/gmane.emacs.orgmode/39206

Is that solved? Will it be (automatically) solved if Emacs (for Mac) learns how 
to use the Mac's 64 bit architecture?

Cheers,

Marius





Re: [O] How to set up anniversaries/birthdays with org-contacts-anniversaries?

2011-11-08 Thread Nick Dokos
Marius Hofert marius.hof...@math.ethz.ch wrote:

  
  The org sexp handler issues this message whenever an error is signalled
  when trying to evaluate the sexp.
  
  In this case (as in most of these cases), the error is probably because
  org-contacts-anniversaries is not defined, for whatever reason.
  
  Try to eval
  
 (org-contacts-anniversaries)
  
  manually - what do you get? I get 
  
 
 via M-x org-contacts-anniversaries? I get No match
 

No, via

 ESC ESC : (org-contacts-anniversaries) RET

or similar. M-x foo requires that foo is a command (aka an interactive
function): org-contacts-anniversaries is not.

  ,
  | Debugger entered--Lisp error: (void-function org-contacts-anniversaries)
  |   (org-contacts-anniversaries)
  |   eval((org-contacts-anniversaries) nil)
  |   eval-last-sexp-1(nil)
  |   eval-last-sexp(nil)
  |   call-interactively(eval-last-sexp nil nil)
  `
  
  Then load org-contacts with
  
  (require 'org-contacts)
 
 Yes, I already had this in .emacs (and obtained No match)
 
  
  or similar, and try the eval again. I get nil as a result, but more
  importantly, no error. Assuming that you get no error either, try the
  agenda again.
  
  Nick
 
 I found out that the error happens due to either one of two reasons:
 1) I have a :BIRTHDAY: tag which is 1970 or 2037
 2) I have an empty :BIRTHDAY: tag
 Have you seen my link to stackoverflow above? I got help there and finally 
 realized that it's linked to the problem discussed here (involving posts of 
 you, too):
 http://thread.gmane.org/gmane.emacs.orgmode/39206
 

Glanced at it, but didn't go far enough to read about those problems.

 Is that solved? Will it be (automatically) solved if Emacs (for Mac) learns 
 how to use the Mac's 64 bit architecture?
 

Not sure.

Nick

 Cheers,
 
 Marius
 
 



Re: [O] How to set up anniversaries/birthdays with org-contacts-anniversaries?

2011-11-08 Thread Marius Hofert
Okay, ESC ESC : (org-contacts-anniversaries) gives:


Debugger entered--Lisp error: (void-function diary-anniversary)
  diary-anniversary(10 25 1970)
  apply(diary-anniversary (10 25 1970))
  (and anniv (apply (quote diary-anniversary) anniv))
  (if (and anniv (apply (quote diary-anniversary) anniv)) (progn (push 
(format-spec format (\` ((108 \, (org-with-point-at ... ...)) (104 \, (car 
contact)) (121 \, (- ... ...)) (89 \, (let ... ...) --cl-var--)))
  (while (consp --cl-var--) (setq contact (car --cl-var--)) (setq anniv (let 
((anniv (cdr (assoc-string (or field org-contacts-birthday-property) (caddr 
contact) (when anniv (calendar-gregorian-from-absolute 
(org-time-string-to-absolute anniv) (if (and anniv (apply (quote 
diary-anniversary) anniv)) (progn (push (format-spec format (\` ((108 \, ...) 
(104 \, ...) (121 \, ...) (89 \, ... --cl-var--))) (setq --cl-var-- (cdr 
--cl-var--)))
  (let* ((--cl-var-- (org-contacts-filter)) (contact nil) (anniv nil) 
(--cl-var-- nil)) (while (consp --cl-var--) (setq contact (car --cl-var--)) 
(setq anniv (let ((anniv (cdr (assoc-string ... ... (when anniv 
(calendar-gregorian-from-absolute (org-time-string-to-absolute anniv) (if 
(and anniv (apply (quote diary-anniversary) anniv)) (progn (push (format-spec 
format (\` (... ... ... ...))) --cl-var--))) (setq --cl-var-- (cdr 
--cl-var--))) (nreverse --cl-var--))
  (catch (quote --cl-block-nil--) (let* ((--cl-var-- (org-contacts-filter)) 
(contact nil) (anniv nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq 
contact (car --cl-var--)) (setq anniv (let ((anniv (cdr ...))) (when anniv 
(calendar-gregorian-from-absolute (org-time-string-to-absolute anniv) (if 
(and anniv (apply (quote diary-anniversary) anniv)) (progn (push (format-spec 
format (\` ...)) --cl-var--))) (setq --cl-var-- (cdr --cl-var--))) (nreverse 
--cl-var--)))
  (cl-block-wrapper (catch (quote --cl-block-nil--) (let* ((--cl-var-- 
(org-contacts-filter)) (contact nil) (anniv nil) (--cl-var-- nil)) (while 
(consp --cl-var--) (setq contact (car --cl-var--)) (setq anniv (let ((anniv 
...)) (when anniv (calendar-gregorian-from-absolute ... (if (and anniv 
(apply (quote diary-anniversary) anniv)) (progn (push (format-spec format ...) 
--cl-var--))) (setq --cl-var-- (cdr --cl-var--))) (nreverse --cl-var--
  (block nil (let* ((--cl-var-- (org-contacts-filter)) (contact nil) (anniv 
nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq contact (car 
--cl-var--)) (setq anniv (let ((anniv (cdr ...))) (when anniv 
(calendar-gregorian-from-absolute (org-time-string-to-absolute anniv) (if 
(and anniv (apply (quote diary-anniversary) anniv)) (progn (push (format-spec 
format (\` ...)) --cl-var--))) (setq --cl-var-- (cdr --cl-var--))) (nreverse 
--cl-var--)))
  (loop for contact in (org-contacts-filter) for anniv = (let ((anniv (cdr 
(assoc-string (or field org-contacts-birthday-property) (caddr contact) 
(when anniv (calendar-gregorian-from-absolute (org-time-string-to-absolute 
anniv if (and anniv (apply (quote diary-anniversary) anniv)) collect 
(format-spec format (\` ((108 \, (org-with-point-at (cadr contact) 
(org-store-link nil))) (104 \, (car contact)) (121 \, (- (calendar-extract-year 
date) (calendar-extract-year anniv))) (89 \, (let ((years ...)) (format %d%s 
years (diary-ordinal-suffix years
  (let ((calendar-date-style (quote american)) (entry )) (unless format (setq 
format org-contacts-birthday-format)) (loop for contact in 
(org-contacts-filter) for anniv = (let ((anniv (cdr (assoc-string (or field 
org-contacts-birthday-property) (caddr contact) (when anniv 
(calendar-gregorian-from-absolute (org-time-string-to-absolute anniv if 
(and anniv (apply (quote diary-anniversary) anniv)) collect (format-spec format 
(\` ((108 \, (org-with-point-at (cadr contact) (org-store-link nil))) (104 \, 
(car contact)) (121 \, (- (calendar-extract-year date) (calendar-extract-year 
anniv))) (89 \, (let (...) (format %d%s years ...
  org-contacts-anniversaries()
  eval((org-contacts-anniversaries) nil)
  eval-expression((org-contacts-anniversaries) nil)
  call-interactively(eval-expression nil nil)





Re: [O] How to set up anniversaries/birthdays with org-contacts-anniversaries?

2011-11-08 Thread Jambunathan K
 Debugger entered--Lisp error: (void-function diary-anniversary)

There is a universal solution to this problem

M-x load-library RET diary TAB

and choose which of the options make most sense or try each one of them
in turn.

Note that in the above load-library you are using diary because it is
the prefix of function (or variable) which reported as void.

The load-library call unvoids the void things.






Re: [O] How to set up anniversaries/birthdays with org-contacts-anniversaries?

2011-11-08 Thread Marius Hofert
Thanks for the explanation. Is there also an equivalent solution by just 
adjusting .emacs?

 
On 2011-11-08, at 23:33 , Jambunathan K wrote:

 Debugger entered--Lisp error: (void-function diary-anniversary)
 
 There is a universal solution to this problem
 
 M-x load-library RET diary TAB
 
 and choose which of the options make most sense or try each one of them
 in turn.
 
 Note that in the above load-library you are using diary because it is
 the prefix of function (or variable) which reported as void.
 
 The load-library call unvoids the void things.
 
 
 




Re: [O] How to set up anniversaries/birthdays with org-contacts-anniversaries?

2011-11-08 Thread Nick Dokos
Marius Hofert marius.hof...@math.ethz.ch wrote:

 Okay, ESC ESC : (org-contacts-anniversaries) gives:
 
 
 Debugger entered--Lisp error: (void-function diary-anniversary)

So you need to load diary.el and associated stuff:

(require 'diary)

is probably enough.



Re: [O] How to set up anniversaries/birthdays with org-contacts-anniversaries?

2011-11-08 Thread Jambunathan K
Marius Hofert marius.hof...@math.ethz.ch writes:

 Thanks for the explanation. Is there also an equivalent solution by
 just adjusting .emacs?

C-h r
g Init Examples

Hint: search for load
Helpful tip: Learn to use Emacs Info system well.


  
 On 2011-11-08, at 23:33 , Jambunathan K wrote:

 Debugger entered--Lisp error: (void-function diary-anniversary)
 
 There is a universal solution to this problem
 
 M-x load-library RET diary TAB
 
 and choose which of the options make most sense or try each one of them
 in turn.
 
 Note that in the above load-library you are using diary because it is
 the prefix of function (or variable) which reported as void.
 
 The load-library call unvoids the void things.
 
 
 




-- 



Re: [O] How to set up anniversaries/birthdays with org-contacts-anniversaries?

2011-11-08 Thread Nick Dokos
Marius Hofert marius.hof...@math.ethz.ch wrote:

 Thanks for the explanation. Is there also an equivalent solution by just 
 adjusting .emacs?
 
  

If you are going to use emacs extensively, you probably should read the
emacs reference manual and maybe the emacs lisp introduction as
well.

M-x foo RET is entirely equivalent to evaluating

(foo)

which is a call to function foo. (foo) is the more general mechanism: it
works for any lisp function, M-x foo works iff foo is a command (aka an
interactive function). The form (foo) can be added to .emacs.

load-library is a command that takes an argument: the name of the library
to load. See its doc string for details. M-x load-library RET diary RET
is entirely equivalent to evaluating

(load-library diary)

This calls the function load-library with the string argument diary.
This form can be added to .emacs. Alternatively, you can use the
require form that I posted:

(require 'diary)

Note that load-library takes a string as argument, whereas require takes
a symbol.

Nick


 On 2011-11-08, at 23:33 , Jambunathan K wrote:
 
  Debugger entered--Lisp error: (void-function diary-anniversary)
  
  There is a universal solution to this problem
  
  M-x load-library RET diary TAB
  
  and choose which of the options make most sense or try each one of them
  in turn.
  
  Note that in the above load-library you are using diary because it is
  the prefix of function (or variable) which reported as void.
  
  The load-library call unvoids the void things.
  
  
  
 



Re: [O] How to set up anniversaries/birthdays with org-contacts-anniversaries?

2011-11-08 Thread Marius Hofert

On 2011-11-08, at 23:33 , Jambunathan K wrote:

 Debugger entered--Lisp error: (void-function diary-anniversary)
 
 There is a universal solution to this problem
 
 M-x load-library RET diary TAB
 
 and choose which of the options make most sense or try each one of them
 in turn.

I have:
1) diary-lib
2) diary-loaddefs

I chose the first one. After that, I could define a :BIRTHDAY: with year  1970 
and it correctly showed up in the agenda view! Seems to work! :-) 

Thanks a lot,

Marius

 
 Note that in the above load-library you are using diary because it is
 the prefix of function (or variable) which reported as void.
 
 The load-library call unvoids the void things.





Re: [O] How to set up anniversaries/birthdays with org-contacts-anniversaries?

2011-11-08 Thread Marius Hofert

On 2011-11-09, at 00:06 , Nick Dokos wrote:

 Marius Hofert marius.hof...@math.ethz.ch wrote:
 
 Thanks for the explanation. Is there also an equivalent solution by just 
 adjusting .emacs?
 
 
 
 If you are going to use emacs extensively, you probably should read the
 emacs reference manual and maybe the emacs lisp introduction as
 well.
 
 M-x foo RET is entirely equivalent to evaluating
 
 (foo)
 
 which is a call to function foo. (foo) is the more general mechanism: it
 works for any lisp function, M-x foo works iff foo is a command (aka an
 interactive function). The form (foo) can be added to .emacs.
 
 load-library is a command that takes an argument: the name of the library
 to load. See its doc string for details. M-x load-library RET diary RET
 is entirely equivalent to evaluating
 
 (load-library diary)
 
 This calls the function load-library with the string argument diary.
 This form can be added to .emacs. Alternatively, you can use the
 require form that I posted:
 
 (require 'diary)

I obtain (also for (load-library diary) ):
File error: Cannot open load file, diary

I assume I'm missing some diary.el (?). 

I'm wondering why diary is needed anyway? Julien does not specifically mention 
it:
http://julien.danjou.info/org-contacts.html

Cheers,

Marius


 
 Note that load-library takes a string as argument, whereas require takes
 a symbol.
 
 Nick
 
 
 On 2011-11-08, at 23:33 , Jambunathan K wrote:
 
 Debugger entered--Lisp error: (void-function diary-anniversary)
 
 There is a universal solution to this problem
 
 M-x load-library RET diary TAB
 
 and choose which of the options make most sense or try each one of them
 in turn.
 
 Note that in the above load-library you are using diary because it is
 the prefix of function (or variable) which reported as void.
 
 The load-library call unvoids the void things.
 
 
 
 




Re: [O] How to set up anniversaries/birthdays with org-contacts-anniversaries?

2011-11-08 Thread Marius Hofert
Okay, I assume it's (require 'diary-lib) then.


On 2011-11-09, at 00:13 , Marius Hofert wrote:

 
 On 2011-11-09, at 00:06 , Nick Dokos wrote:
 
 Marius Hofert marius.hof...@math.ethz.ch wrote:
 
 Thanks for the explanation. Is there also an equivalent solution by just 
 adjusting .emacs?
 
 
 
 If you are going to use emacs extensively, you probably should read the
 emacs reference manual and maybe the emacs lisp introduction as
 well.
 
 M-x foo RET is entirely equivalent to evaluating
 
 (foo)
 
 which is a call to function foo. (foo) is the more general mechanism: it
 works for any lisp function, M-x foo works iff foo is a command (aka an
 interactive function). The form (foo) can be added to .emacs.
 
 load-library is a command that takes an argument: the name of the library
 to load. See its doc string for details. M-x load-library RET diary RET
 is entirely equivalent to evaluating
 
 (load-library diary)
 
 This calls the function load-library with the string argument diary.
 This form can be added to .emacs. Alternatively, you can use the
 require form that I posted:
 
 (require 'diary)
 
 I obtain (also for (load-library diary) ):
 File error: Cannot open load file, diary
 
 I assume I'm missing some diary.el (?). 
 
 I'm wondering why diary is needed anyway? Julien does not specifically 
 mention it:
 http://julien.danjou.info/org-contacts.html
 
 Cheers,
 
 Marius
 
 
 
 Note that load-library takes a string as argument, whereas require takes
 a symbol.
 
 Nick
 
 
 On 2011-11-08, at 23:33 , Jambunathan K wrote:
 
 Debugger entered--Lisp error: (void-function diary-anniversary)
 
 There is a universal solution to this problem
 
 M-x load-library RET diary TAB
 
 and choose which of the options make most sense or try each one of them
 in turn.
 
 Note that in the above load-library you are using diary because it is
 the prefix of function (or variable) which reported as void.
 
 The load-library call unvoids the void things.
 
 
 
 
 

ETH Zurich
Dr. Marius Hofert
RiskLab, Department of Mathematics
HG E 65.2
Rämistrasse 101
8092 Zurich
Switzerland

Phone +41 44 632 2423
marius.hof...@math.ethz.ch
http://www.math.ethz.ch/~hofertj




Re: [O] How to set up anniversaries/birthdays with org-contacts-anniversaries?

2011-11-08 Thread Nick Dokos
Marius Hofert marius.hof...@math.ethz.ch wrote:

  
  (load-library diary)
  
  This calls the function load-library with the string argument diary.
  This form can be added to .emacs. Alternatively, you can use the
  require form that I posted:
  
  (require 'diary)
 
 I obtain (also for (load-library diary) ):
 File error: Cannot open load file, diary
 
 I assume I'm missing some diary.el (?). 
 

Nope, I'm wrong: diary-anniversary is in diary-lib, so the
correct form is

(load-library diary-lib)

or

(require 'diary-lib)



Re: [O] How to set up anniversaries/birthdays with org-contacts-anniversaries?

2011-11-08 Thread Marius Hofert
 (load-library diary)
 
 This calls the function load-library with the string argument diary.
 This form can be added to .emacs. Alternatively, you can use the
 require form that I posted:
 
 (require 'diary)
 
 I obtain (also for (load-library diary) ):
 File error: Cannot open load file, diary
 
 I assume I'm missing some diary.el (?). 
 
 
 Nope, I'm wrong: diary-anniversary is in diary-lib, so the
 correct form is
 
 (load-library diary-lib)
 
 or
 
 (require 'diary-lib)


okay, that's also what I tried and it worked. However, I still see the Bad 
sexp... error when there is a BIRTHDAY tag *without* date, so just a line 
containing :BIRTHDAY: But that's of course not a big issue.




Re: [O] How to set up anniversaries/birthdays with org-contacts-anniversaries?

2011-11-08 Thread Jonathan Leech-Pepin
:BIRTHDAY: without any date is an invalid date for the sexp.

org-contacts-anniversaries loops through all valid contacts (headlines with
an :EMAIL: property) for any that contain the :BIRTHDAY: property (by
default, this can be customized).

When there is no date associated the value is nil.

(calendar-gregorian-from-absolute
  (org-time-string-to-absolute anniv))

Where anniv is the date retrieved from :BIRTHDAY:. nil is not a valid date,
so the expression fails, giving you a bad sexp.

On Tue, Nov 8, 2011 at 6:25 PM, Marius Hofert marius.hof...@math.ethz.chwrote:

  (load-library diary)
 
  This calls the function load-library with the string argument diary.
  This form can be added to .emacs. Alternatively, you can use the
  require form that I posted:
 
  (require 'diary)
 
  I obtain (also for (load-library diary) ):
  File error: Cannot open load file, diary
 
  I assume I'm missing some diary.el (?).
 
 
  Nope, I'm wrong: diary-anniversary is in diary-lib, so the
  correct form is
 
  (load-library diary-lib)
 
  or
 
  (require 'diary-lib)


 okay, that's also what I tried and it worked. However, I still see the
 Bad sexp... error when there is a BIRTHDAY tag *without* date, so just a
 line containing :BIRTHDAY: But that's of course not a big issue.





[O] How to set up anniversaries/birthdays with org-contacts-anniversaries?

2011-11-06 Thread Marius Hofert
How can I set up anniversaries with org-contact?

My agend.org file contains the following, as mentioned on the bottom of 
http://julien.danjou.info/org-contacts.html

#+STARTUP: showeverything
* Birthdays
  %%(org-contacts-anniversaries)

My contacts.org file contains (e.g.):

* My contact   :my.tag:
:PROPERTIES:
:EMAIL:  my.cont...@my.address.org
:URL:
:WORK: 
:HOME: 
:MOBILE:
:LOCATION:
:BIRTHDAY: 2000-01-01
:NOTE: 
:END:

When I access agenda view via C-c a a, I obtain:

Bad sexp at line 3 in /Users/myusername/org/agenda.org: 
(org-contacts-anniversaries) [7 times]

Note that line three corresponds to %%(org-contacts-anniversaries)


Cheers,

Marius