emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master c7bbddf: Use access-file in EWW to check before dow


From: Mark Oteiza
Subject: [Emacs-diffs] master c7bbddf: Use access-file in EWW to check before downloading a file
Date: Sat, 28 Jan 2017 17:40:37 +0000 (UTC)

branch: master
commit c7bbddf0eae653b23430c426cb75e0289e9f3a29
Author: Mark Oteiza <address@hidden>
Commit: Mark Oteiza <address@hidden>

    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.
---
 lisp/net/eww.el |    1 +
 src/fileio.c    |    2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 0282fe6..f7e0634 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -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")
diff --git a/src/fileio.c b/src/fileio.c
index 81eaa77..a46cfc7 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -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,
        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)
 {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]