diff options
52 files changed, 468 insertions, 239 deletions
@@ -23,7 +23,7 @@ INSTALLINFO = /usr/bin/install-info --info-dir=$(INFODIR) CHANGELOG_CMD = git log --pretty=medium --no-merges # The currently released version of EMMS -VERSION=6.00 +VERSION=6.03 .PHONY: all install docs clean .PRECIOUS: %.elc @@ -1,3 +1,7 @@ +News since version 6.2 + + - Updated documentation + News since version 5.4 - Emms is now available via the GNU ELPA repository. @@ -1,3 +1,13 @@ -Please read the fine manual which is available in the doc -directory. We do our best to make sure that it's up to date and -informative. +Emms is the Emacs Multimedia System. Emms displays and plays +multimedia from within GNU/Emacs using a variety of external players +and from different sources. + +Emms can run as a minimalist player and controlled with a handful of +M-x Emacs commands, or a fully-fledged, interactive media +browser. Emms can display album art, play streaming audio, tag music +files, search for lyrics, provide MPD connectivity, control the +volume, and more. + +Please read the info fine manual which is shipped with Emms and +available in the doc directory. We do our best to make sure that it's +up to date and informative. diff --git a/doc/developer-release.txt b/doc/developer-release.txt index a09081b..d32e4ae 100644 --- a/doc/developer-release.txt +++ b/doc/developer-release.txt @@ -1,25 +1,19 @@ This is an explanation of how to make a release for Emms. Emms is -currently distributed in three different ways: via the Git repo on -Savannah, as a tarball from GNU, and via GNU ELPA. +developed at Savannah (https://savannah.gnu.org/projects/emms/) and +distributed via Emacs ELPA (https://elpa.gnu.org/). * Increase the version number in emms.el (variable, elpa header), Makefile * Update NEWS -* Push version updates to git repo +* Update the manual, then copy compiled emms.info to root directory + +* Push version updates to VCS * Tag release in VCS, for example `git tag -a 4.2 -m "4.2"' * Push tag to VCS if needed, for example `git push --tags origin "4.2"' -* Run make release - -* Run make upload - -* Update copy of emms.info in root directory - -* Update online manual (cvs commit -m "update manual" manual/index.html) - * Update website (cvs commit -m "update website" index.html) * Push to GNU ELPA: diff --git a/doc/emms.texinfo b/doc/emms.texinfo index f5ac7a9..fb86818 100644 --- a/doc/emms.texinfo +++ b/doc/emms.texinfo @@ -15,7 +15,7 @@ @copying @copyright{} 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2014, - 2015, 2016, 2020 Free Software Foundation, Inc. + 2015, 2016, 2020, 2021 Free Software Foundation, Inc. @quotation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or @@ -141,22 +141,22 @@ Emms, an online version of the manual is available at: The basic functionality of Emms consists of three parts: The core, the sources, and the players. -The core resides in @file{emms.el}, and provides a simple playlist and the -basic functionality to use all the other features of Emms. It provides -the common user commands and interfaces for other parts. It thinks in -tracks, where a track is the combination of a type and a name - e.g. -the track type 'file has a name that is the file name. Other track -types are possible. +The core resides in @file{emms.el}, provides a simple playlist, and +the basic functionality to use all the other features of Emms. It +provides the common user commands and interfaces for other parts. It +thinks in tracks, where a track is the combination of a type and a +name - e.g. the track type 'file has a name that is the file +name. Other track types are possible. To get to tracks, the core needs sources. The file @file{emms-source-file.el} provides simple sources to interact with the file system. When Emms finally has the sources in the playlist, it needs a player -to play them. @file{emms-player-simple.el} defines a few useful players, and -allows you to define your own in a very simple way. +to play them. @file{emms-player-simple.el} defines a few useful +players and provides a straightforward way of providing your own. -The Emms core comes with many additional features to extend its -functionality. +The Emms comes with many additional features to extend the +functionality beyond the core. The way Emms works is easy to customize with your own code or by using `M-x customize' or by changing the variables directly. @@ -170,7 +170,8 @@ This chapter demonstrates how to setup Emms so that you can start listening to your music without having to read all of the documentation first. This is the tl;dr version of the manual. -The first thing you have to do is telling Emacs where Emms is +The first thing you do is to load Emms via GNU ELPA. But if you are +installing manually, then start by telling Emacs where Emms is located. Let's say you have it in @file{~/elisp/emms/}. So add this line to your @file{.emacs}: @@ -183,7 +184,7 @@ installation chapter, @xref{Installation}. You'll then want to load Emms into Emacs. To achieve this you invoke the @code{emms-all} setup function by adding the following three lines -to your @file{.emacs}. +to your Emacs initialization file. @lisp (require 'emms-setup) @@ -206,16 +207,16 @@ the name of the file) of the music you listen to. Emms can use a number of pieces of software and libraries as sources for track info, see @xref{Track Information} for more. -The last thing to do is to tell Emms where your music is; the root +The last thing to do is to tell Emms where is your music; the root directory of our music collection. Let's say all your music is in -@file{~/Music} or in subdirectories thereof. +@file{~/Music} or in subdirectories thereof: @lisp (setq emms-source-file-default-directory "~/Music/") @end lisp -OK, now we've set up Emms. Reload your @file{.emacs} or restart Emacs to -let the changes have an effect. +OK, now we've set up Emms. Reload your Emacs initialization file or +restart Emacs to let the changes have an effect. Now we will add all our music to a playlist by invoking @kbd{M-x emms-add-directory-tree RET ~/Music/ RET}. We do this because then @@ -224,9 +225,9 @@ is also required for the Emms browser, @xref{The Browser}.) To switch to the playlist buffer, invoke @kbd{M-x emms-playlist-mode-go} or simply @kbd{M-x emms}. You may see that some -tracks are displayed with their file name, but as Emms populates its -tag cache, track by track, the filenames get replaced with the artist -and track name of the file's tag. +tracks are displayed with their file name, but as Emms asynchronously +populates its tag cache, track by track, the filenames get replaced +with the artist and track name of the file's tag. Go ahead and navigate to a track and hit @kbd{RET} on it to start playback. @@ -369,6 +370,7 @@ Another way to change Emms variables is to use the M-x @menu * Finding files and speed:: Finding files quickly or portably. +* Setup Examples:: Examples of ways to setup Emms. @end menu @@ -396,6 +398,63 @@ The method Emms will use is defined in the customisable variable @var{emms-source-file-directory-tree-function}. +@node Setup Examples +@section Setup Examples + +@cindex example +@cindex configuration + +What follow are samples from real-world Emms configurations which show +some of the variety and breadth of modifications people make to the +default Emms setup. + +The following excerpt includes dbus integration, defining a "recent" +filter for the @xref{The Browser}, persistent playlist via +@file{emms-history.el}, and enabling sending track information with +@file{emms-librefm-stream.el}: + +@lisp + ;; notifications + (require 'emms-dbus) + (emms-dbus-enable) + ;; covers + (setq emms-browser-covers #'emms-browser-cache-thumbnail-async) + (setq emms-browser-thumbnail-small-size 64) + (setq emms-browser-thumbnail-medium-size 128) + ;; filters + (emms-browser-make-filter "all" #'ignore) + (emms-browser-make-filter "recent" + (lambda (track) (< 30 + (time-to-number-of-days + (time-subtract (current-time) + (emms-info-track-file-mtime track)))))) + (emms-browser-set-filter (assoc "all" emms-browser-filters)) + ;; history + (emms-history-load) + ;; libre-fm + (emms-librefm-scrobbler-enable) +@end lisp + + +In the following it is possible to see how some of defaults are set +regarding saving playlists, playlist interaction, as well as adding +special arguments to a specific player backend. + +@lisp + (setq-default + emms-source-file-default-directory "/mnt/db/mediaCore/sound_music/" + + emms-source-playlist-default-format 'm3u + emms-playlist-mode-center-when-go t + emms-playlist-default-major-mode 'emms-playlist-mode + emms-show-format "NP: %s" + + emms-player-list '(emms-player-mpv) + emms-player-mpv-environment '("PULSE_PROP_media.role=music") + emms-player-mpv-parameters '("--quiet" "--really-quiet" "--no-audio-display" "--force-window=no" "--vo=null")) +@end lisp + + @c ------------------------------------------------------------------- @node Getting Help @chapter Getting Help diff --git a/emms-bookmarks.el b/emms-bookmarks.el index b579ca3..1c43e2a 100644 --- a/emms-bookmarks.el +++ b/emms-bookmarks.el @@ -1,4 +1,4 @@ -;;; emms-bookmarks.el --- Bookmarks for Emms. +;;; emms-bookmarks.el --- Bookmarks for Emms. -*- lexical-binding: t; -*- ;; Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. diff --git a/emms-browser.el b/emms-browser.el index f805b3b..08dd546 100644 --- a/emms-browser.el +++ b/emms-browser.el @@ -1,4 +1,4 @@ -;;; emms-browser.el --- a track browser supporting covers and filtering +;;; emms-browser.el --- a track browser supporting covers and filtering -*- lexical-binding: t; -*- ;; Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. @@ -505,6 +505,7 @@ Called once for each directory." (if (fboundp 'with-selected-window) (defalias 'emms-browser-with-selected-window 'with-selected-window) (defmacro emms-browser-with-selected-window (window &rest body) + (ignore window) ;; this emulates the behavior introduced earlier, though it ;; might be best to do something with `window' `(save-selected-window ,body))) @@ -692,7 +693,7 @@ For 'info-year TYPE, use 'info-originalyear, 'info-originaldate and (let ((hash (make-hash-table :test emms-browser-comparison-test)) field existing-entry) - (maphash (lambda (path track) + (maphash (lambda (_path track) (unless (run-hook-with-args-until-success 'emms-browser-filter-tracks-hook track) (setq field @@ -792,7 +793,7 @@ For example, if TYPE is 'info-year, return an alist like: artist1 -> album1 -> *track* 1.." (let* ((next-type (emms-browser-next-mapping-type type)) (next-level (1+ level)) - alist name new-db new-tracks) + alist name _new-db new-tracks) ;; if we're at a leaf, the db data is a list of tracks (if (eq type 'info-title) tracks @@ -1143,17 +1144,14 @@ Stops at the next line at the same level, or EOF." (defun emms-browser-playlist-insert-group (bdata) "Insert a group description into the playlist buffer." - (let* ((type (emms-browser-bdata-type bdata)) - (short-type (substring (symbol-name type) 5)) - (name (emms-browser-format-line bdata 'playlist))) + (let ((name (emms-browser-format-line bdata 'playlist))) (with-current-emms-playlist (goto-char (point-max)) (insert name "\n")))) (defun emms-browser-playlist-insert-track (bdata) "Insert a track into the playlist buffer." - (let ((name (emms-browser-format-line bdata 'playlist)) - (track (car (emms-browser-bdata-data bdata)))) + (let ((name (emms-browser-format-line bdata 'playlist))) (with-current-emms-playlist (goto-char (point-max)) (insert name "\n")))) @@ -1161,7 +1159,6 @@ Stops at the next line at the same level, or EOF." (defun emms-browser-playlist-insert-bdata (bdata starting-level) "Add all tracks in BDATA to the playlist." (let ((type (emms-browser-bdata-type bdata)) - (name (emms-browser-bdata-name bdata)) (level (emms-browser-bdata-level bdata)) emms-browser-current-indent) @@ -1444,7 +1441,7 @@ tracks from point, it does not delete files." (setq path (emms-track-get track 'name)) (when delete (delete-file path)) - (add-to-list 'dirs (file-name-directory path)) + (cl-pushnew (file-name-directory path) dirs) (emms-cache-del path)) ;; remove the item from the browser (when (emms-browser-tracks-at-point) @@ -1533,10 +1530,9 @@ configuration." playlist-window (goto-char start-of-tracks) (recenter '(4))))))) - (let (wind buf) + (let (wind) (cond ((eq major-mode 'emms-browser-mode) - (setq buf (emms-browser-get-linked-buffer)) (setq wind (emms-browser-get-linked-window)) ;; if the playlist window is visible, select it (if wind @@ -1630,7 +1626,7 @@ If string matches any of the fields in a cons pair, it will be included." (let (tracks) - (maphash (lambda (k track) + (maphash (lambda (_k track) (when (emms-browser-matches-p track search-list) (push track tracks))) emms-cache-db) @@ -1967,7 +1963,7 @@ the text that it generates." (symbol-value sym) emms-browser-default-format))) -(defun emms-browser-track-artist-and-title-format (bdata fmt) +(defun emms-browser-track-artist-and-title-format (_bdata fmt) (concat "%i" (let ((track (emms-browser-format-elem fmt "T"))) @@ -1983,7 +1979,7 @@ the text that it generates." (defvar emms-browser-playlist-info-album-format 'emms-browser-year-and-album-fmt-med) -(defun emms-browser-year-and-album-fmt (bdata fmt) +(defun emms-browser-year-and-album-fmt (_bdata fmt) (concat "%i%cS" (let ((year (emms-browser-format-elem fmt "y"))) @@ -1992,7 +1988,7 @@ the text that it generates." "")) "%n")) -(defun emms-browser-year-and-album-fmt-med (bdata fmt) +(defun emms-browser-year-and-album-fmt-med (_bdata fmt) (concat "%i%cM" (let ((year (emms-browser-format-elem fmt "y"))) diff --git a/emms-cache.el b/emms-cache.el index 939f0f0..9b5deb8 100644 --- a/emms-cache.el +++ b/emms-cache.el @@ -1,4 +1,4 @@ -;;; emms-cache.el --- persistence for emms-track +;;; emms-cache.el --- persistence for emms-track -*- lexical-binding: t; -*- ;; Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. @@ -111,11 +111,12 @@ This is used to cache over emacs sessions.") (defun emms-cache-get (type path) "Return a cache element for PATH, or nil." + (ignore type) ;; implicitly ignored before 2021-03-02 (gethash path emms-cache-db)) -;; Note we ignore TYPE, as it's stored in TRACK (defun emms-cache-set (type path track) "Set PATH to TRACK in the cache." + (ignore type) ;; implicitly ignored before 2021-03-02 (puthash path track emms-cache-db) (emms-cache-dirty)) diff --git a/emms-compat.el b/emms-compat.el index 94f9b45..55a851f 100644 --- a/emms-compat.el +++ b/emms-compat.el @@ -1,4 +1,4 @@ -;;; emms-compat.el --- Compatibility routines for EMMS +;;; emms-compat.el --- Compatibility routines for EMMS -*- lexical-binding: t; -*- ;; Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. diff --git a/emms-cue.el b/emms-cue.el index aefcafd..3828ee6 100644 --- a/emms-cue.el +++ b/emms-cue.el @@ -1,4 +1,4 @@ -;;; emms-cue.el --- Recognize cue sheet file +;;; emms-cue.el --- Recognize cue sheet file -*- lexical-binding: t; -*- ;; Copyright (C) 2009 Free Software Foundation, Inc. diff --git a/emms-history.el b/emms-history.el index 2f75571..f5e4ca6 100644 --- a/emms-history.el +++ b/emms-history.el @@ -1,4 +1,4 @@ -;;; emms-history.el -- save all playlists when exiting emacs +;;; emms-history.el -- save all playlists when exiting emacs -*- lexical-binding: t; -*- ;; Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. ;; diff --git a/emms-i18n.el b/emms-i18n.el index 66a5eeb..4926858 100644 --- a/emms-i18n.el +++ b/emms-i18n.el @@ -1,4 +1,4 @@ -;;; emms-i18n.el --- functions for handling coding systems +;;; emms-i18n.el --- functions for handling coding systems -*- lexical-binding: t; -*- ;; Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. @@ -164,7 +164,7 @@ simply passed to `call-process'." (defun emms-i18n-detect-buffer-coding-system (&optional buf) "Before calling this function, make sure the buffer is literal." (let ((size (- (point-max) (point-min))) - (func (append emms-i18n-coding-detect-functions 'emms-i18n-detect-coding-function)) + (_func (append emms-i18n-coding-detect-functions 'emms-i18n-detect-coding-function)) coding) (save-excursion (and buf (set-buffer buf)) diff --git a/emms-info-libtag.el b/emms-info-libtag.el index 7954ab2..97d25c2 100644 --- a/emms-info-libtag.el +++ b/emms-info-libtag.el @@ -1,4 +1,4 @@ -;;; emms-info-libtag.el --- Info-method for EMMS using libtag +;;; emms-info-libtag.el --- Info-method for EMMS using libtag -*- lexical-binding: t; -*- ;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, ;; 2009 Free Software Foundation, Inc. diff --git a/emms-info-metaflac.el b/emms-info-metaflac.el index 5a9f517..8b528c4 100644 --- a/emms-info-metaflac.el +++ b/emms-info-metaflac.el @@ -1,4 +1,4 @@ -;;; emms-info-metaflac.el --- Info-method for EMMS using metaflac +;;; emms-info-metaflac.el --- Info-method for EMMS using metaflac -*- lexical-binding: t; -*- ;; Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. diff --git a/emms-info-mp3info.el b/emms-info-mp3info.el index b01217e..07cf6d2 100644 --- a/emms-info-mp3info.el +++ b/emms-info-mp3info.el @@ -1,4 +1,4 @@ -;;; emms-info-mp3info.el --- Info-method for EMMS using mp3info +;;; emms-info-mp3info.el --- Info-method for EMMS using mp3info -*- lexical-binding: t; -*- ;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, ;; 2009 Free Software Foundation, Inc. diff --git a/emms-info-ogginfo.el b/emms-info-ogginfo.el index 2d8412f..f28b072 100644 --- a/emms-info-ogginfo.el +++ b/emms-info-ogginfo.el @@ -1,4 +1,4 @@ -;;; emms-info-ogginfo.el --- Emms information from Ogg Vorbis files. +;;; emms-info-ogginfo.el --- Emms information from Ogg Vorbis files. -*- lexical-binding: t; -*- ;; Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. diff --git a/emms-info-opusinfo.el b/emms-info-opusinfo.el index d636f7b..0a6cee6 100644 --- a/emms-info-opusinfo.el +++ b/emms-info-opusinfo.el @@ -1,4 +1,4 @@ -;;; emms-info-opusinfo.el --- Emms information from Ogg Opus files. +;;; emms-info-opusinfo.el --- Emms information from Ogg Opus files. -*- lexical-binding: t; -*- ;; Copyright (C) 2018 Free Software Foundation, Inc. diff --git a/emms-info.el b/emms-info.el index 382a324..9a49a5c 100644 --- a/emms-info.el +++ b/emms-info.el @@ -1,4 +1,4 @@ -;;; emms-info.el --- Retrieving track information +;;; emms-info.el --- Retrieving track information -*- lexical-binding: t; -*- ;; Copyright (C) 2005-2020 Free Software Foundation, Inc. @@ -92,8 +92,7 @@ This is a suitable value for `emms-track-initialize-functions'." Return t when the track got changed." (let ((file-mtime (when emms-info-auto-update (emms-info-track-file-mtime track))) - (info-mtime (emms-track-get track 'info-mtime)) - (name (emms-track-get track 'name))) + (info-mtime (emms-track-get track 'info-mtime))) ;; if the file's been modified or is new (when (or (not file-mtime) diff --git a/emms-last-played.el b/emms-last-played.el index 529869a..33f1c83 100644 --- a/emms-last-played.el +++ b/emms-last-played.el @@ -1,4 +1,4 @@ -;;; emms-last-played.el --- Support for last-played-time of a track +;;; emms-last-played.el --- Support for last-played-time of a track -*- lexical-binding: t; -*- ;; Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. diff --git a/emms-later-do.el b/emms-later-do.el index e2729ab..68e29d3 100644 --- a/emms-later-do.el +++ b/emms-later-do.el @@ -1,4 +1,4 @@ -;;; emms-later-do.el --- execute lisp code ... later +;;; emms-later-do.el --- execute lisp code ... later -*- lexical-binding: t; -*- ;; Copyright (C) 2004, 2005, 2006, 2007, 2008, ;; 2009, 2018 Free Software Foundation, Inc. @@ -76,7 +76,7 @@ empty." (setq emms-later-do-timer nil) (let (res) (unwind-protect - (dotimes (b (min emms-later-do-batch (length emms-later-do-list)) res) + (dotimes (_b (min emms-later-do-batch (length emms-later-do-list)) res) (let ((fun (caar emms-later-do-list)) (args (cdar emms-later-do-list))) (setq emms-later-do-list (cdr emms-later-do-list)) diff --git a/emms-librefm-scrobbler.el b/emms-librefm-scrobbler.el index a49a458..eb4f175 100644 --- a/emms-librefm-scrobbler.el +++ b/emms-librefm-scrobbler.el @@ -1,4 +1,4 @@ -;;; emms-librefm-scrobbler.el --- Libre.FM Scrobbing API +;;; emms-librefm-scrobbler.el --- Libre.FM Scrobbing API -*- lexical-binding: t; -*- ;; Copyright (C) 2014 Free Software Foundation, Inc. @@ -133,6 +133,7 @@ TOKEN is :user of :secret." (defun emms-librefm-scrobbler-handshake-call (url username password) "Perform client handshake and return a response in a buffer." (let ((url-request-method "POST")) + (ignore url-request-method) (let ((response (url-retrieve-synchronously (emms-librefm-scrobbler-handshake-string @@ -248,6 +249,9 @@ TOKEN is :user of :secret." (url-request-data flarb) (url-request-extra-headers `(("Content-type" . "application/x-www-form-urlencoded")))) + (ignore url-request-extra-headers + url-request-data + url-request-method) (url-retrieve emms-librefm-scrobbler-submission-url #'emms-librefm-scrobbler-async-submission-callback (list (cons track rating)))))) @@ -255,6 +259,7 @@ TOKEN is :user of :secret." (defun emms-librefm-scrobbler-async-submission-callback (status &optional cbargs) "Pass response of asynchronous submission call to handler." (let ((response (emms-librefm-scrobbler-get-response-status))) + (ignore status) ;; From the API docs: This indicates that the ;; submission request was accepted for processing. It ;; does not mean that the submission was valid, but diff --git a/emms-librefm-stream.el b/emms-librefm-stream.el index 7df67cb..c46a060 100644 --- a/emms-librefm-stream.el +++ b/emms-librefm-stream.el @@ -1,4 +1,4 @@ -;;; emms-librefm-stream.el --- Libre.FM streaming +;;; emms-librefm-stream.el --- Libre.FM streaming -*- lexical-binding: t; -*- ;; Copyright (C) 2014 Free Software Foundation, Inc. @@ -104,6 +104,7 @@ point after the HTTP headers." (defun emms-librefm-stream-tune-handshake-call () "Make the tune handshake call." (let ((url-request-method "POST")) + (ignore url-request-method) (let ((response (url-retrieve-synchronously (emms-librefm-stream-tune-handshake-string)))) @@ -171,6 +172,7 @@ point after the HTTP headers." (defun emms-librefm-stream-tune-call (session-id station) "Make the tune call." (let ((url-request-method "POST")) + (ignore url-request-method) (let ((response (url-retrieve-synchronously (emms-librefm-stream-tune-string @@ -187,32 +189,24 @@ point after the HTTP headers." (error "response not a buffer")) (with-current-buffer resbuf (emms-librefm-stream-assert-http) - (let ((status (buffer-substring (point-at-bol) - (point-at-eol)))) - (let (response - url - stationname - (start (point))) - - (if (re-search-forward "^response=\\(.*\\)$" (point-max) t) - (setq response (match-string-no-properties 1)) - (error "no response status code")) - (when (not (string= response "OK")) - (error "tune response not OK")) + (let (response + stationname + (start (point))) - (goto-char start) - (if (re-search-forward "^url=\\(.*\\)$" (point-max) t) - (setq url (match-string-no-properties 1)) - (error "no url from server")) + (if (re-search-forward "^response=\\(.*\\)$" (point-max) t) + (setq response (match-string-no-properties 1)) + (error "no response status code")) + (when (not (string= response "OK")) + (error "tune response not OK")) - (goto-char start) - (if (re-search-forward "^stationname=\\(.*\\)$" (point-max) t) - (setq stationname (match-string-no-properties 1)) - (error "no stationname from server")) + (goto-char start) + (if (re-search-forward "^stationname=\\(.*\\)$" (point-max) t) + (setq stationname (match-string-no-properties 1)) + (error "no stationname from server")) - (setq emms-librefm-stream-station-name stationname) + (setq emms-librefm-stream-station-name stationname) - (message "successfully tuned to: %s" stationname))))) + (message "successfully tuned to: %s" stationname)))) (defun emms-librefm-stream-tune (station) "Make and handle tune call." @@ -242,6 +236,7 @@ point after the HTTP headers." (defun emms-librefm-stream-getplaylist-call (session-id) "Make the getplaylist call." (let ((url-request-method "POST")) + (ignore url-request-method) (let ((response (url-retrieve-synchronously (emms-librefm-stream-getplaylist-string session-id)))) @@ -269,7 +264,6 @@ point after the HTTP headers." ;;; ------------------------------------------------------------------ ;;; XSPF ;;; ------------------------------------------------------------------ - (defun emms-librefm-stream-xspf-find (tag data) "Return the tracklist portion of PLAYLIST or nil." (let ((tree (copy-tree data)) @@ -296,8 +290,7 @@ point after the HTTP headers." (title (emms-librefm-stream-xspf-get 'title track)) (album (emms-librefm-stream-xspf-get 'album track)) (creator (emms-librefm-stream-xspf-get 'creator track)) - (duration (emms-librefm-stream-xspf-get 'duration track)) - (image (emms-librefm-stream-xspf-get 'image track))) + (duration (emms-librefm-stream-xspf-get 'duration track))) (let ((emms-track (emms-dictionary '*track*))) (emms-track-set emms-track 'name location) (emms-track-set emms-track 'info-artist creator) diff --git a/emms-lyrics.el b/emms-lyrics.el index 95b8e29..0b18d24 100644 --- a/emms-lyrics.el +++ b/emms-lyrics.el @@ -1,4 +1,4 @@ -;;; emms-lyrics.el --- Display lyrics synchronically +;;; emms-lyrics.el --- Display lyrics synchronically -*- lexical-binding: t; -*- ;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2013 Free Software Foundation, Inc. diff --git a/emms-mark.el b/emms-mark.el index b7d2558..ec9960c 100644 --- a/emms-mark.el +++ b/emms-mark.el @@ -1,4 +1,4 @@ -;;; emms-mark.el --- mark track like dired +;;; emms-mark.el --- mark track like dired -*- lexical-binding: t; -*- ;; Copyright (C) 2006, 2007, 2008, 2009, 2018 Free Software Foundation, Inc. ;; diff --git a/emms-metaplaylist-mode.el b/emms-metaplaylist-mode.el index d4616f0..40d7b74 100644 --- a/emms-metaplaylist-mode.el +++ b/emms-metaplaylist-mode.el @@ -1,4 +1,4 @@ -;;; emms-metaplaylist-mode.el --- A major mode for lists of Emms playlists +;;; emms-metaplaylist-mode.el --- A major mode for lists of Emms playlists -*- lexical-binding: t; -*- ;; Copyright (C) 2006, 2007, 2008, 2009, 2017-2018 Free Software Foundation, Inc. diff --git a/emms-mode-line-icon.el b/emms-mode-line-icon.el index 82cf815..7d54d7e 100644 --- a/emms-mode-line-icon.el +++ b/emms-mode-line-icon.el @@ -1,4 +1,4 @@ -;; emms-mode-line-icon.el --- show an icon in the Emacs mode-line +;; emms-mode-line-icon.el --- show an icon in the Emacs mode-line -*- lexical-binding: t; -*- ;; Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. diff --git a/emms-mode-line.el b/emms-mode-line.el index caac8b1..02d3a33 100644 --- a/emms-mode-line.el +++ b/emms-mode-line.el @@ -1,4 +1,4 @@ -;;; emms-mode-line.el --- Mode-Line and titlebar infos for emms +;;; emms-mode-line.el --- Mode-Line and titlebar infos for emms -*- lexical-binding: t; -*- ;; Copyright (C) 2004, 2005, 2006, 2007, 2008, ;; 2009 Free Software Foundation, Inc. @@ -117,6 +117,7 @@ Optional TRACK is used to be compatible with `emms-track-updated-functions'. It's simply ignored currently." + (ignore track) (emms-mode-line-alter-mode-line) (emms-mode-line-alter-titlebar)) diff --git a/emms-player-mpd.el b/emms-player-mpd.el index 327938d..78fd857 100644 --- a/emms-player-mpd.el +++ b/emms-player-mpd.el @@ -1,4 +1,4 @@ -;;; emms-player-mpd.el --- MusicPD support for EMMS +;;; emms-player-mpd.el --- MusicPD support for EMMS -*- lexical-binding: t; -*- ;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2014 Free Software Foundation, Inc. @@ -506,7 +506,7 @@ Call CALLBACK with CLOSURE and result when the request is complete. If INFO is specified, use that instead of acquiring the necessary info from MusicPD." (when info - (setq callback (lambda (closure id) id))) + (setq callback (lambda (closure id) (ignore closure) id))) (emms-player-mpd-get-status-part closure callback "playlist" info)) (defun emms-player-mpd-get-volume (closure callback &optional info) @@ -515,7 +515,7 @@ Call CALLBACK with CLOSURE and result when the request is complete. If INFO is specified, use that instead of acquiring the necessary info from MusicPD." (when info - (setq callback (lambda (closure volume) volume))) + (setq callback (lambda (closure volume) (ignore closure) volume))) (emms-player-mpd-get-status-part closure callback "volume" info)) (defun emms-player-mpd-get-current-song (closure callback &optional info) @@ -527,7 +527,7 @@ Call CALLBACK with CLOSURE and result when the request is complete. If INFO is specified, use that instead of acquiring the necessary info from MusicPD." (when info - (setq callback (lambda (closure id) id))) + (setq callback (lambda (closure id) (ignore closure) id))) (emms-player-mpd-get-status-part closure callback "song" info)) (defun emms-player-mpd-get-mpd-state (closure callback &optional info) @@ -538,7 +538,7 @@ Call CALLBACK with CLOSURE and result when the request is complete. If INFO is specified, use that instead of acquiring the necessary info from MusicPD." (when info - (setq callback (lambda (closure id) id))) + (setq callback (lambda (closure id) (ignore closure) id))) (emms-player-mpd-get-status-part closure callback "state" info)) (defun emms-player-mpd-get-playing-time (closure callback &optional info) @@ -552,6 +552,7 @@ info from MusicPD." (emms-player-mpd-get-status-part nil (lambda (closure time) + (ignore closure) (and time (string-match "\\`\\([0-9]+\\):" time) (string-to-number (match-string 1 time)))) @@ -684,6 +685,7 @@ main EMMS playlist buffer." (emms-player-mpd-detect-song-change info)) (defun emms-player-mpd-detect-song-change-1 (closure info) + (ignore closure) (let ((song (emms-player-mpd-get-current-song nil #'ignore info)) (state (emms-player-mpd-get-mpd-state nil #'ignore info)) (time (emms-player-mpd-get-playing-time nil #'ignore info)) @@ -879,6 +881,7 @@ playlist." (concat "play " id) nil (lambda (closure response) + (ignore closure response) (setq emms-player-mpd-current-song nil) (if emms-player-mpd-check-interval (setq emms-player-mpd-status-timer @@ -890,6 +893,7 @@ playlist." "play" nil (lambda (closure response) + (ignore closure response) (emms-player-started 'emms-player-mpd))))) (defun emms-player-mpd-start-and-sync-2 (buffer id) @@ -913,6 +917,7 @@ playlist." (emms-player-mpd-play track-cnt)))))) (defun emms-player-mpd-start-and-sync-1 (closure id) + (ignore closure) (let ((buf-id (with-current-emms-playlist emms-player-mpd-playlist-id))) (if (and (not (buffer-modified-p emms-playlist-buffer)) @@ -934,11 +939,13 @@ This is called if `emms-player-mpd-sync-playlist' is non-nil." "clearerror" nil (lambda (closure response) + (ignore closure response) (emms-player-mpd-get-playlist-id nil #'emms-player-mpd-start-and-sync-1)))) (defun emms-player-mpd-connect-1 (closure info) + (ignore closure) (setq emms-player-mpd-current-song nil) (let* ((state (emms-player-mpd-get-mpd-state nil #'ignore info))) (unless (string= state "stop") @@ -1219,6 +1226,7 @@ This is useful to do when you have recently acquired new music." (concat "listallinfo " dir) nil (lambda (closure response) + (ignore closure response) (message "Dumping MusicPD data to cache...processing") (let ((info (emms-player-mpd-parse-response response))) (when (null (car info)) @@ -1256,6 +1264,7 @@ order to prime the cache." (emms-player-mpd-send (concat "update " (emms-player-mpd-quote-file dir)) nil (lambda (closure response) + (ignore closure) (let ((id (cdr (assoc "updating_db" (emms-player-mpd-get-alist (emms-player-mpd-parse-response response)))))) @@ -1288,6 +1297,7 @@ cache." "Wait for a currently running mpd update to finish. Afterwards, clear the EMMS cache and call `emms-cache-set-from-mpd-all'." + (ignore closure) (if response ;; This is the first call after the update command (let ((id (cdr (assoc "updating_db" @@ -1303,6 +1313,7 @@ Afterwards, clear the EMMS cache and call (emms-player-mpd-get-status-part nil (lambda (closure updating) + (ignore closure) (if updating ;; MPD update still in progress, so wait another second (run-at-time 1 nil 'emms-player-mpd-wait-for-update) diff --git a/emms-player-mpg321-remote.el b/emms-player-mpg321-remote.el index de242ea..40ff9d0 100644 --- a/emms-player-mpg321-remote.el +++ b/emms-player-mpg321-remote.el @@ -1,4 +1,4 @@ -;;; emms-player-mpg321-remote.el --- play files with mpg321 -R +;;; emms-player-mpg321-remote.el --- play files with mpg321 -R -*- lexical-binding: t; -*- ;; Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. @@ -125,6 +125,7 @@ For example: (list \"-o\" \"alsa\")" (defun emms-player-mpg321-remote-sentinel (proc str) "Sentinel for determining the end of process" + (ignore str) (when (or (eq (process-status proc) 'exit) (eq (process-status proc) 'signal)) ;; reset @@ -145,8 +146,10 @@ For example: (list \"-o\" \"alsa\")" ;; -------------------------------------------------- (defun emms-player-mpg321-remote-filter (proc str) + (ignore proc) (let* ((data-lines (split-string str "\n" t)) - data line cmd) + data + cmd) (dolist (line data-lines) (setq data (split-string line)) (setq cmd (car data)) @@ -176,6 +179,7 @@ If USER-ACTION, set `emms-player-mpg321-remote-ignore-stop' so that we ignore the next message from mpg321." (if user-action (let ((emms-player-ignore-stop t)) + (ignore emms-player-ignore-stop) ;; so we ignore the next stop message (setq emms-player-mpg321-remote-ignore-stop (1+ emms-player-mpg321-remote-ignore-stop)) diff --git a/emms-player-mplayer.el b/emms-player-mplayer.el index aa1f5c7..0ce0a19 100644 --- a/emms-player-mplayer.el +++ b/emms-player-mplayer.el @@ -1,4 +1,4 @@ -;;; emms-player-mplayer.el --- mplayer support for EMMS +;;; emms-player-mplayer.el --- mplayer support for EMMS -*- lexical-binding: t; -*- ;; Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. diff --git a/emms-player-mpv.el b/emms-player-mpv.el index c4fc541..7d9099a 100644 --- a/emms-player-mpv.el +++ b/emms-player-mpv.el @@ -1,4 +1,4 @@ -;;; emms-player-mpv.el --- mpv support for EMMS +;;; emms-player-mpv.el --- mpv support for EMMS -*- lexical-binding: t; -*- ;; ;; Copyright (C) 2018 Free Software Foundation, Inc. @@ -130,7 +130,7 @@ depending on `emms-player-mpv-ipc-method' value and/or mpv version." "Update track duration when played by mpv. Uses `emms-player-mpv-event-functions' hook." :type 'boolean - :set (lambda (sym value) + :set (lambda (_sym value) (run-at-time 0.1 nil (lambda (value) (if value @@ -148,7 +148,7 @@ Uses `emms-player-mpv-event-functions' hook." This allows to dynamically update stream info from ICY tags, for example. Uses `emms-player-mpv-event-connect-hook' and `emms-player-mpv-event-functions' hooks." :type 'boolean - :set (lambda (sym value) + :set (lambda (_sym value) (run-at-time 0.1 nil (lambda (value) (if value @@ -213,7 +213,7 @@ Should be fine with both mpv and emacs, and probably never reached anyway.") (defvar emms-player-mpv-ipc-stop-command nil "Internal flag to track when stop command starts/finishes before next loadfile. Set to either nil, t or playback start function to call on end-file event after stop command. -This is a workaround for mpv-0.30+ behavior, when 'stop + loadfile' only runs 'stop'.") +This is a workaround for mpv-0.30+ behavior, where 'stop + loadfile' only runs 'stop'.") (defvar emms-player-mpv-event-connect-hook nil @@ -315,7 +315,7 @@ Error is signaled if mpv binary fails to run." 'file) ((pred (string> "000.016.999")) 'unix-socket) - (- 'ipc-server))))) + (_ 'ipc-server))))) ;; ----- mpv process @@ -572,7 +572,7 @@ PROC can be specified to avoid `emms-player-mpv-ipc' call (e.g. from sentinel/fi (let ((json (concat (json-encode (list :command cmd :request_id req-id)) "\n"))) (emms-player-mpv-debug-msg "json >> %s" json) - (condition-case err + (condition-case _err ;; On any disconnect, assume that mpv process is to blame and force restart. (process-send-string req-proc json) (error @@ -591,7 +591,7 @@ PROC can be specified to avoid `emms-player-mpv-ipc' call (e.g. from sentinel/fi (remhash req-id emms-player-mpv-ipc-req-table) (when handler (funcall handler data err))))) -(defun emms-player-mpv-ipc-req-error-printer (data err) +(defun emms-player-mpv-ipc-req-error-printer (_data err) "Simple default `emms-player-mpv-ipc-req-send' handler to log errors, if any." (when err (message "emms-player-mpv ipc-error: %s" err))) @@ -765,32 +765,37 @@ or otherwise schedule start/connect and set (setq emms-player-mpv-ipc-connect-command cmd)))) (defmacro emms-player-mpv-cmd-prog (cmd &rest handler-body) - "Macro around `emms-player-mpv-cmd' that creates + "Obsolete macro around `emms-player-mpv-cmd' that creates handler callback (see `emms-player-mpv-ipc-req-send') from HANDLER-BODY forms, which have following bindings: - mpv-cmd for CMD. - mpv-data for response data (decoded json, nil if none). -- mpv-error for response error (nil if no error, decoded json or 'connection-error)." +- mpv-error for response error (nil if no error, decoded json or 'connection-error). + +Do not use it with new code - it will raise warnings when used with lexical bindings, +and will be removed in a future EMMS version." `(emms-player-mpv-cmd ,cmd (apply-partially (lambda (mpv-cmd mpv-data mpv-error) ,@handler-body) ,cmd))) +(make-obsolete 'emms-player-mpv-cmd-prog nil "Emms 7") + (defun emms-player-mpv-playable-p (track) (memq (emms-track-type track) '(file url streamlist playlist))) -(defun emms-player-mpv-start-error-handler (mpv-cmd mpv-data mpv-error) +(defun emms-player-mpv-start-error-handler (mpv-cmd _mpv-data mpv-error) "Playback-restart error handler for `emms-player-mpv-cmd', to restart/reconnect-to mpv and re-run MPV-CMD, if there was any issue when trying to start it initially." (if (eq mpv-error 'connection-error) ;; Reconnect and restart playback if current connection fails (e.g. mpv crash) - (emms-player-mpv-cmd-prog - (emms-player-mpv-cmd mpv-cmd) - (emms-player-mpv-cmd `(set pause no))) - (emms-player-mpv-cmd `(set pause no)))) + (emms-player-mpv-cmd mpv-cmd + (lambda (_mpv-data _mpv-error) + (emms-player-mpv-cmd mpv-cmd) + (emms-player-mpv-cmd `(set pause no)))))) (defun emms-player-mpv-start (track) (setq emms-player-mpv-stopped nil) diff --git a/emms-player-simple.el b/emms-player-simple.el index fd93137..0e921fe 100644 --- a/emms-player-simple.el +++ b/emms-player-simple.el @@ -1,4 +1,4 @@ -;;; emms-player-simple.el --- A generic simple player. +;;; emms-player-simple.el --- A generic simple player. -*- lexical-binding: t; -*- ;; Copyright (C) 2003, 2004, 2006, 2007, 2008, ;; 2009 Free Software Foundation, Inc. @@ -129,6 +129,7 @@ PLAYER is the name of the current player." (defun emms-player-simple-sentinel (proc str) "Sentinel for determining the end of process" + (ignore str) (when (or (eq (process-status proc) 'exit) (eq (process-status proc) 'signal)) (emms-player-stopped))) diff --git a/emms-player-vlc.el b/emms-player-vlc.el index 7c2130d..35d6861 100644 --- a/emms-player-vlc.el +++ b/emms-player-vlc.el @@ -1,4 +1,4 @@ -;;; emms-player-vlc.el --- vlc support for EMMS +;;; emms-player-vlc.el --- vlc support for EMMS -*- lexical-binding: t; -*- ;; Copyright (C) 2008, 2009 Free Software Foundation, Inc. diff --git a/emms-player-xine.el b/emms-player-xine.el index 2fc60e7..98c3c28 100644 --- a/emms-player-xine.el +++ b/emms-player-xine.el @@ -1,4 +1,4 @@ -;;; emms-player-xine.el --- xine support for EMMS +;;; emms-player-xine.el --- xine support for EMMS -*- lexical-binding: t; -*- ;; Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. diff --git a/emms-playing-time.el b/emms-playing-time.el index 8b14e16..920c9d5 100644 --- a/emms-playing-time.el +++ b/emms-playing-time.el @@ -1,4 +1,4 @@ -;;; emms-playing-time.el --- Display emms playing time on mode line +;;; emms-playing-time.el --- Display emms playing time on mode line -*- lexical-binding: t; -*- ;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2019 Free Software Foundation, Inc. @@ -197,10 +197,10 @@ could call `emms-playing-time-enable-display' and (let ((progress "[") ;; percent based on 10 (percent (/ (* emms-playing-time 10) total-playing-time))) - (dotimes (i percent) + (dotimes (_i percent) (setq progress (concat progress "="))) (setq progress (concat progress ">")) - (dotimes (i (- 10 percent)) + (dotimes (_i (- 10 percent)) (setq progress (concat progress " "))) (setq progress (concat progress "]")) (setq emms-playing-time-string progress)))) diff --git a/emms-playlist-mode.el b/emms-playlist-mode.el index 6979b79..f851b63 100644 --- a/emms-playlist-mode.el +++ b/emms-playlist-mode.el @@ -1,4 +1,4 @@ -;;; emms-playlist-mode.el --- Playlist mode for Emms. +;;; emms-playlist-mode.el --- Playlist mode for Emms. -*- lexical-binding: t; -*- ;; Copyright (C) 2005-2019 Free Software Foundation, Inc. @@ -354,6 +354,7 @@ set it as current." (when track (let ((track-region (emms-property-region (point) 'emms-track))) + (ignore track-region) (when (and emms-player-playing-p (emms-playlist-selected-track-at-p)) (emms-stop) @@ -458,8 +459,7 @@ of the saved playlist inside." This preserves the current EMMS buffer." (interactive) (let* ((track (emms-playlist-track-at)) - (name (emms-track-get track 'name)) - (type (emms-track-get track 'type))) + (name (emms-track-get track 'name))) (emms-playlist-select (point)) (run-hooks 'emms-player-stopped-hook) (switch-to-buffer diff --git a/emms-playlist-sort.el b/emms-playlist-sort.el index e23604b..ae5bb56 100644 --- a/emms-playlist-sort.el +++ b/emms-playlist-sort.el @@ -1,4 +1,4 @@ -;;; emms-playlist-sort.el --- sort emms playlist +;;; emms-playlist-sort.el --- sort emms playlist -*- lexical-binding: t; -*- ;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2018 Free Software Foundation, Inc. diff --git a/emms-score.el b/emms-score.el index 8c783c5..1537322 100644 --- a/emms-score.el +++ b/emms-score.el @@ -1,4 +1,4 @@ -;;; emms-score.el --- Scoring system for mp3player +;;; emms-score.el --- Scoring system for mp3player -*- lexical-binding: t; -*- ;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, ;; 2009, 2018 Free Software Foundation, Inc. diff --git a/emms-setup.el b/emms-setup.el index 21a7c03..9754c5c 100644 --- a/emms-setup.el +++ b/emms-setup.el @@ -1,4 +1,4 @@ -;;; emms-setup.el --- Setup script for EMMS +;;; emms-setup.el --- Setup script for EMMS -*- lexical-binding: t; -*- ;; Copyright (C) 2005-2020 Free Software Foundation, Inc. @@ -86,6 +86,7 @@ the stable features which come with the Emms distribution." (require 'emms-info-metaflac) (require 'emms-info-tinytag) (require 'emms-info-exiftool) + (require 'emms-info-native) (require 'emms-cache) (require 'emms-mode-line) (require 'emms-mark) @@ -114,12 +115,7 @@ the stable features which come with the Emms distribution." ;; setup (setq emms-playlist-default-major-mode 'emms-playlist-mode) (add-to-list 'emms-track-initialize-functions 'emms-info-initialize-track) - (when (executable-find emms-info-mp3info-program-name) - (add-to-list 'emms-info-functions 'emms-info-mp3info)) - (when (executable-find emms-info-ogginfo-program-name) - (add-to-list 'emms-info-functions 'emms-info-ogginfo)) - (when (executable-find emms-info-opusinfo-program-name) - (add-to-list 'emms-info-functions 'emms-info-opusinfo)) + (setq emms-info-functions '(emms-info-native emms-info-cueinfo)) (setq emms-track-description-function 'emms-info-track-description) (when (fboundp 'emms-cache) ; work around compiler warning (emms-cache 1)) @@ -127,7 +123,6 @@ the stable features which come with the Emms distribution." (emms-mode-line-blank) (emms-lyrics 1) (emms-playing-time 1) - (add-to-list 'emms-info-functions 'emms-info-cueinfo) (add-hook 'emms-player-started-hook 'emms-last-played-update-current) (emms-score 1)) diff --git a/emms-show-all.el b/emms-show-all.el index f37ef5e..fa7181d 100644 --- a/emms-show-all.el +++ b/emms-show-all.el @@ -1,4 +1,4 @@ -;;; emms-show-all.el --- Detailed track information for Emms. +;;; emms-show-all.el --- Detailed track information for Emms. -*- lexical-binding: t; -*- ;; Copyright (C) 2016 Free Software Foundation, Inc. diff --git a/emms-source-file.el b/emms-source-file.el index 2be6538..ed8d832 100644 --- a/emms-source-file.el +++ b/emms-source-file.el @@ -1,4 +1,4 @@ -;;; emms-source-file.el --- EMMS sources from the filesystem. +;;; emms-source-file.el --- EMMS sources from the filesystem. -*- lexical-binding: t; -*- ;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, ;; 2009 Free Software Foundation, Inc. diff --git a/emms-source-playlist.el b/emms-source-playlist.el index 327be8c..aca63b7 100644 --- a/emms-source-playlist.el +++ b/emms-source-playlist.el @@ -1,4 +1,4 @@ -;;; emms-source-playlist.el --- EMMS sources from playlist files +;;; emms-source-playlist.el --- EMMS sources from playlist files -*- lexical-binding: t; -*- ;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, ;; 2009 Free Software Foundation, Inc. @@ -208,6 +208,7 @@ See `emms-source-playlist-formats' for a list of supported formats." (defun emms-source-playlist-parse-native (file) "Parse the native EMMS playlist in the current buffer." + (ignore file) (save-excursion (goto-char (point-min)) (read (current-buffer)))) diff --git a/emms-stream-info.el b/emms-stream-info.el index 2bc7a41..035af43 100644 --- a/emms-stream-info.el +++ b/emms-stream-info.el @@ -1,4 +1,4 @@ -;;; emms-stream-info.el --- Info from streaming audio +;;; emms-stream-info.el --- Info from streaming audio -*- lexical-binding: t; -*- ;; Copyright (C) 2004, 2005, 2006, 2007, 2008, ;; 2009, 2019 Free Software Foundation, Inc. diff --git a/emms-streams.el b/emms-streams.el index c3b2d11..3055f73 100644 --- a/emms-streams.el +++ b/emms-streams.el @@ -1,4 +1,4 @@ -;; emms-streams.el -- A collection of online streaming audio +;; emms-streams.el -- A collection of online streaming audio -*- lexical-binding: t; -*- ;; Copyright (C) 2019 Free Software Foundation, Inc. diff --git a/emms-tag-editor.el b/emms-tag-editor.el index ee9b2cb..52a8046 100644 --- a/emms-tag-editor.el +++ b/emms-tag-editor.el @@ -1,8 +1,9 @@ -;;; emms-tag-editor.el --- Edit track tags. +;;; emms-tag-editor.el --- Edit track tags. -*- lexical-binding: t; -*- -;; Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +;; Copyright (C) 2006-2021 Free Software Foundation, Inc. ;; -;; Author: Ye Wenbin <wenbinye@163.com> +;; Original Author: Ye Wenbin <wenbinye@163.com> +;; Authors: the Emms developers (see AUTHORS file) ;; This file is part of EMMS. @@ -37,6 +38,12 @@ (require 'emms-playlist-mode) (require 'emms-mark) (require 'format-spec) +(require 'subr-x) + +(defcustom emms-tag-editor-tag-ogg-program "vorbiscomment" + "*The name/path of the ogg editor program." + :type 'string + :group 'emms-tag-editor) (defvar emms-tag-editor-tags '((info-artist . "a") @@ -147,7 +154,7 @@ See also `emms-tag-editor-tag-file' and `emms-tag-editor-tag-ogg'.") (require 'emms-info-metaflac) (with-temp-buffer (let ((tags '("artist" "composer" "performer" "title" "album" "tracknumber" "discnumber" "date" "genre" "note")) - need val) + val) (mapc (lambda (tag) (let ((info-tag (intern (concat "info-" tag)))) (when (> (length (setq val (emms-track-get track info-tag))) 0) @@ -175,7 +182,7 @@ See also `emms-tag-editor-tag-file' and `emms-tag-editor-tag-ogg'.") (setq args (append (list "-t" (concat (upcase tag) "=" val)) args))))) '("artist" "composer" "performer" "title" "album" "tracknumber" "date" "genre" "note")) (when args - (apply #'call-process "vorbiscomment" nil + (apply #'call-process emms-tag-editor-tag-ogg-program nil (get-buffer-create emms-tag-editor-log-buffer) nil "-w" @@ -537,7 +544,7 @@ Available tags are: match "[^-]+")) (setq compiled (concat compiled "\\(" match "\\)") index (1+ index)) - (add-to-list 'registers (cons register index))) + (push (cons register index) registers)) (t (setq compiled (concat compiled (char-to-string c)))))) (if (/= paren 0) (error "Paren not match!")) (cons compiled registers))) @@ -783,5 +790,92 @@ Then it's the callers job to apply them afterwards with (define-key emms-playlist-mode-map "R" 'emms-tag-editor-rename) +(defvar emms-tag-editor-pipe-config + '(("mid3iconv -e gbk <file>" + :command "mid3iconv" + :arguments ("-e" "gbk" name))) + "Config of tag editor pipe. + +A pipe is defined like below: + + (\"piper-name\" :command xxx :arguments xxx) + +:command is a command string, this command can not change file name. +:arguments is a list or a function return list, for example: + + (\"--track-name\" name (\"--year\" info-year)) + (lambda (track) (list (emms-track-name track 'name))) + +1. symbols can be 'name or elements of (mapcar 'car emms-tag-editor-tags), + which will be replaced to track info before run command. +2. sublist used to deal with group args, for example, (\"--year\" info-year), when + track's info-year is nil, the \"--year\" will be removed too.") + +(defun emms-tag-editor-pipe-get (pipe-name key) + "Get the pipe value of KEY named PIPE-NAME in `emms-tag-editor-pipe-config'." + (let ((config emms-tag-editor-pipe-config)) + (plist-get (cdr (assoc pipe-name config)) key))) + +(defun emms-tag-editor-pipe () + "Select and run pipe command to track at point or all marked tracks." + (interactive) + (let* ((pipe-name (completing-read "Please choise pipe: " emms-tag-editor-pipe-config))) + (when pipe-name + (if (emms-mark-has-markedp) + (emms-tag-editor-marked-track-pipe pipe-name) + (emms-tag-editor-track-pipe + (emms-tag-editor-track-at) pipe-name))))) + +(defun emms-tag-editor-track-pipe (track pipe-name) + "Run command of pipe nameed PIPE-NAME to TRACK." + (if (eq (emms-track-get track 'type) 'file) + (let* ((coding-system-for-read 'utf-8) + (command (emms-tag-editor-pipe-get pipe-name :command)) + (arguments (emms-tag-editor-pipe-get pipe-name :arguments))) + (when (functionp arguments) + (setq arguments (funcall arguments track))) + (setq arguments + (when (listp arguments) + (mapcar + #'(lambda (x) + (cond ((symbolp x) + (emms-track-get track x)) + ((listp x) + (let ((list (mapcar + #'(lambda (y) + (if (symbolp y) + (emms-track-get track y) + y)) + x))) + (if (member nil list) + (list nil) + list))) + (t x))) + arguments))) + (setq arguments + (flatten-tree + (remove (list nil) arguments))) + (if (and command (listp arguments)) + (if (member nil arguments) + (message "Warn: skip run %S" (string-join `(,command ,@(remove nil arguments)) " ")) + (if (zerop (apply #'call-process + command nil nil nil arguments)) + (progn + (message "Run command: %S" (string-join `(,command ,@arguments) " ")) + (run-hook-with-args 'emms-info-functions track)) + (message "Fail to run command: %S" (string-join `(,command ,@arguments) " ")))) + (message "No command or arguments are found."))) + (message "Only support files."))) + +(defun emms-tag-editor-marked-track-pipe (pipe-name) + "Run command of pipe named PIPE-NAME to marked tracks." + (let ((tracks (emms-mark-mapcar-marked-track + 'emms-tag-editor-track-at t))) + (if (null tracks) + (message "No track marked!") + (dolist (track tracks) + (emms-tag-editor-track-pipe track pipe-name))))) + + (provide 'emms-tag-editor) ;;; Emms-tag-editor.el ends here diff --git a/emms-url.el b/emms-url.el index 59d5cfa..4e05d7a 100644 --- a/emms-url.el +++ b/emms-url.el @@ -1,4 +1,4 @@ -;;; emms-url.el --- Make URL and EMMS work together well +;;; emms-url.el --- Make URL and EMMS work together well -*- lexical-binding: t; -*- ;; Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. diff --git a/emms-volume-amixer.el b/emms-volume-amixer.el index 190f6b0..9cd4cb3 100644 --- a/emms-volume-amixer.el +++ b/emms-volume-amixer.el @@ -1,4 +1,4 @@ -;;; emms-volume-amixer.el --- a mode for changing volume using amixer +;;; emms-volume-amixer.el --- a mode for changing volume using amixer -*- lexical-binding: t; -*- ;; Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. diff --git a/emms-volume-mixerctl.el b/emms-volume-mixerctl.el index 4ca7820..72bdfec 100644 --- a/emms-volume-mixerctl.el +++ b/emms-volume-mixerctl.el @@ -1,4 +1,4 @@ -;;; emms-volume-mixerctl.el --- a mode for changing volume using mixerctl +;;; emms-volume-mixerctl.el --- a mode for changing volume using mixerctl -*- lexical-binding: t; -*- ;; Copyright (C) 2006, 2007, 2008, 2009, 2019 Free Software Foundation, Inc. diff --git a/emms-volume-pulse.el b/emms-volume-pulse.el index 440ab7f..10b8889 100644 --- a/emms-volume-pulse.el +++ b/emms-volume-pulse.el @@ -1,4 +1,4 @@ -;;; emms-volume-pulse.el --- a mode for changing volume using PulseAudio pactl +;;; emms-volume-pulse.el --- a mode for changing volume using PulseAudio pactl -*- lexical-binding: t; -*- ;; Copyright (C) 2015 Free Software Foundation, Inc. @@ -65,7 +65,6 @@ See full list of devices on your system by running (defun emms-volume--pulse-get-volume () "Return `emms-volume-pulse-sink' volume." (let ((sink-number-p (numberp emms-volume-pulse-sink)) - (start 0) (output (shell-command-to-string (concat "pactl list sinks" "|" diff --git a/emms-volume.el b/emms-volume.el index 078eef5..655e587 100644 --- a/emms-volume.el +++ b/emms-volume.el @@ -1,4 +1,4 @@ -;;; emms-volume.el --- Volume functions and a minor mode to adjust volume easily +;;; emms-volume.el --- Volume functions and a minor mode to adjust volume easily -*- lexical-binding: t; -*- ;; Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. @@ -64,7 +64,7 @@ ((executable-find "amixer") 'emms-volume-amixer-change) ((executable-find "pactl") 'emms-volume-pulse-change) ((executable-find "mixerctl") 'emms-volume-mixerctl-change) - (t #'(lambda (amount) (user-error "%s" "No supported mixer found. Please, define ‘emms-volume-change-function’.")))) + (t #'(lambda (_amount) (user-error "%s" "No supported mixer found. Please, define ‘emms-volume-change-function’.")))) "*The function to use to change the volume. If you have your own functions for changing volume, set this." :type '(choice (const :tag "Amixer" emms-volume-amixer-change) @@ -1,11 +1,11 @@ -;;; emms.el --- The Emacs Multimedia System +;;; emms.el --- The Emacs Multimedia System -*- lexical-binding: t; -*- ;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, ;; 2009, 2018, 2020 Free Software Foundation, Inc. ;; Author: Jorgen Schäfer <forcer@forcix.cx>, the Emms developers (see AUTHORS file) ;; Maintainer: Yoni Rabkin <yrk@gnu.org> -;; Version: 6.02 +;; Version: 6.03 ;; Keywords: emms, mp3, ogg, flac, music, mpeg, video, multimedia ;; Package-Type: multi ;; Package-Requires: ((cl-lib "0.5") (seq)) @@ -45,7 +45,7 @@ ;;; Code: -(defvar emms-version "6.00" +(defvar emms-version "6.03" "EMMS version string.") @@ -1261,6 +1261,7 @@ ignore this." (defun emms-default-ok-track-function (track) "A function which OKs all tracks for playing by default." + (ignore track) ;; explicit ignore t) ;;; Helper functions @@ -1,7 +1,7 @@ This is emms.info, produced by makeinfo version 6.1 from emms.texinfo. (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2014, 2015, 2016, -2020 Free Software Foundation, Inc. +2020, 2021 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software @@ -22,7 +22,7 @@ Emms Manual This is the Manual for the Emacs Multimedia System. (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2014, 2015, 2016, -2020 Free Software Foundation, Inc. +2020, 2021 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software @@ -123,7 +123,7 @@ Emms, an online version of the manual is available at: The basic functionality of Emms consists of three parts: The core, the sources, and the players. - The core resides in 'emms.el', and provides a simple playlist and the + The core resides in 'emms.el', provides a simple playlist, and the basic functionality to use all the other features of Emms. It provides the common user commands and interfaces for other parts. It thinks in tracks, where a track is the combination of a type and a name - e.g. @@ -135,11 +135,11 @@ types are possible. system. When Emms finally has the sources in the playlist, it needs a player -to play them. 'emms-player-simple.el' defines a few useful players, and -allows you to define your own in a very simple way. +to play them. 'emms-player-simple.el' defines a few useful players and +provides a straightforward way of providing your own. - The Emms core comes with many additional features to extend its -functionality. + The Emms comes with many additional features to extend the +functionality beyond the core. The way Emms works is easy to customize with your own code or by using 'M-x customize' or by changing the variables directly. @@ -154,9 +154,10 @@ This chapter demonstrates how to setup Emms so that you can start listening to your music without having to read all of the documentation first. This is the tl;dr version of the manual. - The first thing you have to do is telling Emacs where Emms is -located. Let's say you have it in '~/elisp/emms/'. So add this line to -your '.emacs': + The first thing you do is to load Emms via GNU ELPA. But if you are +installing manually, then start by telling Emacs where Emms is located. +Let's say you have it in '~/elisp/emms/'. So add this line to your +'.emacs': (add-to-list 'load-path "~/elisp/emms/lisp/") @@ -165,7 +166,7 @@ installation chapter, *Note Installation::. You'll then want to load Emms into Emacs. To achieve this you invoke the 'emms-all' setup function by adding the following three lines to -your '.emacs'. +your Emacs initialization file. (require 'emms-setup) (emms-all) @@ -185,14 +186,14 @@ the name of the file) of the music you listen to. Emms can use a number of pieces of software and libraries as sources for track info, see *Note Track Information:: for more. - The last thing to do is to tell Emms where your music is; the root + The last thing to do is to tell Emms where is your music; the root directory of our music collection. Let's say all your music is in -'~/Music' or in subdirectories thereof. +'~/Music' or in subdirectories thereof: (setq emms-source-file-default-directory "~/Music/") - OK, now we've set up Emms. Reload your '.emacs' or restart Emacs to -let the changes have an effect. + OK, now we've set up Emms. Reload your Emacs initialization file or +restart Emacs to let the changes have an effect. Now we will add all our music to a playlist by invoking 'M-x emms-add-directory-tree RET ~/Music/ RET'. We do this because then Emms @@ -201,9 +202,9 @@ required for the Emms browser, *Note The Browser::.) To switch to the playlist buffer, invoke 'M-x emms-playlist-mode-go' or simply 'M-x emms'. You may see that some tracks are displayed with -their file name, but as Emms populates its tag cache, track by track, -the filenames get replaced with the artist and track name of the file's -tag. +their file name, but as Emms asynchronously populates its tag cache, +track by track, the filenames get replaced with the artist and track +name of the file's tag. Go ahead and navigate to a track and hit 'RET' on it to start playback. @@ -329,9 +330,10 @@ mechanism provided by Emacs. * Menu: * Finding files and speed:: Finding files quickly or portably. +* Setup Examples:: Examples of ways to setup Emms. -File: emms.info, Node: Finding files and speed, Up: Configuration +File: emms.info, Node: Finding files and speed, Next: Setup Examples, Up: Configuration 5.1 Finding files and speed =========================== @@ -353,6 +355,57 @@ installed. EMMS-SOURCE-FILE-DIRECTORY-TREE-FUNCTION. +File: emms.info, Node: Setup Examples, Prev: Finding files and speed, Up: Configuration + +5.2 Setup Examples +================== + +What follow are samples from real-world Emms configurations which show +some of the variety and breadth of modifications people make to the +default Emms setup. + + The following excerpt includes dbus integration, defining a "recent" +filter for the *Note The Browser::, persistent playlist via +'emms-history.el', and enabling sending track information with +'emms-librefm-stream.el': + + ;; notifications + (require 'emms-dbus) + (emms-dbus-enable) + ;; covers + (setq emms-browser-covers #'emms-browser-cache-thumbnail-async) + (setq emms-browser-thumbnail-small-size 64) + (setq emms-browser-thumbnail-medium-size 128) + ;; filters + (emms-browser-make-filter "all" #'ignore) + (emms-browser-make-filter "recent" + (lambda (track) (< 30 + (time-to-number-of-days + (time-subtract (current-time) + (emms-info-track-file-mtime track)))))) + (emms-browser-set-filter (assoc "all" emms-browser-filters)) + ;; history + (emms-history-load) + ;; libre-fm + (emms-librefm-scrobbler-enable) + + In the following it is possible to see how some of defaults are set +regarding saving playlists, playlist interaction, as well as adding +special arguments to a specific player backend. + + (setq-default + emms-source-file-default-directory "/mnt/db/mediaCore/sound_music/" + + emms-source-playlist-default-format 'm3u + emms-playlist-mode-center-when-go t + emms-playlist-default-major-mode 'emms-playlist-mode + emms-show-format "NP: %s" + + emms-player-list '(emms-player-mpv) + emms-player-mpv-environment '("PULSE_PROP_media.role=music") + emms-player-mpv-parameters '("--quiet" "--really-quiet" "--no-audio-display" "--force-window=no" "--vo=null")) + + File: emms.info, Node: Getting Help, Next: Formats and Freedom, Prev: Configuration, Up: Top 6 Getting Help @@ -3370,12 +3423,14 @@ Concept Index * compiling: Compiling Emms. (line 6) * complex player: More Complex Player. (line 6) * Configuration: Configuration. (line 6) +* configuration: Setup Examples. (line 6) * core file: The Core File. (line 6) * core functions: Core Functions. (line 6) * defining info methods: Defining Info Methods. (line 6) * defining new players: New Player. (line 6) * defining players: Extending Emms. (line 6) * display emms information: Emms Mode Line. (line 6) +* example: Setup Examples. (line 6) * FDL, GNU Free Documentation License: The GNU FDL. (line 6) * files: Finding files and speed. (line 6) @@ -3755,61 +3810,62 @@ Keybinding Index Tag Table: -Node: Top695 -Node: Introduction4442 -Node: Quickstart Guide5901 -Node: Installation8652 -Node: Compiling Emms9201 -Node: Setup9889 -Node: Configuration10875 -Node: Finding files and speed12286 -Node: Getting Help13132 -Node: Formats and Freedom13710 -Node: Basic Commands14915 -Node: The Core File18296 -Node: User Variables18730 -Node: Hooks19706 -Node: Core Functions21132 -Node: Sources24132 -Node: Simple Players26265 -Node: Playlists27322 -Node: Track Information28603 -Node: Using tinytag31490 -Node: Using exiftool31919 -Node: Using TagLib32291 -Node: Defining Info Methods33400 -Node: Interactive Playlists34182 -Node: Markable Playlists37224 -Node: Extending Emms39695 -Node: New Player40131 -Node: Simple Player for `play'40520 -Node: More Complex Player42248 -Node: The Browser45255 -Node: Browser Interface46231 -Node: Filtering Tracks48645 -Node: Displaying Covers50423 -Node: Changing Looks52437 -Node: Sorting Playlists55415 -Node: Persistent Playlists56884 -Node: Editing Tracks58043 -Node: Emms Mode Line61717 -Node: Limiting62885 -Node: Music Player Daemon65224 -Node: Lyrics68737 -Node: Volume70785 -Node: Streaming Audio72573 -Ref: Streaming Audio-Footnote-173165 -Node: APE / FLAC Commands73516 -Node: Bookmarks74223 -Node: Managing Playlists74934 -Node: GNU FM75957 -Node: Uploading Track Information77311 -Node: GNU FM Streaming78193 -Node: Copying78693 -Node: The GNU FDL116210 -Node: Concept Index138598 -Node: Function Index143529 -Node: Variable Index159221 -Node: Keybinding Index161564 +Node: Top701 +Node: Introduction4454 +Node: Quickstart Guide5922 +Node: Installation8790 +Node: Compiling Emms9339 +Node: Setup10027 +Node: Configuration11013 +Node: Finding files and speed12488 +Node: Setup Examples13357 +Node: Getting Help15290 +Node: Formats and Freedom15868 +Node: Basic Commands17073 +Node: The Core File20454 +Node: User Variables20888 +Node: Hooks21864 +Node: Core Functions23290 +Node: Sources26290 +Node: Simple Players28423 +Node: Playlists29480 +Node: Track Information30761 +Node: Using tinytag33648 +Node: Using exiftool34077 +Node: Using TagLib34449 +Node: Defining Info Methods35558 +Node: Interactive Playlists36340 +Node: Markable Playlists39382 +Node: Extending Emms41853 +Node: New Player42289 +Node: Simple Player for `play'42678 +Node: More Complex Player44406 +Node: The Browser47413 +Node: Browser Interface48389 +Node: Filtering Tracks50803 +Node: Displaying Covers52581 +Node: Changing Looks54595 +Node: Sorting Playlists57573 +Node: Persistent Playlists59042 +Node: Editing Tracks60201 +Node: Emms Mode Line63875 +Node: Limiting65043 +Node: Music Player Daemon67382 +Node: Lyrics70895 +Node: Volume72943 +Node: Streaming Audio74731 +Ref: Streaming Audio-Footnote-175323 +Node: APE / FLAC Commands75674 +Node: Bookmarks76381 +Node: Managing Playlists77092 +Node: GNU FM78115 +Node: Uploading Track Information79469 +Node: GNU FM Streaming80351 +Node: Copying80851 +Node: The GNU FDL118368 +Node: Concept Index140756 +Node: Function Index145833 +Node: Variable Index161525 +Node: Keybinding Index163868 End Tag Table |