aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1996-12-27 21:12:40 +0000
committerRichard M. Stallman1996-12-27 21:12:40 +0000
commit469b44cbf1916dc9502d4356e8fce0081809f585 (patch)
tree4dec7b816a4c238aba2e0dbb1ddbf26bd3aa75c2
parente5df7c4ad7a1cb8834e8dd600087c7b73ae12cd4 (diff)
downloademacs-469b44cbf1916dc9502d4356e8fce0081809f585.tar.gz
emacs-469b44cbf1916dc9502d4356e8fce0081809f585.zip
Many doc fixes.
(sort-regexp-fields): Don't test for buffer-substring-lessp; always return a pair of bounds.
-rw-r--r--lisp/sort.el30
1 files changed, 21 insertions, 9 deletions
diff --git a/lisp/sort.el b/lisp/sort.el
index 61a35b635c6..fcd8906b1f0 100644
--- a/lisp/sort.el
+++ b/lisp/sort.el
@@ -46,6 +46,8 @@ contiguous.
46 46
47Usually the records are rearranged in order of ascending sort key. 47Usually the records are rearranged in order of ascending sort key.
48If REVERSE is non-nil, they are rearranged in order of descending sort key. 48If REVERSE is non-nil, they are rearranged in order of descending sort key.
49The variable `sort-fold-case' determines whether alphabetic case affects
50the sort order.
49 51
50The next four arguments are functions to be called to move point 52The next four arguments are functions to be called to move point
51across a sort record. They will be called many times from within sort-subr. 53across a sort record. They will be called many times from within sort-subr.
@@ -192,7 +194,9 @@ same as ENDRECFUN."
192(defun sort-lines (reverse beg end) 194(defun sort-lines (reverse beg end)
193 "Sort lines in region alphabetically; argument means descending order. 195 "Sort lines in region alphabetically; argument means descending order.
194Called from a program, there are three arguments: 196Called from a program, there are three arguments:
195REVERSE (non-nil means reverse order), BEG and END (region to sort)." 197REVERSE (non-nil means reverse order), BEG and END (region to sort).
198The variable `sort-fold-case' determines whether alphabetic case affects
199the sort order."
196 (interactive "P\nr") 200 (interactive "P\nr")
197 (save-excursion 201 (save-excursion
198 (save-restriction 202 (save-restriction
@@ -204,7 +208,9 @@ REVERSE (non-nil means reverse order), BEG and END (region to sort)."
204(defun sort-paragraphs (reverse beg end) 208(defun sort-paragraphs (reverse beg end)
205 "Sort paragraphs in region alphabetically; argument means descending order. 209 "Sort paragraphs in region alphabetically; argument means descending order.
206Called from a program, there are three arguments: 210Called from a program, there are three arguments:
207REVERSE (non-nil means reverse order), BEG and END (region to sort)." 211REVERSE (non-nil means reverse order), BEG and END (region to sort).
212The variable `sort-fold-case' determines whether alphabetic case affects
213the sort order."
208 (interactive "P\nr") 214 (interactive "P\nr")
209 (save-excursion 215 (save-excursion
210 (save-restriction 216 (save-restriction
@@ -221,7 +227,9 @@ REVERSE (non-nil means reverse order), BEG and END (region to sort)."
221(defun sort-pages (reverse beg end) 227(defun sort-pages (reverse beg end)
222 "Sort pages in region alphabetically; argument means descending order. 228 "Sort pages in region alphabetically; argument means descending order.
223Called from a program, there are three arguments: 229Called from a program, there are three arguments:
224REVERSE (non-nil means reverse order), BEG and END (region to sort)." 230REVERSE (non-nil means reverse order), BEG and END (region to sort).
231The variable `sort-fold-case' determines whether alphabetic case affects
232the sort order."
225 (interactive "P\nr") 233 (interactive "P\nr")
226 (save-excursion 234 (save-excursion
227 (save-restriction 235 (save-restriction
@@ -293,7 +301,9 @@ FIELD, BEG and END. BEG and END specify region to sort."
293Fields are separated by whitespace and numbered from 1 up. 301Fields are separated by whitespace and numbered from 1 up.
294With a negative arg, sorts by the ARGth field counted from the right. 302With a negative arg, sorts by the ARGth field counted from the right.
295Called from a program, there are three arguments: 303Called from a program, there are three arguments:
296FIELD, BEG and END. BEG and END specify region to sort." 304FIELD, BEG and END. BEG and END specify region to sort.
305The variable `sort-fold-case' determines whether alphabetic case affects
306the sort order."
297 (interactive "p\nr") 307 (interactive "p\nr")
298 (sort-fields-1 field beg end 308 (sort-fields-1 field beg end
299 (function (lambda () 309 (function (lambda ()
@@ -382,6 +392,9 @@ If a match for KEY is not found within a record then that record is ignored.
382 392
383With a negative prefix arg sorts in reverse order. 393With a negative prefix arg sorts in reverse order.
384 394
395The variable `sort-fold-case' determines whether alphabetic case affects
396the sort order.
397
385For example: to sort lines in the region by the first word on each line 398For example: to sort lines in the region by the first word on each line
386 starting with the letter \"f\", 399 starting with the letter \"f\",
387 RECORD-REGEXP would be \"^.*$\" and KEY would be \"\\\\=\\<f\\\\w*\\\\>\"" 400 RECORD-REGEXP would be \"^.*$\" and KEY would be \"\\\\=\\<f\\\\w*\\\\>\""
@@ -416,11 +429,8 @@ sRegexp specifying key within record: \nr")
416 (setq n 0)) 429 (setq n 0))
417 (t (throw 'key nil))) 430 (t (throw 'key nil)))
418 (condition-case () 431 (condition-case ()
419 (if (fboundp 'buffer-substring-lessp) 432 (cons (match-beginning n)
420 (cons (match-beginning n) 433 (match-end n))
421 (match-end n))
422 (buffer-substring (match-beginning n)
423 (match-end n)))
424 ;; if there was no such register 434 ;; if there was no such register
425 (error (throw 'key nil))))))))))) 435 (error (throw 'key nil)))))))))))
426 436
@@ -434,6 +444,8 @@ For the purpose of this command, the region includes
434the entire line that point is in and the entire line the mark is in. 444the entire line that point is in and the entire line the mark is in.
435The column positions of point and mark bound the range of columns to sort on. 445The column positions of point and mark bound the range of columns to sort on.
436A prefix argument means sort into reverse order. 446A prefix argument means sort into reverse order.
447The variable `sort-fold-case' determines whether alphabetic case affects
448the sort order.
437 449
438Note that `sort-columns' rejects text that contains tabs, 450Note that `sort-columns' rejects text that contains tabs,
439because tabs could be split across the specified columns 451because tabs could be split across the specified columns