From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Handling phone calls Date: Sat, 23 Feb 2008 20:20:34 -0500 Message-ID: <14507.1203816034@gamaville.dokosmarshall.org> References: <87tzkhoi45.fsf@gollum.intra.norang.ca> Reply-To: nicholas.dokos@hp.com Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JT5ZA-0003ZH-Bs for emacs-orgmode@gnu.org; Sat, 23 Feb 2008 20:22:08 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JT5Z9-0003Yr-0W for emacs-orgmode@gnu.org; Sat, 23 Feb 2008 20:22:07 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JT5Z8-0003Yn-RA for emacs-orgmode@gnu.org; Sat, 23 Feb 2008 20:22:06 -0500 Received: from qmta04.westchester.pa.mail.comcast.net ([76.96.62.40]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JT5Z8-00020h-9b for emacs-orgmode@gnu.org; Sat, 23 Feb 2008 20:22:06 -0500 In-Reply-To: Message from Bernt Hansen of "Sat, 09 Feb 2008 17:55:06 EST." <87tzkhoi45.fsf@gollum.intra.norang.ca> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bernt Hansen Cc: emacs-orgmode@gnu.org Hi Bernt, I tried to get your phone handling method running on my system, more for education than for need. I had problems setting it up but I did get an education !-) The problem that I had is that when the Remember buffer was set up, the entry contained the CLOCK-IN marker but no clock was running. After some head scratching, I found out that the sequencing seemed to be wrong: my-phone-call() -> locally set the org-remember-templates to the special my-phone-remember-templates get a name and search bbdb call org-remember() -> call remember() -> run the remember-annotation-functions call remember-mode() -> run the remember-mode-hook functions Now the value of remember-mode-hook was (my-start-clock-if-needed org-remember-apply-template) because of my initialization sequence: I first set up orgmode and remember and then set up the phone handling: add-hook added my-start-clock-if-needed to the beginning of the list - but that's exactly backwards: when the hook is run, my-start-clock-if-needed is run first, finds no CLOCK-IN marker in the remember buffer and does nothing; then org-remember-apply-template is run and adds the template to the remember buffer, CLOCK-IN marker and all. I fixed the problem by modifying the add-hook invocation to add the my-start-clock-if-needed function to the end of the hook: (add-hook 'remember-mode-hook 'my-start-clock-if-needed 'append) and everything seems to work properly. I hope the fix and the explanation help anybody who is trying to set this up. BTW, thanks very much for posting this! I think this is the kind of thing that can help org newbies like me get their heads around its capabilities. I've been taking baby steps into more capabilities and I find that the documentation, good as it is, leaves me wondering about how to use a particular feature (the usual questions that I have seen on the list start with "what good is such-and-such?", where you can substitute e.g tags, properties, dynamic blocks, column-view etc in the question) and conversely, what org feature(s) could I use in order to solve such-and-such a problem? Part of the problem is of course that org provides mechanisms and it is up to you to figure out the best way (or perhaps a good way - or even a bad way!) to get it done. So having non-trivial, interesting, but simple to implement solutions to problems such as the one you posed is indeed very welcome. Regards, Nick