summaryrefslogtreecommitdiff
path: root/lisp/net/eww.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/net/eww.el')
-rw-r--r--lisp/net/eww.el25
1 files changed, 16 insertions, 9 deletions
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 73d11c0ef52..99450356b7c 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -64,16 +64,23 @@ The action to be taken can be further customized via
:version "28.1"
:type 'regexp)
+(defcustom eww-default-download-directory "~/Downloads/"
+ "Default directory where `eww' saves downloaded files.
+Used by `eww--download-directory', which see."
+ :version "29.1"
+ :group 'eww
+ :type 'directory)
+
(defun eww--download-directory ()
- "Return the name of the download directory.
-If ~/Downloads/ exists, that will be used, and if not, the
-DOWNLOAD XDG user directory will be returned. If that's
-undefined, ~/Downloads/ is returned anyway."
- (or (and (file-exists-p "~/Downloads/")
- "~/Downloads/")
+ "Return the name of the EWW download directory.
+The default is specified by `eww-default-download-directory'; however,
+if that directory doesn't exist and the DOWNLOAD XDG user directory
+is defined, use the latter instead."
+ (or (and (file-exists-p eww-default-download-directory)
+ eww-default-download-directory)
(when-let ((dir (xdg-user-dir "DOWNLOAD")))
(file-name-as-directory dir))
- "~/Downloads/"))
+ eww-default-download-directory))
(defcustom eww-download-directory 'eww--download-directory
"Directory where files will downloaded.
@@ -319,7 +326,7 @@ parameter, and should return the (possibly) transformed URL."
"<mouse-2>" #'eww-follow-link)
(defvar-keymap eww-image-link-keymap
- :parent shr-map
+ :parent shr-image-map
"RET" #'eww-follow-link)
(defun eww-suggested-uris nil
@@ -1008,7 +1015,7 @@ the like."
(list 'base (list (cons 'href base))
(eww-highest-readability dom))
nil (current-buffer))
- (dolist (elem '(:source :url :title :next :previous :up))
+ (dolist (elem '(:source :url :title :next :previous :up :peer))
(plist-put eww-data elem (plist-get old-data elem)))
(eww--after-page-change)))