zsh-workers
 help / color / mirror / code / Atom feed
From: Phil Pennock <zsh-workers+phil.pennock@spodhuis.org>
To: zsh-workers@sunsite.dk
Subject: Re: [PATCH] Proposal: stat -> zstat
Date: Sat, 5 May 2007 18:07:50 -0700	[thread overview]
Message-ID: <20070506010750.GA46162@redoubt.spodhuis.org> (raw)
In-Reply-To: <20070503095025.38ceb321.pws@csr.com>

On 2007-05-03 at 09:50 +0100, Peter Stephenson wrote:
> Adding zstat is useful.  We could possibly still make modules that only
> use it internally disable stat if the module wasn't previously
> loaded---otherwise removing the disabling actually makes things worse.

Hrm.

Situation before:
  If zsh/stat loaded and stat enabled:
    happy days
  If zsh/stat loaded and stat disabled:
    temporarily reenable, disable with exception
  If zsh/stat not loaded and user likes builtin stat:
    gloriously happy days
  If zsh/stat not loaded and user dislikes builtin stat:
    manual-page documents work-around

Situation with my patch:
  If zsh/stat loaded and zstat enabled:
    happy days, don't touch stat
  If zsh/stat loaded and zstat disabled:
    hrm.  Why would zstat be disabled?  Perhaps worth covering, but
    nothing else works around "functions loaded but disabled" so this
    would be the exception
  If zsh/stat loaded and stat disabled:
    Fine.  We leave it that way.
  If zsh/stat not loaded and user likes builtin stat:
    gloriously happy days
  If zsh/stat not loaded and user dislikes builtin stat:
    manual-page documents work-around (same)

I'm not seeing what makes things worse.  History suggests that given
that you've claimed it does then I'm wrong and just not seeing it, so
I'd appreciate a clarification.  :^)

Now, one thing which might be useful in addition to the proposed
extended syntax for zmodload would be to add a new flag BINF_DISABLED
which actually names the (1<<0) case and offers something to go in a
module, so that a builtin table entry can per definition be disabled by
default.

So the stat documentation note could state something like:

 In the next major release of zsh, stat will still be a valid loadable
 command but it will not be enabled by default.  If you need to maintain
 a script's compatibility across different versions of zsh, then a good
 idea is to _now_ add an explicit "enable stat" after "zmodload
 zsh/stat".  In this and older releases of zsh, the explicit enable is
 harmless.  In the next major version, it will allow the script to work
 unmodified.

 If you only need compatibility with version 3.1.6 or newer, then you
 can move to zstat now and avoid introducing stat unnecessarily when the
 zsh is recent enough by using this code:

   zmodload -i zsh/parameter zsh/stat
   if [[ $builtins[stat] == defined && $builtins[zstat] != defined ]]
   then
     function zstat { builtin stat "$@" }
   fi

As an aside: I explicitly check against 'defined' instead of non-zero
since this is more resilient to *cough* people who put:
  zmodload -ab -i zsh/stat stat zstat
in a startup file unguarded by version numbers as it's "harmless".
*whistles innocently*

With documentation like this, and a phased approach to any change, I
think that it'd be fair to say that zsh still takes backwards
compatibility somewhat more seriously than some other shells I could
name.

I'm not sure how to word "next major release" to cleanly convey "the
stable release directly after, not counting patch-levels, the stable
release in which this was introduced (and if you're using zsh 4.3.x then
note that this is unstable, so we're giving you more time)".  The only
way would be to commit to explicit release version numbers.  zsh 4.4
adds zstat, 4.6 disables stat by default, 4.8 removes stat?  Or does
anyone have thoughts about a zsh 5?

Personally, I think that multibyte support is significant enough to
warrant 5.0 following 4.3.x.  At times after the EU added the Euro and I
switched to UTF-8, I found missing multibyte support a reason to do some
things in other shells.  (Why use a rarely found Latin 9 when you can
bite the bullet and switch to something more global?)

-Phil


  reply	other threads:[~2007-05-06  1:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-03  5:39 Phil Pennock
2007-05-03  8:50 ` Peter Stephenson
2007-05-06  1:07   ` Phil Pennock [this message]
2007-05-06 11:57     ` Peter Stephenson
2007-05-06 14:00       ` Phil Pennock
2007-05-07  0:58         ` Peter Stephenson
2007-05-03 14:48 ` Bart Schaefer
2007-05-03 15:46   ` Peter Stephenson
2007-05-07  5:31     ` Bart Schaefer
2007-05-08 14:40       ` Peter Stephenson
2007-05-09 17:19         ` Bart Schaefer
2007-05-09 17:47           ` Peter Stephenson
2012-06-29  9:40 4.3.17 unset RPS1 vs RPROMPT Phil Pennock
2012-06-29 10:02 ` Mikael Magnusson
2012-06-29 13:32   ` Phil Pennock
2012-06-29 17:35 ` Bart Schaefer
2012-06-29 18:52 ` Peter Stephenson
2012-06-30  5:05   ` Phil Pennock
2012-06-30 17:31     ` Bart Schaefer
2012-07-01 17:39     ` Peter Stephenson

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=20070506010750.GA46162@redoubt.spodhuis.org \
    --to=zsh-workers+phil.pennock@spodhuis.org \
    --cc=zsh-workers@sunsite.dk \
    /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).