Skip to content

Commit

Permalink
Merge: v0.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
alphapapa committed Aug 16, 2024
2 parents 5008920 + c579f03 commit 079882d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
8 changes: 7 additions & 1 deletion README.org
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Synchronously download a JPEG file, then create an Emacs image object from the d
- ~string~ to pass the response body as a decoded string.
- ~response~ to pass a ~plz-response~ structure.
- ~file~ to pass a temporary filename to which the response body has been saved without decoding.
- ~(file ~FILENAME)~ to pass ~FILENAME~ after having saved the response body to it without decoding. ~FILENAME~ must be a non-existent file; if it exists, it will not be overwritten, and an error will be signaled.
- ~(file ~FILENAME)~ to pass ~FILENAME~ after having saved the response body to it without decoding. ~FILENAME~ must be a non-existent file; if it exists, it will not be overwritten, and an error will be signaled. ~FILENAME~ is passed through ~expand-file-name~, which see.
- A function, which is called in the response buffer with it narrowed to the response body (suitable for, e.g. ~json-read~).

If ~DECODE~ is non-nil, the response body is decoded automatically. For binary content, it should be nil. When ~AS~ is ~binary~, ~DECODE~ is automatically set to nil.
Expand Down Expand Up @@ -192,6 +192,12 @@ You may also clear a queue with ~plz-clear~, which cancels any active or queued

Nothing new yet.

** 0.9.1

*Fixes*

+ Expand filenames when downloading to files (which was already applied to filenames passed for uploading). (Thanks to [[https://github.com/josephmturner][Joseph Turner]].)

** 0.9

*Compatibility*
Expand Down
21 changes: 17 additions & 4 deletions plz.el
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
;; Author: Adam Porter <[email protected]>
;; Maintainer: Adam Porter <[email protected]>
;; URL: https://github.com/alphapapa/plz.el
<<<<<<< HEAD
;; Version: 0.10-pre
||||||| 399ad3e
;; Version: 0.9
=======
;; Version: 0.9.1
>>>>>>> stable
;; Package-Requires: ((emacs "27.1"))
;; Keywords: comm, network, http

Expand Down Expand Up @@ -359,7 +365,8 @@ It may be:
- `(file FILENAME)' to pass FILENAME after having saved the
response body to it without decoding. FILENAME must be a
non-existent file; if it exists, it will not be overwritten,
and an error will be signaled.
and an error will be signaled. FILENAME is passed through
`expand-file-name', which see.
- A function, which is called in the response buffer with it
narrowed to the response body (suitable for, e.g. `json-read').
Expand Down Expand Up @@ -454,7 +461,9 @@ into the process buffer.
(`(file ,(and (pred stringp) as-filename))
(when (file-exists-p as-filename)
(error "File exists, will not overwrite: %S" as-filename))
(setf filename as-filename)
;; Use `expand-file-name' because curl doesn't
;; expand, e.g. "~" into "/home/...".
(setf filename (expand-file-name as-filename))
(list (cons "--output" filename))))))
((or 'put 'post)
(append (list (cons "--dump-header" "-")
Expand All @@ -466,7 +475,9 @@ into the process buffer.
(`(file ,(and (pred stringp) as-filename))
(when (file-exists-p as-filename)
(error "File exists, will not overwrite: %S" as-filename))
(setf filename as-filename)
;; Use `expand-file-name' because curl doesn't
;; expand, e.g. "~" into "/home/...".
(setf filename (expand-file-name as-filename))
(list (cons "--output" filename))))
(list
;; It appears that this must be the last argument
Expand All @@ -487,7 +498,9 @@ into the process buffer.
(`(file ,(and (pred stringp) as-filename))
(when (file-exists-p as-filename)
(error "File exists, will not overwrite: %S" as-filename))
(setf filename as-filename)
;; Use `expand-file-name' because curl doesn't
;; expand, e.g. "~" into "/home/...".
(setf filename (expand-file-name as-filename))
(list (cons "--output" filename))))))
('head
(list (cons "--head" "")
Expand Down

0 comments on commit 079882d

Please sign in to comment.