On 2018-09-06, at 16:18, Nicolas Goaziou <m...@nicolasgoaziou.fr> wrote:
> Hello, > > Marcin Borkowski <mb...@mbork.pl> writes: > >> I decided to put a warning about this in the docstring in my patch. My >> assumption was that this is enough. If a user wants to change the >> default, he will most probably see the docstring and will have to >> actively ignore the warning. > > I don't think this is enough. As you put it, it instills doubt without > explaining anything. Why 35? Why "may not work"? What "may not work"? Agreed. I attach a patch with a more verbose docstring. It is perhaps still not ideal - in particular, the warning is not visible in the Customize interface - but I do not think this is a big deal. My line of thinking is that: - if a user wants to change this setting, they will either look up the docstring and understand the limitation (btw, even the built-in way works for org-clock-history-length as high as 76 or so, provided you have a really high frame), or - use Customize, which is potentially a trouble - but in that case, I would assume that the user fiddles with org-clock-history-length because they clock in many tasks, and then they will see that the list in the *Clock Task Select* buffer is too long anyway, and dial the setting down. An alternative could be to change the hard-coded 35 in the code into yet another variable, say, org-clock-history-max-length, and set it to 35. Still, if a user wants to increase org-clock-history-length beyond 35 (or whatever this could be changed to), it is IMHO the /current/ behavior which is really confusing, and introducing a cap on the cap would only make things worse. WDYT? -- Marcin Borkowski http://mbork.pl
>From bd5c4b7f3afe6a906b91e7f0bd33e2842fcf8656 Mon Sep 17 00:00:00 2001 From: Marcin Borkowski <mb...@mbork.pl> Date: Fri, 31 Aug 2018 07:53:42 +0200 Subject: [PATCH] Lift the artificial limit on the clock history length. The default limit of 35 was hard-coded, and was especially annoying when using an alternative way of selecting from history, e.g. https://github.com/unhammer/org-mru-clock. --- lisp/org-clock.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 9819fcff2..71ed99f69 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -156,7 +156,10 @@ state to switch it to." (symbol :tag "Function"))) (defcustom org-clock-history-length 5 - "Number of clock tasks to remember in history." + "Number of clock tasks to remember in history. +Clocking in using history works best if this is at most 35, in +which case all digits and capital letters are used up by the +*Clock Task Select* buffer." :group 'org-clock :type 'integer) @@ -534,7 +537,7 @@ cannot be translated." (defun org-clock-history-push (&optional pos buffer) "Push a marker to the clock history." - (setq org-clock-history-length (max 1 (min 35 org-clock-history-length))) + (setq org-clock-history-length (max 1 org-clock-history-length)) (let ((m (move-marker (make-marker) (or pos (point)) (org-base-buffer (or buffer (current-buffer))))) -- 2.19.0