Bruce Robertson <[email protected]> writes:

> * lisp/org-clock.el (org-clock-kill-emacs-query): Wrap the `org-clock-out'
> and `save-buffer' calls in `condition-case', reporting any error instead of
> letting it escape the hook.
>
> `org-clock-kill-emacs-query' runs from `kill-emacs-query-functions', where a
> non-nil return value is what allows the exit to proceed.  The function ends
> with an unconditional t and a comment saying so, but `org-clock-out' is
> called without its FAIL-QUIETLY argument, so any error it signals propagates
> out of the hook and that t is never reached.  Emacs then refuses to exit.
> ...
> With this change the same recipe returns t and reports "Could not clock out:
> Clock start time is gone" in the echo area.

Thanks!
Applied onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=c4ea1b908

> Note this only guarantees that a lost marker cannot trap the user in a
> session; it does not attempt to keep the marker in sync, which is the larger
> issue behind the "Clock start time is gone" reports going back to 2017.

I doubt we can fix this in all the edge cases, but we might in some, via
`org-save-markers-in-region' / `org-reinstall-markers-in-region'

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to