emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Subject: Bug: Org-Clock-Out in indirect buffer error after refile [9.3 (release_9.3 @ /usr/share/emacs/27.1/lisp/org/)]
@ 2021-07-19 10:43 Eddie Drury
  2021-07-20 17:59 ` Bhavin Gandhi
  0 siblings, 1 reply; 5+ messages in thread
From: Eddie Drury @ 2021-07-19 10:43 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 581 bytes --]

Emacs  : GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.23, cairo version 1.16.0)
 of 2021-01-18, modified by Debian
Package: Org mode version 9.3 (release_9.3 @
/usr/share/emacs/27.1/lisp/org/)

Hi,

When I am working in an indirect buffer and am currently clocked into a
subheading. If I refile this subheading and then run org-clock-out, I get
the error "Clock start time is gone".

When not working in an indirect buffer, Org Mode is able to track this
subtree and clock out of it, which is the expected behaviour.

Thanks in advance.

Regards,

- Eddie Drury

[-- Attachment #2: Type: text/html, Size: 775 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Subject: Bug: Org-Clock-Out in indirect buffer error after refile [9.3 (release_9.3 @ /usr/share/emacs/27.1/lisp/org/)]
  2021-07-19 10:43 Subject: Bug: Org-Clock-Out in indirect buffer error after refile [9.3 (release_9.3 @ /usr/share/emacs/27.1/lisp/org/)] Eddie Drury
@ 2021-07-20 17:59 ` Bhavin Gandhi
  2021-07-22 10:25   ` Eddie Drury
  0 siblings, 1 reply; 5+ messages in thread
From: Bhavin Gandhi @ 2021-07-20 17:59 UTC (permalink / raw)
  To: Eddie Drury; +Cc: emacs-orgmode

Hello Eddie

On Mon, 19 Jul 2021 at 16:15, Eddie Drury <eddie.drury@gmail.com> wrote:
>
> When I am working in an indirect buffer and am currently clocked into a subheading. If I refile this subheading and then run org-clock-out, I get the error "Clock start time is gone".

I'm not sure if this is intended behaviour or a bug, but I was able to
reproduce this with the following steps on the latest master. Can you
confirm if you are doing something similar as well?

Content of test.org

#+begin_src org
* Read Org mode list
** Triage bugs

* Read Emacs bugs list

#+end_src

1. Now go to the "Read Org mode list" entry and run,
   org-tree-to-indirect-buffer (C-c C-x b).
2. Switch to the indirect buffer.
3. Go to the "Triage bugs" entry, and run org-clock-in (C-c C-x C-i).
4. Refile the "Triage bugs" entry to "Read Emacs bugs list" with
   org-refile (C-c C-w)
5. Switch to test.org buffer, and go to the "Triage bugs" entry, and run
   org-clock-out (C-c C-x C-o)
6. This will show "Clock start time is gone"

> When not working in an indirect buffer, Org Mode is able to track this subtree and clock out of it, which is the expected behaviour.

Yes, I found that it is able to track the refile.

-- 
Regards,
Bhavin Gandhi (bhavin192) | https://geeksocket.in


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Subject: Bug: Org-Clock-Out in indirect buffer error after refile [9.3 (release_9.3 @ /usr/share/emacs/27.1/lisp/org/)]
  2021-07-20 17:59 ` Bhavin Gandhi
@ 2021-07-22 10:25   ` Eddie Drury
  2021-07-30 14:23     ` [PATCH] " Ihor Radchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Eddie Drury @ 2021-07-22 10:25 UTC (permalink / raw)
  To: Bhavin Gandhi; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1671 bytes --]

Hi Bhavin,

Thanks for your prompt response.

I have followed those steps and that is the same behaviour I get.

The expected behaviour is for it to clock out of the subtree, instead of
giving the "Clock start time is gone" error.

Regards,

- Eddie Drury

On Wed, 21 Jul 2021 at 02:00, Bhavin Gandhi <bhavin7392@gmail.com> wrote:

