summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-10-14 03:53:22 +0100
committerjao <jao@gnu.org>2022-10-14 03:53:22 +0100
commitb2955885cca4b4f91bca63fd2175929f1c684077 (patch)
tree8e8f94d3d43defda3fd17fab33b4cd39c36ef48a
parente52e42bca291f947980ea1938185bd3cd8d85d07 (diff)
downloadelibs-b2955885cca4b4f91bca63fd2175929f1c684077.tar.gz
elibs-b2955885cca4b4f91bca63fd2175929f1c684077.tar.bz2
jao-random-album-p -> -active (and don't trigger it at startup)
-rw-r--r--attic/elisp/jao-mpdn.el4
-rw-r--r--init.el2
-rw-r--r--lib/media/jao-mpc.el4
-rw-r--r--lib/media/jao-random-album.el12
4 files changed, 11 insertions, 11 deletions
diff --git a/attic/elisp/jao-mpdn.el b/attic/elisp/jao-mpdn.el
index d707767..2e02d59 100644
--- a/attic/elisp/jao-mpdn.el
+++ b/attic/elisp/jao-mpdn.el
@@ -1,6 +1,6 @@
;;; jao-mpdn.el --- Notifications using elmpd -*- lexical-binding: t; -*-
-;; Copyright (C) 2021 jao
+;; Copyright (C) 2021, 2022 jao
;; Author: jao <mail@jao.io>
;; Keywords: convenience
@@ -116,7 +116,7 @@
(setq jao-mpdn--current (jao-mpdn--parse-retort txt))
(jao-mpdn--update-minibuffer)
(cond (next (funcall next))
- ((and (null jao-mpdn--current) jao-random-album-p)
+ ((and (null jao-mpdn--current) jao-random-album-active)
(jao-random-album-next)))))))
(jao-mpdn--send "currentsong" cb)))
diff --git a/init.el b/init.el
index 4ccf870..83c66b4 100644
--- a/init.el
+++ b/init.el
@@ -2941,7 +2941,7 @@
("c" "reconnect to mpd" jao-player-connect)
("N" "next random album" jao-random-album-next)
("r" (lambda ()
- (concat (if jao-random-album-p "dis" "en") "able random album"))
+ (concat (if jao-random-album-active "dis" "en") "able random album"))
jao-random-album-toggle)
("P" (lambda () (concat "Toggle to " (if (jao-mpc-mopidy-p) "mpd" "mopidy")))
jao-mpc-toggle-port)]])
diff --git a/lib/media/jao-mpc.el b/lib/media/jao-mpc.el
index 9cdd5bd..74f9b5b 100644
--- a/lib/media/jao-mpc.el
+++ b/lib/media/jao-mpc.el
@@ -116,7 +116,7 @@
(let ((status (or (jao-mpc-status port) "")))
(setq jao-mpc-minibuffer-str
(if (string= "playing" status) (jao-mpc--current-str port) ""))
- (when (and jao-random-album-p
+ (when (and jao-random-album-active
(string= status "paused")
(string= "0\n" (jao-mpc--cmd "status %songpos%" port)))
(jao-random-album-next)))
@@ -301,7 +301,7 @@
#'jao-mpc--add-and-play
#'jao-mpc-stop
jao-notify-audio-icon)
- (jao-mpc-connect)
+ (let ((jao-random-album-active nil)) (jao-mpc-connect))
(when secondary-port (jao-mpc-connect secondary-port))
(when priority
(if (> priority 0)
diff --git a/lib/media/jao-random-album.el b/lib/media/jao-random-album.el
index 2800115..4fc06cb 100644
--- a/lib/media/jao-random-album.el
+++ b/lib/media/jao-random-album.el
@@ -1,6 +1,6 @@
;; jao-random-album.el -- play random albums
-;; Copyright (C) 2009, 2010, 2017, 2018, 2019, 2021 Jose Antonio Ortega Ruiz
+;; Copyright (C) 2009, 2010, 2017, 2018, 2019, 2021, 2022 Jose Antonio Ortega Ruiz
;; Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
;; Start date: Sat Jul 04, 2009 13:06
@@ -20,7 +20,7 @@
(require 'jao-notify)
-(defvar jao-random-album-p t)
+(defvar jao-random-album-active t)
(defvar jao-random-lines nil)
(defvar jao-random-lines-file (expand-file-name "~/.emacs.d/random-lines"))
(defvar jao-random-album-notify-p t)
@@ -60,19 +60,19 @@
(defun jao-random-album-start ()
(interactive)
- (setq jao-random-album-p t)
+ (setq jao-random-album-active t)
(jao-random-album-next))
(defun jao-random-album-stop ()
(interactive)
- (setq jao-random-album-p nil)
+ (setq jao-random-album-active nil)
(funcall jao-random-album-stop))
(defun jao-random-album-toggle ()
(interactive)
- (setq jao-random-album-p (not jao-random-album-p))
+ (setq jao-random-album-active (not jao-random-album-active))
(message "Random album %s"
- (if jao-random-album-p "enabled" "disabled")))
+ (if jao-random-album-active "enabled" "disabled")))
(defun jao-random-album-next ()
(interactive)