[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ampc 3ff387653a 006/111: Add ampc-goto-current-song.
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ampc 3ff387653a 006/111: Add ampc-goto-current-song. |
Date: |
Tue, 20 Feb 2024 18:16:35 -0500 (EST) |
branch: externals/ampc
commit 3ff387653a3ee31fd9b4f0565cfd0525440c8384
Author: Christopher Schmidt <christopher@ch.ristopher.com>
Commit: Christopher Schmidt <christopher@ch.ristopher.com>
Add ampc-goto-current-song.
---
ampc.el | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/ampc.el b/ampc.el
index 0b6357cb40..56b2b29c61 100644
--- a/ampc.el
+++ b/ampc.el
@@ -138,6 +138,9 @@
;; `r' (ampc-toggle-random): Toggle random state.
;; `f' (ampc-toggle-consume): Toggle consume state.
;;
+;; `P' (ampc-goto-current-song): Select the current playlist window and move
+;; point to the current song.
+;;
;; `T' (ampc-trigger-update): Trigger a database update.
;; `q' (ampc-quit): Quit ampc.
@@ -261,6 +264,7 @@ This hook is called as the first thing when ampc is
started."
(define-key map (kbd "e") 'ampc-toggle-repeat)
(define-key map (kbd "r") 'ampc-toggle-random)
(define-key map (kbd "f") 'ampc-toggle-consume)
+ (define-key map (kbd "P") 'ampc-goto-current-song)
(define-key map (kbd "q") 'ampc-quit)
(define-key map (kbd "T") 'ampc-trigger-update)
(loop for view in ampc-views
@@ -1516,7 +1520,7 @@ If ARG is omitted, use the selected entries."
(ampc-send-command 'playlistclear nil (ampc-playlist))
(ampc-send-command 'clear)))
-(defun* ampc-add (&optional arg)
+(defun ampc-add (&optional arg)
"Add the next ARG songs associated with the entries after point
to the playlist.
If ARG is omitted, use the selected entries in the current buffer."
@@ -1538,6 +1542,18 @@ Interactively, read NAME from the minibuffer."
(interactive "MSave playlist as: ")
(ampc-send-command 'save nil name))
+(defun* ampc-goto-current-song
+ (&aux (song (cdr-safe (assoc "song" ampc-status))))
+ "Select the current playlist window and move point to the current song."
+ (interactive)
+ (when song
+ (ampc-with-buffer 'current-playlist
+ no-se
+ (select-window (ampc-get-window 'current-playlist))
+ (goto-char (point-min))
+ (forward-line (string-to-number song))
+ (ampc-align-point))))
+
(defun ampc-previous-line (&optional arg)
"Go to previous ARG'th entry in the current buffer.
ARG defaults to 1."
- [elpa] externals/ampc updated (ada6ae9825 -> 66aa7f4fac), Stefan Monnier, 2024/02/20
- [elpa] externals/ampc 89c30b5065 002/111: Minor code simplifications., Stefan Monnier, 2024/02/20
- [elpa] externals/ampc fd83b6c729 004/111: Minor spelling fix., Stefan Monnier, 2024/02/20
- [elpa] externals/ampc c08c444ef9 007/111: Fix error in ampc-toggle-play that occurs when there is no status yet., Stefan Monnier, 2024/02/20
- [elpa] externals/ampc 3ff387653a 006/111: Add ampc-goto-current-song.,
Stefan Monnier <=
- [elpa] externals/ampc 5748479314 008/111: Clean up file local variables., Stefan Monnier, 2024/02/20
- [elpa] externals/ampc 90db166e15 009/111: Fix ampc-with-selection., Stefan Monnier, 2024/02/20
- [elpa] externals/ampc 739785067e 014/111: Add ELPA installation note., Stefan Monnier, 2024/02/20
- [elpa] externals/ampc 966c9da55b 017/111: Assign copyright to the FSF., Stefan Monnier, 2024/02/20
- [elpa] externals/ampc c2eb1d02c8 023/111: * ampc: Update version to 0.1.1., Stefan Monnier, 2024/02/20
- [elpa] externals/ampc 7a8a29df92 027/111: Fix wrong key description., Stefan Monnier, 2024/02/20
- [elpa] externals/ampc 556bc260f9 029/111: Make some interactive functions usable even if ampc is suspended., Stefan Monnier, 2024/02/20
- [elpa] externals/ampc 0372128a6a 033/111: Add ampc-status-changed-hook and ampc-status-changed-hook., Stefan Monnier, 2024/02/20
- [elpa] externals/ampc e6911fc894 036/111: Alias unspecified tags in playlist buffers., Stefan Monnier, 2024/02/20
- [elpa] externals/ampc c840020bc2 038/111: Add note on byte-compiling., Stefan Monnier, 2024/02/20