From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: Re: clock based context settings Date: Wed, 20 Jan 2010 09:30:41 +0100 Message-ID: <873a21rxe6.wl%maus.david@gmail.com> References: <4b562f2a.0c07560a.206e.ffff99b6@mx.google.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/mixed; boundary="===============0364025519==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NXW0V-0007ls-I6 for emacs-orgmode@gnu.org; Wed, 20 Jan 2010 03:33:44 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NXW0P-0007kQ-Bq for emacs-orgmode@gnu.org; Wed, 20 Jan 2010 03:33:42 -0500 Received: from [199.232.76.173] (port=37080 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXW0P-0007kA-0J for emacs-orgmode@gnu.org; Wed, 20 Jan 2010 03:33:37 -0500 Received: from mx20.gnu.org ([199.232.41.8]:48099) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NXW0H-0002o0-W2 for emacs-orgmode@gnu.org; Wed, 20 Jan 2010 03:33:36 -0500 Received: from mail-fx0-f228.google.com ([209.85.220.228]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NXVy0-00060s-FQ for emacs-orgmode@gnu.org; Wed, 20 Jan 2010 03:31:08 -0500 Received: by fxm28 with SMTP id 28so2953842fxm.26 for ; Wed, 20 Jan 2010 00:30:46 -0800 (PST) In-Reply-To: <4b562f2a.0c07560a.206e.ffff99b6@mx.google.com> 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: Richard Riley Cc: Emacs-orgmode mailing list --===============0364025519== Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Wed_Jan_20_09:30:37_2010-1"; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit --pgp-sign-Multipart_Wed_Jan_20_09:30:37_2010-1 Content-Type: text/plain; charset=US-ASCII Hi Richard, At Tue, 19 Jan 2010 23:16:08 +0100, Richard Riley wrote: > > > I would like to be able to execute arbitrary elisp when I clock in or > out of a certain org.item This would be very, very useful for defining > variables or even keystrokes on a "per project" basis. Ideally it would > work using inheritance so if an item does not have something then the > project or file level values would be used. > > e.g at the file level: > > #+CLOCKINEXEC: (setq curr-url "project1.com") > > Or at the org item level > > ** touch up picture of the org logo > :PROPERTIES: > :CLOCKINEXEC: (setq curr-url "org-mode.com/images") > :END: > > Would others think this might be useful or is there another way/approach > to achieve something similar? You could use the org-clock-hooks `org-clock-in-hook', `org-clock-out-hook' and `org-clock-cancel-hook' in combination with a function that checks for the desired conditions and sets the variables accordingly. A question that came in my mind: What happens if you clock out or cancel a clock? Are the variables kept or set to a default value? Or to the value they had before clocking in? Regards -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber.... dmjena@jabber.org Email..... maus.david@gmail.com --pgp-sign-Multipart_Wed_Jan_20_09:30:37_2010-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iF4EABEIAAYFAktWvzAACgkQma24O1pEeOahMwD9FWm4bdqEOql65NjTs5w5oz9h XGf35jByiOAMu7EyXGUA/2FfrQOXRLAmqyOskxew4eJD5NU0THgj+ZcH7/RO9/37 =wR8s -----END PGP SIGNATURE----- --pgp-sign-Multipart_Wed_Jan_20_09:30:37_2010-1-- --===============0364025519== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============0364025519==--