Article View: gnu.emacs.bug
Article #99034Bug in sort.el
From: Kaoru MAEDA
Date: Thu, 29 Nov 1990 12:43
Date: Thu, 29 Nov 1990 12:43
49 lines
2259 bytes
2259 bytes
Setting buffer-substring-lessp reveals the following bug:
sort-build-lists fails to optimize conses.
Here is a quick hack.
*** /usr/local/emacs/lisp/sort.el Tue May 31 06:53:34 1988
--- ./sort.el Thu Nov 29 21:34:40 1990
***************
*** 128,134 ****
(equal (car key) start-rec)
(equal (cdr key) (point)))
(cons key key)
! (list key start-rec (point)))
sort-lists)))
(and (not done) nextrecfun (funcall nextrecfun)))
sort-lists))
--- 128,134 ----
(equal (car key) start-rec)
(equal (cdr key) (point)))
(cons key key)
! (cons key (cons start-rec (point))))
sort-lists)))
(and (not done) nextrecfun (funcall nextrecfun)))
sort-lists))
***************
*** 145,152 ****
(goto-char (point-max))
(insert-buffer-substring (current-buffer)
(nth 1 (car sort-lists))
! (nth 2 (car sort-lists)))
! (setq last (nth 2 (car old))
sort-lists (cdr sort-lists)
old (cdr old)))
(goto-char (point-max))
--- 145,152 ----
(goto-char (point-max))
(insert-buffer-substring (current-buffer)
(nth 1 (car sort-lists))
! (cdr (cdr (car sort-lists))))
! (setq last (cdr (cdr (car old)))
sort-lists (cdr sort-lists)
old (cdr old)))
(goto-char (point-max))
--
--------------------------------------------------
Kaoru Maeda kaoru@is.s.u-tokyo.ac.jp
Dept. of Inf. Sci., Fac. of Sci., Univ. of Tokyo
--------------------------------------------------
Technical Details
Message-ID:
<1803@malta.is.s.u-tokyo.ac.jp>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!is.s.u-tokyo.ac.jp!kaoruShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,b02bca82b6e05d37,start X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1990-11-29 04:43:28 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!is.s.u-tokyo.ac.jp!kaoru From: kaoru@is.s.u-tokyo.ac.jp (Kaoru MAEDA) Newsgroups: gnu.emacs.bug Subject: Bug in sort.el Message-ID: <1803@malta.is.s.u-tokyo.ac.jp> Date: 29 Nov 90 12:43:28 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: Dept. of Infomation Science, Univ. of Tokyo, Japan. Lines: 49 Approved: bug-gnu-emacs@prep.ai.mit.edu Posted: Thu Nov 29 13:43:28 1990