From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Automatic Elapsed Time Stamps? Date: Sat, 28 Jul 2007 00:44:08 +0200 Message-ID: <876445wjpj.fsf@bzg.ath.cx> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IEYXg-0003aC-N5 for emacs-orgmode@gnu.org; Fri, 27 Jul 2007 18:44:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IEYXf-0003Ux-Ah for emacs-orgmode@gnu.org; Fri, 27 Jul 2007 18:44:15 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IEYXf-0003UH-5H for emacs-orgmode@gnu.org; Fri, 27 Jul 2007 18:44:15 -0400 Received: from ug-out-1314.google.com ([66.249.92.175]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IEYXe-0006hz-M3 for emacs-orgmode@gnu.org; Fri, 27 Jul 2007 18:44:14 -0400 Received: by ug-out-1314.google.com with SMTP id 34so895418ugf for ; Fri, 27 Jul 2007 15:44:13 -0700 (PDT) In-Reply-To: (Alan Dove's message of "Fri\, 27 Jul 2007 16\:07\:39 -0400") 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: emacs-orgmode@gnu.org --=-=-= Alan Dove writes: > In my work, I often take notes at a meeting while simultaneously > taping it. Same here. In addition to what Adam sent, i see two solutions: 1. Use org-clock-in, org-clock-out and org-clock-report. Put the time report (C-c C-x C-r) at the beginning of the first level of your writing, then clock (out and) in each time you insert a new sublevel. Make sure clock-out is not a member of `org-log-done' so that you won't be prompted for a log entry each time you clock out. 2. Use an `Elapsed_time' property. Here is a quick hack that could help: --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline; filename=bzg-org-step-report.el (defvar bzg-step-time-report-time nil) (defun bzg-step-time-report-initialize (project) "Insert a 1st-level project at point and start a timer." (interactive "sProject name: ") (insert "* " project " :PROPERTIES: :COLUMNS: %25ITEM %5Elapsed_time(Elapsed Time){:} :Elapsed_time: :END:\n\n") (setq bzg-step-time-report-time (current-time))) (defun bzg-step-time-report-add-step (&optional step) "Insert a 2nd-level headline for current step." (interactive "P") (let ((elapsed-time (format-time-string "%H:%M" (time-since bzg-step-time-report-time) t)) (step-name (when step (read-from-minibuffer "Step name: ")))) (save-excursion (re-search-backward ":Elapsed_time:" nil t) (goto-char (match-end 0)) (insert " " elapsed-time)) (insert "** " (or step-name "Step") " :PROPERTIES: :Elapsed_time: :END:\n\n")) (setq bzg-step-time-report-time (current-time))) (defun bzg-step-time-report-finish () "Insert a 2nd-level headline for current step." (interactive) (let ((elapsed-time (format-time-string "%H:%M" (time-since bzg-step-time-report-time) t))) (save-excursion (re-search-backward ":Elapsed_time:" nil t) (goto-char (match-end 0)) (insert " " elapsed-time)))) --=-=-= What it does: `bzg-step-time-report-initialize' will prompt for the name of the project. This headline have a property called "Elapsed_time". It's computed when you switch to the column view (C-c C-x C-x) or when you press C-c C-c in front of it. `bzg-step-time-report-add-step' will update the `Elapsed_time' value of the previous headline and insert a new one. `bzg-step-time-report-finish' will just update the `Elapsed_time' value of the previous headline. Of course, this could be refined... but I hope it might help! Regards, PS: You might also have a look at the `run-at-time' function, but either you need to get the time intervals between steps, or you need to know on what frequency they are inserted, right? See (info "(elisp)Timers") -- Bastien --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--