* lisp/net/eww.el (eww-download): If there's no URL at point,
download the current URL instead. Previous behavior was to
signal an error if there was no URL at point. (Bug#34291)
* doc/misc/eww.texi (Basics): Update documentation.
@vindex eww-download-directory
@kindex d
@cindex Download
- A URL under the point can be downloaded with @kbd{d}
-(@code{eww-download}). The file will be written to the directory
-specified in @code{eww-download-directory} (Default: @file{~/Downloads/}).
+ A URL can be downloaded with @kbd{d} (@code{eww-download}). This
+will download the link under point if there is one, or else the URL of
+the current page. The file will be written to the directory specified
+in @code{eww-download-directory} (default: @file{~/Downloads/}).
@findex eww-back-url
@findex eww-forward-url
(kill-new (plist-get eww-data :url)))
(defun eww-download ()
- "Download URL under point to `eww-download-directory'."
+ "Download URL to `eww-download-directory'.
+Use link under point if there is one, else the current page URL."
(interactive)
(access-file eww-download-directory "Download failed")
- (let ((url (get-text-property (point) 'shr-url)))
+ (let ((url (or (get-text-property (point) 'shr-url)
+ (eww-current-url))))
(if (not url)
(message "No URL under point")
(url-retrieve url 'eww-download-callback (list url)))))