branch: externals/emms commit c0c6ecbcad8015774ff62ec9fd1c0723940214e5 Author: Petteri Hintsanen <pette...@iki.fi> Commit: Petteri Hintsanen <pette...@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