%PDF- %PDF-
Direktori : /usr/local/share/emacs/27.2/lisp/ |
Current File : //usr/local/share/emacs/27.2/lisp/sort.elc |
;ELC ;;; Compiled ;;; in Emacs version 27.2 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301\302\303\304\305%\210\306\307\310\311\312DD\313\304\301\314\315&\207" [custom-declare-group sort nil "Commands to sort text in an Emacs buffer." :group data custom-declare-variable sort-fold-case funcall function #[0 "\300\207" [nil] 1] "Non-nil if the buffer sort functions should ignore case." :type boolean] 8) #@2111 General text sorting routine to divide buffer into records and sort them. 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. 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. The variable `sort-fold-case' determines whether alphabetic case affects the sort order. The next four arguments are functions to be called to move point across a sort record. They will be called many times from within sort-subr. NEXTRECFUN is called with point at the end of the previous record. It moves point to the start of the next record. It should move point to the end of the buffer if there are no more records. The first record is assumed to start at the position of point when sort-subr is called. ENDRECFUN is called with point within the record. It should move point to the end of the record. STARTKEYFUN moves from the start of the record to the start of the key. It may return either a non-nil value to be used as the key, or else the key is the substring between the values of point after STARTKEYFUN and ENDKEYFUN are called. If STARTKEYFUN is nil, the key starts at the beginning of the record. ENDKEYFUN moves from the start of the sort key to the end of the sort key. ENDKEYFUN may be nil if STARTKEYFUN returns a value or if it would be the same as ENDRECFUN. PREDICATE, if non-nil, is the predicate function for comparing keys; it is called with two arguments, the keys to compare, and should return non-nil if the first key should sort before the second key. If PREDICATE is nil, comparison is done with `<' if the keys are numbers, with `compare-buffer-substrings' if the keys are cons cells (the car and cdr of each cons cell are taken as start and end positions), and with `string<' otherwise. (fn REVERSE NEXTRECFUN ENDRECFUN &optional STARTKEYFUN ENDKEYFUN PREDICATE) (defalias 'sort-subr #[1539 "deZ\302V\212\211\203 \303\304!\210\305$\306!\203r \204* \237\262\2032 \303\307!\210\310\203B \311\312\313BE\202Y @@\247\203M \314\202Y @@:\203X \315\202Y \316\"\262\203e \237\262\203m \303\317!\210\320\"\210)\266\211\203} \303\321!\210)\210\322\207" [sort-fold-case case-fold-search 50000 message "Finding sort keys..." sort-build-lists reverse "Sorting records..." sort lambda (a b) ((car a) (car b)) car-less-than-car #[514 "\300\301\302@@@A\302@@@A&V\207" [0 compare-buffer-substrings nil] 10 "\n\n(fn A B)"] #[514 "@@\231\207" [] 4 "\n\n(fn A B)"] "Reordering buffer..." sort-reorder-buffer "Reordering buffer... Done" nil] 15 (#$ . 745)]) #@51 (fn NEXTRECFUN ENDRECFUN STARTKEYFUN ENDKEYFUN) (defalias 'sort-build-lists #[1028 "\300\211\211\211m\204\204 `\262\300\262\3012- \203 \206, `\206% \302\262 \210\211`B\2620\262\300\262\204N \203B \210\202N \203N \210\302\262\211\203t \211:\203k \211@\232\203k \211A`\232\203k \211B\202p \211`BBB\262\204 \203 \210\202 \207" [nil key t] 11 (#$ . 3576)]) #@23 (fn SORT-LISTS OLD) (defalias 'sort-reorder-buffer #[514 "eedp\302\303\304!r\211q\210\305\306\307\310\311!\312\"\313$\216\314!\210p\262\203X db\210\315\n@A@#\210db\210\315\n@A@@AA#\210@AA\262A\262 A\262\202 db\210\315#\210q\210\316S|\210eb\210\315!\210\211T|+\262\207" [enable-multibyte-characters inhibit-quit nil generate-new-buffer " *temp*" make-byte-code 0 "\301\300!\205 \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 set-buffer-multibyte insert-buffer-substring t] 15 (#$ . 3977)]) #@387 Sort lines in region alphabetically; REVERSE non-nil means descending order. Interactively, REVERSE is the prefix argument, and BEG and END are the region. Called from a program, there are three arguments: REVERSE (non-nil means reverse order), BEG and END (region to sort). The variable `sort-fold-case' determines whether alphabetic case affects the sort order. (fn REVERSE BEG END) (defalias 'sort-lines #[771 "\212\214}\210eb\210\301\302\303\304#+\207" [inhibit-field-text-motion t sort-subr forward-line end-of-line] 7 (#$ . 4522) "P\nr"]) #@306 Sort paragraphs in region alphabetically; argument means descending order. Called from a program, there are three arguments: REVERSE (non-nil means reverse order), BEG and END (region to sort). The variable `sort-fold-case' determines whether alphabetic case affects the sort order. (fn REVERSE BEG END) (defalias 'sort-paragraphs #[771 "\212\214}\210eb\210\300\301\302#*\207" [sort-subr #[0 "m?\205 \301!\205 \302y\210\202 \207" [paragraph-separate looking-at 1] 2] #[0 "\300 \210m\205 n?\205 \301c\207" [forward-paragraph "\n"] 1]] 7 (#$ . 5079) "P\nr"]) #@301 Sort pages in region alphabetically; argument means descending order. Called from a program, there are three arguments: REVERSE (non-nil means reverse order), BEG and END (region to sort). The variable `sort-fold-case' determines whether alphabetic case affects the sort order. (fn REVERSE BEG END) (defalias 'sort-pages #[771 "\212\214}\210eb\210\300\301\302#*\207" [sort-subr #[0 "\300\301w\207" ["\n" nil] 2] forward-page] 7 (#$ . 5653) "P\nr"]) (defvar sort-fields-syntax-table nil) (byte-code "\2046 \301 \302\211\303W\203 \304\305#\210\211T\262\202 \304\306\307#\210\304\310\307#\210\304\311\307#\210\304\312\313#\210\266\314\315\316\317\320DD\321\322\323\324\325&\207" [sort-fields-syntax-table make-syntax-table 0 256 modify-syntax-entry "w" 32 " " 9 10 46 "_" custom-declare-variable sort-numeric-base funcall function #[0 "\300\207" [10] 1] "The default base used by `sort-numeric-fields'." :group sort :type integer] 8) #@525 Sort lines in region numerically by the ARGth field of each line. Fields are separated by whitespace and numbered from 1 up. Specified field must contain a number in each line of the region, which may begin with "0x" or "0" for hexadecimal and octal values. Otherwise, the number is interpreted according to sort-numeric-base. With a negative arg, sorts by the ARGth field counted from the right. Called from a program, there are three arguments: FIELD, BEG and END. BEG and END specify region to sort. (fn FIELD BEG END) (defalias 'sort-numeric-fields #[771 "\301\302\303\304\305\306\307!\310\"\311$\312%)\207" [inhibit-field-text-motion t sort-fields-1 make-byte-code 0 "\303\300!\210\304\305\306!\205' \307\224\203 \307\225b\210\310\202' \311\224\203&