From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: Org-mode version 6.32trans (release_6.32b.127.g471c2); Clocking out moves point to clock entry Date: Mon, 09 Nov 2009 17:00:42 -0500 Message-ID: <87hbt3e4tx.fsf@gollum.intra.norang.ca> References: <200911091712.nA9HC1LR026406@gollum.intra.norang.ca> <87bpjbcx7u.fsf@gollum.intra.norang.ca> <76FAFC2E-A305-4796-802A-705B60B3D5E5@gmail.com> <87ocnbe56i.fsf@gollum.intra.norang.ca> <40E226D8-F9E2-482A-8A2B-097FB324CE45@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N7cI8-00068O-8V for emacs-orgmode@gnu.org; Mon, 09 Nov 2009 17:00:52 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N7cI4-00066m-C6 for emacs-orgmode@gnu.org; Mon, 09 Nov 2009 17:00:51 -0500 Received: from [199.232.76.173] (port=58026 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N7cI4-00066f-7B for emacs-orgmode@gnu.org; Mon, 09 Nov 2009 17:00:48 -0500 Received: from mho-01-ewr.mailhop.org ([204.13.248.71]:60521) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N7cI1-0007VW-R1 for emacs-orgmode@gnu.org; Mon, 09 Nov 2009 17:00:46 -0500 In-Reply-To: <40E226D8-F9E2-482A-8A2B-097FB324CE45@gmail.com> (Carsten Dominik's message of "Mon\, 9 Nov 2009 22\:55\:28 +0100") 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: Carsten Dominik Cc: emacs-orgmode@gnu.org I think it's because in my case I have two tasks in the same file I'm clocking in. * STARTED first clocking task ... * TODO second clocking task and updating the first clocking task moves the point in the buffer on me so I lose my place (at the second clocking task). So clocking in the second task while the first is clocking just moves point to first task, clocks it out, then clocks it in again (since the point moved) Does that make sense? -Bernt Carsten Dominik writes: > Hmmm. > > I do not understand why this makes a difference, but I will make these > changes. Thanks a lot. > > This was on of the big-sweep changes that happen in Emacs all the > time, where someone thinks we should use this and that style. > > This looked trivial, so I accepted the changes. Too early it seems. > > - Carsten > > On Nov 9, 2009, at 10:53 PM, Bernt Hansen wrote: > >> Reverting just the org-clock.el patches seems to fix it too. >> >> -Bernt >> >> --8<---------------cut here---------------start------------->8--- >> commit 01b1eb143f027bc6cdf54d95bd15fc03f2e03208 >> Author: Bernt Hansen >> Date: Mon Nov 9 14:27:03 2009 -0500 >> >> Revert part of "Use with-current-buffer instead of save-excursion >> set-buffer where possible" >> >> This reverts the clocking changes in commit >> 7c0a16e2566e1cc3bb3c9f6b7571efe21f323a3c. >> >> diff --git a/lisp/org-clock.el b/lisp/org-clock.el >> index fc1e977..29cdf83 100644 >> --- a/lisp/org-clock.el >> +++ b/lisp/org-clock.el >> @@ -1103,7 +1103,8 @@ If there is no running clock, throw an error, >> unless FAIL-QUIETLY is set." >> (if (not (marker-buffer org-clock-marker)) >> (if fail-quietly (throw 'exit t) (error "No active clock"))) >> (let (ts te s h m remove) >> - (with-current-buffer (marker-buffer org-clock-marker) >> + (save-excursion >> + (set-buffer (marker-buffer org-clock-marker)) >> (save-restriction >> (widen) >> (goto-char org-clock-marker) >> @@ -1168,7 +1169,8 @@ If there is no running clock, throw an error, >> unless FAIL-QUIETLY is set." >> (interactive) >> (if (not (marker-buffer org-clock-marker)) >> (error "No active clock")) >> - (with-current-buffer (marker-buffer org-clock-marker) >> + (save-excursion >> + (set-buffer (marker-buffer org-clock-marker)) >> (goto-char org-clock-marker) >> (delete-region (1- (point-at-bol)) (point-at-eol)) >> ;; Just in case, remove any empty LOGBOOK left over >> --8<---------------cut here---------------end--------------->8--- >> >> >> Carsten Dominik writes: >> >>> Hi Bernt, >>> >>> could I ask you to only revert that patch in org-clock.el and >>> see if that is enought to fix it? >>> >>> - Carsten >>> >>> >>> On Nov 9, 2009, at 8:30 PM, Bernt Hansen wrote: >>> >>>> Bernt Hansen writes: >>>> >>>>> Remember to cover the basics, that is, what you expected to happen >>>>> and >>>>> what in fact did happen. You don't know how to make a good >>>>> report? See >>>>> >>>>> http://orgmode.org/manual/Feedback.html#Feedback >>>>> >>>>> Your bug report will be posted to the Org-mode mailing list. >>>>> ------------------------------------------------------------------------ >>>>> >>>>> Clocking out of a task moves point to the clock entry being closed. >>>>> This makes my workaround for clocking in a new task (just use a >>>>> speed >>>>> key O to clock out and I to clock in) fail since we jump away from >>>>> the >>>>> task that I want to clock in. >>>>> >>>>> Emacs : GNU Emacs 22.2.1 (i486-pc-linux-gnu, GTK+ Version 2.12.11) >>>>> of 2008-11-09 on raven, modified by Debian >>>>> Package: Org-mode version 6.32trans (release_6.32b.127.g471c2) >>>> >>>> Reverting this commit seems to fix it >>>> 7c0a16e (Use with-current-buffer instead of save-excursion set- >>>> buffer where possible, 2009-11-05) >>>> >>>> -Bernt >>>> >>>> >>>> _______________________________________________ >>>> 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 >>> >>> - Carsten >>> >>> >>> >>> >>> >>> _______________________________________________ >>> 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 > > - Carsten