%PDF- %PDF-
Direktori : /usr/local/share/emacs/27.2/lisp/eshell/ |
Current File : //usr/local/share/emacs/27.2/lisp/eshell/esh-util.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\306\307&\210\310\311\312\313\314DD\315\316\317\306\301&\210\310\320\312\313\321DD\322\316\323\306\301&\210\310\324\312\313\325DD\326\316\327\306\301&\210\310\330\312\313\331DD\332\316\333\306\301&\210\310\334\312\313\335DD\336\316\317\306\301&\210\310\337\312\313\340DD\341\316\342\306\301&\210\310\343\312\313\344DD\345\316\342\306\301&\210\310\346\312\313\347DD\350\351\352\316\353\306\301& \210\310\354\312\313\355DD\356\316\317\306\301&\210\310\357\312\313\360DD\361\316\353\306\301&\210\310\362\312\313\363DD\364\316\365\306\301&\207" [custom-declare-group eshell-util nil "This is general utility code, meant for use by Eshell itself." :tag "General utilities" :group eshell custom-declare-variable eshell-stringify-t funcall function #[0 "\300\207" [t] 1] "If non-nil, the string representation of t is \"t\".\nIf nil, t will be represented only in the exit code of the function,\nand not printed as a string. This causes Lisp functions to behave\nsimilarly to external commands, as far as successful result output." :type boolean eshell-group-file #[0 "\300\207" [#1="/etc/group"] 1 #1#] "If non-nil, the name of the group file on your system." (choice (const :tag "No group file" nil) file) eshell-passwd-file #[0 "\300\207" [#2="/etc/passwd"] 1 #2#] "If non-nil, the name of the passwd file on your system." (choice (const :tag "No passwd file" nil) file) eshell-hosts-file #[0 "\300\207" [#3="/etc/hosts"] 1 #3#] "The name of the /etc/hosts file." (choice (const :tag "No hosts file" nil) file) eshell-handle-errors #[0 "\300\207" [t] 1] "If non-nil, Eshell will handle errors itself.\nSetting this to nil is offered as an aid to debugging only." eshell-private-file-modes #[0 "\300\207" [384] 1] "The file-modes value to use for creating \"private\" files." integer eshell-private-directory-modes #[0 "\300\207" [448] 1] "The file-modes value to use for creating \"private\" directories." eshell-tar-regexp #[0 "\300\207" [#4="\\.t\\(ar\\(\\.\\(gz\\|bz2\\|xz\\|Z\\)\\)?\\|gz\\|a[zZ]\\|z2\\)\\'"] 1 #4#] "Regular expression used to match tar file names." :version "24.1" regexp eshell-convert-numeric-arguments #[0 "\300\207" [t] 1] "If non-nil, converting arguments of numeric form to Lisp numbers.\nNumeric form is tested using the regular expression\n`eshell-number-regexp'.\n\nNOTE: If you find that numeric conversions are interfering with the\nspecification of filenames (for example, in calling `find-file', or\nsome other Lisp function that deals with files, not numbers), add the\nfollowing in your init file:\n\n (put \\='find-file \\='eshell-no-numeric-conversions t)\n\nAny function with the property `eshell-no-numeric-conversions' set to\na non-nil value, will be passed strings, not numbers, even when an\nargument matches `eshell-number-regexp'." eshell-number-regexp #[0 "\300\207" [#5="-?\\([0-9]*\\.\\)?[0-9]+\\(e[-0-9.]+\\)?"] 1 #5#] "Regular expression used to match numeric arguments.\nIf `eshell-convert-numeric-arguments' is non-nil, and an argument\nmatches this regexp, it will be converted to a Lisp number, using the\nfunction `string-to-number'." eshell-ange-ls-uids #[0 "\300\207" [nil] 1] "List of user/host/id strings, used to determine remote ownership." (repeat (cons :tag "Host for User/UID map" (string :tag "Hostname") (repeat (cons :tag "User/UID List" (string :tag "Username") (repeat :tag "UIDs" string)))))] 10) #@38 A cache to hold the names of groups. (defvar eshell-group-names nil (#$ . 3822)) #@46 A timestamp of when the group file was read. (defvar eshell-group-timestamp nil (#$ . 3909)) #@37 A cache to hold the names of users. (defvar eshell-user-names nil (#$ . 4008)) #@45 A timestamp of when the user file was read. (defvar eshell-user-timestamp nil (#$ . 4093)) #@49 A cache the names of frequently accessed hosts. (defvar eshell-host-names nil (#$ . 4190)) #@46 A timestamp of when the hosts file was read. (defvar eshell-host-timestamp nil (#$ . 4287)) #@56 Return non-nil if we are running under MS-DOS/Windows. (defalias 'eshell-under-windows-p #[0 "\301>\207" [system-type (ms-dos windows-nt)] 2 (#$ . 4385)]) (put 'eshell-under-windows-p 'byte-optimizer 'byte-compile-inline-expand) #@145 If `eshell-handle-errors' is non-nil, this is `condition-case'. Otherwise, evaluates FORM with no error handling. (fn TAG FORM &rest HANDLERS) (defalias 'eshell-condition-case '(macro . #[642 "\203\f \301BBB\207\207" [eshell-handle-errors condition-case-unless-debug] 7 (#$ . 4622)])) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put eshell-condition-case lisp-indent-function 2 put edebug-form-spec (sexp form &rest form)] 5) #@345 From point, find the CLOSE delimiter corresponding to OPEN. The matching is bounded by BOUND. If REVERSE-P is non-nil, process the region backwards. If BACKSLASH-P is non-nil, and OPEN and CLOSE are the same character, then quoting is done by a backslash, rather than a doubled delimiter. (fn OPEN CLOSE &optional BOUND REVERSE-P BACKSLASH-P) (defalias 'eshell-find-delimiter #[1282 "\212\300\206 d\203 `Sf=\202 \301f=\203' \203$ \302\202% \300u\210\303V\203*\2035 \304\2026 \305`\"\203*\203F `Sf\202H \301f\301\204| =\203Y \203| \306=\203| `Tf\211\262\203| \211 =\204v \211=\203| \300u\210\202\203\255 =\203\214 \203\255 =\204\232 =\203\255 `S\206\240 `Sf\306=\203\255 \302u\210\202=\203\355 =\203\204\346 \203\317 `S\206\312 `Sf\202\322 `Tf =\203\346 \203\340 \302\202\341 \300u\210\202S\262\202 U\203\203\376 \302\202\377 \300\\\262\202U\203\203\300\202\302\\\262\266\203$\302\202%\300u\210\202' \303U\205:\2038`\202:`S\266\202)\207" [1 nil -1 0 > < 92] 11 (#$ . 5079)]) #@69 Convert STRING into a more native looking Lisp object. (fn STRING) (defalias 'eshell-convert #[257 "\211;\204 \207\211G\211\302U\203 \202F SH\303=\203# \304\302S#\262\305\306\"\2031 \307\306\"\202F \203E \305\310 \311Q\"\203E \312!\202F \207" [eshell-convert-numeric-arguments eshell-number-regexp 0 10 substring string-match "\n" split-string "\\`\\s-*" "\\s-*\\'" string-to-number] 6 (#$ . 6154)]) #@109 Return from LIST the N to M elements. If N or M is nil, it means the end of the list. (fn L &optional N M) (defalias 'eshell-sublist #[769 "\300!\203 \233:\203 \233\301\241\210\203 \233\262\202* \211GS\262\302!\262\211\207" [copy-sequence nil last] 6 (#$ . 6576)]) #@113 Content of $PATH. It might be different from (getenv "PATH"), when `default-directory' points to a remote host. (defvar eshell-path-env (getenv "PATH") (#$ . 6865)) (make-variable-buffer-local 'eshell-path-env) #@66 Return $PATH as a list. Add the current directory on MS-Windows. (defalias 'eshell-get-path #[0 "\303\304>\203 \305 \nQ\202 \n!\207" [system-type path-separator eshell-path-env eshell-parse-colon-path (ms-dos windows-nt) "."] 4 (#$ . 7082)]) #@116 Split string with `parse-colon-path'. Prepend remote identification of `default-directory', if any. (fn PATH-ENV) (defalias 'eshell-parse-colon-path #[257 "\301!\211\203 \302\303\304\305\306\307!\310\"\311\312%\313!\"\202 \313!\207" [default-directory file-remote-p mapcar make-byte-code 257 "\300P\207" vconcat vector [] 3 "\n\n(fn X)" parse-colon-path] 9 (#$ . 7334)]) #@49 Split a path into multiple subparts. (fn PATH) (defalias 'eshell-split-path #[257 "\211G\301\211\302\303>\203$ \304V\203$ \301H\305=\203$ \306H\305=\203$ \304\262W\203Z H\305=\203S \307\310#\204S U\203E \311\202K \312T#B\262T\262T\262\202$ W\203i \312#B\262\303>\203\204 \313\314\315!@\"\203\204 \315!\315!@\311P\240\210\211\237\207" [system-type 0 nil (ms-dos windows-nt) 2 47 1 get-text-property escaped "/" substring string-match "\\`[A-Za-z]:\\'" last] 9 (#$ . 7720)]) #@83 Make value a string. If separated by newlines change them to spaces. (fn VALUE) (defalias 'eshell-to-flat-string #[257 "\300!\301\302\"\203 \303\304\305\211$\262\301\306\"\203$ \303\307\305\211$\262\202 \211\207" [eshell-stringify string-match "\n+\\'" replace-match "" t "\n+" " "] 7 (#$ . 8234)]) #@60 Iterate through a list. (fn FOR-VAR FOR-LIST &rest FORMS) (defalias 'eshell-for '(macro . #[642 "\300\301DC\302\301\300\303BCBB\304BBBE\207" [let list-iter while ((car list-iter)) ((setq list-iter (cdr list-iter)))] 10 (#$ . 8550)])) (byte-code "\300\301\302\303#\210\304\305\306\307#\210\300\305\306\310#\207" [make-obsolete eshell-for dolist "24.1" defalias eshell-flatten-list flatten-tree nil "27.1"] 4) #@76 Remove occurring multiples in L. You probably want to sort first. (fn L) (defalias 'eshell-uniquify-list #[257 "\211\211\203# \211A\203 \211@A@\230\203 \211AA\241\210\202 \211A\262\202 \210\207" [] 4 (#$ . 8970)]) (byte-code "\300\301\302\303#\210\304\301\302\305#\207" [defalias eshell-uniqify-list eshell-uniquify-list nil make-obsolete "27.1"] 4) #@50 Convert OBJECT into a string value. (fn OBJECT) (defalias 'eshell-stringify #[257 "\211;\203 \207\211<\203 \211\301=\204 \302!\303\304GS#\207\211\247\203% \305!\207\211\306=\205- ??\2054 \302!\207" [eshell-stringify-t nil pp-to-string substring 0 number-to-string t] 6 (#$ . 9335)]) #@62 Convert each element of ARGS into a string value. (fn ARGS) (defalias 'eshell-stringify-list #[257 "\300\301\"\207" [mapcar eshell-stringify] 4 (#$ . 9634)]) (put 'eshell-stringify-list 'byte-optimizer 'byte-compile-inline-expand) #@78 Flatten and stringify all of the ARGS into a single string. (fn &rest ARGS) (defalias 'eshell-flatten-and-stringify #[128 "\300\301\302!\303#\207" [mapconcat eshell-stringify flatten-tree " "] 5 (#$ . 9873)]) (put 'eshell-flatten-and-stringify 'byte-optimizer 'byte-compile-inline-expand) #@97 Return a list of files in the given DIRECTORY matching REGEXP. (fn REGEXP &optional DIRECTORY) (defalias 'eshell-directory-files #[513 "\301\206 #\207" [default-directory directory-files] 6 (#$ . 10170)]) (put 'eshell-directory-files 'byte-optimizer 'byte-compile-inline-expand) #@65 Return list of regexp and prefix arg using PROMPT. (fn PROMPT) (defalias 'eshell-regexp-arg #[257 "\303\304\211\211\301%\211\305\230\203 \211A@\240\202 \211\306\n!)D\207" [last-command minibuffer-history-search-history current-prefix-arg read-from-minibuffer nil "" prefix-numeric-value] 7 (#$ . 10461)]) #@92 Return a printable FILESIZE. (fn FILESIZE &optional HUMAN-READABLE BLOCK-SIZE USE-COLORS) (defalias 'eshell-printable-size #[1025 "\300\206 \301!\203\251 \211W\203, \302!\301U\203 \303\202\266 \203% \304\202\266 \305\306\"\202\266 \211\245\262\211W\203K \211\307X\203D \305\310\"\202\266 \305\311\"\202\266 \211\245\262\211W\203z \211\312X\203c \305\313\"\202g \305\314\"\203t \315\301G\316\317%\210\211\262\202\266 \211\245\262\211W\205\266 \211\320X\203\222 \305\321\"\202\226 \305\322\"\203\243 \315\301G\316\323%\210\211\262\202\266 \203\262 \211\245\262\305\306\"\207" [float 0 round "0" "1.0k" format "%.0f" 9.94 "%.1fk" "%.0fk" 9.94 "%.1fM" "%.0fM" put-text-property face bold 9.94 "%.1fG" "%.0fG" bold-italic] 12 (#$ . 10779)]) #@259 Pare down the ENTRIES list using the EXCLUDE regexp, and PREDICATES. The original list is not affected. If the result is only one element long, it will be returned itself, rather than returning a one-element list. (fn ENTRIES EXCLUDE &optional PREDICATES) (defalias 'eshell-winnow-list #[770 "\300C\301\211\211<\204 C\262\300\262\211\203^ \211@\203( \302\"\204W \262?\262\203N @!\203A \300\262\202G \301\262\301\262A\262\2020 \203W C\244\210A\266\202\202 \210\211\203i A@\202k A\207" [t nil string-match] 12 (#$ . 11558)]) #@35 Allow Emacs to redisplay buffers. (defalias 'eshell-redisplay #[0 "\3001\n \301\302\211\"0\207\210\303\207" [(error) sit-for 0 nil] 3 (#$ . 12123)]) (put 'eshell-redisplay 'byte-optimizer 'byte-compile-inline-expand) #@69 Return an alist correlating gids to group names in FILE. (fn FILE) (defalias 'eshell-read-passwd-file #[257 "\300\301!\203\\ \302\303!r\211q\210\304\305\306\307\310!\311\"\312$\216\313!\210eb\210m\204Z \314`\300\210`{\315\"\211\203S \211@\203S \3128\203S \316\3128!\236\204S \316\3128!@BB\262\210\300y\210\202! *\210\211\207" [nil file-readable-p generate-new-buffer " *temp*" make-byte-code 0 "\301\300!\205 \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 insert-file-contents split-string ":" string-to-number] 9 (#$ . 12346)]) #@86 Read the contents of /etc/passwd for user names. (fn FILE RESULT-VAR TIMESTAMP-VAR) (defalias 'eshell-read-passwd #[771 "J\203 \211J\203 \300J\301!\3028\262\"\203$ \303!L\210\211\304 L\210J\207" [time-less-p file-attributes 5 eshell-read-passwd-file current-time] 8 (#$ . 12905)]) #@50 Read the contents of /etc/group for group names. (defalias 'eshell-read-group-names #[0 "\205 \301\302\303#\207" [eshell-group-file eshell-read-passwd eshell-group-names eshell-group-timestamp] 4 (#$ . 13203)]) #@46 Return the user id for user NAME. (fn NAME) (defalias 'eshell-group-id #[257 "\300\301 \"@\207" [rassoc eshell-read-group-names] 4 (#$ . 13423)]) (put 'eshell-group-id 'byte-optimizer 'byte-compile-inline-expand) #@52 Return the group name for the given GID. (fn GID) (defalias 'eshell-group-name #[257 "\300\301 \"A\207" [assoc eshell-read-group-names] 4 (#$ . 13644)]) (put 'eshell-group-name 'byte-optimizer 'byte-compile-inline-expand) #@50 Read the contents of /etc/passwd for user names. (defalias 'eshell-read-user-names #[0 "\205 \301\302\303#\207" [eshell-passwd-file eshell-read-passwd eshell-user-names eshell-user-timestamp] 4 (#$ . 13874)]) #@46 Return the user id for user NAME. (fn NAME) (defalias 'eshell-user-id #[257 "\300\301 \"@\207" [rassoc eshell-read-user-names] 4 (#$ . 14092)]) (byte-code "\300\301\302\303#\210\304\305\306\"\207" [put eshell-user-id byte-optimizer byte-compile-inline-expand defalias eshell-user-name user-login-name] 4) #@78 Read in the hosts from FILENAME, default `eshell-hosts-file'. (fn FILENAME) (defalias 'eshell-read-hosts-file #[257 "\301\302\303!r\211q\210\304\305\306\307\310!\311\"\312$\216\313\206 !\210eb\210\314\315\301\316#\2037 \317\320!\321\317\312!!BB\262\202 *\210\211\237\207" [eshell-hosts-file nil generate-new-buffer " *temp*" make-byte-code 0 "\301\300!\205 \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 insert-file-contents re-search-forward "^[ ]*\\([^# \n]+\\)[ ]+\\([^ \n].+\\)" t match-string 1 split-string] 9 (#$ . 14405)]) #@85 Read the contents of /etc/hosts for host names. (fn FILE RESULT-VAR TIMESTAMP-VAR) (defalias 'eshell-read-hosts #[771 "J\203 \211J\203 \300J\301!\3028\262\"\203( \303\304\305!\"L\210\211\306 L\210J\207" [time-less-p file-attributes 5 apply nconc eshell-read-hosts-file current-time] 8 (#$ . 14966)]) #@49 Read the contents of /etc/hosts for host names. (defalias 'eshell-read-host-names #[0 "\205 \301\302\303#\207" [eshell-hosts-file eshell-read-hosts eshell-host-names eshell-host-timestamp] 4 (#$ . 15284)]) #@52 Return an unrelated copy of `process-environment'. (defalias 'eshell-copy-environment #[0 "\301\302\"\207" [process-environment mapcar concat] 3 (#$ . 15499)]) (put 'eshell-copy-environment 'byte-optimizer 'byte-compile-inline-expand) #@57 Return all of the subgroups of GROUPSYM. (fn GROUPSYM) (defalias 'eshell-subgroups #[257 "\211\300N\301C\203 @A@\300=\203 \211@@C\244\210A\262\202 \211A\207" [custom-group t] 5 (#$ . 15741)]) #@82 Evaluate, with file-modes set to MODES, the given FORMS. (fn MODES &rest FORMS) (defalias 'eshell-with-file-modes '(macro . #[385 "\300BB\207" [with-file-modes] 5 (#$ . 15948)])) (make-obsolete 'eshell-with-file-modes 'with-file-modes "25.1") #@63 Evaluate FORMS with private file modes set. (fn &rest FORMS) (defalias 'eshell-with-private-file-modes '(macro . #[128 "\301BB\207" [eshell-private-file-modes with-file-modes] 4 (#$ . 16200)])) #@95 Make DIR with file-modes set to `eshell-private-directory-modes'. (fn DIR &optional PARENTS) (defalias 'eshell-make-private-directory #[513 "\301 \302\303\304\305\306!\307\"\310$\216\311!\210\312\")\207" [eshell-private-directory-modes default-file-modes make-byte-code 0 "\301\300!\207" vconcat vector [set-default-file-modes] 2 set-default-file-modes make-directory] 9 (#$ . 16403)]) (put 'eshell-make-private-directory 'byte-optimizer 'byte-compile-inline-expand) #@73 Return the beginning of STRING, up to SUBLEN bytes. (fn STRING SUBLEN) (defalias 'eshell-substring #[514 "\205 GV\203 \300\301#\207\207" [substring 0] 6 (#$ . 16881)]) (put 'eshell-substring 'byte-optimizer 'byte-compile-inline-expand) #@116 Make sure to use the handler for `directory-files-and-attributes'. (fn DIR &optional FULL MATCH NOSORT ID-FORMAT) (defalias 'eshell-directory-files-and-attributes #[1281 "\300!\301\302\"\303\230\203* \304$\305\306\307\310\311\312!\313\"\314\315%\"\262\2025 \316%\207" [expand-file-name file-remote-p method "ftp" directory-files mapcar make-byte-code 257 "\211\301\302\300\"!B\207" vconcat vector [eshell-file-attributes expand-file-name] 6 "\n\n(fn FILE)" directory-files-and-attributes] 14 (#$ . 17133)]) (defalias 'eshell-current-ange-uids #[0 "\302\303\"\205\"