emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Austin Frank <austin.frank@gmail.com>
To: emacs-orgmode@gnu.org
Subject: application switching hook
Date: Tue, 02 Jun 2009 15:04:10 -0400	[thread overview]
Message-ID: <m0fxeilaol.fsf@gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1737 bytes --]

Hi all--

I'd like to extend my time tracking to some activities outside of emacs.
More specifically, I'd like to be prompted to log a note in the active
time clock block whenever I change to an application outside of emacs.
I'm trying to be honest with myself about why I move from one
application to another (the difference between "needed a reference from
Zotero" and "got bored so went to check the score of the baseball
game").

In Mac OS X, I switch applications using the Command-Tab key sequence.
I suspect that the solution to my problem involves writing some
applescript that fires a call to emacsclient every time Command-Tab is
pressed, or perhaps every time the focused application changes.

I think the relevant command line call will be something like

  emacsclient -e "(progn (org-clock-goto) (org-add-note))"

But maybe other people have better ideas for this part of the solution.
Perhaps calling a remember template with the current clock as its target
(using whichever function drives `C-2 C-c C-c' in the remember buffer)
would be better?


Unfortunately, I know nothing of applescript and haven't turned up any
promising leads in web searches.  I know I've seen some applescript
posted to this list before, so someone out there must know something
about it.  Any chance one of you folks has an idea about how to
implement this functionality?

Alternatively, does emacs have something like an
`emacs-loses-focus-hook'?  I don't see anything using `M-x apropos' or
`M-x apropos-variable' for "focus", but perhaps I'm looking in the wrong
place.

Thanks for any comments,
/au


-- 
Austin Frank
http://aufrank.net
GPG Public Key (D7398C2F): http://aufrank.net/personal.asc

[-- Attachment #1.2: Type: application/pgp-signature, Size: 193 bytes --]

[-- Attachment #2: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

                 reply	other threads:[~2009-06-02 19:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=m0fxeilaol.fsf@gmail.com \
    --to=austin.frank@gmail.com \
    --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).