From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: clocking in and out in remember buffers - seems to be buggy Date: Thu, 24 Jan 2008 09:33:35 +0100 Message-ID: <6E8F4EA5-D1B1-4B80-9601-70E1A8B5A849@science.uva.nl> References: Mime-Version: 1.0 (Apple Message framework v915) Content-Type: multipart/mixed; boundary="===============1850187360==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JHxWs-0003Bn-94 for emacs-orgmode@gnu.org; Thu, 24 Jan 2008 03:33:46 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JHxWo-0003Ay-Km for emacs-orgmode@gnu.org; Thu, 24 Jan 2008 03:33:45 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JHxWn-0003AW-Dy for emacs-orgmode@gnu.org; Thu, 24 Jan 2008 03:33:41 -0500 Received: from ug-out-1314.google.com ([66.249.92.173]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JHxWm-0001QK-Tg for emacs-orgmode@gnu.org; Thu, 24 Jan 2008 03:33:41 -0500 Received: by ug-out-1314.google.com with SMTP id a2so260265ugf.48 for ; Thu, 24 Jan 2008 00:33:40 -0800 (PST) In-Reply-To: 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: Rainer Stengele Cc: emacs-orgmode@gnu.org --===============1850187360== Content-Type: multipart/alternative; boundary=Apple-Mail-2--481884183 --Apple-Mail-2--481884183 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On Jan 22, 2008, at 10:04 PM, Rainer Stengele wrote: > I use to clock in a task when beginning to write in a remember buffer. > For example when receive a phone call from a customer I pop up a > remember template and the first thing I do is to start the clock. > > - it would be very nice to have a way to do this automatically, > maybe a certain variable ... You could use remember-mode-hook to run org-clock-in, maybe depending on some string that you find and remove in the buffer. The string could be part of the template, for example CLOCK-IN: (add-hook 'remember-mode-hook 'my-start-clock-if-needed) (defun my-start-clock-if-needed () (save-excursion (goto-char (point-min)) (when (re-search-forward " *CLOCK-IN *" nil t) (replace-match "") (org-clock-in)))) > After writing down notes and doing some stuff, documenting further > in the clocked in remember buffer, I finally want to save and close > the remember template. > After for example "C-u C-c C-c" I am asked if I want to clock out... The query happens when the buffer gets killed - by then it is too late, the content of the buffer has already been filed away. I will (in 5.20) have a check if the clock is running in the remember buffer before allowing you it file it. This will not be an automatic clock-out because that would lead to trouble with possibly adding a note about clocking out. But it will stop you from exiting without clocking out first. - Carsten --Apple-Mail-2--481884183 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable
On Jan 22, 2008, = at 10:04 PM, Rainer Stengele wrote:

I use to = clock in a task when beginning to write in a remember buffer.
For = example when receive a phone call from a customer I pop up a remember = template and the first thing I do is to start the clock.

- it = would be very nice to have a way to do this automatically, maybe a = certain variable ...

You could use = remember-mode-hook to run org-clock-in, maybe depending
on = some string that you find and remove in the buffer.  The string = could
be part of the template, for example = CLOCK-IN:

(add-hook = 'remember-mode-hook 'my-start-clock-if-needed)
(defun = my-start-clock-if-needed = ()
  (save-excursion
   =  (goto-char (point-min))
    (when = (re-search-forward " *CLOCK-IN *" nil t)
     =   (replace-match "")
       = (org-clock-in))))

After = writing down notes and doing some stuff, documenting further in the = clocked in remember buffer, I finally want to save and close the = remember template.
After for example "C-u C-c C-c" I am asked if I = want to clock out...

The query happens when the = buffer gets killed - by then it is too late, the
content of = the buffer has already been filed away.

I will (in 5.20) have a = check if the clock is running in the remember buffer
before = allowing you it file it.  This will not be an automatic = clock-out
because that would lead to trouble with possibly = adding a note about
clocking out.  But it will stop you = from exiting without clocking out first.

- Carsten



= --Apple-Mail-2--481884183-- --===============1850187360== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============1850187360==--