From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 1314 invoked from network); 2 Jul 2020 12:01:02 -0000 Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTPUTF8; 2 Jul 2020 12:01:02 -0000 Received: (qmail 23928 invoked by alias); 2 Jul 2020 12:00:52 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: Sender: zsh-users@zsh.org X-Seq: 24973 Received: (qmail 26332 invoked by uid 1010); 2 Jul 2020 12:00:52 -0000 X-Qmail-Scanner-Diagnostics: from smtpq2.tb.ukmail.iss.as9143.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.3/25857. spamassassin: 3.4.4. Clear:RC:0(212.54.57.97):SA:0(-2.7/5.0):. Processed in 3.815695 secs); 02 Jul 2020 12:00:52 -0000 X-Envelope-From: p.w.stephenson@ntlworld.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _mailcloud.virginmedia.com designates 212.54.57.97 as permitted sender) X-Env-Mailfrom: p.w.stephenson@ntlworld.com X-Env-Rcptto: zsh-users@zsh.org X-SourceIP: 172.25.160.154 X-CNFS-Analysis: v=2.3 cv=M6LW1x4s c=1 sm=1 tr=0 a=0gQdd85zlVecdCXELxTKIw==:117 a=KEnZaF_ea6UA:10 a=IkcTkHD0fZMA:10 a=DoY9bV0jb9AA:10 a=MJ-RG22gi5_RzU4ddG8A:9 a=QEXdDO2ut3YA:10 X-Authenticated-Sender: p.w.stephenson@ntlworld.com Date: Thu, 2 Jul 2020 13:00:10 +0100 (BST) From: Peter Stephenson To: zsh-users@zsh.org Message-ID: <911983023.281006.1593691210724@mail2.virginmedia.com> In-Reply-To: <20200702113640.3343ff0c@tarpaulin.shahaf.local2> References: <3580763ca2a81e24786f92071be073833b820b83.camel@ntlworld.com> <20200702113640.3343ff0c@tarpaulin.shahaf.local2> Subject: Re: How to impose a numeric sort on negative numbers? MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.8.4-Rev70 X-Originating-IP: 165.225.81.56 X-Originating-Client: open-xchange-appsuite X-CMAE-Envelope: MS4wfFiauKY/Rq4vt5p9TkbRWEyMn/qUhvDNrNv/5IlUdEK1ff0l7OOeSojcy/UOUZbTxsCkWJ1Il9SrNT5W+j6YIMaPT4IMpBzLP0QAU9sGJnWGxDMcdJXw 6ekrunm547MskkyY59idjfSRTWDKWiHVKgcf9ZzVaJeBJsVYWbjb49YZLPVlB59TPfMP59Ut6LUMy/TkP054hD9wUwsMtq1YVGQ= > On 02 July 2020 at 12:36 Daniel Shahaf wrote: > Peter Stephenson wrote on Wed, 01 Jul 2020 20:42 +0100: > > +++ b/Doc/Zsh/expn.yo > > @@ -1097,6 +1097,11 @@ are sorted before those with fewer or none. Hen= ce the array `tt(foo1 foo02 > > foo2 foo3 foo20 foo23)' is sorted into the order shown. > > May be combined with `tt(i)' or `tt(O)'. > > ) > > +item(tt(DASH()))( > > +As tt(n), but a leading minus sign indicates a negative decimal > > +integer. A solo `tt(DASH())' not followed by an integer does > > +not trigger numeric sorting. > > +) >=20 > In the texinfo build DASH() will emit _two_ hyphens, which would be > incorrect in this context. I think both instances of DASH() should be > changed to use a literal minus sign. >=20 > The macro is defined as =C2=ABDEFINEMACRO(DASH)(0)(ifztexi(--)ifnztexi(-)= )=C2=BB. Heh. This stuff's complicated. The two dashes correspond to an en-dash in TeX. If you look where DASH() is actually used in the text it's in places where it gets combined with another dash --- which would make an em-dash in TeX. Info is aware of this, so turns -- back into a single minus. So compare the output from a use of DASH()- (not a typo, there's an extra hyphen)... Info file: of the backreferences fail to match -- which happens if they are in - a visible two dashes, the usual convention to show it's a dash, not a hyp= hen .texi file: backreferences fail to match --- which happens if they are in an altern= ate - three dashes, converted by TeX into an em-dash in print. So it's sort of doing the right thing at least from the point of what's vis= ible in text. However(!), what we really want here is indeed an ASCII hyphen, because thi= s is what your're typing. (It's not even actually a minus sign because this is an input code, not a mathematical expression. For what it's worth, whic= h is very little, this would be different in TeX, $-$, but no other format I know of really cares.) I have a vague memory we got into problems with such things in YODL once, which is why I used the macro. But looking at the current doc source doesn= 't suggest any trace of it, so I'll abandon that. There have been many improv= ements in YODL since then. pws