diff options
| author | Stefan Monnier | 2014-09-22 09:42:57 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2014-09-22 09:42:57 -0400 |
| commit | 84a87ab505e6bb94fccabf49efb39268c4a8075e (patch) | |
| tree | fc50b9f682fb8b0345aae337a33708a00dad5ad3 | |
| parent | 99c3fad7d44ceced111d8fa1b46d938bd4c67c73 (diff) | |
| download | emacs-84a87ab505e6bb94fccabf49efb39268c4a8075e.tar.gz 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.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/mpc.el | 17 |
2 files changed, 14 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9a52384cd19..659c8aa5cba 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-09-22 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * mpc.el (mpc-data-directory): Use locate-user-emacs-file. | ||
| 4 | (mpc-volume-refresh): Make sure the corresponding header-line is updated. | ||
| 5 | |||
| 1 | 2014-09-17 Tom Willemse <tom@ryuslash.org> (tiny change) | 6 | 2014-09-17 Tom Willemse <tom@ryuslash.org> (tiny change) |
| 2 | 7 | ||
| 3 | * simple.el (clone-indirect-buffer): Mention the return value | 8 | * simple.el (clone-indirect-buffer): Mention the return value |
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 @@ | |||
| 1 | ;;; mpc.el --- A client for the Music Player Daemon -*- coding: utf-8; lexical-binding: t -*- | 1 | ;;; mpc.el --- A client for the Music Player Daemon -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2006-2014 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2006-2014 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -891,9 +891,7 @@ If PLAYLIST is t or nil or missing, use the main playlist." | |||
| 891 | :type '(choice (const nil) directory)) | 891 | :type '(choice (const nil) directory)) |
| 892 | 892 | ||
| 893 | (defcustom mpc-data-directory | 893 | (defcustom mpc-data-directory |
| 894 | (if (and (not (file-directory-p "~/.mpc")) | 894 | (locate-user-emacs-file "mpc" ".mpc") |
| 895 | (file-directory-p "~/.emacs.d")) | ||
| 896 | "~/.emacs.d/mpc" "~/.mpc") | ||
| 897 | "Directory where MPC.el stores auxiliary data." | 895 | "Directory where MPC.el stores auxiliary data." |
| 898 | :type 'directory) | 896 | :type 'directory) |
| 899 | 897 | ||
| @@ -1807,7 +1805,9 @@ A value of t means the main playlist.") | |||
| 1807 | ;; Maintain the volume. | 1805 | ;; Maintain the volume. |
| 1808 | (setq mpc-volume | 1806 | (setq mpc-volume |
| 1809 | (mpc-volume-widget | 1807 | (mpc-volume-widget |
| 1810 | (string-to-number (cdr (assq 'volume mpc-status)))))) | 1808 | (string-to-number (cdr (assq 'volume mpc-status))))) |
| 1809 | (let ((status-buf (mpc-proc-buffer (mpc-proc) 'status))) | ||
| 1810 | (when status-buf (with-current-buffer status-buf (force-mode-line-update))))) | ||
| 1811 | 1811 | ||
| 1812 | (defvar mpc-volume-step 5) | 1812 | (defvar mpc-volume-step 5) |
| 1813 | 1813 | ||
| @@ -2036,7 +2036,7 @@ This is used so that they can be compared with `eq', which is needed for | |||
| 2036 | (match-string 1))))) | 2036 | (match-string 1))))) |
| 2037 | (cond | 2037 | (cond |
| 2038 | ((null re) (posn-set-point posn)) | 2038 | ((null re) (posn-set-point posn)) |
| 2039 | ((null sn) (error "This song is not in the playlist")) | 2039 | ((null sn) (user-error "This song is not in the playlist")) |
| 2040 | ((null (with-current-buffer plbuf (re-search-forward re nil t))) | 2040 | ((null (with-current-buffer plbuf (re-search-forward re nil t))) |
| 2041 | ;; song-file only appears once in the playlist: no ambiguity, | 2041 | ;; song-file only appears once in the playlist: no ambiguity, |
| 2042 | ;; we're good to go! | 2042 | ;; we're good to go! |
| @@ -2346,7 +2346,7 @@ This is used so that they can be compared with `eq', which is needed for | |||
| 2346 | (if (mpc-playlist-add) | 2346 | (if (mpc-playlist-add) |
| 2347 | (if (member (cdr (assq 'state (mpc-cmd-status))) '("stop")) | 2347 | (if (member (cdr (assq 'state (mpc-cmd-status))) '("stop")) |
| 2348 | (mpc-cmd-play)) | 2348 | (mpc-cmd-play)) |
| 2349 | (error "Don't know what to play")))) | 2349 | (user-error "Don't know what to play")))) |
| 2350 | 2350 | ||
| 2351 | (defun mpc-next () | 2351 | (defun mpc-next () |
| 2352 | "Jump to the next song in the queue." | 2352 | "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 | |||
| 2610 | (mpc-cmd-move (let ((poss '())) | 2610 | (mpc-cmd-move (let ((poss '())) |
| 2611 | (dotimes (i (length songs)) | 2611 | (dotimes (i (length songs)) |
| 2612 | (push (+ i (length pl)) poss)) | 2612 | (push (+ i (length pl)) poss)) |
| 2613 | (nreverse poss)) dest-pos mpc-songs-playlist) | 2613 | (nreverse poss)) |
| 2614 | dest-pos mpc-songs-playlist) | ||
| 2614 | (message "Added %d songs" (length songs))))) | 2615 | (message "Added %d songs" (length songs))))) |
| 2615 | (mpc-songs-refresh)) | 2616 | (mpc-songs-refresh)) |
| 2616 | (t | 2617 | (t |