summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-10-04 17:21:19 +0300
committerThanos Apollo <[email protected]>2023-10-04 18:20:50 +0300
commit576b52473f346bbae61178e309a1134e04c61124 (patch)
tree52896bd26384ac047ba8c4629246ce46b77d41ba
parent927f1d7d867dda9fbec1dd2b5f688268b457088b (diff)
yeetube: Rewrite keymap & require version 27.2
Rewrite keymap to use make-sparse-keymap & require version 27.2. defvar-keymap which was previously used requires emacs version 29.1 This change was suggested by emacs-devel mailing list, to make this package available to users that have not updated to the latest emacs version.
-rw-r--r--yeetube-buffer.el2
-rw-r--r--yeetube-mpv.el2
-rw-r--r--yeetube.el24
3 files changed, 13 insertions, 15 deletions
diff --git a/yeetube-buffer.el b/yeetube-buffer.el
index 216c186..f54d9d3 100644
--- a/yeetube-buffer.el
+++ b/yeetube-buffer.el
@@ -7,7 +7,7 @@
;; URL: https://git.thanosapollo.com/yeetube
;; Version: 0.0.1
-;; Package-Requires: ((emacs "29.1"))
+;; Package-Requires: ((emacs "27.2"))
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
diff --git a/yeetube-mpv.el b/yeetube-mpv.el
index 99a2ebf..6c59552 100644
--- a/yeetube-mpv.el
+++ b/yeetube-mpv.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2023 Thanos Apollo
;; Author: Thanos Apollo <[email protected]>
-;; Keywords: extensions youtube videos invidious
+;; Keywords: extensions youtube videos
;; URL: https://git.thanosapollo.com/yeetube
;; Version: 0.1
diff --git a/yeetube.el b/yeetube.el
index 0c1fb93..896a6d1 100644
--- a/yeetube.el
+++ b/yeetube.el
@@ -8,7 +8,7 @@
;; Version: 2.0.5
-;; Package-Requires: ((emacs "29.1"))
+;; Package-Requires: ((emacs "27.2"))
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -267,18 +267,16 @@ prompt blank to keep the default name."
(yeetube-download-ytdlp url name yeetube-download-audio-format)))))
;; Yeetube Mode
-(defvar-keymap yeetube-mode-map
- :doc "Keymap for yeetube commands"
- "RET" #'yeetube-play
- "d" #'yeetube-download-video
- "D" #'yeetube-change-download-directory
- "a" #'yeetube-change-download-audio-format
- "p" #'yeetube-mpv-toggle-pause
- "v" #'yeetube-mpv-toggle-video
- "V" #'yeetube-mpv-toggle-no-video-flag
- "s" #'yeetube-save-video
- "P" #'yeetube-play-saved-video
- "q" #'quit-window)
+(defvar yeetube-mode-map (make-sparse-keymap))
+(define-key yeetube-mode-map (kbd "RET") #'yeetube-play)
+(define-key yeetube-mode-map (kbd "d") #'yeetube-download-video)
+(define-key yeetube-mode-map (kbd "D") #'yeetube-download-change-directory)
+(define-key yeetube-mode-map (kbd "a") #'yeetube-download-change-audio-format)
+(define-key yeetube-mode-map (kbd "v") #'yeetube-mpv-toggle-video)
+(define-key yeetube-mode-map (kbd "V") #'yeetube-mpv-toggle-no-video-flag)
+(define-key yeetube-mode-map (kbd "s") #'yeetube-save-video)
+(define-key yeetube-mode-map (kbd "P") #'yeetube-play-saved-video)
+(define-key yeetube-mode-map (kbd "q") #'quit-window)
(define-derived-mode yeetube-mode special-mode "Yeetube"
"Yeetube mode."