emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to set up anniversaries/birthdays with org-contacts-anniversaries?
@ 2011-11-06 11:05 Marius Hofert
  2011-11-08 21:03 ` Marius Hofert
  0 siblings, 1 reply; 17+ messages in thread
From: Marius Hofert @ 2011-11-06 11:05 UTC (permalink / raw)
  To: Emacs help

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.contact@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

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

* Re: How to set up anniversaries/birthdays with org-contacts-anniversaries?
  2011-11-06 11:05 How to set up anniversaries/birthdays with org-contacts-anniversaries? Marius Hofert
@ 2011-11-08 21:03 ` Marius Hofert
  2011-11-08 21:33   ` Nick Dokos
  0 siblings, 1 reply; 17+ messages in thread
From: Marius Hofert @ 2011-11-08 21:03 UTC (permalink / raw)
  To: Emacs help

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.contact@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

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

* Re: How to set up anniversaries/birthdays with org-contacts-anniversaries?
  2011-11-08 21:03 ` Marius Hofert
@ 2011-11-08 21:33   ` Nick Dokos
  2011-11-08 21:43     ` Marius Hofert
  0 siblings, 1 reply; 17+ messages in thread
From: Nick Dokos @ 2011-11-08 21:33 UTC (permalink / raw)
  To: Marius Hofert; +Cc: nicholas.dokos, Emacs help

Marius Hofert <marius.hofert@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.contact@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

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

* Re: How to set up anniversaries/birthdays with org-contacts-anniversaries?
  2011-11-08 21:33   ` Nick Dokos
@ 2011-11-08 21:43     ` Marius Hofert
  2011-11-08 22:07       ` Nick Dokos
  0 siblings, 1 reply; 17+ messages in thread
From: Marius Hofert @ 2011-11-08 21:43 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Emacs help

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

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

* Re: How to set up anniversaries/birthdays with org-contacts-anniversaries?
  2011-11-08 21:43     ` Marius Hofert
@ 2011-11-08 22:07       ` Nick Dokos
  2011-11-08 22:16         ` Marius Hofert
  0 siblings, 1 reply; 17+ messages in thread
From: Nick Dokos @ 2011-11-08 22:07 UTC (permalink / raw)
  To: Marius Hofert; +Cc: nicholas.dokos, Emacs help

Marius Hofert <marius.hofert@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
> 
> 

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

* Re: How to set up anniversaries/birthdays with org-contacts-anniversaries?
  2011-11-08 22:07       ` Nick Dokos
@ 2011-11-08 22:16         ` Marius Hofert
  2011-11-08 22:33           ` Jambunathan K
  2011-11-08 22:48           ` Nick Dokos
  0 siblings, 2 replies; 17+ messages in thread
From: Marius Hofert @ 2011-11-08 22:16 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Emacs help

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)

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

* Re: How to set up anniversaries/birthdays with org-contacts-anniversaries?
  2011-11-08 22:16         ` Marius Hofert
@ 2011-11-08 22:33           ` Jambunathan K
  2011-11-08 22:36             ` Marius Hofert
  2011-11-08 23:12             ` Marius Hofert
  2011-11-08 22:48           ` Nick Dokos
  1 sibling, 2 replies; 17+ messages in thread
From: Jambunathan K @ 2011-11-08 22:33 UTC (permalink / raw)
  To: Marius Hofert; +Cc: nicholas.dokos, Emacs help

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

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

* Re: How to set up anniversaries/birthdays with org-contacts-anniversaries?
  2011-11-08 22:33           ` Jambunathan K
@ 2011-11-08 22:36             ` Marius Hofert
  2011-11-08 22:50               ` Jambunathan K
  2011-11-08 23:06               ` Nick Dokos
  2011-11-08 23:12             ` Marius Hofert
  1 sibling, 2 replies; 17+ messages in thread
From: Marius Hofert @ 2011-11-08 22:36 UTC (permalink / raw)
  To: Jambunathan K; +Cc: nicholas.dokos, Emacs help

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

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

* Re: How to set up anniversaries/birthdays with org-contacts-anniversaries?
  2011-11-08 22:16         ` Marius Hofert
  2011-11-08 22:33           ` Jambunathan K
@ 2011-11-08 22:48           ` Nick Dokos
  1 sibling, 0 replies; 17+ messages in thread
From: Nick Dokos @ 2011-11-08 22:48 UTC (permalink / raw)
  To: Marius Hofert; +Cc: nicholas.dokos, Emacs help

Marius Hofert <marius.hofert@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.

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

* Re: How to set up anniversaries/birthdays with org-contacts-anniversaries?
  2011-11-08 22:36             ` Marius Hofert
@ 2011-11-08 22:50               ` Jambunathan K
  2011-11-08 23:06               ` Nick Dokos
  1 sibling, 0 replies; 17+ messages in thread
From: Jambunathan K @ 2011-11-08 22:50 UTC (permalink / raw)
  To: Marius Hofert; +Cc: Emacs help

