emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Bug: Bug: org-clock commands spawn drawer outside of narrowing [9.2.


From: Leo Vivier
Subject: [O] Bug: Bug: org-clock commands spawn drawer outside of narrowing [9.2.1 (9.2.1-2-gc6d37c-elpaplus @ /home/zaeph/.emacs.d/elpa/org-plus-contrib-20190204/)]
Date: Mon, 11 Feb 2019 19:44:10 +0100

Hello,

Version info:
- Emacs : GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version
  3.22.30), of 2018-07-05
- Package: Org mode version 9.2.1 (9.2.1-2-gc6d37c-elpaplus)

The bug only happens in narrowed org-mode buffers when the tree at
point (or targeted by the resolving) is a single line not followed by a
blank line.

I was able to replicate the problem with `emacs -q`.

MWE:
--------------------------------[START]--------------------------------
* Tree 1
* Tree 2
---------------------------------[END]---------------------------------

- Narrow to ‘Tree 1’l
- Clock in.

Observations:
- No clock drawer visible in the narrowed buffer.
- Feedback in the minibuffer that the clock was started.
- Widening the buffer confirms the presence of the buffer where it
  should be.

Whilst the observations would lead one to think that everything ‘Just
Works™’, it causes a slew of problems.  Two examples:
- After clocking in, adding a new heading ‘Subtree’ bellow ‘Tree 1’
  would make the drawer belong to ‘Subtree’ instead of ‘Tree 1’
- `org-clock-out-when-done` isn’t respected since the drawer is not
  visible

It seems to be part of a larger set of bugs related to single-line
trees, such as the one I’d reported before and which was addressed in
503ede74bc0a1db59fd2fb7bac0bf1ba7352d15b.

I tried to fix it on my own by tracking down the problem with edebug,
and that led me to the `save-restriction` used in `org-clock-in`,
`org-clock-out`, and `org-clock-resolve-clock`.  Those calls to
`save-restriction` are sometimes embedded into macros, such as
`org-with-wide-buffer` or `org-with-point-at`.

I initially thought that replacing those calls in favour of a `widen`
followed by a `org-narrow-to-subtree` would refresh the bounds of the
narrowing.  This proved to be a lot more finicky than I anticipated, and
I’d hate to break anything.

Would you be able to look into it?

Thank you for your time,
-- 
Leo Vivier
English Studies & General Linguistics
Master Student, English Department
Université Rennes 2



reply via email to

[Prev in Thread] Current Thread [Next in Thread]