;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\303\304\305\306#\210\303\304\307\310#\207" [require s dash put f-guard-error error-conditions (error f-guard-error) error-message "Destructive operation outside sandbox"] 4) #@77 List of allowed paths to modify when guarded. Do not modify this variable. (defvar f--guard-paths nil (#$ . 300)) #@123 If PATH is allowed to be modified, yield BODY. If PATH is not allowed to be modified, throw error. (fn PATH &rest BODY) (defalias 'f--destructive '(macro . #[385 "\300\301\300\302\303\304\305E\306\305 EE\307BB\310B\311\312\313 \314BBEFBBB\207" [if f--guard-paths --any\? or f-same\? it f-ancestor-of\? (f--guard-paths) progn signal 'f-guard-error list (f--guard-paths)] 12 (#$ . 422)])) (byte-code "\300\301\302\303#\300\207" [function-put f--destructive lisp-indent-function 1] 4) #@46 Join ARGS to a single path. (fn &rest ARGS) (defalias 'f-join #[128 "\300C\301@!\302\303\304\"\"\210\211\203\305\242!\207\242\207" [nil f-relative\? -map make-closure #[257 "\300\301\300\242\"\240\207" [V0 f-expand] 5 "\n\n(fn ARG)"] f-relative] 7 (#$ . 918)]) #@57 Split PATH and return list containing parts. (fn PATH) (defalias 'f-split #[257 "\300\301 \302#\303!\203\301 B\211\262\207\207" [s-split f-path-separator omit-nulls f-absolute\?] 5 (#$ . 1194)]) #@274 Expand PATH relative to DIR (or `default-directory'). PATH and DIR can be either a directory names or directory file names. Return a directory name if PATH is a directory name, and a directory file name otherwise. File name handlers are ignored. (fn PATH &optional DIR) (defalias 'f-expand #[513 "\301\302\")\207" [file-name-handler-alist nil expand-file-name] 5 (#$ . 1403)]) #@37 Return the name of PATH. (fn PATH) (defalias 'f-filename #[257 "\300\301!!\207" [file-name-nondirectory directory-file-name] 4 (#$ . 1792)]) (defalias 'f-parent 'f-dirname) #@49 Return the parent directory to PATH. (fn PATH) (defalias 'f-dirname #[257 "\301\302\303\"!!\304\"?\205\305!\203\306!\207\302!\207" [default-directory file-name-directory directory-file-name f-expand f-same\? f-relative\? f-relative] 6 (#$ . 1973)]) #@66 Return the deepest common parent directory of PATHS. (fn PATHS) (defalias 'f-common-parent #[257 "\211\204\300\207\211A\204\301@!\207\302\303\"\211@@\300@\203l\304\305\300\211\211\203Q\211A\262\242\262\262\211\262\203Q@\232\211\262\203Q\262\262T\262\202#\266\211\262\203l\302\306\"\262B\262@@\262\202\211\204t\266\307\207\211G\310U\203\205\311@!\203\205\312 \207\313\314\237\"\315P\207" [nil f-parent -map f-split t 0 cdr "" 1 f-root\? f-root apply f-join "/"] 12 (#$ . 2240)]) #@165 Return the file extension of PATH. The extension, in a file name, is the part that follows the last '.', excluding version numbers and backup suffixes. (fn PATH) (defalias 'f-ext #[257 "\300!\207" [file-name-extension] 3 (#$ . 2775)]) #@62 Return everything but the file extension of PATH. (fn PATH) (defalias 'f-no-ext #[257 "\300!\207" [file-name-sans-extension] 3 (#$ . 3019)]) #@93 Return PATH but with EXT as the new extension. EXT must not be nil or empty. (fn PATH EXT) (defalias 'f-swap-ext #[514 "\300!\203\n\301\302!\207\303!\304Q\207" [s-blank\? error "Extension cannot be empty or nil" f-no-ext "."] 5 (#$ . 3168)]) #@70 Return the name of PATH, excluding the extension of file. (fn PATH) (defalias 'f-base #[257 "\300\301!!\207" [f-no-ext f-filename] 4 (#$ . 3421)]) #@55 Return PATH relative to DIR. (fn PATH &optional DIR) (defalias 'f-relative #[513 "\300\"\207" [file-relative-name] 5 (#$ . 3576)]) (defalias 'f-abbrev 'f-short) #@64 Return abbrev of PATH. See `abbreviate-file-name'. (fn PATH) (defalias 'f-short #[257 "\300!\207" [abbreviate-file-name] 3 (#$ . 3746)]) #@41 Return long version of PATH. (fn PATH) (defalias 'f-long #[257 "\300!\207" [f-expand] 3 (#$ . 3892)]) #@47 Return the canonical name of PATH. (fn PATH) (defalias 'f-canonical #[257 "\300!\207" [file-truename] 3 (#$ . 4002)]) #@131 Append slash to PATH unless one already. Some functions, such as `call-process' requires there to be an ending slash. (fn PATH) (defalias 'f-slash #[257 "\300!\203\n\301!\207\207" [f-dir\? file-name-as-directory] 3 (#$ . 4129)]) #@61 Return absolute path to PATH, with ending slash. (fn PATH) (defalias 'f-full #[257 "\300\301!!\207" [f-slash f-long] 4 (#$ . 4369)]) #@61 Helper for `f-uniquify' and `f-uniquify-alist'. (fn PATHS) (defalias 'f--uniquify #[257 "\211G\300\301\"\302\303\"GU\204!\302\303\304\305\300\306\"\"\"\262\202\n\207" [mapcar #[257 "\211\300!B\207" [f-filename] 4 "\n\n(fn IT)"] -group-by cdr apply append #[257 "\211A\211G\300V\203\301\302\"\207\207" [1 mapcar #[257 "\211@\300\301A@\"!\302 AQB\207" [f-filename s-chop-suffix f-path-separator] 6 "\n\n(fn IT)"]] 5 "\n\n(fn IT)"]] 11 (#$ . 4510)]) #@89 Return unique suffixes of FILES. This function expects no duplicate paths. (fn FILES) (defalias 'f-uniquify #[257 "\300\301\302!\"\207" [-map car f--uniquify] 5 (#$ . 4980)]) #@112 Return alist mapping FILES to unique suffixes of FILES. This function expects no duplicate paths. (fn FILES) (defalias 'f-uniquify-alist #[257 "\300\301\302!\"\207" [-map cadr f--uniquify] 5 (#$ . 5165)]) #@195 Read binary data from PATH. Return the binary data as unibyte string. The optional second and third arguments BEG and END specify what portion of the file to read. (fn PATH &optional BEG END) (defalias 'f-read-bytes #[769 "\301\302\303\"r\211q\210\304\305\"\216\306\307!\210\310\311\307$\210\312ed\"*\207" [buffer-file-coding-system generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] set-buffer-multibyte nil binary insert-file-contents-literally buffer-substring-no-properties] 9 (#$ . 5380)]) (defalias 'f-read 'f-read-text) #@139 Read text with PATH, using CODING. CODING defaults to `utf-8'. Return the decoded text as multibyte string. (fn PATH &optional CODING) (defalias 'f-read-text #[513 "\300\301!\206 \302\"\207" [decode-coding-string f-read-bytes utf-8] 5 (#$ . 5982)]) (defalias 'f-write 'f-write-text) #@167 Write TEXT with CODING to PATH. TEXT is a multibyte string. CODING is a coding system to encode TEXT with. PATH is a file name to write to. (fn TEXT CODING PATH) (defalias 'f-write-text #[771 "\300\301\"\"\207" [f-write-bytes encode-coding-string] 7 (#$ . 6278)]) #@50 Determine whether S is a unibyte string. (fn S) (defalias 'f-unibyte-string-p #[257 "\300!?\207" [multibyte-string-p] 3 (#$ . 6555)]) #@105 Write binary DATA to PATH. DATA is a unibyte string. PATH is a file name to write to. (fn DATA PATH) (defalias 'f-write-bytes #[514 "\300\301#\207" [f--write-bytes nil] 6 (#$ . 6698)]) (defalias 'f-append 'f-append-text) #@97 Append TEXT with CODING to PATH. If PATH does not exist, it is created. (fn TEXT CODING PATH) (defalias 'f-append-text #[771 "\300\301\"\"\207" [f-append-bytes encode-coding-string] 7 (#$ . 6930)]) #@85 Append binary DATA to PATH. If PATH does not exist, it is created. (fn DATA PATH) (defalias 'f-append-bytes #[514 "\300\301#\207" [f--write-bytes :append] 6 (#$ . 7139)]) #@123 Write binary DATA to FILENAME. If APPEND is non-nil, append the DATA to the existing contents. (fn DATA FILENAME APPEND) (defalias 'f--write-bytes #[771 "\203m\304\305\304\211\211\203@\211A\262\242\262\262\211\262\203@\306 \"\206-\307 \"\211\262\204@\262\262T\262\202\n\266\211\262\203f\310!\204U\311\312\310D\"\210\313\304\211\314\304\315%\210+\304\207\311\316D\"\207\310!\204z\311\312\310D\"\210\313\304\211\314\304\315%\210+\304\207" [f--guard-paths write-region-post-annotation-function write-region-annotate-functions coding-system-for-write nil 0 f-same\? f-ancestor-of\? f-unibyte-string-p signal wrong-type-argument binary write-region :silent f-guard-error] 12 (#$ . 7321)]) #@43 Create directories DIRS. (fn &rest DIRS) (defalias 'f-mkdir #[128 "\300C\301\302\303\"\"\207" [nil -each make-closure #[257 "\300\302\300\242\"\240\210\303\300\242!?\205i \203e\304 \305\304\211\211\203P\211A\262\242\262\262\211\262\203P\306\300\242\"\206=\307\300\242\"\211\262\204P\262\262T\262\202\266\211\262\203]\310\300\242!\207\311\312\300\242 D\"\207\310\300\242!\207" [V0 f--guard-paths f-expand f-directory\? nil 0 f-same\? f-ancestor-of\? make-directory signal f-guard-error] 10 "\n\n(fn DIR)"]] 7 (#$ . 8062)]) #@130 Delete PATH, which can be file or directory. If FORCE is t, a directory will be deleted recursively. (fn PATH &optional FORCE) (defalias 'f-delete #[513 "\203d\301\302\301\211\211\203@\211A\262\242\262\262\211\262\203@\303 \"\206-\304 \"\211\262\204@\262\262T\262\202\n\266\211\262\203]\305!\204T\306!\203X\307!\207\310\"\207\311\312D\"\207\305!\204p\306!\203t\307!\207\310\"\207" [f--guard-paths nil 0 f-same\? f-ancestor-of\? f-file\? f-symlink\? delete-file delete-directory signal f-guard-error] 11 (#$ . 8623)]) #@57 Create a symlink to SOURCE from PATH. (fn SOURCE PATH) (defalias 'f-symlink #[514 "\203T\301\302\301\211\211\203@\211A\262\242\262\262\211\262\203@\303\"\206-\304\"\211\262\204@\262\262T\262\202\n\266\211\262\203M\305\"\207\306\307D\"\207\305\"\207" [f--guard-paths nil 0 f-same\? f-ancestor-of\? make-symbolic-link signal f-guard-error] 11 (#$ . 9194)]) #@88 Move or rename FROM to TO. If TO is a directory name, move FROM into TO. (fn FROM TO) (defalias 'f-move #[514 "\203U\301\302\301\211\211\203@\211A\262\242\262\262\211\262\203@\303\"\206-\304\"\211\262\204@\262\262T\262\202\n\266\211\262\203N\305\306#\207\307\310D\"\207\305\306#\207" [f--guard-paths nil 0 f-same\? f-ancestor-of\? rename-file t signal f-guard-error] 11 (#$ . 9594)]) #@141 Copy file or directory FROM to TO. If FROM names a directory and TO is a directory name, copy FROM into TO as a subdirectory. (fn FROM TO) (defalias 'f-copy #[514 "\203\202\302\303\302\211\211\203@\211A\262\242\262\262\211\262\203@\304\"\206-\305\"\211\262\204@\262\262T\262\202\n\266\211\262\203{\306!\203S\307\"\207 \310V\203^\311\"\207\312!\203v\313\314\315!\"\210\316\317!\"\311\"\207\311\"\207\320\321D\"\207\306!\203\215\307\"\207 \310V\203\230\311\"\207\312!\203\260\313\314\315!\"\210\316\317!\"\311\"\207\311\"\207" [f--guard-paths emacs-major-version nil 0 f-same\? f-ancestor-of\? f-file\? copy-file 23 copy-directory f-dir\? apply f-mkdir f-split f-expand f-filename signal f-guard-error] 11 (#$ . 10024)]) #@65 Copy contents in directory FROM, to directory TO. (fn FROM TO) (defalias 'f-copy-contents #[514 "\300!\204 \301\302\"\210\303!\204\301\304\"\210\305!\306\307\211\205:\211A\262\242\262\262T\262\310\311!\"\210\202\207" [f-exists\? error "Cannot copy contents to non existing directory %s" f-dir\? "Cannot copy contents as %s is a file" f-entries 0 nil f-copy file-name-as-directory] 10 (#$ . 10816)]) #@79 Update PATH last modification date or create if it does not exist. (fn PATH) (defalias 'f-touch #[257 "\203^\301\302\301\211\211\203@\211A\262\242\262\262\211\262\203@\303\"\206-\304\"\211\262\204@\262\262T\262\202\n\266\211\262\203W\305!\203R\306!\207\307\310\"\207\311\312D\"\207\305!\203h\306!\207\307\310\"\207" [f--guard-paths nil 0 f-same\? f-ancestor-of\? f-file\? set-file-times f-write-bytes "" signal f-guard-error] 10 (#$ . 11244)]) #@54 Return t if PATH exists, false otherwise. (fn PATH) (defalias 'f-exists\? #[257 "\300!\207" [file-exists-p] 3 (#$ . 11737)]) (byte-code "\300\301\302\"\210\300\303\304\"\210\300\305\303\"\207" [defalias f-exists-p f-exists\? f-dir\? f-directory\? f-dir-p] 3) #@60 Return t if PATH is directory, false otherwise. (fn PATH) (defalias 'f-directory\? #[257 "\300!\207" [file-directory-p] 3 (#$ . 12004)]) (defalias 'f-directory-p 'f-directory\?) #@55 Return t if PATH is file, false otherwise. (fn PATH) (defalias 'f-file\? #[257 "\300!\207" [file-regular-p] 3 (#$ . 12190)]) (defalias 'f-file-p 'f-file\?) #@58 Return t if PATH is symlink, false otherwise. (fn PATH) (defalias 'f-symlink\? #[257 "\300!??\207" [file-symlink-p] 3 (#$ . 12354)]) (defalias 'f-symlink-p 'f-symlink\?) #@59 Return t if PATH is readable, false otherwise. (fn PATH) (defalias 'f-readable\? #[257 "\300!\207" [file-readable-p] 3 (#$ . 12532)]) (defalias 'f-readable-p 'f-readable\?) #@59 Return t if PATH is writable, false otherwise. (fn PATH) (defalias 'f-writable\? #[257 "\300!\207" [file-writable-p] 3 (#$ . 12713)]) (defalias 'f-writable-p 'f-writable\?) #@61 Return t if PATH is executable, false otherwise. (fn PATH) (defalias 'f-executable\? #[257 "\300!\207" [file-executable-p] 3 (#$ . 12894)]) (defalias 'f-executable-p 'f-executable\?) #@59 Return t if PATH is absolute, false otherwise. (fn PATH) (defalias 'f-absolute\? #[257 "\300!\207" [file-name-absolute-p] 3 (#$ . 13085)]) (defalias 'f-absolute-p 'f-absolute\?) #@59 Return t if PATH is relative, false otherwise. (fn PATH) (defalias 'f-relative\? #[257 "\300!?\207" [f-absolute\?] 3 (#$ . 13271)]) (defalias 'f-relative-p 'f-relative\?) #@65 Return t if PATH is root directory, false otherwise. (fn PATH) (defalias 'f-root\? #[257 "\300!?\207" [f-parent] 3 (#$ . 13450)]) (defalias 'f-root-p 'f-root\?) #@279 Return t if extension of PATH is EXT, false otherwise. If EXT is nil or omitted, return t if PATH has any extension, false otherwise. The extension, in a file name, is the part that follows the last '.', excluding version numbers and backup suffixes. (fn PATH &optional EXT) (defalias 'f-ext\? #[513 "\211\203\n\300!\230\207\300!\301=?\207" [f-ext nil] 4 (#$ . 13620)]) (byte-code "\300\301\302\"\210\300\303\304\"\210\300\305\303\"\207" [defalias f-ext-p f-ext\? f-equal\? f-same\? f-equal-p] 3) #@80 Return t if PATH-A and PATH-B are references to same file. (fn PATH-A PATH-B) (defalias 'f-same\? #[514 "\300!\205\300!\205\301\302\303!!!\301\302\303!!!\232\207" [f-exists\? f-canonical directory-file-name f-expand] 7 (#$ . 14130)]) (defalias 'f-same-p 'f-same\?) #@61 Return t if PATH-A is parent of PATH-B. (fn PATH-A PATH-B) (defalias 'f-parent-of\? #[514 "\300!\211\205 \301\"\207" [f-parent f-same\?] 6 (#$ . 14410)]) (defalias 'f-parent-of-p 'f-parent-of\?) #@60 Return t if PATH-A is child of PATH-B. (fn PATH-A PATH-B) (defalias 'f-child-of\? #[514 "\300!\211\205 \301\"\207" [f-parent f-same\?] 6 (#$ . 14616)]) (defalias 'f-child-of-p 'f-child-of\?) #@63 Return t if PATH-A is ancestor of PATH-B. (fn PATH-A PATH-B) (defalias 'f-ancestor-of\? #[514 "\300\"?\205\301\302!\302!\"\207" [f-same\? s-starts-with\? f-full] 6 (#$ . 14818)]) (defalias 'f-ancestor-of-p 'f-ancestor-of\?) #@64 Return t if PATH-A is desendant of PATH-B. (fn PATH-A PATH-B) (defalias 'f-descendant-of\? #[514 "\300\"?\205\301\302!\302!\"\207" [f-same\? s-starts-with\? f-full] 6 (#$ . 15055)]) (defalias 'f-descendant-of-p 'f-descendant-of\?) #@55 Return t if PATH is hidden, nil otherwise. (fn PATH) (defalias 'f-hidden\? #[257 "\300!\204 \301\302\"\210\211\303\304O\305\230\207" [f-exists\? error "Path does not exist: %s" 0 1 "."] 4 (#$ . 15299)]) (defalias 'f-hidden-p 'f-hidden\?) #@158 If PATH is a file, return t if the file in PATH is empty, nil otherwise. If PATH is directory, return t if directory has no files, nil otherwise. (fn PATH) (defalias 'f-empty\? #[257 "\300!\203\301\302\303#\302=\207\304!\305U\207" [f-directory\? f-files nil t f-size 0] 5 (#$ . 15548)]) (defalias 'f-empty-p 'f-empty\?) #@135 Return size of PATH. If PATH is a file, return size of that file. If PATH is directory, return sum of all files in PATH. (fn PATH) (defalias 'f-size #[257 "\300!\203\301\302\303\304\305\306#\"!\207\307\310!8\207" [f-directory\? -sum -map f-size f-files nil t 7 file-attributes] 8 (#$ . 15881)]) #@195 Return the depth of PATH. At first, PATH is expanded with `f-expand'. Then the full path is used to detect the depth. '/' will be zero depth, '/usr' will be one depth. And so on. (fn PATH) (defalias 'f-depth #[257 "\300\301!!GS\207" [f-split f-expand] 4 (#$ . 16191)]) #@27 Return path to this file. (defalias 'f-this-file #[0 "\203 \207\303\302!\203\n\203\n\207\304 \207" [load-in-progress load-file-name byte-compile-current-file boundp buffer-file-name] 2 (#$ . 16472)]) #@51 A variable to cache result of `f-path-separator'. (defvar f--path-separator nil (#$ . 16685)) #@24 Return path separator. (defalias 'f-path-separator #[0 "\206 \301\302\303\"\304\305O\211\207" [f--path-separator f-join "x" "y" 1 2] 3 (#$ . 16785)]) #@52 Find PATTERN in PATH. (fn PATTERN &optional PATH) (defalias 'f-glob #[513 "\301\302\206\"!\207" [default-directory file-expand-wildcards f-join] 6 (#$ . 16944)]) #@23 (fn PATH RECURSIVE) (defalias 'f--collect-entries #[514 "\300C\301\302\303\304\"\"\203\305\306\307#\"\210\202\240\210\242\207" [nil -reject #[257 "\300!\301\232\206 \300!\302\232\207" [f-filename "." ".."] 3 "\n\n(fn FILE)"] directory-files t -map make-closure #[257 "\302!\203 \301\301\242B\240\207\303!\205$\301\301\242B\240\210\301\304\301\242\305\300\"\"\240\207" [V0 V1 f-file\? f-directory\? append f--collect-entries] 7 "\n\n(fn ENTRY)"]] 9 (#$ . 17118)]) #@71 Anaphoric version of `f-entries'. (fn PATH BODY &optional RECURSIVE) (defalias 'f--entries '(macro . #[770 "\300\301\302\303\304EEF\207" [f-entries lambda (path) let ((it path))] 10 (#$ . 17611)])) #@247 Find all files and directories in PATH. FN - called for each found file and directory. If FN returns a thruthy value, file or directory will be included. RECURSIVE - Search for files and directories recursive. (fn PATH &optional FN RECURSIVE) (defalias 'f-entries #[769 "\300\"\203 \301\"\207\207" [f--collect-entries -select] 7 (#$ . 17821)]) #@75 Anaphoric version of `f-directories'. (fn PATH BODY &optional RECURSIVE) (defalias 'f--directories '(macro . #[770 "\300\301\302\303\304EEF\207" [f-directories lambda (path) let ((it path))] 10 (#$ . 18180)])) #@83 Find all directories in PATH. See `f-entries'. (fn PATH &optional FN RECURSIVE) (defalias 'f-directories #[769 "\300\301\302\"\"\203\300\"\207\207" [-select f-directory\? f--collect-entries] 8 (#$ . 18401)]) #@69 Anaphoric version of `f-files'. (fn PATH BODY &optional RECURSIVE) (defalias 'f--files '(macro . #[770 "\300\301\302\303\304EEF\207" [f-files lambda (path) let ((it path))] 10 (#$ . 18624)])) #@77 Find all files in PATH. See `f-entries'. (fn PATH &optional FN RECURSIVE) (defalias 'f-files #[769 "\300\301\302\"\"\203\300\"\207\207" [-select f-file\? f--collect-entries] 8 (#$ . 18827)]) #@70 Anaphoric version of `f-traverse-upwards'. (fn BODY &optional PATH) (defalias 'f--traverse-upwards '(macro . #[513 "\300\301\302\303\304EEE\207" [f-traverse-upwards lambda (dir) let ((it dir))] 8 (#$ . 19033)])) #@224 Traverse up as long as FN return nil, starting at PATH. If FN returns a non-nil value, the path sent as argument to FN is returned. If no function callback return a non-nil value, nil is returned. (fn FN &optional PATH) (defalias 'f-traverse-upwards #[513 "\211\204\262\301!\203\302!\262!\203\207\303!?\205&\304\305!\"\207" [default-directory f-relative\? f-expand f-root\? f-traverse-upwards f-parent] 6 (#$ . 19256)]) #@23 Return absolute root. (defalias 'f-root #[0 "\300\301!\207" [f-traverse-upwards f-root\?] 2 (#$ . 19702)]) #@97 Only allow PATH-OR-PATHS and descendants to be modified in BODY. (fn PATH-OR-PATHS &rest BODY) (defalias 'f-with-sandbox '(macro . #[385 "\300\301\302\303D\304DFDC\305\300\306BB\307BBE\207" [let paths if listp list unwind-protect ((f--guard-paths paths)) ((setq f--guard-paths nil))] 9 (#$ . 19815)])) (byte-code "\300\301\302\303#\304\305!\207" [function-put f-with-sandbox lisp-indent-function 1 provide f] 4)