~breatheoutbreathein/emacs-simple-mpc-breatheoutbreathein

ed6ca31851f49f62099a1ccc4fd2f59bf829eb1d — Joseph Turner 1 year, 9 months ago 64ea36b
Add simple-mpc-song-position
1 files changed, 10 insertions(+), 0 deletions(-)

M simple-mpc-utils.el
M simple-mpc-utils.el => simple-mpc-utils.el +10 -0
@@ 112,6 112,16 @@ output as a string."
    (mark-word 2)
    (buffer-substring (mark) (point))))

(defun simple-mpc-song-position ()
  "Return song position."
  (with-temp-buffer
    (simple-mpc-call-mpc t "status")
    (search-backward-regexp " [0-9:]+/")
    (forward-char)
    (push-mark)
    (end-of-line)
    (buffer-substring (point) (mark))))

(defun simple-mpc-goto-line (line-number)
  "Go to beginning of line LINE-NUMBER.