diff options
author | jao <jao@gnu.org> | 2020-10-14 04:28:02 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2020-10-14 04:28:02 +0100 |
commit | b2dc72bab727df8406568297f9ec84ea26ea7366 (patch) | |
tree | f966c1328b34736d350f231c7620dcc8a46759f2 /net | |
parent | f3f859a5328e35094e183a24235034464c81c96e (diff) | |
download | elibs-b2dc72bab727df8406568297f9ec84ea26ea7366.tar.gz elibs-b2dc72bab727df8406568297f9ec84ea26ea7366.tar.bz2 |
jao-lyrics: remembering last used track info function
Diffstat (limited to 'net')
-rw-r--r-- | net/jao-lyrics.el | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/net/jao-lyrics.el b/net/jao-lyrics.el index 1967b3f..6f11381 100644 --- a/net/jao-lyrics.el +++ b/net/jao-lyrics.el @@ -115,10 +115,14 @@ (prog1 (jao-lyrics--get-cached artist title) (message nil)))) (defvar jao-lyrics-info-function) +(defvar-local jao-lyrics--info-function nil) +;;;###autoload (defun jao-show-lyrics (&optional force info-function) (interactive "P") - (let* ((a/t (funcall (or info-function jao-lyrics-info-function))) + (let* ((a/t (funcall (or info-function + jao-lyrics--info-function + jao-lyrics-info-function))) (artist (car a/t)) (title (cdr a/t)) (artist (if force (read-string "Artist: " artist) artist)) @@ -131,6 +135,8 @@ (jao-lyrics--download "" title artist))) (inhibit-read-only t)) (with-current-buffer buffer + (when info-function + (setq-local jao-lyrics--info-function info-function)) (delete-region (point-min) (point-max)) (insert (format "♪ %s - %s\n\n" (propertize artist 'face 'jao-lyrics-font-lock-artist) |