aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwilliam.xwl <william.xwl>2005-10-05 06:49:00 +0000
committerwilliam.xwl <mwolson@gnu.org>2005-10-05 06:49:00 +0000
commit50a4eb28bb4183731b7fae4edac1cece8f4ccba3 (patch)
treec304ee46defb61cc2b2f7158baccd56990a92554
parent47c874cbc0e9582c19d56fa2176bd2a473148765 (diff)
emms-lyrics.el: New function: `emms-lyrics-restore-mode-line'.
darcs-hash:20051005064914-e8fe6-a3bf4ebc649177b6c8774510fc8746c2fa1fa028.gz
-rw-r--r--emms-lyrics.el13
1 files changed, 10 insertions, 3 deletions
diff --git a/emms-lyrics.el b/emms-lyrics.el
index 507b052..db38335 100644
--- a/emms-lyrics.el
+++ b/emms-lyrics.el
@@ -249,19 +249,20 @@ To find FILE, will look up in current directory and `emms-lyrics-dir'."
(add-hook 'emms-player-finished-hook 'emms-lyrics-stop)
(add-hook 'emms-player-paused-hook 'emms-lyrics-pause)
(add-hook 'emms-player-seeked-functions 'emms-lyrics-seek)
- (message "Displaying emms lyrics enabled."))
+ (message "emms lyrics enabled."))
(defun emms-lyrics-disable ()
"Disable displaying emms lyrics."
(interactive)
- (setq emms-lyrics-display-p nil)
(emms-lyrics-stop)
+ (setq emms-lyrics-display-p nil)
+ (emms-lyrics-restore-mode-line)
(remove-hook 'emms-player-started-hook 'emms-lyrics-start)
(remove-hook 'emms-player-stopped-hook 'emms-lyrics-stop)
(remove-hook 'emms-player-finished-hook 'emms-lyrics-stop)
(remove-hook 'emms-player-paused-hook 'emms-lyrics-pause)
(remove-hook 'emms-player-seeked-functions 'emms-lyrics-seek)
- (message "Displaying emms lyrics disabled."))
+ (message "emms lyrics disabled."))
(defun emms-lyrics-toggle ()
"Toggle displaying emms lyrics."
@@ -294,6 +295,12 @@ To find FILE, will look up in current directory and `emms-lyrics-dir'."
(append global-mode-string
'(emms-lyrics-mode-line-string)))))
+(defun emms-lyrics-restore-mode-line ()
+ "Restore the mode line."
+ (setq global-mode-string
+ (remove 'emms-lyrics-mode-line-string global-mode-string))
+ (force-mode-line-update))
+
(defun emms-lyrics-display (lyric)
"Display lyric.