# HG changeset patch # User Richard M. Stallman # Date 729064454 0 # Node ID d48f094be56eb5f4c40d87a8bb8a84e117ce1107 # Parent 2d5caf3fd862af54a8bf0a784b6c63adc4886e55 (sort-build-lists): Record the key as pair of positions; don't copy string from buffer. (sort-subr): Use compare-buffer-substrings. diff -r 2d5caf3fd862 -r d48f094be56e lisp/sort.el --- a/lisp/sort.el Sun Feb 07 04:56:23 1993 +0000 +++ b/lisp/sort.el Sun Feb 07 05:54:14 1993 +0000 @@ -76,7 +76,11 @@ ;; This handles both ints and floats. '<) ((consp (car (car sort-lists))) - 'buffer-substring-lessp) + (function + (lambda (a b) + (> 0 (compare-buffer-substrings + nil (car a) (nth 1 a) + nil (car b) (nth 1 b)))))) (t 'string<))) (sort sort-lists @@ -87,7 +91,9 @@ ((consp (car (car sort-lists))) (function (lambda (a b) - (buffer-substring-lessp (car a) (car b))))) + (> 0 (compare-buffer-substrings + nil (car (car a)) (nth 1 (car a)) + nil (car (car b)) (nth 1 (car b))))))) (t (function (lambda (a b) @@ -123,9 +129,7 @@ (let ((start (point))) (funcall (or endkeyfun (prog1 endrecfun (setq done t)))) - (if (fboundp 'buffer-substring-lessp) - (cons start (point)) - (buffer-substring start (point))))))) + (cons start (point)))))) ;; Move to end of this record (start of next one, or end of buffer). (cond ((prog1 done (setq done nil))) (endrecfun (funcall endrecfun))