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: Wed, 29 Apr 2015 20:38:50 -0400 Message-ID: <87vbgebgbp.fsf@kyleam.com> References: <874mo58oa5.fsf@kmlap.domain.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37200) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YncVE-0005kG-Pa for emacs-orgmode@gnu.org; Wed, 29 Apr 2015 20:38:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YncVA-0003NJ-Pi for emacs-orgmode@gnu.org; Wed, 29 Apr 2015 20:38:56 -0400 Received: from mail-qc0-f177.google.com ([209.85.216.177]:34425) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YncVA-0003L2-MR for emacs-orgmode@gnu.org; Wed, 29 Apr 2015 20:38:52 -0400 Received: by qcyk17 with SMTP id k17so21902714qcy.1 for ; Wed, 29 Apr 2015 17:38:51 -0700 (PDT) In-Reply-To: (Brice Waegenire's message of "Wed, 29 Apr 2015 23:52:58 +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: > I have took in consideration all of your points, is it better now? > The current patch doesn't overwrite the present behavior of > org-set-timer it only add the possibility to use hh:mm:ss format. Thanks. > From 8d6e379f3ed432511c613a0cf40804d2de1764b8 Mon Sep 17 00:00:00 2001 > From: Brice Waegeneire > Date: Fri, 24 Apr 2015 14:18:45 +0200 > Subject: [PATCH] org-timer.el: hh:mm:ss format for setting a timer > > * lisp/org-timer.el (org-timer-set-timer): Add support for hh:mm:ss format. > > * testing/lisp/test-org-timer.el (test-org-timer/set-timer): Add hh:mm:ss format in the test. Minor: ChangeLog lines tend to be filled at around 72 characters. [...] > (read-from-minibuffer > - "How many minutes left? " > + "How much time left? (minutes or h:mm:ss) " > (if (not (eq org-timer-default-timer 0)) > - (number-to-string org-timer-default-timer)))))) > + (eval org-timer-default-timer)))))) The defcustom for org-timer-default-timer now specifies a string and is set to "0", so `(not (eq org-timer-default-timer 0))` will return t for the default value of org-timer-default-timer. Something like (and (not (string= org-timer-default-timer "0")) org-timer-default-timer) would be needed to keep the old behavior (i.e., only insert the value of org-timer-default-timer as the initial prompt input if the user has changed it). > + (if (string-match "^[0-9]+$" minutes) > + (setq minutes (concat minutes ":00"))) Minor: `when` could be used here. Aside from that, this looks good to me. Thoughts from Nicolas or others?