summaryrefslogtreecommitdiff
path: root/lisp/mpc.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2014-09-22 09:42:57 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2014-09-22 09:42:57 -0400
commit84a87ab505e6bb94fccabf49efb39268c4a8075e (patch)
treefc50b9f682fb8b0345aae337a33708a00dad5ad3 /lisp/mpc.el
parent99c3fad7d44ceced111d8fa1b46d938bd4c67c73 (diff)
downloademacs-84a87ab505e6bb94fccabf49efb39268c4a8075e.tar.gz
emacs-84a87ab505e6bb94fccabf49efb39268c4a8075e.tar.bz2
emacs-84a87ab505e6bb94fccabf49efb39268c4a8075e.zip
* lisp/mpc.el (mpc-data-directory): Use locate-user-emacs-file.
(mpc-volume-refresh): Make sure the corresponding header-line is updated. (mpc-songs-jump-to, mpc-play): Use user-error.
Diffstat (limited to 'lisp/mpc.el')
-rw-r--r--lisp/mpc.el17
1 files changed, 9 insertions, 8 deletions
diff --git a/lisp/mpc.el b/lisp/mpc.el
index ab3fd6e7518..3dac7f99014 100644
--- a/lisp/mpc.el
+++ b/lisp/mpc.el
@@ -1,4 +1,4 @@
-;;; mpc.el --- A client for the Music Player Daemon -*- coding: utf-8; lexical-binding: t -*-
+;;; mpc.el --- A client for the Music Player Daemon -*- lexical-binding: t -*-
;; Copyright (C) 2006-2014 Free Software Foundation, Inc.
@@ -891,9 +891,7 @@ If PLAYLIST is t or nil or missing, use the main playlist."
:type '(choice (const nil) directory))
(defcustom mpc-data-directory
- (if (and (not (file-directory-p "~/.mpc"))
- (file-directory-p "~/.emacs.d"))
- "~/.emacs.d/mpc" "~/.mpc")
+ (locate-user-emacs-file "mpc" ".mpc")
"Directory where MPC.el stores auxiliary data."
:type 'directory)
@@ -1807,7 +1805,9 @@ A value of t means the main playlist.")
;; Maintain the volume.
(setq mpc-volume
(mpc-volume-widget
- (string-to-number (cdr (assq 'volume mpc-status))))))
+ (string-to-number (cdr (assq 'volume mpc-status)))))
+ (let ((status-buf (mpc-proc-buffer (mpc-proc) 'status)))
+ (when status-buf (with-current-buffer status-buf (force-mode-line-update)))))
(defvar mpc-volume-step 5)
@@ -2036,7 +2036,7 @@ This is used so that they can be compared with `eq', which is needed for
(match-string 1)))))
(cond
((null re) (posn-set-point posn))
- ((null sn) (error "This song is not in the playlist"))
+ ((null sn) (user-error "This song is not in the playlist"))
((null (with-current-buffer plbuf (re-search-forward re nil t)))
;; song-file only appears once in the playlist: no ambiguity,
;; we're good to go!
@@ -2346,7 +2346,7 @@ This is used so that they can be compared with `eq', which is needed for
(if (mpc-playlist-add)
(if (member (cdr (assq 'state (mpc-cmd-status))) '("stop"))
(mpc-cmd-play))
- (error "Don't know what to play"))))
+ (user-error "Don't know what to play"))))
(defun mpc-next ()
"Jump to the next song in the queue."
@@ -2610,7 +2610,8 @@ This is used so that they can be compared with `eq', which is needed for
(mpc-cmd-move (let ((poss '()))
(dotimes (i (length songs))
(push (+ i (length pl)) poss))
- (nreverse poss)) dest-pos mpc-songs-playlist)
+ (nreverse poss))
+ dest-pos mpc-songs-playlist)
(message "Added %d songs" (length songs)))))
(mpc-songs-refresh))
(t