diff --git a/.emacs.d/lisp/functions.el b/.emacs.d/lisp/functions.el index ea05f344..2fb25472 100644 --- a/.emacs.d/lisp/functions.el +++ b/.emacs.d/lisp/functions.el @@ -441,4 +441,17 @@ Each paragraph stand on its line." (let ((fill-column (point-max))) (fill-region (region-beginning) (region-end) nil))) +(defun ambrevar/youtube-dl-at-point (&optional url) + "Run 'youtube-dl' over thr URL at point. +If URL is non nil, use that instead." + (interactive) + (setq url (or url (thing-at-point-url-at-point))) + (let ((eshell-buffer-name "*youtube-dl*")) + (eshell) + (when (eshell-interactive-process) + (eshell t)) + (eshell-interrupt-process) + (insert "cd ~/temp && youtube-dl " url) + (eshell-send-input))) + (provide 'functions)