diff options
| author | Richard M. Stallman | 1996-12-27 21:12:40 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-12-27 21:12:40 +0000 |
| commit | 469b44cbf1916dc9502d4356e8fce0081809f585 (patch) | |
| tree | 4dec7b816a4c238aba2e0dbb1ddbf26bd3aa75c2 | |
| parent | e5df7c4ad7a1cb8834e8dd600087c7b73ae12cd4 (diff) | |
| download | emacs-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.el | 30 |
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 | ||
| 47 | Usually the records are rearranged in order of ascending sort key. | 47 | Usually the records are rearranged in order of ascending sort key. |
| 48 | If REVERSE is non-nil, they are rearranged in order of descending sort key. | 48 | If REVERSE is non-nil, they are rearranged in order of descending sort key. |
| 49 | The variable `sort-fold-case' determines whether alphabetic case affects | ||
| 50 | the sort order. | ||
| 49 | 51 | ||
| 50 | The next four arguments are functions to be called to move point | 52 | The next four arguments are functions to be called to move point |
| 51 | across a sort record. They will be called many times from within sort-subr. | 53 | across 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. |
| 194 | Called from a program, there are three arguments: | 196 | Called from a program, there are three arguments: |
| 195 | REVERSE (non-nil means reverse order), BEG and END (region to sort)." | 197 | REVERSE (non-nil means reverse order), BEG and END (region to sort). |
| 198 | The variable `sort-fold-case' determines whether alphabetic case affects | ||
| 199 | the 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. |
| 206 | Called from a program, there are three arguments: | 210 | Called from a program, there are three arguments: |
| 207 | REVERSE (non-nil means reverse order), BEG and END (region to sort)." | 211 | REVERSE (non-nil means reverse order), BEG and END (region to sort). |
| 212 | The variable `sort-fold-case' determines whether alphabetic case affects | ||
| 213 | the 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. |
| 223 | Called from a program, there are three arguments: | 229 | Called from a program, there are three arguments: |
| 224 | REVERSE (non-nil means reverse order), BEG and END (region to sort)." | 230 | REVERSE (non-nil means reverse order), BEG and END (region to sort). |
| 231 | The variable `sort-fold-case' determines whether alphabetic case affects | ||
| 232 | the 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." | |||
| 293 | Fields are separated by whitespace and numbered from 1 up. | 301 | Fields are separated by whitespace and numbered from 1 up. |
| 294 | With a negative arg, sorts by the ARGth field counted from the right. | 302 | With a negative arg, sorts by the ARGth field counted from the right. |
| 295 | Called from a program, there are three arguments: | 303 | Called from a program, there are three arguments: |
| 296 | FIELD, BEG and END. BEG and END specify region to sort." | 304 | FIELD, BEG and END. BEG and END specify region to sort. |
| 305 | The variable `sort-fold-case' determines whether alphabetic case affects | ||
| 306 | the 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 | ||
| 383 | With a negative prefix arg sorts in reverse order. | 393 | With a negative prefix arg sorts in reverse order. |
| 384 | 394 | ||
| 395 | The variable `sort-fold-case' determines whether alphabetic case affects | ||
| 396 | the sort order. | ||
| 397 | |||
| 385 | For example: to sort lines in the region by the first word on each line | 398 | For 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 | |||
| 434 | the entire line that point is in and the entire line the mark is in. | 444 | the entire line that point is in and the entire line the mark is in. |
| 435 | The column positions of point and mark bound the range of columns to sort on. | 445 | The column positions of point and mark bound the range of columns to sort on. |
| 436 | A prefix argument means sort into reverse order. | 446 | A prefix argument means sort into reverse order. |
| 447 | The variable `sort-fold-case' determines whether alphabetic case affects | ||
| 448 | the sort order. | ||
| 437 | 449 | ||
| 438 | Note that `sort-columns' rejects text that contains tabs, | 450 | Note that `sort-columns' rejects text that contains tabs, |
| 439 | because tabs could be split across the specified columns | 451 | because tabs could be split across the specified columns |