emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Leo Vivier <leo.vivier@gmail.com>
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 00:26:32 +0100	[thread overview]
Message-ID: <87pnufa72v.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87lg57bxh1.fsf@gmail.com> (Leo Vivier's message of "Sun, 02 Dec 2018 19:22:02 +0100")

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,

-- 
Nicolas Goaziou

  reply	other threads:[~2018-12-05 23:26 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 [this message]
2018-12-06 10:17   ` Leo Vivier

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=87pnufa72v.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=leo.vivier@gmail.com \
    /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).