emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Bernt Hansen <bernt@norang.ca>
Cc: emacs-orgmode@gnu.org
Subject: Re: Handling phone calls
Date: Sat, 23 Feb 2008 20:20:34 -0500	[thread overview]
Message-ID: <14507.1203816034@gamaville.dokosmarshall.org> (raw)
In-Reply-To: Message from Bernt Hansen <bernt@norang.ca> of "Sat, 09 Feb 2008 17:55:06 EST." <87tzkhoi45.fsf@gollum.intra.norang.ca>

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

  parent reply	other threads:[~2008-02-24  1:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-09 22:55 Handling phone calls Bernt Hansen
2008-02-10  7:42 ` Carsten Dominik
2008-02-10 11:09   ` Bastien
2008-02-24  1:20 ` Nick Dokos [this message]
2009-11-13 19:11 ` Gregory J. Grubbs
2009-11-13 19:28   ` Bernt Hansen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14507.1203816034@gamaville.dokosmarshall.org \
    --to=nicholas.dokos@hp.com \
    --cc=bernt@norang.ca \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).