branch: externals/tmr
commit d3f44ec6513ec737c40f5379b239a2549039fd46
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>
Make stylistic change to tmr--format-duration
---
tmr.el | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/tmr.el b/tmr.el
index db7fd5b038..67b9f2886a 100644
--- a/tmr.el
+++ b/tmr.el
@@ -426,11 +426,13 @@ optional `tmr--timer-description'."
(defun tmr--format-duration (timer)
"Format duration of TIMER."
(let ((input (tmr--timer-input timer)))
- (if (string-match-p ":" input)
- (tmr--format-seconds (tmr--get-seconds timer))
- (if (string-match-p "\\`[0-9]+\\(?:\\.[0-9]+\\)?\\'" input)
- (concat input "m")
- input))))
+ (cond
+ ((string-match-p ":" input)
+ (tmr--format-seconds (tmr--get-seconds timer)))
+ ((string-match-p "\\`[0-9]+\\(?:\\.[0-9]+\\)?\\'" input)
+ (concat input "m"))
+ (t
+ input))))
(defun tmr--format-time (time)
"Return a human-readable string representing TIME."