Tweak elfeed, emms and tame spurious buffers

This commit is contained in:
Gerard Vermeulen 2022-04-24 10:18:32 +02:00
parent f2c2f6aa10
commit e2c6671f96

View File

@ -3508,7 +3508,8 @@ initializes a list of =webjump-sites=.
:CUSTOM_ID: sec:emacs-web-feed-reader :CUSTOM_ID: sec:emacs-web-feed-reader
:END: :END:
Listing [[lst:configure-elfeed]] configures =elfeed=. Listing [[lst:configure-elfeed]] configures =elfeed= and makes a minimal attempt to
enable =emms=.
#+attr_latex: :options breaklines #+attr_latex: :options breaklines
#+caption[Configure =elfeed=]: #+caption[Configure =elfeed=]:
@ -3537,7 +3538,11 @@ Listing [[lst:configure-elfeed]] configures =elfeed=.
("https://www.bof.nl/rss/" bof) ("https://www.bof.nl/rss/" bof)
("https://www.democracynow.org/podcast-video.xml" dn) ("https://www.democracynow.org/podcast-video.xml" dn)
("https://www.laquadrature.net/fr/rss.xml" lqdn) ("https://www.laquadrature.net/fr/rss.xml" lqdn)
("https://www.lemonde.fr/blog/huet/feed/" sciences)))))) ("https://www.lemonde.fr/blog/huet/feed/" sciences)))))
(with-eval-after-load 'elfeed-show
(when (require 'emms-setup nil 'noerror)
(emms-all))))
#+end_src #+end_src
** [[info:emms#Top][Emacs Multimedia System (info)]] ** [[info:emms#Top][Emacs Multimedia System (info)]]
@ -3546,18 +3551,12 @@ Listing [[lst:configure-elfeed]] configures =elfeed=.
:END: :END:
The link [[https://sqrtminusone.xyz/posts/2021-09-07-emms/][my emms and elfeed setup]] is a nice introduction to configuring and The link [[https://sqrtminusone.xyz/posts/2021-09-07-emms/][my emms and elfeed setup]] is a nice introduction to configuring and
using =emms= with =elfeed=. Listing [[lst:configure-emms]] configures =emms= for using =emms= with =elfeed=. Listing [[lst:configure-emms]] configures =emms=.
use with =elfeed= and listing [[lst:write-mpd-conf]] writes a configuration file for
the [[https://www.musicpd.org/][Music Player Daemon]].
#+caption[Configure =emms=]: #+caption[Configure =emms=]:
#+caption: Configure =emms=. #+caption: Configure =emms=.
#+name: lst:configure-emms #+name: lst:configure-emms
#+begin_src emacs-lisp #+begin_src emacs-lisp
(with-eval-after-load 'elfeed-show
(when (require 'emms-setup nil 'noerror)
(emms-all)))
(with-eval-after-load 'emms (with-eval-after-load 'emms
(custom-set-variables (custom-set-variables
'(emms-player-list '(emms-player-mpd emms-player-mpv)))) '(emms-player-list '(emms-player-mpd emms-player-mpv))))
@ -3592,9 +3591,46 @@ the [[https://www.musicpd.org/][Music Player Daemon]].
(emms-all)) (emms-all))
#+end_src #+end_src
#+caption[Write =mpd.conf=]: *** Taming spurious buffers
#+caption: Write =mpd.conf=. :PROPERTIES:
#+name: lst:write-mpd-conf :CUSTOM_ID: sec:taming-spurious-buffers
:END:
When =emms-player-mpd= opens a connection to =mpd=, =mpd= responds with a
message of the form "OK MPD 0.23.5". Neither =emms-player-mpd= nor its support
library =tq= anticipate the "OK MPD 0.23.5" message, but send such messages to a
new intrusive buffer called =*spurious*=. Listing [[lst:taming-spurious-buffers]]
makes those =*spurious*= buffers less intrusive. See:
1. [[info:elisp#The Zen of Buffer Display][The Zen of Buffer Display (info)]]
2. [[https://e17i.github.io/articles-emacs-display-1/][Configuring the Emacs display system]]
for technical information.
#+caption[Taming =*spurious*= buffers]:
#+caption: Taming =*spurious*= buffers.
#+name: lst:taming-spurious-buffers
#+begin_src emacs-lisp
(with-eval-after-load 'emms-player-mpd
;; https://stackoverflow.com/a/47587185 answers:
;; How to avoid pop-up of *Async Shell Command* buffers in Emacs?
;; Avoid popping up of `*spurious*' buffers:
(add-to-list 'display-buffer-alist
'("\\*spurious\\*.*"
(display-buffer-at-bottom)
(window-height . fit-window-to-buffer))))
#+end_src
*** [[https://www.musicpd.org/][Music Player Daemon]] configuration configuration
:PROPERTIES:
:CUSTOM_ID: sec:mpd-configuration-file
:END:
Listing [[lst:make-mpd-conf]] proposes a [[https://www.musicpd.org/][Music Player Daemon]] configuration file that
keeps each new connection for a day in order to reduce the rate of =*spurious*=
generation.
#+Caption[A Music Player Daemon configuration file proposal]:
#+caption: A Music Player Daemon configuration file proposal.
#+name: lst:make-mpd-conf
#+begin_src shell :results silent #+begin_src shell :results silent
case "$(uname -s)" in case "$(uname -s)" in
Darwin) Darwin)
@ -3608,17 +3644,15 @@ the [[https://www.musicpd.org/][Music Player Daemon]].
follow_outside_symlinks "yes" follow_outside_symlinks "yes"
follow_inside_symlinks "yes" follow_inside_symlinks "yes"
bind_to_address "localhost"
port "6600"
connection_timeout "86400"
audio_output { audio_output {
type "osx" type "osx"
name "CoreAudio" name "CoreAudio"
mixer_type "software" mixer_type "software"
} }
bind_to_address "localhost"
connection_timeout "86400"
port "6600"
user "$USER"
EOF EOF
;; ;;
esac esac