summaryrefslogtreecommitdiff
path: root/lisp/sort.el
diff options
context:
space:
mode:
authorJim Blandy <jimb@redhat.com>1992-08-19 03:54:46 +0000
committerJim Blandy <jimb@redhat.com>1992-08-19 03:54:46 +0000
commitfea425b9ddc3534a501a86de782ecabf406ebb47 (patch)
tree6bf3f918ced5456561952138dd895a76fafaef94 /lisp/sort.el
parent529ba5d03e88b434f941d038577653a24d43f539 (diff)
downloademacs-fea425b9ddc3534a501a86de782ecabf406ebb47.tar.gz
entered into RCS
Diffstat (limited to 'lisp/sort.el')
-rw-r--r--lisp/sort.el33
1 files changed, 17 insertions, 16 deletions
diff --git a/lisp/sort.el b/lisp/sort.el
index dd238d326e5..4405b6e77c0 100644
--- a/lisp/sort.el
+++ b/lisp/sort.el
@@ -29,9 +29,10 @@
Arguments are REVERSE NEXTRECFUN ENDRECFUN &optional STARTKEYFUN ENDKEYFUN.
We divide the accessible portion of the buffer into disjoint pieces
-called sort records. A portion of each sort record (perhaps all of it)
-is designated as the sort key. The records are rearranged in the buffer
-in order by their sort keys. The records may or may not be contiguous.
+called sort records. A portion of each sort record (perhaps all of
+it) is designated as the sort key. The records are rearranged in the
+buffer in order by their sort keys. The records may or may not be
+contiguous.
Usually the records are rearranged in order of ascending sort key.
If REVERSE is non-nil, they are rearranged in order of descending sort key.
@@ -78,19 +79,19 @@ same as ENDRECFUN."
'buffer-substring-lessp)
(t
'string<)))
- (sort sort-lists
- (cond ((numberp (car (car sort-lists)))
- (function
- (lambda (a b)
- (< (car a) (car b)))))
- ((consp (car (car sort-lists)))
- (function
- (lambda (a b)
- (buffer-substring-lessp (car a) (car b)))))
- (t
- (function
- (lambda (a b)
- (string< (car a) (car b)))))))))
+ (sort sort-lists
+ (cond ((numberp (car (car sort-lists)))
+ (function
+ (lambda (a b)
+ (< (car a) (car b)))))
+ ((consp (car (car sort-lists)))
+ (function
+ (lambda (a b)
+ (buffer-substring-lessp (car a) (car b)))))
+ (t
+ (function
+ (lambda (a b)
+ (string< (car a) (car b)))))))))
(if reverse (setq sort-lists (nreverse sort-lists)))
(if messages (message "Reordering buffer..."))
(sort-reorder-buffer sort-lists old)))