From e5a23039a7b6c77b61edb64f6b111beff3236c19 Mon Sep 17 00:00:00 2001 From: Arnaud Fontaine Date: Sat, 5 Nov 2011 15:28:21 +0900 Subject: * lisp/emms-history.el: Don't set `kill-emacs-hook' on noninteractive sessions. From Emacs 24.1, `kill-emacs-hook' is ran even in batch mode (commit 1e5ffe30b3f7682ee8467e7694b5f63371e31cf9). As a consequence, upon Debian package installation, byte compilation fails at the end as /root/.emacs.d/emms/ does not exist and should not be created neither. --- lisp/emms-cache.el | 3 ++- lisp/emms-history.el | 3 ++- lisp/emms-score.el | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lisp/emms-cache.el b/lisp/emms-cache.el index 4f96898..4e45eda 100644 --- a/lisp/emms-cache.el +++ b/lisp/emms-cache.el @@ -73,7 +73,8 @@ This is used to cache over emacs sessions.") (progn (unless emms-cache-dirty (emms-cache-restore)) - (add-hook 'kill-emacs-hook 'emms-cache-save) + (unless noninteractive + (add-hook 'kill-emacs-hook 'emms-cache-save)) (setq emms-cache-get-function 'emms-cache-get) (setq emms-cache-set-function 'emms-cache-set) (setq emms-cache-modified-function 'emms-cache-dirty)) diff --git a/lisp/emms-history.el b/lisp/emms-history.el index feba6c7..4d3238b 100644 --- a/lisp/emms-history.el +++ b/lisp/emms-history.el @@ -103,7 +103,8 @@ Emacs." (insert "\n)") (write-file emms-history-file)))))) -(add-hook 'kill-emacs-hook 'emms-history-save) +(unless noninteractive + (add-hook 'kill-emacs-hook 'emms-history-save)) (defun emms-history-load () "Restore all playlists in `emms-history-file'." diff --git a/lisp/emms-score.el b/lisp/emms-score.el index 71e65a3..78e17db 100644 --- a/lisp/emms-score.el +++ b/lisp/emms-score.el @@ -89,7 +89,8 @@ off otherwise." (setq emms-score-enabled-p t) (setq emms-player-next-function 'emms-score-next-noerror) (emms-score-load-hash) - (add-hook 'kill-emacs-hook 'emms-score-save-hash)) + (unless noninteractive + (add-hook 'kill-emacs-hook 'emms-score-save-hash))) (setq emms-score-enabled-p nil) (setq emms-player-next-function 'emms-next-noerror) (emms-score-save-hash) -- cgit v1.2.3