Discussion:
[emms-help] [PATCH 1/2] Bind seek-more keys
Alejandro Erickson
2016-06-22 22:34:14 UTC
Permalink
Bind keys for seek-more forward/backward. It might make more sense to
bind </> instead of ,/., but those were taken for seek 10 seconds.
---
lisp/emms-playlist-mode.el | 2 ++
1 file changed, 2 insertions(+)

diff --git a/lisp/emms-playlist-mode.el b/lisp/emms-playlist-mode.el
index e8972c0..b4d3faa 100644
--- a/lisp/emms-playlist-mode.el
+++ b/lisp/emms-playlist-mode.el
@@ -137,7 +137,9 @@ This is true for every invocation of `emms-playlist-mode-go'."
(define-key map (kbd "p") 'emms-previous)
(define-key map (kbd "SPC") 'scroll-up)
(define-key map (kbd ">") 'emms-seek-forward)
+ (define-key map (kbd ".") 'emms-seek-minute-forward)
(define-key map (kbd "<") 'emms-seek-backward)
+ (define-key map (kbd ",") 'emms-seek-minute-backward)
(define-key map (kbd "P") 'emms-pause)
(define-key map (kbd "s") 'emms-stop)
(define-key map (kbd "f") 'emms-show)
--
2.8.3
Alejandro Erickson
2016-06-22 22:34:15 UTC
Permalink
Mimmicks emms-seek-forward/backward, using defcustom
emms-seek-more-seconds set to 60. Does not break existing
functionality.
---
lisp/emms-playlist-mode.el | 4 ++--
lisp/emms.el | 17 +++++++++++++++++
2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/lisp/emms-playlist-mode.el b/lisp/emms-playlist-mode.el
index b4d3faa..ce7af1b 100644
--- a/lisp/emms-playlist-mode.el
+++ b/lisp/emms-playlist-mode.el
@@ -137,9 +137,9 @@ This is true for every invocation of `emms-playlist-mode-go'."
(define-key map (kbd "p") 'emms-previous)
(define-key map (kbd "SPC") 'scroll-up)
(define-key map (kbd ">") 'emms-seek-forward)
- (define-key map (kbd ".") 'emms-seek-minute-forward)
+ (define-key map (kbd ".") 'emms-seek-forward-more)
(define-key map (kbd "<") 'emms-seek-backward)
- (define-key map (kbd ",") 'emms-seek-minute-backward)
+ (define-key map (kbd ",") 'emms-seek-backward-more)
(define-key map (kbd "P") 'emms-pause)
(define-key map (kbd "s") 'emms-stop)
(define-key map (kbd "f") 'emms-show)
diff --git a/lisp/emms.el b/lisp/emms.el
index 2d282bb..4f495d0 100644
--- a/lisp/emms.el
+++ b/lisp/emms.el
@@ -250,6 +250,11 @@ Use `emms-player-paused-p' to find the current state."
:group 'emms
:type 'number)

+(defcustom emms-seek-more-seconds 60
+ "The number of seconds to seek forward or backward when long-seeking."
+ :group 'emms
+ :type 'number)
+
(defcustom emms-player-seeked-functions nil
"*Functions called when a player is seeking.
The functions are called with a single argument, the amount of
@@ -462,6 +467,18 @@ It can also be negative to seek backwards."
(when emms-player-playing-p
(emms-player-seek (- emms-seek-seconds))))

+(defun emms-seek-forward-more ()
+ "Seek one minute forward."
+ (interactive)
+ (when emms-player-playing-p
+ (emms-player-seek emms-seek-more-seconds)))
+
+(defun emms-seek-backward-more ()
+ "Seek one minute backward."
+ (interactive)
+ (when emms-player-playing-p
+ (emms-player-seek (- emms-seek-more-seconds))))
+
(defun emms-show (&optional insertp)
"Describe the current EMMS track in the minibuffer.
If INSERTP is non-nil, insert the description into the current buffer instead.
--
2.8.3
Yoni Rabkin
2016-06-24 21:02:04 UTC
Permalink
Post by Alejandro Erickson
Bind keys for seek-more forward/backward. It might make more sense to
bind </> instead of ,/., but those were taken for seek 10 seconds.
---
lisp/emms-playlist-mode.el | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lisp/emms-playlist-mode.el b/lisp/emms-playlist-mode.el
index e8972c0..b4d3faa 100644
--- a/lisp/emms-playlist-mode.el
+++ b/lisp/emms-playlist-mode.el
@@ -137,7 +137,9 @@ This is true for every invocation of `emms-playlist-mode-go'."
(define-key map (kbd "p") 'emms-previous)
(define-key map (kbd "SPC") 'scroll-up)
(define-key map (kbd ">") 'emms-seek-forward)
+ (define-key map (kbd ".") 'emms-seek-minute-forward)
(define-key map (kbd "<") 'emms-seek-backward)
+ (define-key map (kbd ",") 'emms-seek-minute-backward)
(define-key map (kbd "P") 'emms-pause)
(define-key map (kbd "s") 'emms-stop)
(define-key map (kbd "f") 'emms-show)
Since patch 2/2 of this series removes the above, I assume you didn't
mean to send this.
--
"Cut your own wood and it will warm you twice"
Loading...