From 4b9d216e80767d33fe7000e8d97e831213f0a9d7 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Fri, 29 Sep 2023 06:21:41 +0300 Subject: [fix] yeetube-buffer: remove extra line --- yeetube-buffer.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yeetube-buffer.el b/yeetube-buffer.el index c1cc431..75a99a6 100644 --- a/yeetube-buffer.el +++ b/yeetube-buffer.el @@ -170,7 +170,10 @@ video-duration "nil")) (yeetube-buffer--format-channel channel-name) - "\n"))))) + "\n"))) + (setf buffer-read-only nil) + (backward-delete-char 1) ;; Delete extra line + (beginning-of-buffer))) (provide 'yeetube-buffer) ;;; yeetube-buffer.el ends here -- cgit v1.2.3 From c9f50a5880b5a9d229ec9a5c9b2b2e1b9c76c964 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Fri, 29 Sep 2023 06:22:06 +0300 Subject: [fix] yeetube-mode-map: remove obsolete functions --- yeetube.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/yeetube.el b/yeetube.el index e5f9ab5..83e03e8 100644 --- a/yeetube.el +++ b/yeetube.el @@ -93,8 +93,6 @@ Example Usage: :keymap (let ((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 "u") 'yeetube-change-platform) - (define-key yeetube-mode-map (kbd "q") 'kill-current-buffer) (define-key yeetube-mode-map (kbd "D") 'yeetube-change-download-directory) (define-key yeetube-mode-map (kbd "a") 'yeetube-change-download-audio-format) (define-key yeetube-mode-map (kbd "p") 'yeetube-mpv-toggle-pause) @@ -102,6 +100,7 @@ Example Usage: (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) yeetube-mode-map)) (defvar yeetube-yt-dlp (executable-find "yt-dlp")) -- cgit v1.2.3 From bc6ce90e0f7b20fe27f5e2b309622cd225e45578 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Fri, 29 Sep 2023 09:15:07 +0300 Subject: remove duplicate formatting functions --- yeetube-buffer.el | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/yeetube-buffer.el b/yeetube-buffer.el index 75a99a6..1e4970e 100644 --- a/yeetube-buffer.el +++ b/yeetube-buffer.el @@ -111,18 +111,6 @@ "...")))) (propertize formatted-string 'face 'yeetube-face-duration))) -(defun yeetube-buffer--format-video-duration (video-duration) - "Format a video VIDEO-DURATION to be inserted in the *yeetube* buffer." - (let* ((n (string-width video-duration)) - (extra-chars (- n 7)) - (formatted-string (if (<= extra-chars 0) - (concat video-duration - (make-string (abs extra-chars) ?\ ) - " ") - (concat (seq-subseq video-duration 0 7) - "...")))) - (propertize formatted-string 'face 'yeetube-face-duration))) - (defun yeetube-buffer--format-channel (channel) "Format a video CHANNEL to be inserted in the *yeetube* buffer." (let* ((n (string-width channel)) -- cgit v1.2.3 From f21f1f3b76ed30340451040ced1fe4665fa586d6 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Fri, 29 Sep 2023 10:19:50 +0300 Subject: remove tests --- test/yeetube-tests.el | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 test/yeetube-tests.el diff --git a/test/yeetube-tests.el b/test/yeetube-tests.el deleted file mode 100644 index ee7fb6a..0000000 --- a/test/yeetube-tests.el +++ /dev/null @@ -1,32 +0,0 @@ -;;; Code: -(load-file "../yeetube.el") - -(setq package-archives '(("melpa" . "https://melpa.org/packages/") - ("elpa" . "https://elpa.gnu.org/packages/") - ("nongnu" . "https://elpa.nongnu.org/nongnu/"))) -(package-initialize) - -(unless package-archive-contents - (package-refresh-contents)) - -(require 'ert) -(require 'yeetube) - - -(package-install 'package-lint) -(require 'package-lint) - - -(ert-deftest test-is-youtube? () - (should (equal (yeetube-youtube-p "youtube.com") t)) - (should (equal (yeetube-youtube-p "localhost") nil)) - (should (equal (yeetube-youtube-p "yewtu.be") nil))) - -(ert-deftest test-package-lint () - (let ((package-lint-errors (package-lint-buffer (find-file-noselect "../yeetube.el")))) - (should (equal package-lint-errors nil)))) - -(ert-run-tests-batch-and-exit) - -(provide 'yeetube-tests) -;;; yeetube-tests.el ends here -- cgit v1.2.3