diff options
Diffstat (limited to 'lib/media')
| -rw-r--r-- | lib/media/jao-lyrics.el | 11 | ||||
| -rw-r--r-- | lib/media/jao-mpc.el | 5 | ||||
| -rw-r--r-- | lib/media/jao-mpris.el | 12 | ||||
| -rw-r--r-- | lib/media/jao-random-album.el | 5 |
4 files changed, 20 insertions, 13 deletions
diff --git a/lib/media/jao-lyrics.el b/lib/media/jao-lyrics.el index f7b47ca..c00a913 100644 --- a/lib/media/jao-lyrics.el +++ b/lib/media/jao-lyrics.el @@ -99,8 +99,13 @@ "^\\(CreditsWritten by:\\|External linksNominate\\)" nil t) (beginning-of-line) (kill-region (point) (point-max))) - (replace-string "
" "" nil (point-min) (point-max)) - (replace-string "\\'" "'" nil (point-min) (point-max)) + (goto-char (point-min)) + (save-excursion + (while (search-forward "
" nil t) + (replace-match ""))) + (save-excursion + (while (search-forward "\\'" nil t) + (replace-match "'"))) (save-buffer))) (defun jao-lyrics--download (artist title &optional noartist) @@ -115,7 +120,7 @@ (jao-lyrics--clean-download fn) (prog1 (jao-lyrics--get-cached artist title) (message nil)))) -(defvar jao-lyrics-info-function) +(defvar jao-lyrics-info-function nil) (defvar-local jao-lyrics--info-function nil) ;;;###autoload diff --git a/lib/media/jao-mpc.el b/lib/media/jao-mpc.el index 43046b4..cb47f17 100644 --- a/lib/media/jao-mpc.el +++ b/lib/media/jao-mpc.el @@ -31,6 +31,7 @@ (require 'jao-lyrics) (require 'jao-random-album) (require 'jao-notify) +(require 'jao-minibuffer) (defconst jao-mpc--albums "*MPC Albums*") (defconst jao-mpc--playlist "*MPC Playlist*") @@ -259,12 +260,12 @@ (message "%s" (jao-mpc--current-str port t))) ;;;###autoload -(defun jao-mpc-echo-current-times (&optional port) +(defun jao-mpc-echo-current-times (&optional _port) (interactive) (message "Playing time: %s" (jao-mpc--current-timestr t))) ;;;###autoload -(defun jao-mpc-notify (&optional port) +(defun jao-mpc-notify (&optional _port) (interactive) (when-let* ((current (jao-mpc--current))) (let* ((artist (or (alist-get 'artist current) "Anonymous")) diff --git a/lib/media/jao-mpris.el b/lib/media/jao-mpris.el index 7331cf3..c120ae3 100644 --- a/lib/media/jao-mpris.el +++ b/lib/media/jao-mpris.el @@ -51,10 +51,9 @@ (interactive "p") (jao-mpris-seek (- secs))) -(defun jao-mpris-vol (n) +(defun jao-mpris-vol (vol) (interactive "p") - (let ((secs (if (zerop n) 10 n))) - (jao-mpris--playerctl "volume" (format "%d" n)))) + (jao-mpris--playerctl "volume" (format "%d" (if (zerop vol) 10 vol)))) (defun jao-mpris-vol-down (n) (interactive "p") @@ -146,9 +145,10 @@ (interactive "P") (when refresh (jao-mpris--track)) (when jao-mpris--current - (jao-notify (format "%s%s" (if-let (s (jao-mpris--get 'status)) - (format "%s: " s) - "") + (jao-notify (format "%s%s" + (if-let* ((s (jao-mpris--get 'status))) + (format "%s: " s) + "") (jao-mpris--format))))) (defun jao-mpris-minibuffer-order (order) diff --git a/lib/media/jao-random-album.el b/lib/media/jao-random-album.el index 07d04e8..540f6a6 100644 --- a/lib/media/jao-random-album.el +++ b/lib/media/jao-random-album.el @@ -28,9 +28,10 @@ (defun jao-random-album--buffer-lines () (let ((lines nil)) - (dotimes (n (1- (line-number-at-pos (point-max))) lines) + (dotimes (n (1- (line-number-at-pos (point-max)))) (when (> n jao-random-album-skip-lines) - (push (1+ n) lines))))) + (push (1+ n) lines))) + lines)) (defun jao-random-lines () (or (multisession-value jao-random-lines) |
