unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel@gnu.org
Subject: Re: master 902f31d 1/2: New user option mpc-cover-image-re
Date: Wed, 29 Sep 2021 06:11:54 -0700	[thread overview]
Message-ID: <CADwFkmn9xaVGNeZ8M1Rq37iuVkwK8dA77Xv0-EbReh=H4Ay7Vg@mail.gmail.com> (raw)
In-Reply-To: <jwvtui3tuko.fsf-monnier+emacs@gnu.org>

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> Hi Stefan,
>
> Nice to see someone contributing to `mpc.el`.
> Any chance you can be tempted to implement support for the
> `idle` command?

I have various small various fixes and improvements in the cooker, but
implementing "idle" does sound like a fair bit more work.  Let me think
about it.  IIUC, it would basically make mpc.el less synchronous?

Meanwhile, maybe you can help me with this.  I have implemented the
below command, but when I run it outside of the "*Songs*" buffer, it
doesn't work.  I also can't add it to the end of `mpc' (to make point
start near the currently playing song).  I'm probably missing something
very obvious...

Also, once I get this working, any objections to the keybinding "o" for
this?  (This is the same key as in ncmpcpp.)

(This is an important feature for me, as I typically have very long
playlists that doubles as notes of what I've been listening to
recently.)

diff --git a/lisp/mpc.el b/lisp/mpc.el
index ad32ce8d33..06b80b1423 100644
--- a/lisp/mpc.el
+++ b/lisp/mpc.el
@@ -2669,6 +2669,16 @@ mpc-play-at-point
   (mpc-select event)
   (mpc-play))

+(defun mpc-jump-to-playing ()
+  "Move point to the currently playing song in the \"*Songs*\" buffer."
+  (interactive)
+  (let ((buf (mpc-proc-buffer (mpc-proc) 'songs)))
+    (when (buffer-live-p buf)
+      (with-current-buffer buf
+        (when (and overlay-arrow-position
+                   (eq (marker-buffer overlay-arrow-position) buf))
+          (goto-char (marker-position overlay-arrow-position)))))))
+
 ;; (defun mpc-play-tagval ()
 ;;   "Play all the songs of the tag at point."
 ;;   (interactive)



  reply	other threads:[~2021-09-29 13:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210929092814.12368.49075@vcs0.savannah.gnu.org>
     [not found] ` <20210929092816.41BAC207F5@vcs0.savannah.gnu.org>
2021-09-29 12:50   ` master 902f31d 1/2: New user option mpc-cover-image-re Stefan Monnier
2021-09-29 13:11     ` Stefan Kangas [this message]
2021-09-29 16:37       ` Stefan Monnier
2021-09-30  3:57         ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADwFkmn9xaVGNeZ8M1Rq37iuVkwK8dA77Xv0-EbReh=H4Ay7Vg@mail.gmail.com' \
    --to=stefan@marxist.se \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).