From 50a4eb28bb4183731b7fae4edac1cece8f4ccba3 Mon Sep 17 00:00:00 2001 From: "william.xwl" Date: Wed, 5 Oct 2005 06:49:00 +0000 Subject: emms-lyrics.el: New function: `emms-lyrics-restore-mode-line'. darcs-hash:20051005064914-e8fe6-a3bf4ebc649177b6c8774510fc8746c2fa1fa028.gz --- emms-lyrics.el | 13 ++++++++++--- 1 file 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. -- cgit v1.2.3