Marius Hofert <marius.hofert@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.
>> 
>> 
>> 
>
>
>

-- 

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

* Re: How to set up anniversaries/birthdays with org-contacts-anniversaries?
  2011-11-08 22:36             ` Marius Hofert
  2011-11-08 22:50               ` Jambunathan K
@ 2011-11-08 23:06               ` Nick Dokos
  2011-11-08 23:13                 ` Marius Hofert
  1 sibling, 1 reply; 17+ messages in thread
From: Nick Dokos @ 2011-11-08 23:06 UTC (permalink / raw)
  To: Marius Hofert; +Cc: nicholas.dokos, Emacs help, Jambunathan K

Marius Hofert <marius.hofert@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.
> > 
> > 
> > 
> 

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

* Re: How to set up anniversaries/birthdays with org-contacts-anniversaries?
  2011-11-08 22:33           ` Jambunathan K
  2011-11-08 22:36             ` Marius Hofert
@ 2011-11-08 23:12             ` Marius Hofert
  1 sibling, 0 replies; 17+ messages in thread
From: Marius Hofert @ 2011-11-08 23:12 UTC (permalink / raw)
  To: Jambunathan K; +Cc: nicholas.dokos, Emacs help


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.

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

* Re: How to set up anniversaries/birthdays with org-contacts-anniversaries?
  2011-11-08 23:06               ` Nick Dokos
@ 2011-11-08 23:13                 ` Marius Hofert
  2011-11-08 23:17                   ` Marius Hofert
  2011-11-08 23:21                   ` Nick Dokos
  0 siblings, 2 replies; 17+ messages in thread
From: Marius Hofert @ 2011-11-08 23:13 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Emacs help, Jambunathan K


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

> Marius Hofert <marius.hofert@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.
>>> 
>>> 
>>> 
>> 

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

* Re: How to set up anniversaries/birthdays with org-contacts-anniversaries?
  2011-11-08 23:13                 ` Marius Hofert
@ 2011-11-08 23:17                   ` Marius Hofert
  2011-11-08 23:21                   ` Nick Dokos
  1 sibling, 0 replies; 17+ messages in thread
From: Marius Hofert @ 2011-11-08 23:17 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Emacs help, Jambunathan K

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.hofert@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.hofert@math.ethz.ch
http://www.math.ethz.ch/~hofertj

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

* Re: How to set up anniversaries/birthdays with org-contacts-anniversaries?
  2011-11-08 23:13                 ` Marius Hofert
  2011-11-08 23:17                   ` Marius Hofert
@ 2011-11-08 23:21                   ` Nick Dokos
  2011-11-08 23:25                     ` Marius Hofert
  1 sibling, 1 reply; 17+ messages in thread
From: Nick Dokos @ 2011-11-08 23:21 UTC (permalink / raw)
  To: Marius Hofert; +Cc: nicholas.dokos, Emacs help, Jambunathan K

Marius Hofert <marius.hofert@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)

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

* Re: How to set up anniversaries/birthdays with org-contacts-anniversaries?
  2011-11-08 23:21                   ` Nick Dokos
@ 2011-11-08 23:25                     ` Marius Hofert
  2011-11-08 23:37                       ` Jonathan Leech-Pepin
  0 siblings, 1 reply; 17+ messages in thread
From: Marius Hofert @ 2011-11-08 23:25 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Emacs help, Jambunathan K

>>> (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.

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

* Re: How to set up anniversaries/birthdays with org-contacts-anniversaries?
  2011-11-08 23:25                     ` Marius Hofert
@ 2011-11-08 23:37                       ` Jonathan Leech-Pepin
  0 siblings, 0 replies; 17+ messages in thread
From: Jonathan Leech-Pepin @ 2011-11-08 23:37 UTC (permalink / raw)
  To: Marius Hofert; +Cc: nicholas.dokos, Emacs help, Jambunathan K

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

: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.hofert@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)
>
>
> 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.
>
>
>

[-- Attachment #2: Type: text/html, Size: 2073 bytes --]

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

end of thread, other threads:[~2011-11-08 23:37 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-06 11:05 How to set up anniversaries/birthdays with org-contacts-anniversaries? Marius Hofert
2011-11-08 21:03 ` Marius Hofert
2011-11-08 21:33   ` Nick Dokos
2011-11-08 21:43     ` Marius Hofert
2011-11-08 22:07       ` Nick Dokos
2011-11-08 22:16         ` Marius Hofert
2011-11-08 22:33           ` Jambunathan K
2011-11-08 22:36             ` Marius Hofert
2011-11-08 22:50               ` Jambunathan K
2011-11-08 23:06               ` Nick Dokos
2011-11-08 23:13                 ` Marius Hofert
2011-11-08 23:17                   ` Marius Hofert
2011-11-08 23:21                   ` Nick Dokos
2011-11-08 23:25                     ` Marius Hofert
2011-11-08 23:37                       ` Jonathan Leech-Pepin
2011-11-08 23:12             ` Marius Hofert
2011-11-08 22:48           ` Nick Dokos

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