all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Francisco Miguel Colaço" <francisco.colaco@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Inclusion of XDG Base Directory library
Date: Fri, 11 May 2018 21:22:37 +0100	[thread overview]
Message-ID: <b84a26f7-676d-d7f0-56c4-98dca51a0fce@gmail.com> (raw)
In-Reply-To: <83o9hmnzsi.fsf@gnu.org>

  Eli,

  Thanks for the heads up.  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.

  I have not tested Windows NT code because I do not currently own any
Windows computer and the virtual machines on which I run it do not have
Emacs.  So, I am dependent on the goodwill and patches from the many
that use Emacs on Microsoft platforms.

  According to http://environmentvariables.org/LocalAppData, the
variable was introduced in Windows Vista and defaults to
C:\Users\{username}\AppData\Local.  I have used it on some applications
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.  If there is no value 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.

  About Linux, the canonical way to get an XDG user folder is by the use
of the command xdg-user-dir.  The alternative is to parse
~/.config/user-dirs.dirs, something that is already done by
xdg-user-dir.  Here are two lines of mine (European Portuguese):

  XDG_DESKTOP_DIR="$HOME/Área de Trabalho"
  XDG_DOWNLOAD_DIR="$HOME/Transferências"

  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.  Every distribution since near 2010 includes
xdg-user-dirs.  I can write parsing code, but it seems inadequate,
considering there is a blessed way to perform the search.  It is akin 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.

  Thanks for your comments.

  Best regards,

    Francisco Colaço


Às 13:26 de 11-05-2018, Eli Zaretskii escreveu:
>> From: Francisco Miguel Colaço <francisco.colaco@gmail.com>
>> Date: Mon, 7 May 2018 09:26:36 +0100
>>
>>   Friends,
>>
>>   I have set a public github repository at:
>>
>>     https://github.com/francisco-colaco/user-directories
>>
>>   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.





  reply	other threads:[~2018-05-11 20:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-06 19:04 Inclusion of XDG Base Directory library Francisco Miguel Colaço
2018-05-07  8:26 ` Francisco Miguel Colaço
2018-05-07 16:43   ` Stefan Monnier
2018-05-11 12:26   ` Eli Zaretskii
2018-05-11 20:22     ` Francisco Miguel Colaço [this message]
2018-05-12  6:52       ` Eli Zaretskii
2018-05-12  9:01         ` Francisco Miguel Colaço
2018-05-12 15:32       ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b84a26f7-676d-d7f0-56c4-98dca51a0fce@gmail.com \
    --to=francisco.colaco@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.