emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: Eddie Drury <eddie.drury@gmail.com>
Cc: emacs-orgmode@gnu.org, Bhavin Gandhi <bhavin7392@gmail.com>
Subject: [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/)]
Date: Fri, 30 Jul 2021 22:23:59 +0800	[thread overview]
Message-ID: <87y29nnam8.fsf@localhost> (raw)
In-Reply-To: <CABa5=g4bvYQoTbBn96tFi9K827u_A+MweqYWWpib_tyFLBdG3g@mail.gmail.com>

[-- 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


  reply	other threads:[~2021-07-30 14:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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     ` Ihor Radchenko [this message]
2021-09-25 21:10       ` [PATCH] " Bastien

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=87y29nnam8.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=bhavin7392@gmail.com \
    --cc=eddie.drury@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).