diff options
author | jao <jao@gnu.org> | 2024-11-07 18:01:13 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2024-11-07 18:01:13 +0000 |
commit | 4308710de811e3b4e2fb47f9024439df03e96b90 (patch) | |
tree | fb719224f99c57d6b2b9b0bd4257208f7d038dc4 /lib/media/jao-mpris.el | |
parent | 5efb9fee7e72c8c514d08940e98f7eb24b90c374 (diff) | |
download | elibs-4308710de811e3b4e2fb47f9024439df03e96b90.tar.gz elibs-4308710de811e3b4e2fb47f9024439df03e96b90.tar.bz2 |
{if,when}-let deprecation in emacs 31
Diffstat (limited to 'lib/media/jao-mpris.el')
-rw-r--r-- | lib/media/jao-mpris.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/media/jao-mpris.el b/lib/media/jao-mpris.el index 3bb2636..f2974ab 100644 --- a/lib/media/jao-mpris.el +++ b/lib/media/jao-mpris.el @@ -97,7 +97,7 @@ jao-mpris--current nil)) (defun jao-mpris--get (k &optional l) - (when-let (v (alist-get k (or l jao-mpris--current))) + (when-let* ((v (alist-get k (or l jao-mpris--current)))) (if (consp v) (car v) v))) (defun jao-mpris--set-current (k v) @@ -146,7 +146,7 @@ (interactive "P") (when refresh (jao-mpris--track)) (when jao-mpris--current - (jao-notify (format "%s%s" (if-let (s (jao-mpris--get 'status)) + (jao-notify (format "%s%s" (if-let* ((s (jao-mpris--get 'status))) (format "%s: " s) "") (jao-mpris--format))))) @@ -159,7 +159,7 @@ (defun jao-mpris--handler (iname properties &rest _args) (let ((inhibit-message t)) (message "Received properties: %S from %s" properties iname)) - (when-let (md (caadr (assoc "Metadata" properties))) + (when-let* ((md (caadr (assoc "Metadata" properties)))) (let ((tno (caadr (assoc "xesam:trackNumber" md))) (tlt (caadr (assoc "xesam:title" md))) (art (caadr (assoc "xesam:artist" md))) @@ -172,7 +172,8 @@ (jao-mpris--set-current 'artist art) (jao-mpris--set-current 'album alb) (jao-mpris--set-current 'length len)))) - (when-let (st (caadr (assoc "PlaybackStatus" properties))) + (when-let* ((st (or (caadr (assoc "PlaybackStatus" properties)) + (jao-mpris--get 'status)))) (jao-mpris--set-current 'status st) (when (string= st "Stopped") (dolist (k '(track title artist album length)) |