From 956a195978f1738b518f6c692e53cb98778618cc Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Fri, 14 Jun 2024 10:47:27 +0300 Subject: [fix] yeetube-download-videos: Refactor using cl-loop --- yeetube.el | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/yeetube.el b/yeetube.el index 2015b19..b6828d0 100644 --- a/yeetube.el +++ b/yeetube.el @@ -584,15 +584,13 @@ Open a Dired buffer and navigate where you want to download your videos, then run this command interactively. You can leave the name prompt blank to keep the default name." (interactive) - (let ((url "") - (name "") - (download-counter 1)) - (while (not (string= url "q")) - (setf url (read-string "Enter URL (q to quit): ")) - (unless (string= url "q") - (setf name (read-string (format "Custom name (download counter: %d) " download-counter))) - (setf download-counter (1+ download-counter)) - (yeetube-download--ytdlp url name yeetube-download-audio-format))))) + (let ((download-counter 1)) + (cl-loop + for url = (read-string "Enter URL (q to quit): ") + until (string= url "q") + do (let ((name (read-string (format "Custom name (download counter: %d) " download-counter)))) + (yeetube-download--ytdlp url name yeetube-download-audio-format) + (cl-incf download-counter))))) (defun yeetube-propertize-vector (content &rest fields-face-pairs) "Create a vector with each item propertized with its corresponding face. -- cgit v1.2.3