1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Use access-file in EWW to check before downloading a file

* lisp/net/eww.el (eww-download): Check accessibility of
eww-download-directory to prevent starting a download that will fail
to write.
* src/fileio.c (Faccess_file): Clarify the use of string argument in
the docstring.
This commit is contained in:
Mark Oteiza 2017-01-28 12:06:41 -05:00
parent f83363d30e
commit c7bbddf0ea
2 changed files with 2 additions and 1 deletions

View file

@ -1501,6 +1501,7 @@ Differences in #targets are ignored."
(defun eww-download ()
"Download URL under point to `eww-download-directory'."
(interactive)
(access-file eww-download-directory "Download failed")
(let ((url (get-text-property (point) 'shr-url)))
(if (not url)
(message "No URL under point")