GNU bug report logs - #62435
[PATCH] 29.0 Fix eww--download-directory on MS-Windows

Previous Next

Package: emacs;

Reported by: "lux" <lx <at> shellcodes.org>

Date: Sat, 25 Mar 2023 11:58:01 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 62435 in the body.
You can then email your comments to 62435 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#62435; Package emacs. (Sat, 25 Mar 2023 11:58:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to "lux" <lx <at> shellcodes.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 25 Mar 2023 11:58:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "lux" <lx <at> shellcodes.org>
To: "bug-gnu-emacs" <bug-gnu-emacs <at> gnu.org>
Subject: [PATCH] 29.0 Fix eww--download-directory on MS-Windows
Date: Sat, 25 Mar 2023 19:56:43 +0800
[Message part 1 (text/plain, inline)]
The eww--download-directory hardcodes the download path, so it does not
work on MS-Windows, I fixed it, and tested on MS-Windows.
[Message part 2 (text/html, inline)]
[0001-Fix-eww-download-directory-on-Windows.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62435; Package emacs. (Sat, 25 Mar 2023 13:27:02 GMT) Full text and rfc822 format available.

Message #8 received at 62435 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "lux" <lx <at> shellcodes.org>
Cc: 62435 <at> debbugs.gnu.org
Subject: Re: bug#62435: [PATCH] 29.0 Fix eww--download-directory on MS-Windows
Date: Sat, 25 Mar 2023 16:25:52 +0300
> From: "lux" <lx <at> shellcodes.org>
> Date: Sat, 25 Mar 2023 19:56:43 +0800
> 
> The eww--download-directory hardcodes the download path, so it does not
> work on MS-Windows, I fixed it, and tested on MS-Windows.

Thanks, but this isn't the right fix.  The code does want to honor the
user's "Downloads" subdirectory, even on Windows.  In addition,
USERPROFILE only works on latest Windows versions.

I think the right fix here is to make this directory a defcustom, and
leave its default value at "~/Downloads" on all systems.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62435; Package emacs. (Sat, 25 Mar 2023 13:44:01 GMT) Full text and rfc822 format available.

Message #11 received at 62435 <at> debbugs.gnu.org (full text, mbox):

From: lux <lx <at> shellcodes.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 62435 <at> debbugs.gnu.org
Subject: Re: bug#62435: [PATCH] 29.0 Fix eww--download-directory on MS-Windows
Date: Sat, 25 Mar 2023 21:42:44 +0800
[Message part 1 (text/plain, inline)]
On Sat, 2023-03-25 at 16:25 +0300, Eli Zaretskii wrote:
> 
> 
> I think the right fix here is to make this directory a defcustom, and
> leave its default value at "~/Downloads" on all systems.
> 

Thank you, I changed it.
[0001-Add-eww-default-download-directory.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62435; Package emacs. (Sat, 25 Mar 2023 14:06:02 GMT) Full text and rfc822 format available.

Message #14 received at 62435 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: lux <lx <at> shellcodes.org>
Cc: 62435 <at> debbugs.gnu.org
Subject: Re: bug#62435: [PATCH] 29.0 Fix eww--download-directory on MS-Windows
Date: Sat, 25 Mar 2023 17:05:06 +0300
> From: lux <lx <at> shellcodes.org>
> Cc: 62435 <at> debbugs.gnu.org
> Date: Sat, 25 Mar 2023 21:42:44 +0800
> 
> 
> +(defcustom eww-default-download-directory "~/Downloads/"
> +  "The default directory where downloaded files will be saved."
> +  :version "29.0"
              ^^^^^^
This should be "30.1".

>  (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/")
> +  (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))

Please update the doc string as well.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62435; Package emacs. (Sat, 25 Mar 2023 14:18:02 GMT) Full text and rfc822 format available.

Message #17 received at 62435 <at> debbugs.gnu.org (full text, mbox):

From: lux <lx <at> shellcodes.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 62435 <at> debbugs.gnu.org
Subject: Re: bug#62435: [PATCH] 29.0 Fix eww--download-directory on MS-Windows
Date: Sat, 25 Mar 2023 22:17:01 +0800
[Message part 1 (text/plain, inline)]
On Sat, 2023-03-25 at 17:05 +0300, Eli Zaretskii wrote:
> > From: lux <lx <at> shellcodes.org>
> > Cc: 62435 <at> debbugs.gnu.org
> > Date: Sat, 25 Mar 2023 21:42:44 +0800
> > 
> > 
> > +(defcustom eww-default-download-directory "~/Downloads/"
> > +  "The default directory where downloaded files will be saved."
> > +  :version "29.0"
>               ^^^^^^
> This should be "30.1".
> 
> >  (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/")
> > +  (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))
> 
> Please update the doc string as well.
> 
> 
Done, please review, thank you.
[0001-Add-eww-default-download-directory.patch (text/x-patch, attachment)]

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sun, 26 Mar 2023 12:00:02 GMT) Full text and rfc822 format available.

Notification sent to "lux" <lx <at> shellcodes.org>:
bug acknowledged by developer. (Sun, 26 Mar 2023 12:00:02 GMT) Full text and rfc822 format available.

Message #22 received at 62435-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: lux <lx <at> shellcodes.org>
Cc: 62435-done <at> debbugs.gnu.org
Subject: Re: bug#62435: [PATCH] 29.0 Fix eww--download-directory on MS-Windows
Date: Sun, 26 Mar 2023 14:59:21 +0300
> From: lux <lx <at> shellcodes.org>
> Cc: 62435 <at> debbugs.gnu.org
> Date: Sat, 25 Mar 2023 22:17:01 +0800
> 
> > Please update the doc string as well.
> > 
> > 
> Done, please review, thank you.

Thanks, installed on the emacs-29 branch, and closing the bug.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 24 Apr 2023 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 3 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.