<commit_before>(require 'ar-vsetq)

(defun ar/open-youtube-url (url)
    "Download and open youtube URL."
    ;; Check for URLs like:
    ;; https://www.youtube.com/watch?v=rzQEIRRJ2T0
    ;; https://youtu.be/rzQEIRRJ2T0
    (assert (string-match-p "^https://\\(www\\.\\)?\\(\\(youtube.com\\)\\|\\(youtu.be\\)\\|\\(soundcloud.com\\)\\)" url)
            nil "Not a downloadable URL: %s" url)
    (message "Downloading: %s" url)
    (async-start
     `(lambda ()
        (shell-command-to-string
         (format "youtube-dl --newline --exec \"open -a VLC {}\" -o \"~/Downloads/%%(title)s.%%(ext)s\" %s" ,url)))
     `(lambda (output)
        (if (string-match-p "ERROR:" output)
            (message "%s" output)
          (message "Opened: %s" ,url)))))

(defun ar/open-youtube-clipboard-url ()
  "Download youtube video from url in clipboard."
  (interactive)
  (ar/open-youtube-url (current-kill 0)))

(use-package elfeed :ensure t
  :commands elfeed
  :hook ((elfeed-search-mode . ar/elfeed-set-style))
  :init
  (defun ar/elfeed-set-style ()
    ;; Separate elfeed lines for readability.
    (ar/vsetq line-spacing 25))
  :config
  (use-package elfeed-goodies :ensure t
    :after elfeed
    :config
    (ar/vsetq elfeed-goodies/entry-pane-position 'bottom)
    (ar/vsetq elfeed-goodies/tag-column-width 35)
    (elfeed-goodies/setup))

  (defun ar/elfeed-open-youtube-video ()
    (interactive)
    (let ((link (elfeed-entry-link elfeed-show-entry)))
      (when link
        (ar/open-youtube-url link))))<commit_msg>Easily mark all elfeed search results as read<commit_after>(require 'ar-vsetq)

(defun ar/open-youtube-url (url)
    "Download and open youtube URL."
    ;; Check for URLs like:
    ;; https://www.youtube.com/watch?v=rzQEIRRJ2T0
    ;; https://youtu.be/rzQEIRRJ2T0
    (assert (string-match-p "^https://\\(www\\.\\)?\\(\\(youtube.com\\)\\|\\(youtu.be\\)\\|\\(soundcloud.com\\)\\)" url)
            nil "Not a downloadable URL: %s" url)
    (message "Downloading: %s" url)
    (async-start
     `(lambda ()
        (shell-command-to-string
         (format "youtube-dl --newline --exec \"open -a VLC {}\" -o \"~/Downloads/%%(title)s.%%(ext)s\" %s" ,url)))
     `(lambda (output)
        (if (string-match-p "ERROR:" output)
            (message "%s" output)
          (message "Opened: %s" ,url)))))

(defun ar/open-youtube-clipboard-url ()
  "Download youtube video from url in clipboard."
  (interactive)
  (ar/open-youtube-url (current-kill 0)))

(use-package elfeed :ensure t
  :commands elfeed
  :hook ((elfeed-search-mode . ar/elfeed-set-style))
  :bind (:map elfeed-search-mode-map
              ("R" . ar/elfeed-mark-all-as-read))
  :init
  (defun ar/elfeed-set-style ()
    ;; Separate elfeed lines for readability.
    (ar/vsetq line-spacing 25))
  (defun ar/elfeed-mark-all-as-read ()
    "Mark all entries in search as read."
      (interactive)
      (mark-whole-buffer)
      (elfeed-search-untag-all-unread))
  :config
  (use-package elfeed-goodies :ensure t
    :after elfeed
    :config
    (ar/vsetq elfeed-goodies/entry-pane-position 'bottom)
    (ar/vsetq elfeed-goodies/tag-column-width 35)
    (elfeed-goodies/setup))

  (defun ar/elfeed-open-youtube-video ()
    (interactive)
    (let ((link (elfeed-entry-link elfeed-show-entry)))
      (when link
        (ar/open-youtube-url link))))
{'fraction_non_alphanumeric': 0.18217286914765907, 'fraction_numerical': 0.005402160864345739, 'mean_word_length': 2.6546052631578947, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2725497', 'n_tokens_mistral': 1260, 'n_tokens_neox': 1221, 'n_words': 257}