]> git.eshelyaron.com Git - emacs.git/commitdiff
Use access-file in EWW to check before downloading a file
authorMark Oteiza <mvoteiza@udel.edu>
Sat, 28 Jan 2017 17:06:41 +0000 (12:06 -0500)
committerMark Oteiza <mvoteiza@udel.edu>
Sat, 28 Jan 2017 17:06:41 +0000 (12:06 -0500)
* 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.

lisp/net/eww.el
src/fileio.c

index 0282fe68e6a204a74b708bfacfc29bc219384ff1..f7e06341443c98f6e85c6571fc09a3e4f6388102 100644 (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")
index 81eaa7711892026e5877b09171e68905bd015143..a46cfc7ac6962956321d63b7a7084cb86aa1a605 100644 (file)
@@ -2682,7 +2682,7 @@ DEFUN ("file-writable-p", Ffile_writable_p, Sfile_writable_p, 1, 1, 0,
 \f
 DEFUN ("access-file", Faccess_file, Saccess_file, 2, 2, 0,
        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.  */)
   (Lisp_Object filename, Lisp_Object string)
 {