"Rohit Patnaik" <quanti...@quanticle.net> writes:

>> Why "5"?
>
> That accounts for the spaces and parentheses surrounding the headline. I've
> updated the code to use a variable (`spaces-and-parens-length') for that
> instead.

This does not eliminate the problem with magic constant in the code.
If we ever change the exact format string used to display the clock
line, this constant will become obsolete.

Rather than hard-coding number 5, I'd rather
1. Let-bind "%s (%s) " value
2. Compute spaces-and-parenth-length by formatting that value with %s
   placeholders being empty.

Alternatively, we can compute the full clock string at the beginning and
work with the actual resulting length rightaway.

Other parts of the patch look good.

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