Skip to content

Commit

Permalink
tweak(lib): make +single-file a command
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Dec 5, 2023
1 parent defe63f commit 926262b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions core/me-lib.el
Original file line number Diff line number Diff line change
Expand Up @@ -905,14 +905,16 @@ When MAIL-MODE-P is non-nil, treat INFILE as a mail."

(defun +single-file (url out-file)
"Save URL into OUT-FILE as a standalone HTML file."
(interactive
(let ((url (or (thing-at-point 'url) (read-string "URL to save: "))))
(list url (read-file-name "Save to: " nil nil nil (url-filename (url-generic-parse-url url))))))
(if (executable-find +single-file-executable)
(make-process
:name "single-file-cli"
:buffer "*single-file*"
:command (list
+single-file-executable
"--browser-executable-path" browse-url-chromium-program
url out-file))
:command (list +single-file-executable
"--browser-executable-path" browse-url-chromium-program
url (expand-file-name out-file)))
(user-error "Please set `+single-file-executable' accordingly")))

(defun +lock--file (name)
Expand Down

0 comments on commit 926262b

Please sign in to comment.