From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: org-mobile-push Date: Sat, 01 Oct 2011 02:40:35 -0400 Message-ID: <3311.1317451235@alphaville.dokosmarshall.org> References: <20110929161328.GA8701@panahar> <23209.1317315273@alphaville.dokosmarshall.org> <20110929233440.GA17073@panahar> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([140.186.70.92]:45100) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9tIF-00086Q-BJ for emacs-orgmode@gnu.org; Sat, 01 Oct 2011 02:43:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R9tID-0006Zn-NW for emacs-orgmode@gnu.org; Sat, 01 Oct 2011 02:43:27 -0400 Received: from g6t0187.atlanta.hp.com ([15.193.32.64]:28404) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9tID-0006Zg-Jr for emacs-orgmode@gnu.org; Sat, 01 Oct 2011 02:43:25 -0400 Received: from g5t0029.atlanta.hp.com (g5t0029.atlanta.hp.com [16.228.8.141]) by g6t0187.atlanta.hp.com (Postfix) with ESMTP id 16039285A2 for ; Sat, 1 Oct 2011 06:43:23 +0000 (UTC) In-Reply-To: Message from Vikas Rawal of "Fri, 30 Sep 2011 05:04:40 +0530." <20110929233440.GA17073@panahar> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: nicholas.dokos@hp.com Vikas Rawal 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 "KEYS=t TITLE: ALL TODO "))) (agenda "" ((org-agenda-title-append "KEYS=n#1 TITLE: Agenda and all TODO's "))) (alltodo nil ((org-agenda-title-append "KEYS=n#2 TITLE: Agenda and all TODO's ")))) ((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 >