From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4615 invoked by alias); 28 Oct 2015 07:46:26 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 36995 Received: (qmail 20193 invoked from network); 28 Oct 2015 07:46:24 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 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:content-type:content-transfer-encoding; bh=ckzcJmQrYyiStpWC2Tdwow1qXViDAAC5+Aytg762FYo=; b=IqyJHNfeaBuZWKhS/7xjOqKqHMT+UQSEvAuP7qgLlbqn27aojEHOYl3aUuRWvqEDN4 8zivv5DkviNAm5FOQI+b6SE4fsDa6M0+fKxdGe3SX2ECfzUT8p35nEb1I8F5C+wdBIqE WoYCTCV0cx6CLrMyBVpbMOsgBEfjcW1spnyPJjDZBujFwLb10OJa0gJhg6y440ABuEb3 B1uc8JhSodfUHun+NIcqWYgBrcec58i/U2MTF1JcVnjbzeqtnqBdQqNWKiJjnPXPYI7H VXV6z3eJykVpuZagwgEVPRLVdkB8BXLING/T+WvBLvIMMrZLdMGX+JvTYH5GpvuYK3lk G0/Q== X-Received: by 10.112.168.138 with SMTP id zw10mr22923828lbb.12.1446018381152; Wed, 28 Oct 2015 00:46:21 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Sebastian Gniazdowski Date: Wed, 28 Oct 2015 08:46:01 +0100 Message-ID: Subject: Re: [PATCH] Index of element after width of characters To: Bart Schaefer Cc: Zsh hackers list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 27 October 2015 at 22:20, Bart Schaefer wrot= e: > 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 =E2=80= =93 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