zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: please conform to the xdg base directory specification
Date: Sat, 24 Aug 2013 18:05:56 +0100	[thread overview]
Message-ID: <20130824180556.407268d8@pws-pc.ntlworld.com> (raw)
In-Reply-To: <130816202019.ZM27717@torch.brasslantern.com>

On Fri, 16 Aug 2013 20:20:19 -0700
Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Aug 15,  7:54pm, Peter Stephenson wrote:
> }
> } Adding yet more complexity to the initialisation file logic doesn't seem
> } a great idea, but one thing that could keep everything more or less
> } under control would be to make ZDOTDIR a colon-separated array (and make
> } zdotdir an array).
> 
> ... this suggestion, while fine on its own, does not solve the problem of
> bootstrapping the value of ZDOTDIR, so zsh would still not "conform to
> XDG."  Unless someone *else* has a good use for a multi-element ZDOTDIR
> path, there's no benefit in going down this road.

Presumably if you wanted your distribution to conform to it you'd stick
the setting in /etc/zshenv, with appropriate protections.  I expect we'd
have to issue guidelines if we went down this route since there are still
plenty of pitfalls.

Mikael wrote:
> I have my dotfiles in ~/.zsh, but .zshrc linked to ~ so I can edit it
> easily (I tend to do that a lot), so parsing both by default would be
> bad for me.

Whatever the rule we came up with was, I'm sure there'd be a way of
dealing with this.

Either look for the first existing directory.  (So it wouldn't be
sensible to have $HOME anywhere other than at the end.)

Or look down $zdotdir for the first existing dot file and
stick with that directory for all files.  (Probably needs special
handling if zdotdir gets changed.)

Or look for the first dot file of each type separately down $zdotdir.  This
is the simplest solution but could have counterintuitive results if you
leave an old file behind in $HOME and subsequently only ever look at
the files in ~/.zsh or wherever.

There doesn't seem any good reason for handling multiple files of the same type within $zdotdir (i.e. .zshrc etc. in two different places), there are already plenty of good ways of chaining files.

We might need to think about rules for finding e.g. ~/.zsh/zshrc instead of
~/.zsh/.zshrc since the extra dot is pretty unhelpful.  (E.g. look for
the file without the dot if a parent directory does have a dot at the
start.  We don't want to look for ~/zshrc, that could easily be problematic.)

If there's no real enthusiasm, however, it's not worth pursuing.

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


      parent reply	other threads:[~2013-08-24 17:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-13  8:33 Thomas Koch
2013-08-13  9:15 ` Frank Terbeck
2013-08-15 18:54   ` Peter Stephenson
2013-08-17  3:20     ` Bart Schaefer
2013-08-17  8:46       ` Mikael Magnusson
2013-08-24 17:05       ` Peter Stephenson [this message]

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=20130824180556.407268d8@pws-pc.ntlworld.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@zsh.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 public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).