> Hello Eddie
>
> On Mon, 19 Jul 2021 at 16:15, Eddie Drury <eddie.drury@gmail.com> wrote:
> >
> > When I am working in an indirect buffer and am currently clocked into a
> subheading. If I refile this subheading and then run org-clock-out, I get
> the error "Clock start time is gone".
>
> I'm not sure if this is intended behaviour or a bug, but I was able to
> reproduce this with the following steps on the latest master. Can you
> confirm if you are doing something similar as well?
>
> Content of test.org
>
> #+begin_src org
> * Read Org mode list
> ** Triage bugs
>
> * Read Emacs bugs list
>
> #+end_src
>
> 1. Now go to the "Read Org mode list" entry and run,
>    org-tree-to-indirect-buffer (C-c C-x b).
> 2. Switch to the indirect buffer.
> 3. Go to the "Triage bugs" entry, and run org-clock-in (C-c C-x C-i).
> 4. Refile the "Triage bugs" entry to "Read Emacs bugs list" with
>    org-refile (C-c C-w)
> 5. Switch to test.org buffer, and go to the "Triage bugs" entry, and run
>    org-clock-out (C-c C-x C-o)
> 6. This will show "Clock start time is gone"
>
> > When not working in an indirect buffer, Org Mode is able to track this
> subtree and clock out of it, which is the expected behaviour.
>
> Yes, I found that it is able to track the refile.
>
> --
> Regards,
> Bhavin Gandhi (bhavin192) | https://geeksocket.in
>

[-- Attachment #2: Type: text/html, Size: 2538 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] Re: Subject: Bug: Org-Clock-Out in indirect buffer error after refile [9.3 (release_9.3 @ /usr/share/emacs/27.1/lisp/org/)]
  2021-07-22 10:25   ` Eddie Drury
@ 2021-07-30 14:23     ` Ihor Radchenko
  2021-09-25 21:10       ` Bastien
  0 siblings, 1 reply; 5+ messages in thread
From: Ihor Radchenko @ 2021-07-30 14:23 UTC (permalink / raw)
  To: Eddie Drury; +Cc: emacs-orgmode, Bhavin Gandhi

[-- Attachment #1: Type: text/plain, Size: 294 bytes --]

Eddie Drury <eddie.drury@gmail.com> writes:

> I have followed those steps and that is the same behaviour I get.
>
> The expected behaviour is for it to clock out of the subtree, instead of
> giving the "Clock start time is gone" error.

I can also reproduce. The fix is attached.

Best,
Ihor


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-not-updating-org-clock-marker-after-refiling-fro.patch --]
[-- Type: text/x-diff, Size: 1290 bytes --]

From 4ad92b3efc8717e3ca871ab83bcb5e23e8faeb35 Mon Sep 17 00:00:00 2001
Message-Id: <4ad92b3efc8717e3ca871ab83bcb5e23e8faeb35.1627654962.git.yantar92@gmail.com>
From: Ihor Radchenko <yantar92@gmail.com>
Date: Fri, 30 Jul 2021 22:16:02 +0800
Subject: [PATCH] Fix not updating org-clock-marker after refiling from
 indirect buffer

* lisp/org.el (org-check-and-save-marker): Save markers in base buffer
of indirect buffer in addition to markers in current buffer.

Fixes bug reported in https://orgmode.org/list/CABa5=g4bvYQoTbBn96tFi9K827u_A+MweqYWWpib_tyFLBdG3g@mail.gmail.com/T/#t
---
 lisp/org.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index eca12a5e7..53fd5b7c7 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -7877,7 +7877,8 @@ (defun org-check-and-save-marker (marker beg end)
   "Check if MARKER is between BEG and END.
 If yes, remember the marker and the distance to BEG."
   (when (and (marker-buffer marker)
-	     (equal (marker-buffer marker) (current-buffer))
+	     (or (equal (marker-buffer marker) (current-buffer))
+                 (equal (marker-buffer marker) (buffer-base-buffer (current-buffer))))
 	     (>= marker beg) (< marker end))
     (push (cons marker (- marker beg)) org-markers-to-move)))
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Re: Subject: Bug: Org-Clock-Out in indirect buffer error after refile [9.3 (release_9.3 @ /usr/share/emacs/27.1/lisp/org/)]
  2021-07-30 14:23     ` [PATCH] " Ihor Radchenko
@ 2021-09-25 21:10       ` Bastien
  0 siblings, 0 replies; 5+ messages in thread
From: Bastien @ 2021-09-25 21:10 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Eddie Drury, emacs-orgmode, Bhavin Gandhi

Hi Ihor,

Ihor Radchenko <yantar92@gmail.com> writes:

> Eddie Drury <eddie.drury@gmail.com> writes:
>
>> I have followed those steps and that is the same behaviour I get.
>>
>> The expected behaviour is for it to clock out of the subtree, instead of
>> giving the "Clock start time is gone" error.
>
> I can also reproduce. The fix is attached.

Applied, thanks!


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-09-25 21:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-19 10:43 Subject: Bug: Org-Clock-Out in indirect buffer error after refile [9.3 (release_9.3 @ /usr/share/emacs/27.1/lisp/org/)] Eddie Drury
2021-07-20 17:59 ` Bhavin Gandhi
2021-07-22 10:25   ` Eddie Drury
2021-07-30 14:23     ` [PATCH] " Ihor Radchenko
2021-09-25 21:10       ` Bastien

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).