emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] org-mobile-push


From: Nick Dokos
Subject: Re: [O] org-mobile-push
Date: Sat, 01 Oct 2011 02:40:35 -0400

Vikas Rawal <address@hidden> wrote:

> Thanks Nick and Jambunathan for taking the trouble to respond.
> 
> > 
> > So pretty please: when you get an error, *at the very least*, do
> > 
> >    M-x toggle-debug-on-error
> 
> Thanks nick for teaching my how to use back-trace. Here is the
> output. May I request you to help identify what could be causing the
> problem.
> 

The backtrace shows (you read it from the bottom up) that the following sequence
of calls took place:

   org-mobile-push -> org-mobile-create-sumo-agenda ->
     org-store-agenda-views -> org-batch-store-agenda-views ->
       org-agenda(nil "X") -> org-agenda-run-series("SUMO" ...) ->
         org-agenda-list -> org-get-entries-from-diary ->
           diary-list-entries -> run the diary-hook ->
             appt-make-list

In trying to call this last function, emacs gets an error: the function
is not defined.

Basically what happens is that org-mobile-push calculates the agenda, by
calling org-agenda-list. This function checks the value of the variable
org-agenda-include-diary, which in your case must be t, so it tries to
add agenda entries from the diary.  It calls org-get-entries-from-diary
to do that, which calls diary-list-entries. This one runs the diary-hook
and somewhere in your init files you must have done something like
this:

  (add-hook 'diary-hook (function appt-make-list))

When the hook is run, emacs tries to call the function, does not find it and
complains.

To fix it, change the above line to

  (require 'appt)
  (add-hook 'diary-hook (function appt-make-list))

The (require 'appt) makes sure that the file that defines this function is
loaded, the function is defined when emacs needs to call it and the problem
is resolved.

Strictly speaking, the function does not need to be defined that early:
it only needs to be defined before it is called, but if you are going to
call it, you might as well do it early. If that's not desirable for some
reason, you can use the autoload mechanism (see the emacs manual for
that).

Note that there are two customizations (the setting of
org-agenda-include-diary to t and the setting of diary-hook) that caused
your problem. I don't include the diary in my agenda, so I would not
have seen the problem at all. That's one of the reasons why it's
important for everybody to have the Pavlovian response:

          error --> must get backtrace

It can pinpoint where *your* problem is and show the way to a solution.

HTH,
Nick


> Debugger entered--Lisp error: (void-function appt-make-list)
>   appt-make-list()
>   run-hooks(diary-hook)
>   diary-list-entries((9 26 2011) 1)
>   byte-code("\301\302!\203\nfter>"))) (alltodo nil ((org-agenda-title-append 
> "<after>KEYS=t TITLE: ALL TODO </after>"))) (agenda "" 
> ((org-agenda-title-append "<after>KEYS=n#1 TITLE: Agenda and all TODO's 
> </after>"))) (alltodo nil ((org-agenda-title-append "<after>KEYS=n#2 TITLE: 
> Agenda and all TODO's </after>")))) ((org-agenda-compact-blocks nil)) 
> ("/home/vikas/Dropbox/MobileOrg/agendas.org")))
>   ...
>   org-agenda(nil "X")
>   (let ((org-agenda-compact-blocks nil)) (org-agenda nil thiscmdkey))
>   eval((let ((org-agenda-compact-blocks nil)) (org-agenda nil thiscmdkey)))
>   ...
>   ...
>   (org-batch-store-agenda-views)
>   eval((org-batch-store-agenda-views))
>   org-store-agenda-views()
>   org-mobile-create-sumo-agenda()
>   org-mobile-push()
>   call-interactively(org-mobile-push t nil)
>   execute-extended-command(nil)
>   call-interactively(execute-extended-command nil nil)
> 
> > which means that you can load the file and therefore define the function
> > by inserting
> > 
> >     (require 'appt)
> 
> Thanks Jambunathan and Nick. This indeed solves the problem.
> 
> Vikas
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]