summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--yeetube-buffer.el28
-rw-r--r--yeetube-face.el3
-rw-r--r--yeetube-mpv.el4
-rw-r--r--yeetube.el1
4 files changed, 19 insertions, 17 deletions
diff --git a/yeetube-buffer.el b/yeetube-buffer.el
index ed57809..c1cc431 100644
--- a/yeetube-buffer.el
+++ b/yeetube-buffer.el
@@ -24,7 +24,8 @@
;;; Commentary:
-;; This package provides yeetube-buffer functionality
+;; This package is an extension for yeetube, to create a custom
+;; *yeetube* buffer.
;;; Code:
@@ -58,7 +59,7 @@
(setf result (concat "," result))))
result))
-;; Formatting inspired from ytel
+;;; Formatting inspired from ytel
(defun yeetube-buffer--format-header-title (query)
"Format header for QUERY."
(let* ((n (string-width query))
@@ -68,20 +69,10 @@
(concat query
(make-string (abs extra-chars) ?\ )
" ")
- (concat (seq-subseq query 0 53)
+ (concat (seq-subseq query 0 50)
"... " ))))
(propertize formatted-string 'face 'yeetube-face-header-query)))
-(defun yeetube-buffer--format-header (query)
- "Render header for *yeetube* buffer for QUERY."
- (setf header-line-format
- (concat
- (concat
- "Search: " (yeetube-buffer--format-header-title query)
- (yeetube-buffer--format-view-count "Views")
- (yeetube-buffer--format-video-duration "Duration")
- (yeetube-buffer--format-channel "Channel")))))
-
(defun yeetube-buffer--format-title (title)
"Format a video TITLE to be inserted in the *yeetube* buffer."
(let* ((n (string-width title))
@@ -145,6 +136,16 @@
"... " ))))
(propertize formatted-string 'face 'yeetube-face-channel)))
+(defun yeetube-buffer--format-header (query)
+ "Render header for *yeetube* buffer for QUERY."
+ (setf header-line-format
+ (concat
+ (concat
+ "Search: " (yeetube-buffer--format-header-title query)
+ (yeetube-buffer--format-view-count "Views")
+ (yeetube-buffer--format-video-duration "Duration")
+ (yeetube-buffer--format-channel "Channel")))))
+
(defun yeetube-buffer-create (query content buffer-mode)
"Create *yeetube* buffer with BUFFER-MODE for QUERY, displaying CONTENT."
(with-current-buffer
@@ -171,6 +172,5 @@
(yeetube-buffer--format-channel channel-name)
"\n")))))
-(add-hook #'yeetube-buffer-create #'yeetube-mode)
(provide 'yeetube-buffer)
;;; yeetube-buffer.el ends here
diff --git a/yeetube-face.el b/yeetube-face.el
index ed0a375..469cdfd 100644
--- a/yeetube-face.el
+++ b/yeetube-face.el
@@ -24,7 +24,8 @@
;;; Commentary:
-;; This package provides yeetube faces
+;; This package is a yeetube extension, providing custom faces for
+;; yeetube variables
;;; Code:
diff --git a/yeetube-mpv.el b/yeetube-mpv.el
index 4470394..e83c46d 100644
--- a/yeetube-mpv.el
+++ b/yeetube-mpv.el
@@ -24,8 +24,8 @@
;;; Commentary:
-;; This package is a yeetube extension, to start an mpv process and
-;; control it
+;; This package is a yeetube extension, to start an mpv process &
+;; remotely control it.
;;; Code:
diff --git a/yeetube.el b/yeetube.el
index fe89b2a..8eb06d2 100644
--- a/yeetube.el
+++ b/yeetube.el
@@ -91,6 +91,7 @@ Example Usage:
:safe #'booleanp
:group 'yeetube)
+;; TODO: Make it as derived from special mode
(define-minor-mode yeetube-mode
"Yeetube mode."
:init-value nil