From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Francisco_Miguel_Cola=c3=a7o?= Newsgroups: gmane.emacs.devel Subject: Re: Inclusion of XDG Base Directory library Date: Fri, 11 May 2018 21:22:37 +0100 Message-ID: References: <779935bf-79ea-5783-4c9c-4b7e2857bc50@gmail.com> <83o9hmnzsi.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1526070100 966 195.159.176.226 (11 May 2018 20:21:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 11 May 2018 20:21:40 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 11 22:21:35 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fHEXl-000076-44 for ged-emacs-devel@m.gmane.org; Fri, 11 May 2018 22:21:33 +0200 Original-Received: from localhost ([::1]:42221 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fHEZr-0002Wy-VF for ged-emacs-devel@m.gmane.org; Fri, 11 May 2018 16:23:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fHEYu-00028a-QR for emacs-devel@gnu.org; Fri, 11 May 2018 16:22:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fHEYr-0001io-Ks for emacs-devel@gnu.org; Fri, 11 May 2018 16:22:44 -0400 Original-Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:38966) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fHEYr-0001iZ-EH; Fri, 11 May 2018 16:22:41 -0400 Original-Received: by mail-wr0-x244.google.com with SMTP id q3-v6so6468120wrj.6; Fri, 11 May 2018 13:22:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=B6pn64WrciFkOHw+Mp91UW9R9Rnn/6Y9cfV/wMSqOv4=; b=EJl7dD7xDvVKTsophbIyAiFnDsD/7YTLuh3ldNfJ4M5mMcHvIIn2jU0CgSok/9MiaR tpKa/48SmwOa8C4tjKaUG9FxeTra7OmWTem2wwsELENUQgVJmIaXonAYZjYM5ioXhWtK BGICi+Ew3yK8OawvtLPZQUKVFSnU5lzHGBUENrBXFItU9CdorHb8CrWPYP9yrxp2X3hg +FD3yOu6ptjLAQXOubGVlpwokAKI06QL5qfzt+P6MM2X+aRiVA/axjVmmmcv4Kb2pWAt 41r7S8RhuEL+ZeXnWcXJwme95KPaxif1ii2n434ukd84GVQnw/r7TXqDOr2Xn1bGVBEr ABog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=B6pn64WrciFkOHw+Mp91UW9R9Rnn/6Y9cfV/wMSqOv4=; b=Qu0jhFi4wmwCbXIqEseIoF/LPqSh9bryxY7/ogVBvM/btT2Qx1xpiRWiZPrbS7XWfD VT1UH7YqYjIpwRixrHqehkE/dTj3gJKcYUMgepPsYEMJaOvjJpgeG3HJEaPL6RCFIZra 15czx5nDAk7eKC3I1JjC/9gVizNz0ja2y9QqpQfYS82zMzXFVgcE02MYfJf6hlW80XWl BHOlY6PffeDtR+zIUAz058EeL2OZcSbqsLKxA1zK0IuHtCeCWSCkBkYKiB8sOhrR0LuO eN3G/ZeQNKRdO+z42G3JKLm8FqYkSxcGAZOZOwMVM441yCfYvRkmgVtXhiBvqhrAqSvY POyQ== X-Gm-Message-State: ALKqPwdz0IP+gfRttdIZOvhh/Pcx2qdybywiX48sPzcUHBAgSOMJR5Kx qtWmZ5BBMxHGOlggiy1cnNCyHhrh X-Google-Smtp-Source: AB8JxZpiIXUP3LQzY6NXZ6G2Xtw9rmye0MLgIY6/XY1ltTz8OLWX/nCTewV1cY/NUiR2pAV6ch8cEg== X-Received: by 2002:adf:984c:: with SMTP id v70-v6mr331736wrb.100.1526070159555; Fri, 11 May 2018 13:22:39 -0700 (PDT) Original-Received: from localhost.localdomain (bl17-210-45.dsl.telepac.pt. [188.82.210.45]) by smtp.gmail.com with ESMTPSA id k126-v6sm2401798wmg.6.2018.05.11.13.22.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 May 2018 13:22:38 -0700 (PDT) In-Reply-To: <83o9hmnzsi.fsf@gnu.org> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::244 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:225248 Archived-At: =C2=A0 Eli, =C2=A0 Thanks for the heads up.=C2=A0 The windows-shell-folder and windows-read-registry-value, which I thought were part of Windows Emacs, were added to user-directories-windows-nt.el. =C2=A0 I have not tested Windows NT code because I do not currently own a= ny Windows computer and the virtual machines on which I run it do not have Emacs.=C2=A0 So, I am dependent on the goodwill and patches from the many= that use Emacs on Microsoft platforms. =C2=A0 According to http://environmentvariables.org/LocalAppData, the variable was introduced in Windows Vista and defaults to C:\Users\{username}\AppData\Local.=C2=A0 I have used it on some applicati= ons I wrote a long time ago and seem to remember that the purpose of that directory is to store temporary files, which should not be shared among machines and pertain only to the local session.=C2=A0 If there is no valu= e in having that variable evaluated, then there is no obstacles to redefine the code and drop it --- or even get the temp files code from the existing code. =C2=A0 About Linux, the canonical way to get an XDG user folder is by the= use of the command xdg-user-dir.=C2=A0 The alternative is to parse ~/.config/user-dirs.dirs, something that is already done by xdg-user-dir.=C2=A0 Here are two lines of mine (European Portuguese): =C2=A0 XDG_DESKTOP_DIR=3D"$HOME/=C3=81rea de Trabalho" =C2=A0 XDG_DOWNLOAD_DIR=3D"$HOME/Transfer=C3=AAncias" =C2=A0 Although it does not pose a gruesome task to parse it (blessed be regexps), as far as I can understand the XDG Base Directory Standard the recommended way to find directories is not to parse the file, but to use the command.=C2=A0 Every distribution since near 2010 includes xdg-user-dirs.=C2=A0 I can write parsing code, but it seems inadequate, considering there is a blessed way to perform the search.=C2=A0 It is aki= n to use 'movemail' to send and receive mail or 'git' by Magit: there is little value added in the effort of reimplementing that which is already functional, something that would leave a dangerous point of stagnation or even breakage at the future. =C2=A0 Thanks for your comments. =C2=A0 Best regards, =C2=A0=C2=A0=C2=A0 Francisco Cola=C3=A7o =C3=80s 13:26 de 11-05-2018, Eli Zaretskii escreveu: >> From: Francisco Miguel Cola=C3=A7o >> Date: Mon, 7 May 2018 09:26:36 +0100 >> >> =C2=A0 Friends, >> >> =C2=A0 I have set a public github repository at: >> >> =C2=A0=C2=A0=C2=A0 https://github.com/francisco-colaco/user-directorie= s >> >> =C2=A0 Please feel free to contribute there or to raise issues. > The code calls windows-shell-folder, but I cannot find that function > anywhere. What did I miss? > > The environment variable LOCALAPPDATA is not defined on my system. > Why do we need it? > > I also think we need not override the code which already computes > where to place the temporary directory. > > On GNU/Linux, this calls an external program; can we avoid that? > > Thanks.