diff options
author | Thanos Apollo <[email protected]> | 2023-09-28 11:04:33 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-09-28 11:04:33 +0300 |
commit | bc15e23c3f558bbf204111453abd5c92406ef2d2 (patch) | |
tree | 0c9cbab165defcdff1644eaa3576267bc09225c8 | |
parent | 18409bb32c0050527ff46295839f3afb22d66631 (diff) |
[Commentary] Update commentary & code format
-rw-r--r-- | yeetube-buffer.el | 28 | ||||
-rw-r--r-- | yeetube-face.el | 3 | ||||
-rw-r--r-- | yeetube-mpv.el | 4 | ||||
-rw-r--r-- | yeetube.el | 1 |
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: @@ -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 |