From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nathan Neff Subject: Re: Prompt for time when clocking in? Date: Thu, 20 Oct 2011 11:15:46 -0500 Message-ID: References: <25337.1319038504@alphaville.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:53896) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGvHe-0004DJ-7G for emacs-orgmode@gnu.org; Thu, 20 Oct 2011 12:15:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RGvHc-0002o6-QV for emacs-orgmode@gnu.org; Thu, 20 Oct 2011 12:15:54 -0400 Received: from mail-bw0-f41.google.com ([209.85.214.41]:45543) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGvHc-0002nw-BX for emacs-orgmode@gnu.org; Thu, 20 Oct 2011 12:15:52 -0400 Received: by bkbzu5 with SMTP id zu5so4283544bkb.0 for ; Thu, 20 Oct 2011 09:15:50 -0700 (PDT) In-Reply-To: <25337.1319038504@alphaville.dokosmarshall.org> 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: nicholas.dokos@hp.com Cc: emacs-orgmode Some progress -- I used Nick's suggestion combined with the org-read-date function. This is my first attempt -- It will prompt you for a time, and clock in to the headline that the cursor is on with that time. (defun njn/clock-in-at-time() (interactive) (setq start-time (org-read-date 't 't)) (org-clock-in nil start-time) ) It's a bit wonky if you clock in to a past time, and then you want to resolve that clock, but my main use-case for now is this: 1) I start doing something 2) I forgot to clock in 3) I don't want to press 8 keys in order to clock in 15 minutes ago. This solution should work for now. Although, I could see it being a handy way to prompt for clock-in *and* clock-out times. Thanks for the suggestions, --Nate On Wed, Oct 19, 2011 at 10:35 AM, Nick Dokos wrote: > John Hendy wrote: > >> On Wed, Oct 19, 2011 at 9:54 AM, Nathan Neff wrote: >> > Is there a way to pull up a date/time prompt when clocking in to a task? >> > >> > Sometimes, I started a task 15 minutes ago, and have to go through the following >> > steps: >> > >> > 1) clock in on the task, >> > 2) Go to the CLOCK section for that header and press tab to open it >> > 3) Fix the clock-in time >> > >> > If it's not built in, does anyone have any slick functions that would accomplish >> > the same thing? :-) >> >> Check out a thread I started a bit back on this exact topic: >> --- http://www.mail-archive.com/emacs-orgmode@gnu.org/msg40498.html >> >> It wasn't exactly what I expected, the suggestion by Bernt for `M-x >> org-resolve-clocks` works reasonably well if you are trying to clock >> back-to-back activities. Post back after you read that perhaps? Maybe >> you'll find something helpful. >> > > org-clock-in takes an optional start-time argument which is used instead > of the current time when non-nil. So I tried > > (setq ct (current-time)) > (setq start-time (cons (car ct) (list (- (cadr ct) 900) (caddr ct)))) > > and started a clock on a task with > > ESC ESC : (org-clock-in nil start-time) > > and it got clocked in 15 minutes before the current time. > > Now I don't propose this as a good UI :-), but it would require just a > small wrapper for it to dtrt. > > HTH, > Nick > > >