diff options
-rw-r--r-- | test/yeetube-tests.el | 32 | ||||
-rw-r--r-- | yeetube-buffer.el | 17 | ||||
-rw-r--r-- | yeetube.el | 1 |
3 files changed, 4 insertions, 46 deletions
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 diff --git a/yeetube-buffer.el b/yeetube-buffer.el index c1cc431..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)) @@ -170,7 +158,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 @@ -96,7 +96,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 "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) |