[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/emms c0c6ecbcad: Fix emms-seek-* functions to work with
From: |
ELPA Syncer |
Subject: |
[elpa] externals/emms c0c6ecbcad: Fix emms-seek-* functions to work with number arguments |
Date: |
Tue, 24 Jan 2023 14:57:50 -0500 (EST) |
branch: externals/emms
commit c0c6ecbcad8015774ff62ec9fd1c0723940214e5
Author: Petteri Hintsanen <petterih@iki.fi>
Commit: Petteri Hintsanen <petterih@iki.fi>
Fix emms-seek-* functions to work with number arguments
In interactive use arguments are always strings, but in
non-interactive use they may be integers or floats.
---
emms.el | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/emms.el b/emms.el
index 5c956a0298..0499d5695c 100644
--- a/emms.el
+++ b/emms.el
@@ -487,6 +487,16 @@ In both forms seconds can be a floating point number."
(defun emms-timespec-to-secs (timespec)
"Convert TIMESPEC to seconds.
+If TIMESPEC is number, use it verbatim. If TIMESPEC is string,
+use `emms-timestr-to-secs' for conversion. Otherwise return
+zero."
+ (cond ((numberp timespec) timespec)
+ ((stringp timespec) (emms-timestr-to-secs timespec))
+ (t 0)))
+
+(defun emms-timestr-to-secs (timespec)
+ "Convert TIMESPEC to seconds.
+
TIMESPEC is assumed to be a string of form [-][[HH:]MM:]SS, where
HH is hours, MM is minutes and SS is seconds. Each element is
converted to number by calling `string-to-number'. Missing or
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/emms c0c6ecbcad: Fix emms-seek-* functions to work with number arguments,
ELPA Syncer <=