From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: tsuucat via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#44093: [PATCH] some patches for lisp/mpc.el Date: Tue, 20 Oct 2020 16:32:26 +0900 Message-ID: <312AE1F0-BCAD-43C2-B078-507549FA400E@icloud.com> Reply-To: tsuucat Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2472"; mail-complaints-to="usenet@ciao.gmane.io" To: 44093@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 20 09:33:10 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kUm8s-0000Wq-05 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 20 Oct 2020 09:33:10 +0200 Original-Received: from localhost ([::1]:39456 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUm8r-0006f8-2G for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 20 Oct 2020 03:33:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60738) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUm8l-0006ey-00 for bug-gnu-emacs@gnu.org; Tue, 20 Oct 2020 03:33:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59908) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kUm8k-0004Wm-Mo for bug-gnu-emacs@gnu.org; Tue, 20 Oct 2020 03:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kUm8k-0004Au-K4 for bug-gnu-emacs@gnu.org; Tue, 20 Oct 2020 03:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: tsuucat Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 20 Oct 2020 07:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 44093 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.160317915916013 (code B ref -1); Tue, 20 Oct 2020 07:33:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 20 Oct 2020 07:32:39 +0000 Original-Received: from localhost ([127.0.0.1]:43221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUm8M-0004AD-VP for submit@debbugs.gnu.org; Tue, 20 Oct 2020 03:32:39 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:56410) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUm8K-0004A4-QO for submit@debbugs.gnu.org; Tue, 20 Oct 2020 03:32:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUm8K-0006bO-JJ for bug-gnu-emacs@gnu.org; Tue, 20 Oct 2020 03:32:36 -0400 Original-Received: from pv50p00im-zteg10011501.me.com ([17.58.6.42]:47955) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUm8G-0004Hu-8r for bug-gnu-emacs@gnu.org; Tue, 20 Oct 2020 03:32:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; t=1603179149; bh=fyrIKoH5g9JfJIBkwImiprWYN6vCYJEr10GmNxx2p8w=; h=From:Content-Type:Mime-Version:Subject:Message-Id:Date:To; b=PxSSzSOq2qI/9C0oo9woR15vU0OdvMcPz3s1lrdtqG3coX0ZqsaFDO87oGlXxdF0k OuSlRJJHKwOr+Jpcyah+rNIO+qfmkleXNJ71UEV15LIIAMGjN8BgBTtTgGnYX17/1u EYDuYhr9uPhC7BiDHIFJk7Xr0F2DrzZTbARX9loKqTuo/8dbfYnJru4Dp7DJK3mpvj lbSDXQMJiAh4mVNHrBNIDn72891aSVazZA4XV4fee+hffLCorRc8r3UU+J087QZkfx 3IM6ROHfP5SaD15AIzwpPl3DfxAeziCiYmC5g9my5jyjpQBtZ/r8RJAgUQni663boU /qCgYN8dhS+AQ== Original-Received: from [192.168.96.166] (hlla-gw.hlla.is.tsukuba.ac.jp [130.158.83.243]) by pv50p00im-zteg10011501.me.com (Postfix) with ESMTPSA id 018D9B003B4 for ; Tue, 20 Oct 2020 07:32:28 +0000 (UTC) X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-10-20_03:2020-10-16, 2020-10-20 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2006250000 definitions=main-2010200049 Received-SPF: pass client-ip=17.58.6.42; envelope-from=tsuucat@icloud.com; helo=pv50p00im-zteg10011501.me.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/20 03:32:29 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:191066 Archived-At: I made three small patches for lisp/mpc.el. 1. I noticed M-x mpc-playlist-delete always messages =E2=80=9CDeleted 1 = songs=E2=80=9D even if playlist queue has more than one songs. This is because mpc-cmd-delete=E2=80=99s sort modifies songs-poss by = side effect. Using copy-sequence fixes this. (also fix mpc-cmd-move for same reason) diff --git a/lisp/mpc.el b/lisp/mpc.el index d22b7ab450..e5f5984a33 100644 --- a/lisp/mpc.el +++ b/lisp/mpc.el @@ -849,7 +849,7 @@ mpc-cmd-delete ;; Sort them from last to first, so the = renumbering ;; caused by the earlier deletions don't = affect ;; later ones. - (sort song-poss '>)))) + (sort (copy-sequence song-poss) '>)))) (if (stringp playlist) (puthash (cons 'Playlist playlist) nil mpc--find-memoize))) @@ -873,7 +873,7 @@ mpc-cmd-move ;; Sort them from last to first, so the renumbering ;; caused by the earlier deletions affect ;; later ones a bit less. - (sort song-poss '>)))) + (sort (copy-sequence song-poss) '>)))) (if (stringp playlist) (puthash (cons 'Playlist playlist) nil mpc--find-memoize)))) 2. M-x mpc-songs-jump-to doesn=E2=80=99t update *MPC-Status* buffer. Use mpc-cmd-play. diff --git a/lisp/mpc.el b/lisp/mpc.el index d22b7ab450..a0f79e0492 100644 --- a/lisp/mpc.el +++ b/lisp/mpc.el @@ -819,8 +819,8 @@ mpc-cmd-pause (defun mpc-cmd-status () (mpc-proc-cmd-to-alist "status")) -(defun mpc-cmd-play () - (mpc-proc-cmd "play") +(defun mpc-cmd-play (&optional sn) + (mpc-proc-cmd (if sn (list "play" sn) "play")) (mpc-status-refresh)) (defun mpc-cmd-seekcur (time) @@ -2089,7 +2089,7 @@ mpc-songs-jump-to ((null (with-current-buffer plbuf (re-search-forward re nil t))) ;; song-file only appears once in the playlist: no ambiguity, ;; we're good to go! - (mpc-proc-cmd (list "play" sn))) + (mpc-cmd-play sn)) (t ;; The song appears multiple times in the playlist. If the = current ;; buffer holds not only the destination song but also the = current @@ -2125,7 +2125,7 @@ mpc-songs-jump-to 3. M-x mpc-stop clears playlist queue. So updating *MPC-Songs* buffer is useful. diff --git a/lisp/mpc.el b/lisp/mpc.el index d22b7ab450..405e669660 100644 --- a/lisp/mpc.el +++ b/lisp/mpc.el @@ -2391,6 +2391,7 @@ mpc-stop (interactive) (mpc-cmd-stop) (mpc-cmd-clear) + (mpc-songs-refresh) (mpc-status-refresh)) (defun mpc-pause () Please review these patches. Do I have to squash these patches to one commit? -- tsuucat=