zsh-workers
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [PATCH] Index of element after width of characters
Date: Wed, 28 Oct 2015 08:46:01 +0100	[thread overview]
Message-ID: <CAKc7PVCGFJSZbiHDpJHivFco8J3SfHDesdjJoTzAY-sR4K5++w@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7b1RQDPWw0u7NSDs9wdxC-rCQYvyXadKCd1pdNXEdFuXA@mail.gmail.com>

On 27 October 2015 at 22:20, Bart Schaefer <schaefer@brasslantern.com> wrote:
> I do find this to be a pretty highly
> specialized operation, though, and I'm not sure I like the idea of
> using up more of our limited number of remaining single-character flag
> letters for it.

I think CJK users need the patch, because with letters that vary in
width things are not what they seem, e.g. $COLUMNS is not what it
seems, any calculation "I will now skip one char to avoid wrapping of
text" is pointless, as char can have width 1, 2, and maybe more. It's
weird to me that no one complaint, wonder how Asian users code scripts
that do some pagination or other formatting of text. It might seem
that the patch is specialized but on the other hand it's fundamental.

I've counted actual flags, there are 42 of them, so there seems to be
room for 10 of them (2*26 letters of English alphabet), 8 with my two
patches. That might be not much. Plus symbols it's more, maybe this
helps. I could use "-" and "," for the patches, it's quite mnemonic –
it would look like ${(-:10:)a}, ${(,:9:)a} - the number is a limit,
"-" is before limit, "," is after limit. Thought about "," and ".",
but "." feels more like "at limit", while "," as "after limit". Minus
feels like "before limit" so "-", "," it's quite fine, even better
than "x", "y".

>> The code works, however not in the test that I commit. Wonder why it
>> works in scripts and at prompt but not in the test?
>
> Did you make sure that the LANG and or LC_* etc. environment variables
> are set correctly in the test script?  Also this test should probably
> be appended to D07multibyte rather than have its own new file.  (That
> would ensure that LANG etc. are properly set, too.)  I don't find a
> test of the (m) flag anywhere in Test/*.ztst either, for that matter
> -- hard to decide if this belongs in D04 or D07 but I tend to think
> the latter.

Thanks for feedback I'll dig into this today.

Best regards,
Sebastian Gniazdowski


  reply	other threads:[~2015-10-28  7:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-27 17:18 Sebastian Gniazdowski
2015-10-27 19:41 ` Mikael Magnusson
2015-10-27 19:55 ` Sebastian Gniazdowski
2015-10-27 21:20 ` Bart Schaefer
2015-10-28  7:46   ` Sebastian Gniazdowski [this message]
2015-10-28  7:54     ` Sebastian Gniazdowski
2015-10-28 11:38       ` Sebastian Gniazdowski
2015-10-28 13:31         ` Mikael Magnusson
2015-10-28 15:46           ` Sebastian Gniazdowski
2015-10-28 15:59             ` Peter Stephenson
2015-10-28 16:37               ` Sebastian Gniazdowski
2015-10-28 23:07               ` Bart Schaefer
2015-10-29  9:42                 ` 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=CAKc7PVCGFJSZbiHDpJHivFco8J3SfHDesdjJoTzAY-sR4K5++w@mail.gmail.com \
    --to=sgniazdowski@gmail.com \
    --cc=schaefer@brasslantern.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).