aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1993-02-07 05:54:14 +0000
committerRichard M. Stallman <[email protected]>1993-02-07 05:54:14 +0000
commit4f1b6c54492ad05632b307285db341955abe973f (patch)
tree935abd73b81990a8a171fb2fc7fd297a41cfd0b8
parent70ca75ae695a53325be020e7247b8b58cc48476e (diff)
(sort-build-lists): Record the key as pair of positions;
don't copy string from buffer. (sort-subr): Use compare-buffer-substrings.
-rw-r--r--lisp/sort.el14
1 files changed, 9 insertions, 5 deletions
diff --git a/lisp/sort.el b/lisp/sort.el
index 89957618b6..55376fcddf 100644
--- a/lisp/sort.el
+++ b/lisp/sort.el
@@ -76,7 +76,11 @@ same as ENDRECFUN."
;; 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 @@ same as ENDRECFUN."
((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 @@ same as ENDRECFUN."
(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))