;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\305\306\307\310\311\312\313\314\315\316& \210\317\320\321\322\323DD\324\325\326\313\306&\210\317\327\321\322\330DD\331\325\326\313\306&\210\317\332\321\322\333DD\334\325\335\313\306&\210\317\336\321\322\337DD\340\325\341\313\306&\210\317\342\321\322\343DD\344\325\345\313\306&\207" [require cl-lib dash f subr-x custom-declare-group searcher nil "Searcher in pure elisp." :prefix "searcher-" :group tool :link (url-link :tag "Repository" "https://github.com/jcs-elpa/searcher") custom-declare-variable searcher-ignore-dirs funcall function #[0 "\300\207" [("/[.]log/" "/[.]vs/" "/[.]vscode/" "/[.]svn/" "/[.]git/" "/[.]hg/" "/[.]bzr/" "/[.]idea/" "/[.]tox/" "/[.]stack-work/" "/[.]ccls-cache/" "/[.]clangd/" "/[.]ensime_cache/" "/[.]eunit/" "/[.]fslckout/" "/[Bb]in/" "/[Bb]uild/" "/res/" "/[.]src/" "/SCCS/" "/RCS/" "/CVS/" "/MCVS/" "/_MTN/" "/_FOSSIL_/" "/_darcs/" "/{arch}/" "/node_modules/")] 1] "List of path you want to ignore by the searcher." :type list searcher-ignore-files #[0 "\300\207" [("[.]gitignore" "[.]gitattributes" "[.]meta" "[.]iso" "[.]img" "[.]png" "[.]jpg" "[.]jpng" "[.]gif" "[.]psd" "[.]obj" "[.]maya" "[.]fbx" "[.]mp3" "[.]wav" "[.]mp4" "[.]avi" "[.]flv" "[.]mov" "[.]webm" "[.]mpg" "[.]mkv" "[.]wmv" "[.]exe" "[.]bin" "[.]elc" "[.]javac" "[.]pyc" "[.]lib" "[.]dll" "[.]o" "[.]a")] 1] "List of files you want to ignore by the searcher." searcher-use-cache #[0 "\300\207" [t] 1] "Use cache to speed up the search speed." boolean searcher-search-type #[0 "\300\207" [regex] 1] "Type of the searching algorithm." (choice (const :tag "regex" regex) (const :tag "regex-fuzzy" regex-fuzzy) (const :tag "flx" flx)) searcher-flx-threshold #[0 "\300\207" [25] 1] "Target score we accept for outputting the search result." integer] 10) #@102 Cache for valid project files. Do `searcher-clean-cache' if project tree strucutre has been changed. (defvar searcher--cache-project-files nil (#$ . 1911)) #@76 Check if IN-STR contain in any string in the IN-LIST. (fn IN-LIST IN-STR) (defalias 'searcher--is-contain-list-string-regexp #[514 "\300\301\302\"\"\207" [cl-some make-closure #[257 "\211\300\302\303\304#)\207" [V0 inhibit-changing-match-data nil t string-match] 8 "\n\n(fn LB-SUB-STR)"]] 6 (#$ . 2073)]) #@102 Find all directories in PATH by ignored common directories with FN and REC. (fn PATH &optional REC) (defalias 'searcher--f-directories-ignore-directories #[513 "\301!\302\211\211\203!\211@\303\304!\"\204\211B\262A\266\202\202\210\203>\211\203=\211@\305\"B\262A\266\202\202'\210\306!\262\306!\262\307\310\"!\207" [searcher-ignore-dirs f-directories nil searcher--is-contain-list-string-regexp f-slash searcher--f-directories-ignore-directories reverse -flatten append] 11 (#$ . 2392)]) #@99 Find all files in PATH by ignored common directories with FN and REC. (fn PATH &optional FN REC) (defalias 'searcher--f-files-ignore-directories #[769 "\300C\301\"\"\302\211\203 \211@\303\"B\262A\266\202\202\n\210\304\305!!\207" [append searcher--f-directories-ignore-directories nil f-files -flatten reverse] 10 (#$ . 2913)]) #@53 Return string at line with current cursor position. (defalias 'searcher--line-string #[0 "\300 \301 S\302 SO\207" [buffer-string line-beginning-position line-end-position] 3 (#$ . 3260)]) #@107 Trim incomplete REGEX. If REGEX ends with \|, trim it, since then it matches an empty string. (fn REGEX) (defalias 'searcher--trim-trailing-re #[257 "\300\301\"\203\f\302\303\"\207\207" [string-match "\\`\\(.*\\)[\\]|\\'" match-string 1] 4 (#$ . 3455)]) #@73 Build a regex sequence from STR. Insert .* between each char. (fn STR) (defalias 'searcher--regex-fuzzy #[257 "\300!\262\301\302\"\2035\303\304\"\303\305\"\306\307\"\262\310\311\312\311\313\314\315\"AB\314\316\"#\"\262\303\317\"Q\207\207" [searcher--trim-trailing-re string-match "\\`\\(\\^?\\)\\(.*?\\)\\(\\$?\\)\\'" match-string 1 2 append nil apply concat cl-mapcar "" mapcar #[257 "\300\301\"\207" [format "[^%c\n]*"] 4 "\n\n(fn C)"] #[257 "\300\301\302\303!!\"\207" [format "\\(%s\\)" regexp-quote char-to-string] 6 "\n\n(fn X)"] 3] 11 (#$ . 3719)]) #@98 Form a match candidate; data are FILE, START, END and LN-STR. (fn FILE LN-STR START END LN COL) (defalias 'searcher--form-match #[1542 "\300\301\302\303 \304\n\305 \257\f\207" [:file :string :start :end :line-number :column] 18 (#$ . 4297)]) #@27 Clean up the cache files. (defalias 'searcher-clean-cache #[0 "\301\211\207" [searcher--cache-project-files nil] 2 (#$ . 4555)]) #@93 Return search string depends on `searcher-search-type' and STR-OR-REGEX. (fn STR-OR-REGEX) (defalias 'searcher--search-string #[257 "\301=\204\f\302=\203\303!\207\207" [searcher-search-type regex-fuzzy flx searcher--regex-fuzzy] 3 (#$ . 4691)]) #@22 Initialize searcher. (defalias 'searcher--init #[0 "\301=\205 \302\301!\207" [searcher-search-type flx require] 2 (#$ . 4949)]) #@76 Search STR-OR-REGEX from the root of project directory. (fn STR-OR-REGEX) (defalias 'searcher-search-in-project #[257 "\300 A\211\203\f\301\"\207\302\303!\207" [project-current searcher-search-in-path error "[ERROR] No project root folder found from default path"] 5 (#$ . 5085)]) #@56 Search STR-OR-REGEX from PATH. (fn PATH STR-OR-REGEX) (defalias 'searcher-search-in-path #[514 "\302\203 \204\303\304\305#\211\203%\211@\306\"B\262A\266\202\202\210\307\310\"\207" [searcher--cache-project-files searcher-use-cache nil searcher--f-files-ignore-directories #[257 "\301\"?\207" [searcher-ignore-files searcher--is-contain-list-string-regexp] 4 "\n\n(fn FILE)"] t searcher-search-in-file -flatten-n 1] 8 (#$ . 5376)]) #@54 Search STR-OR-REGEX in FILE. (fn FILE STR-OR-REGEX) (defalias 'searcher-search-in-file #[514 "\302 \210\303\304\303\304\303\211\211\211\305\n!\262\n \211\306\230\262\204\321\307\310\311\"r\211q\210\312\313\"\216\314\f!\2039\315\f!\210\202Cr q\210\316 )c\210eb\210\3171T\320 \303\311#0\202X\210\202\317\203\317\321\224\262\321\225\262\212b\210i)\262\322\"S\262\\\321U\203\204\304\202\205\321\\\262 \262\323=\203\256\316 SSO\324\"\211\205\242\211@\211\205\251 W\266\203\202\257\311\262\203F\325\f\326   &\nB\262\n\303\262\202F*\210\207" [searcher-search-type searcher-flx-threshold searcher--init nil 1 searcher--search-string "" generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] file-exists-p insert-file-contents buffer-string (error) search-forward-regexp 0 count-lines flx flx-score searcher--form-match searcher--line-string] 19 (#$ . 5832)]) (provide 'searcher)