zsh-workers
 help / color / mirror / code / Atom feed
* Possible bug?
@ 2000-01-01 11:05 Mike Perez
  2000-01-02  0:51 ` pollux
  2000-01-02  0:55 ` Zefram
  0 siblings, 2 replies; 7+ messages in thread
From: Mike Perez @ 2000-01-01 11:05 UTC (permalink / raw)
  To: zsh-workers

Well I am not sure if this is a bug or not, but I was able to reproduce
it on a few machines that all were in Y2K.

It has to do with the RPROMPT variable and strftime, I believe.

I have my RPROMPT set like this:

PROMPT='%n@%m: %~%(#.#.>) '
RPROMPT='[%D{%b %d, %G} / %t]'

And on the prompt, it displays this:

mike@mindcrime: ~>                            [Jan 01, 1999 / 3:04AM]

But date says this:

Sat Jan  1 03:04:42 PST 2000

- Mike

--
Mike Perez <mike@ef.net>
PGP fingerprint = 66 BF C5 DE 78 C6 01 63  76 D9 BF E7 70 24 55 50
"The difference between insanity and genius is only measured by success."


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Possible bug?
  2000-01-01 11:05 Possible bug? Mike Perez
@ 2000-01-02  0:51 ` pollux
  2000-01-02  0:55 ` Zefram
  1 sibling, 0 replies; 7+ messages in thread
From: pollux @ 2000-01-02  0:51 UTC (permalink / raw)
  To: Mike Perez; +Cc: zsh-workers

>>> "Mike" == Mike Perez <mike@ef.net> writes:

[...]

 Mike> RPROMPT='[%D{%b %d, %G} / %t]'
 Mike> And on the prompt, it displays this:
 Mike> mike@mindcrime: ~>                            [Jan 01, 1999 / 3:04AM]
 Mike> But date says this:
 Mike> Sat Jan  1 03:04:42 PST 2000

Since the ISO week is 52, %G is still saying 1999, wich is right.

       %G     The ISO 8601 year with century as a decimal number.
              The 4-digit year corresponding to the ISO week num­
              ber  (see  %V).  This has the same format and value
              as %y, except that if the ISO week  number  belongs
              to  the  previous  or  next year, that year is used
              instead.

You may want to use %Y instead.

 Mike> - Mike

-- 
Alexandre Duret-Lutz


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Possible bug?
  2000-01-01 11:05 Possible bug? Mike Perez
  2000-01-02  0:51 ` pollux
@ 2000-01-02  0:55 ` Zefram
  2000-01-02  1:06   ` Geoff Wing
  1 sibling, 1 reply; 7+ messages in thread
From: Zefram @ 2000-01-02  0:55 UTC (permalink / raw)
  To: Mike Perez; +Cc: zsh-workers

Mike Perez wrote:
>Well I am not sure if this is a bug or not, but I was able to reproduce
>it on a few machines that all were in Y2K.

I can reproduce it too:

% date
Sun Jan  2 00:48:08 GMT 2000
% print -P '%D{%G}'
1999
% date +%G
1999
% date +%Y
2000
% print -P '%D{%Y}'
2000

What is %G, anyway?  It's not one of the zsh extensions; it's just being
handled by the native strftime(3).  My strftime(3) doesn't document %G,
and I don't have its source handy.  I expect that %G is the year part
of the week specification for the current week; today is 1999-W52-7,
and 2000-W01 starts tomorrow (2000-01-03 == 2000-W01-1).  Ah, look:

% date -d tomorrow
Mon Jan  3 00:52:44 GMT 2000
% date -d tomorrow +%G
2000

-zefram


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Possible bug?
  2000-01-02  0:55 ` Zefram
