mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-03 10:31:37 -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:
parent
f83363d30e
commit
c7bbddf0ea
2 changed files with 2 additions and 1 deletions
|
|
@ -1501,6 +1501,7 @@ Differences in #targets are ignored."
|
||||||
(defun eww-download ()
|
(defun eww-download ()
|
||||||
"Download URL under point to `eww-download-directory'."
|
"Download URL under point to `eww-download-directory'."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(access-file eww-download-directory "Download failed")
|
||||||
(let ((url (get-text-property (point) 'shr-url)))
|
(let ((url (get-text-property (point) 'shr-url)))
|
||||||
(if (not url)
|
(if (not url)
|
||||||
(message "No URL under point")
|
(message "No URL under point")
|
||||||
|
|
|
||||||
|
|
@ -2682,7 +2682,7 @@ DEFUN ("file-writable-p", Ffile_writable_p, Sfile_writable_p, 1, 1, 0,
|
||||||
|
|
||||||
DEFUN ("access-file", Faccess_file, Saccess_file, 2, 2, 0,
|
DEFUN ("access-file", Faccess_file, Saccess_file, 2, 2, 0,
|
||||||
doc: /* Access file FILENAME, and get an error if that does not work.
|
doc: /* Access file FILENAME, and get an error if that does not work.
|
||||||
The second argument STRING is used in the error message.
|
The second argument STRING is prepended to the error message.
|
||||||
If there is no error, returns nil. */)
|
If there is no error, returns nil. */)
|
||||||
(Lisp_Object filename, Lisp_Object string)
|
(Lisp_Object filename, Lisp_Object string)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue