Merge from origin/emacs-29

b08bf82860 ; Fix :version of the new defcustom
d941666d85 ; Fix last change
e19b7da7b0 Add 'eww-default-download-directory'.
564c26bdbe ; Fix edebug spec for 'gv-define-simple-setter' (bug#62256)
This commit is contained in:
Stefan Monnier 2023-03-27 17:16:58 -04:00
commit dfa4fb9a2a
2 changed files with 14 additions and 8 deletions

View file

@ -271,7 +271,7 @@ instead the assignment is turned into something equivalent to
(SETTER ARGS... temp)
temp)
so as to preserve the semantics of `setf'."
(declare (debug (sexp (&or symbolp lambda-expr) &optional sexp)))
(declare (debug (sexp [&or symbolp lambda-expr] &optional sexp)))
(when (eq 'lambda (car-safe setter))
(message "Use `gv-define-setter' or name %s's setter function" name))
`(gv-define-setter ,name (val &rest args)

View file

@ -64,16 +64,22 @@ The action to be taken can be further customized via
:version "28.1"
:type 'regexp)
(defcustom eww-download-directory "~/Downloads/"
"Default directory where `eww' saves downloaded files."
: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-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-download-directory)
eww-download-directory)
(when-let ((dir (xdg-user-dir "DOWNLOAD")))
(file-name-as-directory dir))
"~/Downloads/"))
eww-download-directory))
(defcustom eww-download-directory 'eww--download-directory
"Directory where files will downloaded.