mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-12-24 10:38:41 +00:00
Clock: Clock out when done also in indirect buffers
Chris Randle writes: > I have one giant Org-mode file for everything. I frequently use > `C-c C-x b' to take the current node and show it in a new frame > with narrow subtree so that I can concentrate on just that region > of my file. Rather like hoist in GrandView, if anyone remembers > that. > > My Org Manual (6.24b) says "The indirect buffer...will contain > the entire buffer, but will be narrowed to the current > tree. Editing the indirect buffer will also change the original > buffer, but without affecting visibility in that buffer. > > I've noticed that, when working in the new frame, changing the > TODO state of any item within the frame to DONE (when it is the > currently clocked in item) does not stop the clock. Going back to > my main frame and doing the same thing there on the same item > does stop the clock. > > I haven't altered `org-clock-out-when-done', and Emacs reports > its value as t. This was caused by the fact that markers seem to point to the base buffer always, so we need to check if the current buffer's base buffer is equal to the marker buffer.
This commit is contained in:
parent
19f700a606
commit
098cf35983
@ -1,5 +1,8 @@
|
||||
2009-03-23 Carsten Dominik <carsten.dominik@gmail.com>
|
||||
|
||||
* org-clock.el (org-clock-out-if-current): Make buffer detection
|
||||
work in indirect buffers as well.
|
||||
|
||||
* org.el (org-emphasis-regexp-components): Add the exxclamation
|
||||
mark to the post-emphasis characters.
|
||||
|
||||
|
@ -663,7 +663,10 @@ This is used to stop the clock after a TODO entry is marked DONE,
|
||||
and is only done if the variable `org-clock-out-when-done' is not nil."
|
||||
(when (and org-clock-out-when-done
|
||||
(member state org-done-keywords)
|
||||
(equal (marker-buffer org-clock-marker) (current-buffer))
|
||||
(equal (or (buffer-base-buffer (marker-buffer org-clock-marker))
|
||||
(marker-buffer org-clock-marker))
|
||||
(or (buffer-base-buffer (current-buffer))
|
||||
(current-buffer)))
|
||||
(< (point) org-clock-marker)
|
||||
(> (save-excursion (outline-next-heading) (point))
|
||||
org-clock-marker))
|
||||
|
Loading…
Reference in New Issue
Block a user