@ 2000-01-02  1:06   ` Geoff Wing
  0 siblings, 0 replies; 7+ messages in thread
From: Geoff Wing @ 2000-01-02  1:06 UTC (permalink / raw)
  To: zsh-workers

Zefram <zefram@fysh.org> typed:
:Mike Perez wrote:
:>Well I am not sure if this is a bug or not, but I was able to reproduce
:>it on a few machines that all were in Y2K.
:I can reproduce it too:
:% date
:Sun Jan  2 00:48:08 GMT 2000
:% print -P '%D{%G}'
:1999
:% date +%G
:1999


>From my strftime(3):

" %G	is replaced by the ISO 8601 year with century as a decimal number.

  %V	is replaced by the week number of the year (Monday as the first day
	of the week) as a decimal number [01,53].  According to ISO 8601
	the week containing January 1 is week 1 if it has four or more days
	in the new year, otherwise it is week 53 of the previous year, and
	the next week is week 1.  The year is given by the `%G' conversion
	specification."

Regards,
-- 
Geoff Wing : <gcw@pobox.com>     Work URL: http://www.primenet.com.au/
Rxvt Stuff : <gcw@rxvt.org>      Ego URL : http://pobox.com/~gcw/
Zsh Stuff  : <gcw@zsh.org>       Phone   : (Australia) 0413 431 874


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: possible bug?
  1999-09-17  0:29 ` Bart Schaefer
@ 1999-09-17  0:36   ` Glenn Trigg
  0 siblings, 0 replies; 7+ messages in thread
From: Glenn Trigg @ 1999-09-17  0:36 UTC (permalink / raw)
  To: schaefer; +Cc: zsh-workers

"Bart Schaefer" <schaefer@candle.brasslantern.com> said :

> On Sep 17,  8:59am, Glenn Trigg wrote:
> } Subject: possible bug?
> }
> } When I use backward-delete-word it appears to completely ignore the
> } $WORDCHARS variable.
> 
> Wordchars are the non-alphanumeric characters that *ARE* considered to be
> part of a word.  If you want it to stop at slashes, you have to reset the
> value of WORDCHARS to *not* include a slash character.

Whoops, I got that round the wrong way, didn't I? Yep, taking the / out of
that variable makes me very happy! :-)

Thanks for your quick reply.

Glenn


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: possible bug?
  1999-09-16 22:59 possible bug? Glenn Trigg
@ 1999-09-17  0:29 ` Bart Schaefer
  1999-09-17  0:36   ` Glenn Trigg
  0 siblings, 1 reply; 7+ messages in thread
From: Bart Schaefer @ 1999-09-17  0:29 UTC (permalink / raw)
  To: Glenn Trigg, zsh-workers

On Sep 17,  8:59am, Glenn Trigg wrote:
} Subject: possible bug?
}
} When I use backward-delete-word it appears to completely ignore the
} $WORDCHARS variable.

Wordchars are the non-alphanumeric characters that *ARE* considered to be
part of a word.  If you want it to stop at slashes, you have to reset the
value of WORDCHARS to *not* include a slash character.

Either that, or use vi-backward-kill-word instead of backward-kill-word.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


^ permalink raw reply	[flat|nested] 7+ messages in thread

* possible bug?
@ 1999-09-16 22:59 Glenn Trigg
  1999-09-17  0:29 ` Bart Schaefer
  0 siblings, 1 reply; 7+ messages in thread
From: Glenn Trigg @ 1999-09-16 22:59 UTC (permalink / raw)
  To: zsh-workers

Hi,

I have discovered an annoying quirk in zsh-3.0.6 (at least it's annoying for
me - an ex-tcsh user).

When I use backward-delete-word it appears to completely ignore the
$WORDCHARS variable. Vis:

ozpc92 >echo $WORDCHARS 
*?_-.[]~=/&;!#$%^(){}<>
ozpc92 >cd /usr/local/etc

typing \M-^H here results in

ozpc92 >cd 

instead of the expected (desired):


ozpc92 >cd /usr/local

Am I missing something?

Please CC any responses to my email address as I'm not subscribed to this
list.

Regards,

Glenn Trigg


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2000-01-02  1:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-01-01 11:05 Possible bug? Mike Perez
2000-01-02  0:51 ` pollux
2000-01-02  0:55 ` Zefram
2000-01-02  1:06   ` Geoff Wing
  -- strict thread matches above, loose matches on Subject: below --
1999-09-16 22:59 possible bug? Glenn Trigg
1999-09-17  0:29 ` Bart Schaefer
1999-09-17  0:36   ` Glenn Trigg

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).