From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle Meyer Subject: Re: [PATCH] org-timer.el: Use hh:mm:ss format instead of minutes Date: Fri, 24 Apr 2015 12:49:22 -0400 Message-ID: <874mo58oa5.fsf@kmlap.domain.org> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlgnB-0002sz-39 for emacs-orgmode@gnu.org; Fri, 24 Apr 2015 12:49:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ylgn6-0000OO-8C for emacs-orgmode@gnu.org; Fri, 24 Apr 2015 12:49:29 -0400 Received: from mail-qc0-f172.google.com ([209.85.216.172]:35769) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ylgn6-0000O5-4P for emacs-orgmode@gnu.org; Fri, 24 Apr 2015 12:49:24 -0400 Received: by qcbii10 with SMTP id ii10so28817074qcb.2 for ; Fri, 24 Apr 2015 09:49:23 -0700 (PDT) In-Reply-To: (Brice Waegenire's message of "Fri, 24 Apr 2015 14:48:52 +0200") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Brice Waegenire Cc: emacs-orgmode@gnu.org Brice Waegenire wrote: > Hello, > > I've hacked a patch that use hh:mm:ss format instead of minutes for > org-timer-set-timer. I'm really not sure I did it in the right way, > any sugestions are welcome. [...] Thanks. I think it's nice to be able to specify seconds, but now you have to type 'N:00' (or at least 'N:0') instead of 'N' to get N minutes. Should a plain number default to minutes? I don't use org-timer very much, so I don't have a strong preference. > --- a/lisp/org-timer.el > +++ b/lisp/org-timer.el > @@ -429,17 +429,14 @@ using three `C-u' prefix arguments." > (minutes (or (and (not (equal opt '(64))) > effort-minutes > (number-to-string effort-minutes)) > - (and (numberp opt) (number-to-string opt)) > - (and (listp opt) (not (null opt)) > - (number-to-string org-timer-default-timer)) By removing the listp check, you no longer get the C-u behavior described in the docstring. > + (and (stringp opt) (prin1 opt)) Why not `(and (stringp opt) opt)'? > (read-from-minibuffer > - "How many minutes left? " > + "How many time left? " s/many/much/. Also, it'd be nice to specify the format in the prompt. > (if (not (eq org-timer-default-timer 0)) > - (number-to-string org-timer-default-timer)))))) > + (prin1 org-timer-default-timer)))))) The defcustom for org-timer-default-timer still says it should be a number. If set to a number other than 0, this will fail. Perhaps org-timer-default-timer should be updated to be a string in the hh:mm:ss format. -- Kyle