From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "francisco.colaco@gmail.com" Newsgroups: gmane.emacs.devel Subject: Re: xdg-directories.el Date: Wed, 7 Sep 2016 15:59:23 +0100 Message-ID: References: <83shtbaj4b.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114b70b0ad32e5053bec28e2 X-Trace: blaine.gmane.org 1473260419 17481 195.159.176.226 (7 Sep 2016 15:00:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 7 Sep 2016 15:00:19 +0000 (UTC) Cc: Emacs developers To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 07 17:00:14 2016 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 1bheKg-0003qI-ST for ged-emacs-devel@m.gmane.org; Wed, 07 Sep 2016 17:00:11 +0200 Original-Received: from localhost ([::1]:41428 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bheKe-0001Qj-Ny for ged-emacs-devel@m.gmane.org; Wed, 07 Sep 2016 11:00:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bheK7-0001P5-Fh for emacs-devel@gnu.org; Wed, 07 Sep 2016 10:59:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bheK4-00079a-V1 for emacs-devel@gnu.org; Wed, 07 Sep 2016 10:59:34 -0400 Original-Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]:38492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bheJx-00078o-Kx; Wed, 07 Sep 2016 10:59:25 -0400 Original-Received: by mail-wm0-x234.google.com with SMTP id 1so37638037wmz.1; Wed, 07 Sep 2016 07:59:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=2qfOlaDFRY3FOZMvaPFKqClnx+kxsC3paVboRdobxKk=; b=eH5L7xz8J8IqCdErLzzKa/eqHHUxUxo9RUFmOwlRFK1ADrVJ46LMPbT8Hj5lzAlUrk +/AMMVv4cQx9uU0JMJB8djE6eXmJvf5/YdK/hs21hFhlZmcSBUAlj/KHaw10CNZ8kydZ NHuY3v38YIv8Ss+uKpYM80htQWfkJCwqk6/R8NSFkhSB40cMZvsQhMfrTKeZrphRO7tj gkiab8xSu8sEwS9O5lPFbchgcffbaW6vmXnHxEqoK/t3H2jTlQuVksiosfEyx/ufTSQe laS7Gca0VpBFvL2tCYfftI/0j2JkVCHXwoILnR54xcMCrsxNCsrHYhxFajN4s7IWJdat AB6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=2qfOlaDFRY3FOZMvaPFKqClnx+kxsC3paVboRdobxKk=; b=QcVQRPAwm69tyBxMbUyDaG1sOhPEmIbp5vQW7QC7pYdmox3rmii0nTnX6EGForQqqr KBS8xqQaxyC7OruSs1huYLTvhNmjvFhTBoC78BR113qtXo6mYNdz3PEKCIJVp9e16Zaf IFiPuMrrfkt6q9rzoYsrDtRagFHWnxdI9YdhYGhb7XapKLR4B/UDdzn/YYAAx2t6TF6C aypxbgqQr4kthRenx+IJDCVyk7VhKmL4q8FggWiSMvN/ZSrrH5YvtGP0IEF+dV36Ho/d CdsgswdWezbPTmiQm1SpZOr8iIMZP5Zdyj0XLLbsbAx5uPTYbEwxEQ84gxzUzom77l+c rh2w== X-Gm-Message-State: AE9vXwP3MOhSSHN5Y0BCa3BfxnW+tug85GKyyG6msWitJvWFNk4TkV6X4Vb3G6BOptI//eERRSfAfAiU2MyXSQ== X-Received: by 10.28.73.212 with SMTP id w203mr4172722wma.43.1473260364310; Wed, 07 Sep 2016 07:59:24 -0700 (PDT) Original-Received: by 10.28.30.140 with HTTP; Wed, 7 Sep 2016 07:59:23 -0700 (PDT) In-Reply-To: <83shtbaj4b.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::234 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:207243 Archived-At: --001a114b70b0ad32e5053bec28e2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Eli, I have not created a perfect package, I have just shared something I personally use, and that works for my purposes (to separate files I want to backup from those I do not want; and configuration files which I share among machines from data files which are generated in the machine, like recentf or Emacs session files). I emphasize the idea that Emacs must adhere to the XDG protocol, as almost all other applications are. Emacs does so much more now than twenty-five years ago, when I started using it, and the configuration files have also grown concomitantly. About the adoption, I think it is a non-issue. At the very least, user-emacs-directory should be changed to ~/.local/share/emacs, if it exists, and keep on being ~/.emacs.d if not. As far as I know, no package has "~/.emacs.d" hardwritten, so the transition should be painless. In the same spirit, user-emacs-init should look first for (locate-user-config-file "init.el") then ~/.emacs.d/init.el and then the usual choices, as detailed in the Emacs manual. (At this moment, ~/.emacs takes precedence over ~/.emacs.d/init.el, which is annoying. Debian and Fedora tend to install a .emacs of their own, and a pretty useless one. I have been fooled once, surprised my configuration in ~/.emacs.d/init.el was not called.) About some of the useful suggestions you made: - s-chomp does replace a longer elisp call chain. That is why a few months ago I made the choice to use s, which I can tell is a good library. I have never made the change to f, though, not because the lack of want, but because expand-file-name worked well enough. - I am aware that xdg-user-dir reads the environment variables, which actually are in the standard. I guessed, maybe wrongly, at the time, that xdg-user-dir would be the future-proof standard way of getting the values. Thinking better, I will change that. - About the API: I am open to all suggestions. Change at will, and if you want, I will provide you with full access to the Github repository! - About the doc strings: I have to revise those once again. Thanks for your input. I will try do address most of the changes today. Francisco Cola=C3=A7o 2016-09-07 15:18 GMT+01:00 Eli Zaretskii : > > From: "francisco.colaco@gmail.com" > > Date: Tue, 6 Sep 2016 16:24:56 +0100 > > > > I would request that this package (after revision and a possible API > change) becomes part of GNU Emacs. I would also suggest that > ~/.config/emacs/init.el (the result of "(locate-user-emacs-config-file > "init.el") becomes in vanilla emacs part of the chain to determine > user-init-file. > > Thanks. Some comments below. > > . IMO, we need to figure out where this stuff fits into Emacs. Do > the XDG places override the traditional Emacs places, or the other > way around? Do we even want this, and if so, why? > > . If the XDG places override the traditional ones, an important > aspect to consider is the transition period: the first Emacs > version that turns on this feature will need to help users migrate > from the old places to the new ones. This requires support code > that I don't see in your package. > > . The package in its present form "needs work" before it can be > admitted into Emacs: > > . The few settings that must be preloaded and the minimal support > code should go to files.el; the rest of the package doesn't have > to be preloaded, AFAICT. > > . The package currently depends on s.el for a single function; I > think that dependency should be removed, and standard facilities > used instead. > > . The usage of shell commands, such as xdg-user-dir, is > problematic, at least on non-Posix platforms. I wonder if that > script is really needed, or how important it is for the overall > functionality. AFAICS, the script just accesses some environment > variables and reads a file, something we could do from Lisp. > > . Symbols (functions, variables) defined by the package should have > a unique package-specific prefix, in this case probably "xdg-". > > . Maybe it's just me, but I find some of the terminology, and the > respective variable/function names, confusing, because they clash > with the long tradition of the Emacs terminology. For example, > "user file" has a precise meaning in Emacs, so the purpose of > xdg-get-user-file is a surprise. Likewise with "emacs data > file". More generally, the naming convention doesn't sound > consistent: some functions that return file names are called > locate-SOME-file, but other similar functions are > xdg-get-SOME-file. > > . The doc strings need various minor fixes, as they include typos > and copy/paste errors. > > . A minor nit: GNU coding standards frown on using "path" to refer > to anything but PATH-style directory lists; use "file name" or > "directory name" instead. > > Thanks for working on this. > --001a114b70b0ad32e5053bec28e2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Eli,

I hav= e not created a perfect package, I have just shared something I personally = use, and that works for my purposes (to separate files I want to backup fro= m those I do not want; and configuration files which I share among machines= from data files which are generated in the machine, like recentf or Emacs = session files).=C2=A0 I emphasize the idea that Emacs must adhere to the XD= G protocol, as almost all other applications are.=C2=A0 Emacs does so much = more now than twenty-five years ago, when I started using it, and the confi= guration files have also grown concomitantly.

About the adopti= on, I think it is a non-issue.=C2=A0 At the very least, user-emacs-director= y should be changed to ~/.local/share/emacs, if it exists, and keep on bein= g ~/.emacs.d if not.=C2=A0 As far as I know, no package has "~/.emacs.= d" hardwritten, so the transition should be painless.=C2=A0 In the sam= e spirit, user-emacs-init should look first for (locate-user-config-file &q= uot;init.el") then ~/.emacs.d/init.el and then the usual choices, as d= etailed in the Emacs manual.

(At this moment, ~/.emacs takes p= recedence over ~/.emacs.d/init.el, which is annoying.=C2=A0 Debian and Fedo= ra tend to install a .emacs of their own, and a pretty useless one.=C2=A0 I= have been fooled once, surprised my configuration in ~/.emacs.d/init.el wa= s not called.)

About some of the useful suggestions you m= ade:

-=C2=A0 s-chomp does replace a longer elisp ca= ll chain.=C2=A0 That is why a few months ago I made the choice to use s, wh= ich I can tell is a good library.=C2=A0 I have never made the change to f, = though, not because the lack of want, but because expand-file-name worked w= ell enough.

- I am aware that xdg-user-dir reads the environme= nt variables, which actually are in the standard.=C2=A0 I guessed, maybe wr= ongly, at the time, that xdg-user-dir would be the future-proof standard wa= y of getting the values.=C2=A0 Thinking better, I will change that.

=
- About the API: I am open to all suggestions.=C2=A0 Change at will, = and if you want, I will provide you with full access to the Github reposito= ry!

- About the doc strings: I have to revise those once again= .

Thanks for your input.=C2=A0 I will try = do address most of the changes today.

=C2=A0 Francisco Co= la=C3=A7o


2016-09-07 15:18 GMT+01:00 Eli Zaretskii= <el= iz@gnu.org>:
> From: &qu= ot;francisco.colaco@gmail.com= " <francisco.cola= co@gmail.com>
> Date: Tue, 6 Sep 2016 16:24:56 +0100
>
> I would request that this package (after revision and a possible API c= hange) becomes part of GNU Emacs.=C2=A0 I would also suggest that ~/.config= /emacs/init.el (the result of "(locate-user-emacs-config-file &qu= ot;init.el") becomes in vanilla emacs part of the chain to determine u= ser-init-file.

Thanks.=C2=A0 Some comments below.

=C2=A0. IMO, we need to figure out where this stuff fits into Emacs.=C2=A0 = Do
=C2=A0 =C2=A0the XDG places override the traditional Emacs places, or the o= ther
=C2=A0 =C2=A0way around?=C2=A0 Do we even want this, and if so, why?

=C2=A0. If the XDG places override the traditional ones, an important
=C2=A0 =C2=A0aspect to consider is the transition period: the first Emacs =C2=A0 =C2=A0version that turns on this feature will need to help users mig= rate
=C2=A0 =C2=A0from the old places to the new ones.=C2=A0 This requires suppo= rt code
=C2=A0 =C2=A0that I don't see in your package.

=C2=A0. The package in its present form "needs work" before it ca= n be
=C2=A0 =C2=A0admitted into Emacs:

=C2=A0 =C2=A0. The few settings that must be preloaded and the minimal supp= ort
=C2=A0 =C2=A0 =C2=A0code should go to files.el; the rest of the package doe= sn't have
=C2=A0 =C2=A0 =C2=A0to be preloaded, AFAICT.

=C2=A0 =C2=A0. The package currently depends on s.el for a single function;= I
=C2=A0 =C2=A0 =C2=A0think that dependency should be removed, and standard f= acilities
=C2=A0 =C2=A0 =C2=A0used instead.

=C2=A0 =C2=A0. The usage of shell commands, such as xdg-user-dir, is
=C2=A0 =C2=A0 =C2=A0problematic, at least on non-Posix platforms.=C2=A0 I w= onder if that
=C2=A0 =C2=A0 =C2=A0script is really needed, or how important it is for the= overall
=C2=A0 =C2=A0 =C2=A0functionality.=C2=A0 AFAICS, the script just accesses s= ome environment
=C2=A0 =C2=A0 =C2=A0variables and reads a file, something we could do from = Lisp.

=C2=A0 =C2=A0. Symbols (functions, variables) defined by the package should= have
=C2=A0 =C2=A0 =C2=A0a unique package-specific prefix, in this case probably= "xdg-".

=C2=A0 =C2=A0. Maybe it's just me, but I find some of the terminology, = and the
=C2=A0 =C2=A0 =C2=A0respective variable/function names, confusing, because = they clash
=C2=A0 =C2=A0 =C2=A0with the long tradition of the Emacs terminology.=C2=A0= For example,
=C2=A0 =C2=A0 =C2=A0"user file" has a precise meaning in Emacs, s= o the purpose of
=C2=A0 =C2=A0 =C2=A0xdg-get-user-file is a surprise.=C2=A0 Likewise with &q= uot;emacs data
=C2=A0 =C2=A0 =C2=A0file".=C2=A0 More generally, the naming convention= doesn't sound
=C2=A0 =C2=A0 =C2=A0consistent: some functions that return file names are c= alled
=C2=A0 =C2=A0 =C2=A0locate-SOME-file, but other similar functions are
=C2=A0 =C2=A0 =C2=A0xdg-get-SOME-file.

=C2=A0 =C2=A0. The doc strings need various minor fixes, as they include ty= pos
=C2=A0 =C2=A0 =C2=A0and copy/paste errors.

=C2=A0 =C2=A0. A minor nit: GNU coding standards frown on using "path&= quot; to refer
=C2=A0 =C2=A0 =C2=A0to anything but PATH-style directory lists; use "f= ile name" or
=C2=A0 =C2=A0 =C2=A0"directory name" instead.

Thanks for working on this.

--001a114b70b0ad32e5053bec28e2--