Emacs: Add youtube-dl-at-point command
parent
688d5b8ed7
commit
e8d6b34a40
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue