emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Leo Vivier <leo.vivier@gmail.com>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: emacs-orgmode@gnu.org
Subject: Re: Bug: ‘(org-resolve-clocks)’  picks the wrong target for placing a new clock-drawer when ‘org-clock-out-remove-zero-time-clocks’ is set to t [9.1.14 (9.1.14-9-g131531-elpa @ ~/.emacs.d/elpa/org-20181126/)]
Date: Thu, 06 Dec 2018 11:17:13 +0100	[thread overview]
Message-ID: <87zhtj2c46.fsf@gmail.com> (raw)
In-Reply-To: <87pnufa72v.fsf@nicolasgoaziou.fr>

Hello,

Thank you for your quick patch.
Since I wasn’t able to solve it on my own, I’ll take a look at 
your solution to understand what you did.

Have a great day.

Best,

Nicolas Goaziou writes:

> Hello,
>
> Leo Vivier <leo.vivier@gmail.com> writes:
>
>> Hello,
>>
>> There seems to be a bad interaction between 
>> ‘(org-resolve-clocks)’ and
>> ‘org-clock-out-remove-zero-time-clocks’ set to t. Whilst the 
>> right
>> tree is targeted by ‘(org-resolve-clocks)’ to delete the 
>> clock-line
>> and clock-drawer, it adds a new clock-drawer in the next tree 
>> rather
>> than on the one being acted on.
>>
>> I was able to replicate this problem with ‘emacs -Q’.
>>
>>
>> DESCRIPTION:
>>
>>
>> I use org-clock regularly, and recently re-discovered
>> ‘org-clock-out-remove-zero-time-clocks’. When I forget to clock 
>> an
>> item, I run the following commands in quick succession:
>> # ------------------
>> (org-clock-in)
>> (org-resolve-clocks)
>> <INPUT>: g 10 <ENTER> (For indicating that I ‘got back’ 10 min 
>> ago)
>> # ------------------
>>
>>
>> Because those commands are run in quick succession, the time 
>> between
>> ‘(org-clock-in)’ and ‘(org-resolve-clocks)’ is usually equal to 
>> 0 min.
>> Therefore, when ‘(org-resolve-clocks)’ calls ‘(org-clock-out)’ 
>> after
>> pressing <ENTER>, the clock-line is deleted, and if the 
>> clock-drawer
>> was created by ‘(org-clock-in)’, it also gets deleted.
>>
>>
>> The problem occurs in this context (‘|’ represents ‘(point)’):
>> # ------------------
>> * Subtree 1
>> ** Item|
>> * Subtree 2
>> # ------------------
>> ‘Item’ is the subtree we want to clock in the past. ‘Subtrees 1 
>> & 2’
>> are regular subtrees without any newlines separating them (the
>> white-space is important).
>> Please note that I was only able to get ‘(org-resolve-clocks)’ 
>> to
>> trigger in an agenda-file with already had clocking info. I 
>> recommend
>> that you try the snippet in one of your own agenda-files rather 
>> than
>> trying it in a blank buffer.
>
> Fixed. Thank you.
>
> Regards,


-- 
Leo Vivier
English Studies & General Linguistics
Master Student, English Department
Université Rennes 2

      reply	other threads:[~2018-12-06 10:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-02 18:22 Bug: ‘(org-resolve-clocks)’ picks the wrong target for placing a new clock-drawer when ‘org-clock-out-remove-zero-time-clocks’ is set to t [9.1.14 (9.1.14-9-g131531-elpa @ ~/.emacs.d/elpa/org-20181126/)] Leo Vivier
2018-12-05 23:26 ` Nicolas Goaziou
2018-12-06 10:17   ` Leo Vivier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zhtj2c46.fsf@gmail.com \
    --to=leo.vivier@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).