GNU bug report logs -
#41030
[PATCH] Make EWW respect XDG download directory by default
Previous Next
Reported by: Philip K <philip <at> warpmail.net>
Date: Sat, 2 May 2020 17:00:02 UTC
Severity: wishlist
Tags: fixed, patch
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.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 41030 in the body.
You can then email your comments to 41030 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#41030
; Package
emacs
.
(Sat, 02 May 2020 17:00:03 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Philip K <philip <at> warpmail.net>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sat, 02 May 2020 17:00:03 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
---
lisp/net/eww.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index c83884fd25..0d0aa9f3bc 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -32,6 +32,7 @@
(require 'thingatpt)
(require 'mm-url)
(require 'puny)
+(require 'xdg)
(eval-when-compile (require 'subr-x)) ;; for string-trim
(defgroup eww nil
@@ -55,7 +56,8 @@ eww-search-prefix
:group 'eww
:type 'string)
-(defcustom eww-download-directory "~/Downloads/"
+(defcustom eww-download-directory (or (xdg-user-dir "DOWNLOAD")
+ "~/Downloads/")
"Directory where files will downloaded."
:version "24.4"
:group 'eww
--
2.20.1
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#41030
; Package
emacs
.
(Sun, 03 May 2020 22:53:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 41030 <at> debbugs.gnu.org (full text, mbox):
Philip K <philip <at> warpmail.net> writes:
> -(defcustom eww-download-directory "~/Downloads/"
> +(defcustom eww-download-directory (or (xdg-user-dir "DOWNLOAD")
> + "~/Downloads/")
This makes sense conceptually. However, on my machine, evaluating
(xdg-user-dir "DOWNLOAD") just returns $HOME. That's a worse default
than "~/Downloads/", no?
But I don't know enough about the XDG standard to propose a solution.
Nor do I know if this is because my setup is particularly unusual.
Lars, what do you think?
Best regards,
Stefan Kangas
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#41030
; Package
emacs
.
(Sun, 03 May 2020 23:29:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 41030 <at> debbugs.gnu.org (full text, mbox):
severity 41030 wishlist
quit
Stefan Kangas <stefan <at> marxist.se> writes:
> Philip K <philip <at> warpmail.net> writes:
>
>> -(defcustom eww-download-directory "~/Downloads/"
>> +(defcustom eww-download-directory (or (xdg-user-dir "DOWNLOAD")
>> + "~/Downloads/")
>
> This makes sense conceptually. However, on my machine, evaluating
> (xdg-user-dir "DOWNLOAD") just returns $HOME. That's a worse default
> than "~/Downloads/", no?
>
> But I don't know enough about the XDG standard to propose a solution.
> Nor do I know if this is because my setup is particularly unusual.
It sounds like it could be specific to your environment; have a look at
'man 1 xdg-user-dirs-update'.
> Lars, what do you think?
I'm not Lars, but there's some precedent for this feature. In the
following thread that prompted the creation of xdg.el, Lars talked about
a general facility for determining the default download directory:
https://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00607.html
In the following thread(s), using the external executable xdg-user-dirs
for eww-download-directory was discussed:
https://lists.gnu.org/archive/html/emacs-devel/2018-10/msg00599.html
https://lists.gnu.org/archive/html/emacs-devel/2018-11/msg00014.html
Some executive questions:
- Does it make sense and is it safe to eagerly load xdg.el on all
platforms and call xdg-user-dir while eww.el is being loaded? One
alternative being to define a symbolic constant such as 'xdg for
eww-download-directory that is translated to a call to xdg-user-dir on
demand rather than up front. This idea can be expanded to cover
non-XDG systems.
- Should we wait until there's a general utility for this?
- What do we do when xdg-user-dir returns ~/ but ~/Downloads/ also
exists, as in Stefan's case? Consider it a user misconfiguration?
Thanks,
--
Basil
Severity set to 'wishlist' from 'normal'
Request was from
"Basil L. Contovounesios" <contovob <at> tcd.ie>
to
control <at> debbugs.gnu.org
.
(Sun, 03 May 2020 23:29:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#41030
; Package
emacs
.
(Tue, 05 May 2020 08:03:01 GMT)
Full text and
rfc822 format available.
Message #16 received at 41030 <at> debbugs.gnu.org (full text, mbox):
"Basil L. Contovounesios" <contovob <at> tcd.ie> writes:
> - What do we do when xdg-user-dir returns ~/ but ~/Downloads/ also
> exists, as in Stefan's case? Consider it a user misconfiguration?
I think that is ~/Downloads/ exists, it's a good hint that the user
wants to use ~/Downloads/, no matter what xdg-user-dir says.
Probably?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#41030
; Package
emacs
.
(Tue, 05 May 2020 08:21:02 GMT)
Full text and
rfc822 format available.
Message #19 received at 41030 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> "Basil L. Contovounesios" <contovob <at> tcd.ie> writes:
>
>> - What do we do when xdg-user-dir returns ~/ but ~/Downloads/ also
>> exists, as in Stefan's case? Consider it a user misconfiguration?
>
> I think that is ~/Downloads/ exists, it's a good hint that the user
> wants to use ~/Downloads/, no matter what xdg-user-dir says.
So should it check for "~/Downloads/" first (and maybe perhaps a few
other popular directory names in other languages), and unless that
hasn't been found load xdg.el and call xdg-user-dir? In the worst case,
the user doesn't have a download directory and $HOME is actually where
they want their files to land.
--
Philip K.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#41030
; Package
emacs
.
(Tue, 05 May 2020 21:33:01 GMT)
Full text and
rfc822 format available.
Message #22 received at 41030 <at> debbugs.gnu.org (full text, mbox):
"Basil L. Contovounesios" <contovob <at> tcd.ie> writes:
>>> -(defcustom eww-download-directory "~/Downloads/"
>>> +(defcustom eww-download-directory (or (xdg-user-dir "DOWNLOAD")
>>> + "~/Downloads/")
>>
>> This makes sense conceptually. However, on my machine, evaluating
>> (xdg-user-dir "DOWNLOAD") just returns $HOME. That's a worse default
>> than "~/Downloads/", no?
>>
>> But I don't know enough about the XDG standard to propose a solution.
>> Nor do I know if this is because my setup is particularly unusual.
>
> It sounds like it could be specific to your environment; have a look at
> 'man 1 xdg-user-dirs-update'.
In my use-case, I don't think I have ever touched any of this stuff.
Not AFAIR, anyways.
So I wonder if the suggested code would mean to never use
"~/Downloads", since xdg-user-dir will always return something else?
Best regards,
Stefan Kangas
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#41030
; Package
emacs
.
(Wed, 06 May 2020 00:05:02 GMT)
Full text and
rfc822 format available.
Message #25 received at 41030 <at> debbugs.gnu.org (full text, mbox):
Stefan Kangas <stefan <at> marxist.se> writes:
>> It sounds like it could be specific to your environment; have a look at
>> 'man 1 xdg-user-dirs-update'.
>
> In my use-case, I don't think I have ever touched any of this stuff.
> Not AFAIR, anyways.
>
> So I wonder if the suggested code would mean to never use
> "~/Downloads", since xdg-user-dir will always return something else?
I get nil from (xdg-user-dir "DOWNLOAD"). Looking at the code, I guess
you have something in ~/.config/user-dirs.dirs which causes this.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#41030
; Package
emacs
.
(Wed, 06 May 2020 00:19:01 GMT)
Full text and
rfc822 format available.
Message #28 received at 41030 <at> debbugs.gnu.org (full text, mbox):
Noam Postavsky <npostavs <at> gmail.com> writes:
> I get nil from (xdg-user-dir "DOWNLOAD"). Looking at the code, I guess
> you have something in ~/.config/user-dirs.dirs which causes this.
Yup, that seems to be it.
I deleted the file, and now (xdg-user-dir "DOWNLOAD") returns nil as
it should.
Sorry about the noise.
Best regards,
Stefan Kangas
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#41030
; Package
emacs
.
(Fri, 17 Jul 2020 13:10:01 GMT)
Full text and
rfc822 format available.
Message #31 received at 41030 <at> debbugs.gnu.org (full text, mbox):
philip <at> warpmail.net (Philip K.) writes:
>> I think that is ~/Downloads/ exists, it's a good hint that the user
>> wants to use ~/Downloads/, no matter what xdg-user-dir says.
>
> So should it check for "~/Downloads/" first (and maybe perhaps a few
> other popular directory names in other languages), and unless that
> hasn't been found load xdg.el and call xdg-user-dir?
Yes, perhaps something like that.
But we don't want to do that checking at load time, I think? And the
same goes for the call to xdg-user-dir -- that doesn't be done at load
time, either.
(And the patch isn't correct as is, either, because xdg-user-dir returns
the directory without a trailing slash.)
So perhaps eww-download-directory should default to a function that does
all this checking and calling?
Any opinions?
And... as far as I can see, xdg-user-dir isn't used anywhere else in
Emacs? What's up with that?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#41030
; Package
emacs
.
(Wed, 29 Jul 2020 05:15:01 GMT)
Full text and
rfc822 format available.
Message #34 received at 41030 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> So perhaps eww-download-directory should default to a function that does
> all this checking and calling?
I've now done this in Emacs 28.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Added tag(s) fixed.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Wed, 29 Jul 2020 05:15:02 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 28.1, send any further explanations to
41030 <at> debbugs.gnu.org and Philip K <philip <at> warpmail.net>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Wed, 29 Jul 2020 05:15:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 26 Aug 2020 11:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 5 years and 17 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.