ix.io upload: work with non-file buffers

This commit is contained in:
TEC 2021-03-12 19:12:13 +08:00
parent d8c2b4751d
commit 6825ec53d2
Signed by: tec
GPG Key ID: 779591AFDB81F06C
1 changed files with 1 additions and 1 deletions

View File

@ -89,7 +89,7 @@ Then the text of the region/buffer is uploaded, and the URL is copied to clipboa
(let ((output (generate-new-buffer "ixio")) url)
(shell-command-on-region beg end
(format "curl -F 'ext:1=%s' -F 'f:1=<-' ix.io 2>/dev/null"
(file-name-extension (buffer-file-name)))
(file-name-extension (or (buffer-file-name) " .txt")))
output)
(setq url (string-trim-right (with-current-buffer output (buffer-string))))
(kill-buffer output)