🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #98983

bug in sort-numeric-fields

#98983
From: Pete Peterson
Date: Fri, 14 Dec 1990 23:43
32 lines
2014 bytes
In GNU Emacs 18.55, sort-numeric-fields does not work properly if some of
the fields contain negative numbers.  The offending line in sort.el says:
'(skip-chars-forward "[0-9]")'.  It appears to work properly if this is
changed to: '(skip-chars-forward "0-9-")'.  I'm not sure why the brackets
were included in the original string. 

Note that '(skip-chars-forward "[\-0-9]")' didn't work (even ignoring that
brackets shouldn't be part of a numeric field).  I was unable to make "\-",
"\^", or "\\" in CHARS work as the docstring for skip-chars-forward claimed
it would work.  I would have expected "[\-0-9]" to skip digits, brackets,
and "-".  I would have expected "0-9\-\^\\" skip digits, "-", "^" and
backslashes, but it didn't work that way.  Explanations would be welcomed!

Were the brackets included in the original string because somebody was
thinking regexp character classes?  The docstring for skip-chars-forward
explicitly claims that brackets are not special.

*** /usr/local/gnuemacs/lisp/sort.el	Fri Dec 14 17:28:59 1990
--- /usr/local/gnuemacs/lisp/sort.el.bak	Mon May 30 17:53:34 1988
***************
*** 217,221 ****
  			        (point)
  				(save-excursion
! 				  (skip-chars-forward "0-9-")
  				  (point))))))
  		 nil))
--- 217,221 ----
  			        (point)
  				(save-excursion
! 				  (skip-chars-forward "[0-9]")
  				  (point))))))
  		 nil))
Technical Details
Message-ID: <9012202327.AA23502@wheat-chex>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!genrad.com!rep

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,c7a9cdab0cd0193f,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1990-12-14 15:43:06 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!genrad.com!rep
From: rep@genrad.com (Pete Peterson)
Newsgroups: gnu.emacs.bug
Subject: bug in sort-numeric-fields
Keywords: bug, sort-numeric-fields, sort.el
Message-ID: <9012202327.AA23502@wheat-chex>
Date: 14 Dec 90 23:43:06 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 32
Approved: bug-gnu-emacs@prep.ai.mit.edu