From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 28 15:18:01 2024 Received: (at submit) by debbugs.gnu.org; 28 Jan 2024 20:18:01 +0000 Received: from localhost ([127.0.0.1]:58419 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rUBbM-00086V-E9 for submit@debbugs.gnu.org; Sun, 28 Jan 2024 15:18:00 -0500 Received: from lists.gnu.org ([2001:470:142::17]:46884) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rUBbJ-00086E-Gn for submit@debbugs.gnu.org; Sun, 28 Jan 2024 15:17:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rUBb4-0007m5-K2 for bug-gnu-emacs@gnu.org; Sun, 28 Jan 2024 15:17:42 -0500 Received: from out-187.mta1.migadu.com ([95.215.58.187]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rUBb1-0001qI-ID for bug-gnu-emacs@gnu.org; Sun, 28 Jan 2024 15:17:42 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pub.pink; s=key1; t=1706473055; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J83bb3LILZxjVN7GVuqSNGav75KMf91N9B+5bSlWPCw=; b=UZVLE+NqelgGryhopCvj19QShj0ejDUVxhO1UtC6sXcrxSvp54vxb5tKWtCw9TlmQkqNa2 KNulUJCYDPJnt/yqKozPhefdcgDyrdCG7AqCUTfDgBa18GIX3mA6voRZoc3FB3P/IqLZ2R eOhfB8kS6q1BGBud8ZlVePqcFG5Rp0Y= From: john muhl To: bug-gnu-emacs@gnu.org Subject: [PATCH] Fix volume refresh bug in mpc Date: Sun, 28 Jan 2024 14:17:31 -0600 Message-ID: <87a5opb4bo.fsf@pub.pink> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=95.215.58.187; envelope-from=jm@pub.pink; helo=out-187.mta1.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) Tags: patch When mpd is stopped or paused the volume returned is nil which causes the string-to-number in mpc-volume-refresh to error. emacs -Q M-x toggle-debug-on-error M-: (setopt mpc-host "hifi.lan") M-x mpc =E2=80=A6with something in the playlist M-: (mpc-play) M-: (mpc-stop) Debugger entered--Lisp error: (wrong-type-argument stringp nil) string-to-number(nil) (mpc-volume-widget (string-to-number (cdr (assq 'volume mpc-status)))) (setq mpc-volume (mpc-volume-widget (string-to-number (cdr (assq 'volum= e mpc-status))))) mpc-volume-refresh() funcall(mpc-volume-refresh) (progn (funcall (cdr pair))) (if (or (eq t (car pair)) (not (equal (cdr (assq (car pair) old-status)= ) (cdr (assq (car pair) mpc-status))))) (progn (funcall (cdr pair)))) (let ((pair (car tail))) (if (or (eq t (car pair)) (not (equal (cdr (as= sq (car pair) old-status)) (cdr (assq (car pair) mpc-status))))) (progn (fu= ncall (cdr pair)))) (setq tail (cdr tail))) (while tail (let ((pair (car tail))) (if (or (eq t (car pair)) (not (eq= ual (cdr (assq ... old-status)) (cdr (assq ... mpc-status))))) (progn (func= all (cdr pair)))) (setq tail (cdr tail)))) (let ((tail mpc-status-callbacks)) (while tail (let ((pair (car tail)))= (if (or (eq t (car pair)) (not (equal (cdr ...) (cdr ...)))) (progn (funca= ll (cdr pair)))) (setq tail (cdr tail))))) (if (equal old-status mpc-status) nil (let ((tail mpc-status-callbacks)= ) (while tail (let ((pair (car tail))) (if (or (eq t (car pair)) (not (equa= l ... ...))) (progn (funcall (cdr pair)))) (setq tail (cdr tail)))))) (let ((old-status mpc-status)) (setq mpc-status (mpc-proc-buf-to-alist)= ) (progn (or mpc-status (cl--assertion-failed 'mpc-status)) nil) (if (equal= old-status mpc-status) nil (let ((tail mpc-status-callbacks)) (while tail = (let ((pair (car tail))) (if (or (eq t ...) (not ...)) (progn (funcall ...)= )) (setq tail (cdr tail))))))) mpc--status-callback() (closure ((cb)) nil (mpc--status-callback) (if cb (funcall cb)))() funcall((closure ((cb)) nil (mpc--status-callback) (if cb (funcall cb))= )) (let ((callback (process-get proc 'callback))) (process-put proc 'callb= ack nil) (if error-text (process-put proc 'mpc-proc-error error-text)) (fun= call callback)) (let ((error-text (match-string 1))) (delete-region (point) (point-max)= ) (let ((callback (process-get proc 'callback))) (process-put proc 'callbac= k nil) (if error-text (process-put proc 'mpc-proc-error error-text)) (funca= ll callback))) (progn (process-put proc 'ready t) (if (eq (match-end 0) (point-max)) n= il (error "Unexpected trailing text")) (let ((error-text (match-string 1)))= (delete-region (point) (point-max)) (let ((callback (process-get proc 'cal= lback))) (process-put proc 'callback nil) (if error-text (process-put proc = 'mpc-proc-error error-text)) (funcall callback)))) (if (and (< start (point)) (re-search-backward mpc--proc-end-re start t= )) (progn (process-put proc 'ready t) (if (eq (match-end 0) (point-max)) ni= l (error "Unexpected trailing text")) (let ((error-text (match-string 1))) = (delete-region (point) (point-max)) (let ((callback (process-get proc 'call= back))) (process-put proc 'callback nil) (if error-text (process-put proc '= mpc-proc-error error-text)) (funcall callback))))) (let ((start (or (marker-position (process-mark proc)) (point-min)))) (= goto-char start) (insert string) (move-marker (process-mark proc) (point)) = (beginning-of-line) (if (and (< start (point)) (re-search-backward mpc--pro= c-end-re start t)) (progn (process-put proc 'ready t) (if (eq (match-end 0)= (point-max)) nil (error "Unexpected trailing text")) (let ((error-text (ma= tch-string 1))) (delete-region (point) (point-max)) (let ((callback (proces= s-get proc ...))) (process-put proc 'callback nil) (if error-text (process-= put proc 'mpc-proc-error error-text)) (funcall callback)))))) (save-excursion (let ((start (or (marker-position (process-mark proc)) = (point-min)))) (goto-char start) (insert string) (move-marker (process-mark= proc) (point)) (beginning-of-line) (if (and (< start (point)) (re-search-b= ackward mpc--proc-end-re start t)) (progn (process-put proc 'ready t) (if (= eq (match-end 0) (point-max)) nil (error "Unexpected trailing text")) (let = ((error-text (match-string 1))) (delete-region (point) (point-max)) (let ((= callback ...)) (process-put proc 'callback nil) (if error-text (process-put= proc ... error-text)) (funcall callback))))))) (if (process-get proc 'ready) (if nil nil (delete-process proc) (set-pr= ocess-buffer proc nil) (pop-to-buffer (clone-buffer)) (error "MPD output wh= ile idle!?")) (save-excursion (let ((start (or (marker-position (process-ma= rk proc)) (point-min)))) (goto-char start) (insert string) (move-marker (pr= ocess-mark proc) (point)) (beginning-of-line) (if (and (< start (point)) (r= e-search-backward mpc--proc-end-re start t)) (progn (process-put proc 'read= y t) (if (eq (match-end 0) (point-max)) nil (error "Unexpected trailing tex= t")) (let ((error-text ...)) (delete-region (point) (point-max)) (let (...)= (process-put proc ... nil) (if error-text ...) (funcall callback)))))))) (save-current-buffer (set-buffer (process-buffer proc)) (if (process-ge= t proc 'ready) (if nil nil (delete-process proc) (set-process-buffer proc n= il) (pop-to-buffer (clone-buffer)) (error "MPD output while idle!?")) (save= -excursion (let ((start (or (marker-position ...) (point-min)))) (goto-char= start) (insert string) (move-marker (process-mark proc) (point)) (beginnin= g-of-line) (if (and (< start (point)) (re-search-backward mpc--proc-end-re = start t)) (progn (process-put proc 'ready t) (if (eq ... ...) nil (error "U= nexpected trailing text")) (let (...) (delete-region ... ...) (let ... ... = ... ...)))))))) mpc--proc-filter(# "repeat: 0\nrandom: 1\nsingle: 0\nconsu= me: 0\npartition: default\nplaylist: 55708\nplaylistlength: 0\nmixrampdb: 0= \nstate: stop\nOK\n") In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.18.0) of 2024-01-21 built on thelio Repository revision: 9364c28959a5b00e8ffd5d0d283ff0c0042f1bb0 Repository branch: master System Description: Fedora Linux 39 (Thirty Nine) Configured using: 'configure --with-pgtk --prefix=3D/home/jm/.local' From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 28 15:23:10 2024 Received: (at 68785) by debbugs.gnu.org; 28 Jan 2024 20:23:10 +0000 Received: from localhost ([127.0.0.1]:58428 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rUBgM-0008Fs-EO for submit@debbugs.gnu.org; Sun, 28 Jan 2024 15:23:10 -0500 Received: from out-187.mta0.migadu.com ([91.218.175.187]:12073) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rUBgK-0008FR-Vx for 68785@debbugs.gnu.org; Sun, 28 Jan 2024 15:23:09 -0500 References: <87a5opb4bo.fsf@pub.pink> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pub.pink; s=key1; t=1706473373; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=mimXqTpXzIQQXgqnhTgwnL707NbtBgcKHaRVw+7y3w8=; b=wFnHA6gpEt96W/AFhmAJuoxQDN1Pbrjr3Gbr5cmPUIn/Yf4E/OPMC6vQmyS6ftG4druD0p bszvX0PPJ6b9PqHWgVtsSKgQL56pu4EGg30SlTqfVUB6eX8H8QwvcaSve0sBSn4GkWd8GJ fZe9hCM71oAAGWdX2XxWQVYpE5bSOnE= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: john muhl To: 68785@debbugs.gnu.org Subject: Re: bug#68785: Acknowledgement ([PATCH] Fix volume refresh bug in mpc) Date: Sun, 28 Jan 2024 14:22:16 -0600 In-reply-to: Message-ID: <875xzdb42v.fsf@pub.pink> MIME-Version: 1.0 Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-volume-refresh-bug-in-mpc.patch X-Migadu-Flow: FLOW_OUT X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 68785 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >From 52f94878d94a6a3b9d59b53e720230546d881a2a Mon Sep 17 00:00:00 2001 From: john muhl Date: Thu, 25 Jan 2024 21:23:45 -0600 Subject: [PATCH] Fix volume refresh bug in mpc * lisp/mpc.el (mpc-volume-refresh): Only refresh volume when mpd is playing. When stopped or paused volume is nil. (bug#68785) --- lisp/mpc.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lisp/mpc.el b/lisp/mpc.el index 9577e0f2f42..768c70c2e3a 100644 --- a/lisp/mpc.el +++ b/lisp/mpc.el @@ -1867,11 +1867,14 @@ mpc-volume-map (defvar mpc-volume nil) (put 'mpc-volume 'risky-local-variable t) (defun mpc-volume-refresh () - ;; Maintain the volume. - (setq mpc-volume - (mpc-volume-widget - (string-to-number (cdr (assq 'volume mpc-status))))) - (let ((status-buf (mpc-proc-buffer (mpc-proc) 'status))) + "Maintain the volume." + (let ((status-buf (mpc-proc-buffer (mpc-proc) 'status)) + (status-vol (cdr (assq 'volume mpc-status)))) + ;; If MPD is paused or stopped the volume is nil. + (when status-vol + (setq mpc-volume + (mpc-volume-widget + (string-to-number status-vol)))) (when (buffer-live-p status-buf) (with-current-buffer status-buf (force-mode-line-update))))) -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 10 03:55:22 2024 Received: (at 68785-done) by debbugs.gnu.org; 10 Feb 2024 08:55:22 +0000 Received: from localhost ([127.0.0.1]:53641 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYj8r-0007sS-Vr for submit@debbugs.gnu.org; Sat, 10 Feb 2024 03:55:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57084) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYj7h-0007mm-I0 for 68785-done@debbugs.gnu.org; Sat, 10 Feb 2024 03:54:09 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYieC-000671-Fb; Sat, 10 Feb 2024 03:23:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=IJVaPOK39bHVGEz/5iCrOPrk1FvSFDLcyhcRcFz/hGk=; b=bbN1lWo8WFX2 Ov8a3ks94tYAGde+xI4l/vI84yid02lXPCPPbU5OsCd1fN/fe7Dqqjs/cJUOMW3vUCrqJhzmgAzVa njgdA03/rVRva/KkHWFE+gEbbR8kDaHA9laQIX5ZIMfJhkZUbiSLBJJHYn27kwQUsi5qzGG5CiiLe wqfxyW8y5KyrUMsQoswf6qRn5PPmb8PD08Q0EcHRB32r7d5Qq1NIYSZgcoCGLBbwLmeU2YRqVtwhq yZVSu7hzDRdtkG4mkS2ZfIregKPKD9eTlp0XMMQBUxjNqlH0T6k7L7FadTdZKo01d2Q0ZYoG/HpEt b99WW4DZVVuTzURz0sAWuQ==; Date: Sat, 10 Feb 2024 10:23:36 +0200 Message-Id: <86eddkvibb.fsf@gnu.org> From: Eli Zaretskii To: john muhl In-Reply-To: <875xzdb42v.fsf@pub.pink> (bug-gnu-emacs@gnu.org) Subject: Re: bug#68785: [PATCH] Fix volume refresh bug in mpc References: <87a5opb4bo.fsf@pub.pink> <875xzdb42v.fsf@pub.pink> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 68785-done Cc: 68785-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sun, 28 Jan 2024 14:22:16 -0600 > From: john muhl via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > >From 52f94878d94a6a3b9d59b53e720230546d881a2a Mon Sep 17 00:00:00 2001 > From: john muhl > Date: Thu, 25 Jan 2024 21:23:45 -0600 > Subject: [PATCH] Fix volume refresh bug in mpc > > * lisp/mpc.el (mpc-volume-refresh): Only refresh volume when mpd > is playing. When stopped or paused volume is nil. (bug#68785) Thanks, installed on master, and closing the bug. From unknown Sat Jun 21 12:34:42 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 09 Mar 2024 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator