%PDF- %PDF-
Direktori : /usr/local/share/emacs/27.2/lisp/eshell/ |
Current File : //usr/local/share/emacs/27.2/lisp/eshell/em-pred.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!\210\302\303\304\305\306\307\310\311&\210\312\313\314\315\316DD\317\320\321\322\323\310\303& \210\312\324\314\315\325DD\326\322\327\310\303&\210\330\324\331\332#\210\312\333\314\315\334DD\335\322\336\310\303&\210\330\333\331\332#\207" [require esh-mode custom-declare-group eshell-pred nil "This module allows for predicates to be applied to globbing\npatterns (similar to zsh), in addition to string modifiers which can\nbe applied either to globbing results, variable references, or just\nordinary strings." :tag "Value modifiers and predicates" :group eshell-module custom-declare-variable eshell-pred-load-hook funcall function #[0 "\300\207" [nil] 1] "A list of functions to run when `eshell-pred' is loaded." :version "24.1" :type hook eshell-predicate-alist #[0 "\300\207" [((47 eshell-pred-file-type 100) (46 eshell-pred-file-type 45) (115 eshell-pred-file-type 115) (112 eshell-pred-file-type 112) (64 eshell-pred-file-type 108) (37 eshell-pred-file-type 37) (114 eshell-pred-file-mode 400) (119 eshell-pred-file-mode 200) (120 eshell-pred-file-mode 100) (65 eshell-pred-file-mode 40) (73 eshell-pred-file-mode 20) (69 eshell-pred-file-mode 10) (82 eshell-pred-file-mode 4) (87 eshell-pred-file-mode 2) (88 eshell-pred-file-mode 1) (115 eshell-pred-file-mode 4000) (83 eshell-pred-file-mode 2000) (116 eshell-pred-file-mode 1000) (85 function (lambda (file) (if (file-exists-p file) (= (file-attribute-user-id (file-attributes file)) (user-uid))))) (42 function (lambda (file) (and (file-regular-p file) (not (file-symlink-p file)) (file-executable-p file)))) (108 eshell-pred-file-links) (117 eshell-pred-user-or-group 117 "user" 2 'eshell-user-id) (103 eshell-pred-user-or-group 103 "group" 3 'eshell-group-id) (97 eshell-pred-file-time 97 "access" 4) (109 eshell-pred-file-time 109 "modification" 5) (99 eshell-pred-file-time 99 "change" 6) (76 eshell-pred-file-size))] 1] "A list of predicates than can be applied to a globbing pattern.\nThe format of each entry is\n\n (CHAR . PREDICATE-FUNC-SEXP)" (repeat (cons character sexp)) put risky-local-variable t eshell-modifier-alist #[0 "\300\207" [((69 function (lambda (lst) (mapcar #'(lambda (str) (eshell-stringify (car (eshell-parse-argument str)))) lst))) (76 function (lambda (lst) (mapcar 'downcase lst))) (85 function (lambda (lst) (mapcar 'upcase lst))) (67 function (lambda (lst) (mapcar 'capitalize lst))) (104 function (lambda (lst) (mapcar 'file-name-directory lst))) (105 eshell-include-members) (120 eshell-include-members t) (114 function (lambda (lst) (mapcar 'file-name-sans-extension lst))) (101 function (lambda (lst) (mapcar 'file-name-extension lst))) (116 function (lambda (lst) (mapcar 'file-name-nondirectory lst))) (113 function (lambda (lst) (mapcar 'eshell-escape-arg lst))) (117 function (lambda (lst) (eshell-uniquify-list lst))) (111 function (lambda (lst) (sort lst 'string-lessp))) (79 function (lambda (lst) (nreverse (sort lst 'string-lessp)))) (106 eshell-join-members) (83 eshell-split-members) (82 quote reverse) (103 progn (forward-char) (if (eq (char-before) 115) (eshell-pred-substitute t) (error "`g' modifier cannot be used alone"))) (115 eshell-pred-substitute))] 1] "A list of modifiers than can be applied to an argument expansion.\nThe format of each entry is\n\n (CHAR ENTRYWISE-P MODIFIER-FUNC-SEXP)" (repeat (cons character sexp))] 10) (defvar eshell-predicate-help-string "Eshell predicate quick reference:\n\n - follow symbolic references for predicates after the `-'\n ^ invert sense of predicates after the `^'\n\nFILE TYPE:\n / directories s sockets\n . regular files p named pipes\n * executable (files only) @ symbolic links\n\n %x file type == `x' (as by ls -l; so `c' = char device, etc.)\n\nPERMISSION BITS (for owner/group/world):\n r/A/R readable s setuid\n w/I/W writable S setgid\n x/E/X executable t sticky bit\n\nOWNERSHIP:\n U owned by effective uid\n u(UID|\\='user\\=') owned by UID/user\n g(GID|\\='group\\=') owned by GID/group\n\nFILE ATTRIBUTES:\n l[+-]N +/-/= N links\n a[Mwhms][+-](N|\\='FILE\\=') access time +/-/= N months/weeks/hours/mins/secs\n (days if unspecified) if FILE specified,\n use as comparison basis; so a+\\='file.c\\='\n shows files accessed before file.c was\n last accessed\n m[Mwhms][+-](N|\\='FILE\\=') modification time...\n c[Mwhms][+-](N|\\='FILE\\=') change time...\n L[kmp][+-]N file size +/-/= N Kb/Mb/blocks\n\nEXAMPLES:\n *(^@) all non-dot files which are not symlinks\n .#*(^@) all files which are not symbolic links\n **/.#*(*) all executable files, searched recursively\n ***/*~f*(-/) recursively (though not traversing symlinks),\n find all directories (or symlinks referring to\n directories) whose names do not begin with f.\n e*(*Lk+50) executables 50k or larger beginning with `e'") (defvar eshell-modifier-help-string "Eshell modifier quick reference:\n\nFOR SINGLE ARGUMENTS, or each argument of a list of strings:\n E evaluate again\n L lowercase\n U uppercase\n C capitalize\n h dirname\n t basename\n e file extension\n r strip file extension\n q escape special characters\n\n S split string at any whitespace character\n S/PAT/ split string at each occurrence of PAT\n\nFOR LISTS OF ARGUMENTS:\n o sort alphabetically\n O reverse sort alphabetically\n u uniq list (typically used after :o or :O)\n R reverse list\n\n j join list members, separated by a space\n j/PAT/ join list members, separated by PAT\n i/PAT/ exclude all members not matching PAT\n x/PAT/ exclude all members matching PAT\n\n s/pat/match/ substitute PAT with MATCH\n g/pat/match/ substitute PAT with MATCH for all occurrences\n\nEXAMPLES:\n *.c(:o) sorted list of .c files") (defalias 'eshell-display-predicate-help #[0 "\300\301!\207" [with-electric-help #[0 "c\207" [eshell-predicate-help-string] 1]] 2 nil nil]) (defalias 'eshell-display-modifier-help #[0 "\300\301!\207" [with-electric-help #[0 "c\207" [eshell-modifier-help-string] 1]] 2 nil nil]) #@41 Initialize the predicate/modifier code. (defalias 'eshell-pred-initialize #[0 "\301\302\303\304\211$\210\305\306\307#\210\305\310\311#\207" [eshell-command-map add-hook eshell-parse-argument-hook eshell-parse-arg-modifier t define-key [(meta 113)] eshell-display-predicate-help [(meta 109)] eshell-display-modifier-help] 5 (#$ . 6542)]) #@84 Apply to LIST a series of PREDICATES and MODIFIERS. (fn LST PREDICATES MODIFIERS) (defalias 'eshell-apply-modifiers #[771 "\300;\203 C\262\301\262<\205; \302\300#\262\203* @!\262A\262\202 \211\203: G\303U\203: @\202; \207" [nil t eshell-winnow-list 1] 8 (#$ . 6887)]) #@134 Parse a modifier that has been specified after an argument. This function is specially for adding onto `eshell-parse-argument-hook'. (defalias 'eshell-parse-arg-modifier #[0 "\302f\303=\205b \302u\210\304\303\305\"\211\204 \306\307\303\"\202` \211T\211\206 `\211dU\206* \211f>\262\262\205` \214`}\210\310 \211@A\204D \211\203W \311 \312\313\314\315\316D\316DFEC\"\266)\211Tb\210\317 \262\207" [eshell-delimiter-argument-list eshell-current-modifiers nil 40 eshell-find-delimiter 41 throw eshell-incomplete eshell-parse-modifiers append lambda (lst) eshell-apply-modifiers lst quote eshell-finish-arg] 13 (#$ . 7182)]) #@387 Parse value modifiers and predicates at point. Return a cons cell of the form (PRED-FUNC-LIST . MOD-FUNC-LIST) PRED-FUNC-LIST is a list of predicate functions. MOD-FUNC-LIST is a list of result modifier functions. PRED-FUNCS take a filename and return t if the test succeeds; MOD-FUNCS take any list of strings and perform a modification, returning the resultant list of strings. (defalias 'eshell-parse-modifiers #[0 "\302\211\211\211\3031\342 m?\205\336 \302f\211\304\267\202\272 \302u\210\305\306!\203C \307p!\211\2038 \310!\2038 \311$\262\202? \312\313\314!\"\210\210\202\332 \312\315!\210\202\332 \302u\210?\262\202\332 \302u\210?\262\202\332 \302u\210\305\306!\203\220 \307p!\211\203\205 \310!\203\205 \316\317\320\321D\322BBEB\262\202\214 \312\323\314!\"\210\210\202\332 \312\324!\210\202\332 \302u\210\302f\236\211\204\253 \312\325\302f\"\210\202\266 \302u\210\326A!B\262\210\202\332 \211 \236\211\204\311 \312\327\"\210\202\331 \302u\210\311\326A!$\262\210\210\202 0\202\346 \210\312\330!\210\237\237B\207" [eshell-modifier-alist eshell-predicate-alist nil (end-of-buffer) #s(hash-table size 5 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (39 21 94 74 45 84 124 94 58 151)) looking-at "[^|':]" read functionp eshell-add-pred-func error "Invalid function predicate `%s'" eshell-stringify "Invalid function predicate" lambda (lst) mapcar function (lst) "Invalid function modifier `%s'" "Invalid function modifier" "Unknown modifier character `%c'" eval "Unknown predicate character `%c'" "Predicate or modifier ended prematurely"] 11 (#$ . 7822)]) #@74 Add the predicate function PRED to FUNCS. (fn PRED FUNCS NEGATE FOLLOW) (defalias 'eshell-add-pred-func #[1028 "\203 \300\301\302\303\304BBDE\262\211\203 \300\305\303\306BBE\262B\207" [lambda (file) not funcall (file) (file) ((file-truename file))] 10 (#$ . 9441)]) #@119 Return a predicate to test whether a file match a given user/group id. (fn MOD-CHAR MOD-TYPE ATTR-INDEX GET-ID-FUNC) (defalias 'eshell-pred-user-or-group #[1028 "\300\211\211\211\301\302!\203 \303\304\305!!\262\305\225b\210\202S \300f\262\306>\211\262\2030 \307\310G\"@\262\2023 \262\300u\210\311\"\262\211\204H \312\313\n#\210`{!\262\211Tb\210\204_ \312\314\n#\210\315\316\317\320\321\322\323\324 \325BBEEEE\207" [nil looking-at "[0-9]+" string-to-number match-string 0 (40 91 60 123) last (41 93 62 125) eshell-find-delimiter error "Malformed %s name string for modifier `%c'" "Unknown %s name specified for modifier `%c'" lambda (file) let ((attrs (file-attributes file))) if attrs = nth (attrs)] 18 (#$ . 9726)]) #@102 Return a predicate to test whether a file matches a certain time. (fn MOD-CHAR MOD-TYPE ATTR-INDEX) (defalias 'eshell-pred-file-time #[771 "\300\301\211\211\211\211\211f\302>\2035 \301f\262\303\267\2022 \304\262\2022 \305\262\2022 \306\262\2022 \307\262\2022 \310\262\301u\210\301f\311>\203C \301f\262\301u\210\312\313!\203\\ \314\315\316\317!!_!\262\317\225b\210\202\247 \301f\262\320>\211\262\203t \321\322G\"@\262\202w \262\301u\210\323\"\262\211\204\214 \324\325 #\210`{\326!\211\204\233 \324\327\"\2108\262\266\211Tb\210\330\331\332\333\334\335\n\336=\203\270 \337\202\304 \n\340=\203\303 \341\202\304 \342\n\343\344BBEEEE\207" [86400 nil (77 119 104 109 115) #s(hash-table size 5 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (77 23 119 29 104 35 109 41 115 47)) 2592000 604800 3600 60 1 (43 45) looking-at "[0-9]+" time-since string-to-number match-string 0 (40 91 60 123) last (41 93 62 125) eshell-find-delimiter error "Malformed %s time modifier `%c'" file-attributes "Cannot stat file `%s'" lambda (file) let ((attrs (file-attributes file))) if attrs 45 time-less-p 43 (lambda (a b) (time-less-p b a)) time-equal-p nth (attrs)] 20 (#$ . 10476)]) #@201 Return a test which tests that the file is of a certain TYPE. TYPE must be a character, and should be one of the possible options that `ls -l' will show in the first column of its display. (fn TYPE) (defalias 'eshell-pred-file-type #[257 "\211\300=\203 \301f\262\211\302>\203 \301u\210\202 \300\262\303\304\305\306\307\310\311\312\300=\203, \313\2021 \314 CDEEEE\207" [37 nil (98 99) lambda (file) let ((attrs (eshell-file-attributes (directory-file-name file)))) if attrs memq (aref (file-attribute-modes attrs) 0) (98 99) quote] 11 (#$ . 11696)]) #@70 Return a test which tests that MODE pertains to the file. (fn MODE) (defalias 'eshell-pred-file-mode #[257 "\300\301\302\303\304\305\306\307BBEEE\207" [lambda (file) let ((modes (file-modes file))) if modes logand (modes)] 10 (#$ . 12260)]) (put 'eshell-pred-file-mode 'byte-optimizer 'byte-compile-inline-expand) #@72 Return a predicate to test whether a file has a given number of links. (defalias 'eshell-pred-file-links #[0 "\300\211\211f\301>\203 \300f\262\300u\210\302\303!\204 \304\305!\210\306\307\310!!\262\310\225b\210\311\312\313\314\315\316\317=\2036 \320\202B \321=\203A \322\202B \323\324EEEE\207" [nil (45 43) looking-at "[0-9]+" error "Invalid file link count modifier `l'" string-to-number match-string 0 lambda (file) let ((attrs (eshell-file-attributes file))) if attrs 45 < 43 > = (file-attribute-link-number attrs)] 11 (#$ . 12583)]) #@63 Return a predicate to test whether a file is of a given size. (defalias 'eshell-pred-file-size #[0 "\300\301\211\211f\227\302>\203( \301f\227\262\303\267\202% \304\262\202% \305\262\202% \306\262\301u\210\301f\307>\2036 \301f\262\301u\210\310\311!\204@ \312\313!\210\314\315\316!!_\262\316\225b\210\317\320\321\322\323\324\325=\203^ \326\202j \327=\203i \330\202j \331\332EEEE\207" [1 nil (107 109 112) #s(hash-table size 3 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (107 22 109 28 112 34)) 1024 1048576 512 (45 43) looking-at "[0-9]+" error "Invalid file size modifier `L'" string-to-number match-string 0 lambda (file) let ((attrs (eshell-file-attributes file))) if attrs 45 < 43 > = (file-attribute-size attrs)] 12 (#$ . 13135)]) #@81 Return a modifier function that will substitute matches. (fn &optional REPEAT) (defalias 'eshell-pred-substitute #[256 "\300f\300\211\211\211u\210\301\211\300\211\302%\262\303`\"\262\211Tb\210\301\211\300\211\302%\262\303`\"\262\211Tb\210\203[ \304\305\306\307\304\310\311\312\313\314\315\316\317BBE\314\320\321\322BBEEE\323BBBD\324BBE\202~ \304\325\306\307\304\326\327\316\n\330BB\314\320\321\f\331BBE\332BBB\333BBBD\334BBE\207" [nil eshell-find-delimiter t buffer-substring-no-properties lambda (lst) mapcar function (str) let ((i 0)) while setq i string-match (str i) str replace-match (t nil str) (str) (lst) (lst) (str) if (str) (t nil str) ((error (concat str ": substitution failed"))) (str) (lst)] 20 (#$ . 13909)]) #@71 Include only lisp members matching a regexp. (fn &optional INVERT-P) (defalias 'eshell-include-members #[256 "\300f\300\211\211u\210\301\211\300\211\302%\262\303`\"\262\211Tb\210\304\305\306\307\300\310\304\311\2032 \312\313\314BBD\2028 \313\n\315BBECDFE\207" [nil eshell-find-delimiter t buffer-substring-no-properties lambda (lst) eshell-winnow-list lst quote (elem) not string-match (elem) (elem)] 16 (#$ . 14655)]) #@47 Return a modifier function that join matches. (defalias 'eshell-join-members #[0 "\300f\300\211\301>\204 \302\262\202&