From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcin Borkowski Subject: Re: How about lifting the limit of 35 tasks in org-clock-history? Date: Tue, 02 Oct 2018 08:12:56 +0200 Message-ID: <875zykzxjr.fsf@mbork.pl> References: <87h8jbjczo.fsf@mbork.pl> <87pnxwvzij.fsf@nicolasgoaziou.fr> <87zhx0ymvc.fsf@mbork.pl> <87zhwuu2u7.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43512) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g7Dwz-0006nH-9V for emacs-orgmode@gnu.org; Tue, 02 Oct 2018 02:14:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g7Dww-0005Ic-24 for emacs-orgmode@gnu.org; Tue, 02 Oct 2018 02:14:29 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:53078) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g7Dwv-0005IQ-Lt for emacs-orgmode@gnu.org; Tue, 02 Oct 2018 02:14:25 -0400 In-reply-to: <87zhwuu2u7.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou Cc: Org-Mode mailing list --=-=-= Content-Type: text/plain On 2018-09-06, at 16:18, Nicolas Goaziou wrote: > Hello, > > Marcin Borkowski 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 --=-=-= Content-Type: text/x-patch; size=1.41KiB Content-Disposition: attachment; filename=0001-Lift-the-artificial-limit-on-the-clock-history-lengt.patch >From bd5c4b7f3afe6a906b91e7f0bd33e2842fcf8656 Mon Sep 17 00:00:00 2001 From: Marcin Borkowski 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 --=-=-=--