From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.bugs Subject: bug#41030: [PATCH] Make EWW respect XDG download directory by default Date: Mon, 04 May 2020 00:28:13 +0100 Message-ID: <87o8r4ha42.fsf@tcd.ie> References: <20200502165842.8564-1-philip@warpmail.net> <874ksw1vjd.fsf@stefankangas.se> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="4249"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Lars Ingebrigtsen , Philip K , 41030@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 04 01:29:11 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jVO2o-00010d-Bj for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 May 2020 01:29:10 +0200 Original-Received: from localhost ([::1]:33918 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVO2n-00084Q-Ef for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 03 May 2020 19:29:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVO2g-00083m-R4 for bug-gnu-emacs@gnu.org; Sun, 03 May 2020 19:29:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46902) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jVO2g-0002oe-IS for bug-gnu-emacs@gnu.org; Sun, 03 May 2020 19:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jVO2g-0007Vn-Ey for bug-gnu-emacs@gnu.org; Sun, 03 May 2020 19:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 03 May 2020 23:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41030 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 41030-submit@debbugs.gnu.org id=B41030.158854850428822 (code B ref 41030); Sun, 03 May 2020 23:29:02 +0000 Original-Received: (at 41030) by debbugs.gnu.org; 3 May 2020 23:28:24 +0000 Original-Received: from localhost ([127.0.0.1]:58448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jVO23-0007Uj-OI for submit@debbugs.gnu.org; Sun, 03 May 2020 19:28:24 -0400 Original-Received: from mail-wm1-f42.google.com ([209.85.128.42]:39846) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jVO21-0007UO-2A for 41030@debbugs.gnu.org; Sun, 03 May 2020 19:28:22 -0400 Original-Received: by mail-wm1-f42.google.com with SMTP id y24so6852640wma.4 for <41030@debbugs.gnu.org>; Sun, 03 May 2020 16:28:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=5fItSMdsDGjB7MuWP0Ntgjch9lp8xrDrfe0tWWVTK1M=; b=ozl6332avTQQVMBrB/52vvhimcOs1I+VUQgNyC+OPBeSBv/epm8vwtoWTJFV+8rqOD LurbhvCEWNuxHW1F0TNG4cAg1Dtt7BenTE7A6eK1Ki6md8mcM6SH+dAV18gXYcGROrmg 3xumWXgKWgqOecyk6WgKlO//QQLAW6hfBGCkjEDLzStmVVCO65L1dM6k3CnfwsueE/fD BuEZPnfOnkkIn1B5e+fxH4BiqMHyks+c8dbs+LlJbYIOh9+FZx/og0h35ljoijAST5h9 YVV3c+nWdFjmpaqze530BrO8yqVUqevBMvDDwSGGn5oJGWsIJ3U5lD8ZYnyA2nf8ROO4 cQGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=5fItSMdsDGjB7MuWP0Ntgjch9lp8xrDrfe0tWWVTK1M=; b=RH5kcgufxV1eyycl2vx3g3ld3DQMXm3X2VOTPt3O5QAZpZdV2DA5qJtJ8b7/y0JEfQ yiSyLgDBbkAOShJDymsyYAkHK0FFjmN/E8Bl3uAClQbD0BOB+rKOzwSe6H7WrW199Pzy Bu02JnpTlmUXB+jeciA/jtxJDYLvxwuHv4k4WZV1uEZZwiXlNYgm88fWFRwoD+ddxP2I eNGXOvg56OizqtKhYZ0yJI7Q/Zcl9l+H9WRfU9bo1zjY/mh82SrSBfYEIk4Rm1HgEjgn e785zIHU4RANaiSlgW6fzQKA9IgMV+avIRj7CPk/TrAwlgyL/IgkfqbKOxDIiPd435ft TDHA== X-Gm-Message-State: AGi0PuauQsg4sDMPFM/y4sbiXKxTZuiTjWLbTHhst54RibRo+kbfR+uy cw6JHiQIIvYY3MQa/4HiT9kHnw== X-Google-Smtp-Source: APiQypJCdeBwltXmIJ8KN2Ehd4iWGsAjt91WAp4gSUJBTlDxkMNTeqFrFFuif4bCU01ahPxY4ZQTbA== X-Received: by 2002:a1c:1fcf:: with SMTP id f198mr11621890wmf.16.1588548495261; Sun, 03 May 2020 16:28:15 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:1f68:7ff5:120d:64e]) by smtp.gmail.com with ESMTPSA id v16sm10673232wml.30.2020.05.03.16.28.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 May 2020 16:28:14 -0700 (PDT) In-Reply-To: <874ksw1vjd.fsf@stefankangas.se> (Stefan Kangas's message of "Mon, 04 May 2020 00:52:06 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:179642 Archived-At: severity 41030 wishlist quit Stefan Kangas writes: > Philip K 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