;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\332\313\306&\210\317\333\321\322\334DD\335\325\332\313\306&\210\317\336\321\322\337DD\340\325\341\313\306&\207" [require cl-lib ivy searcher s custom-declare-group ivy-searcher nil "Ivy interface to use searcher." :prefix "ivy-searcher-" :group tool :link (url-link :tag "Repository" "https://github.com/jcs-elpa/ivy-searcher") custom-declare-variable ivy-searcher-display-info funcall function #[0 "\300\207" [position] 1] "Display option for file information." :type (choice (const :tag "position" position) (const :tag "line/column" line/column)) ivy-searcher-separator #[0 "\300\207" [#1=":"] 1 #1#] "Separator string for display." string ivy-searcher-default-input #[0 "\300\207" [#2=""] 1 #2#] "Default initial input for searcher." ivy-searcher-preselect #[0 "\300\207" [nil] 1] "Preselect option." (choice (const :tag "none" nil) (const :tag "previous search candidate" previous) (const :tag "next search candidate" next))] 10) #@42 Prompt string when using `ivy-searcher'. (defconst ivy-searcher--prompt-format "[Searcher] %s: " (#$ . 1214)) #@37 Current initial input for searcher. (defvar ivy-searcher--initial-input nil (#$ . 1330)) #@56 Record down the last input for preselecting behaviour. (defvar ivy-searcher--last-input nil (#$ . 1425)) #@40 Record down the current target buffer. (defvar ivy-searcher--target-buffer nil (#$ . 1536)) #@40 Record down the current search string. (defvar ivy-searcher--search-string "" (#$ . 1634)) #@41 Record down the current replace string. (defvar ivy-searcher--replace-string "" (#$ . 1731)) #@47 Record down all the candidates for searching. (defvar ivy-searcher--candidates nil (#$ . 1830)) #@47 List of data about the current winodw buffer. (defvar ivy-searcher--buffer-info nil (#$ . 1932)) #@77 Record the current search directory in order to find respect relative path. (defvar ivy-searcher--current-dir "" (#$ . 2035)) #@31 Get the current project path. (defalias 'ivy-searcher--project-path #[0 "\300 A\207" [project-current] 1 (#$ . 2167)]) #@76 Check if IN-STR contain in any string in the IN-LIST. (fn IN-LIST IN-STR) (defalias 'ivy-searcher--is-contain-list-string #[514 "\300\301\302\"\"\207" [cl-some make-closure #[257 "\302!\300\303\304\305#)\207" [V0 inhibit-changing-match-data regexp-quote nil t string-match] 8 "\n\n(fn LB-SUB-STR)"]] 6 (#$ . 2292)]) #@31 Goto LN line number. (fn LN) (defalias 'ivy-searcher--goto-line #[257 "eb\210\211Sy\207" [] 2 (#$ . 2622)]) #@38 Return PATH file content. (fn PATH) (defalias 'ivy-searcher--get-string-from-file #[257 "\300\301\302\"r\211q\210\303\304\"\216\305!\210\306 *\207" [generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] insert-file-contents buffer-string] 5 (#$ . 2737)]) #@51 Return the separator string with text properties. (defalias 'ivy-searcher--separator-string #[0 "\301\302\303#\207" [ivy-searcher-separator propertize face default] 4 (#$ . 3059)]) #@75 Propertize the LN-STR with INPUT and column (COL). (fn LN-STR INPUT COL) (defalias 'ivy-searcher--propertize-line-string #[771 "\211G\\\3001\301O\302O\303\304#GOQ0\207\210\305\207" [(error) 0 propertize face ivy-highlight-face nil] 9 (#$ . 3247)]) #@78 Read SELECTION and return list of data (file, line, column). (fn SELECTION) (defalias 'ivy-searcher--read-selection #[257 "\211C\301 \302C\302C\302\211\303\304\305$\"\262\306\242\307 \242#\240\210\310\242\"\262\211\2035\242\2027@A@\3118E\207" [ivy-searcher-separator buffer-list nil cl-some make-closure #[257 "\301\304!\240\210\302\305\306\307\301\242!\"\240\210\302\242\300\242\310\311\312#)\207" [V0 V1 V2 inhibit-changing-match-data buffer-name format "^%s" regexp-quote nil t string-match] 8 "\n\n(fn BUF)"] s-replace-regexp "" split-string 2] 13 (#$ . 3514)]) #@49 Convert CAND string to a plist data. (fn CAND) (defalias 'ivy-searcher--candidate-to-plist #[257 "\301!\211@\302\211\211\211\303\267\202.A@\262\3048\262\202.A@\262\3048\262\3058\262\306\307\310\311\312 \257\n\207" [ivy-searcher-display-info ivy-searcher--read-selection nil #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (position 15 line/column 29)) 2 3 :file :string :start :line-number :column] 17 (#$ . 4114)]) #@70 Return the default initiali input depend if region is active or not. (defalias 'ivy-searcher--initial-input-or-region #[0 "\301 \203\f\302\303 \304 \"\207\207" [ivy-searcher-default-input use-region-p buffer-substring-no-properties region-beginning region-end] 3 (#$ . 4599)]) #@55 Delay display a bit so the preselect can get updated. (defalias 'ivy-searcher--delay-display #[0 "\301\302 )\207" [ivy-dynamic-exhibit-delay-ms 0.1 ivy--queue-exhibit] 1 (#$ . 4884)]) #@69 Preselect the candidate depends on `ivy-searcher-preselect' option. (defalias 'ivy-searcher--search-preselect #[0 "\205R \n\230?\205R\n\305 \306\"\305 \307\"\305 \310\"\305 \311\"\312\313=\203(\314\202)\315\316\312\f\317\320\321    %$\262\203J\322\\\315]!\210\202N\322\315!\210\323 \266\206\207" [ivy-searcher-preselect ivy-searcher--last-input ivy-text ivy-searcher--buffer-info ivy-searcher--candidates plist-get :file :start :line-number :column nil previous -1 0 cl-position :test make-closure #[514 "\211A\305\306\"\305\307\"\305\310\"\305\311\"\300\230\2053\f\312\267\2022\301X\207\302W\2063\302X\2053\303W\207\313\207" [V0 V1 V2 V3 ivy-searcher-display-info plist-get :file :start :line-number :column #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (position 30 line/column 34)) nil] 9 "\n\n(fn KEY CAND)"] ivy-set-index ivy-searcher--delay-display] 16 (#$ . 5075)]) #@50 Initialize and get ready for searcher to search. (defalias 'ivy-searcher--init #[0 "\301 \210\302\303 \206 \304 \305`\306\307 \310iS\257\211\207" [ivy-searcher--buffer-info searcher-clean-cache :file buffer-file-name buffer-name :start :line-number line-number-at-pos :column] 8 (#$ . 6023)]) #@33 Do action with CAND. (fn CAND) (defalias 'ivy-searcher--do-search-complete-action #[257 "\302!\303\304\"\305!\303\306\"\303\307\"\303\310\"\311\"\262\312!\203*\313!\210\202.\314!\210 \315\267\202O\316!\262Tb\207\316!\262\316!\262\317!\210\320!\207\321\207" [ivy-searcher--current-dir ivy-searcher-display-info ivy-searcher--candidate-to-plist plist-get :file f-filename :start :line-number :column f-join file-exists-p find-file switch-to-buffer #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (position 52 line/column 61)) string-to-number ivy-searcher--goto-line move-to-column nil] 10 (#$ . 6325)]) #@69 Do the search action by INPUT, CANDS and DIR. (fn INPUT CANDS DIR) (defalias 'ivy-searcher--do-search-input-action #[771 "\303\304\303\211\211\211\211\303\211\203\247\211@\305\306\"\262\307\n\304 #\262\305\310\"\262\305\311\"\262\312 #\262\305\313\"\262\314!\262\305\315\"\262\314!\262\314!\262\n\316\267\202\217\317\320\321#\322 \317\320\323#\322  \260\202\220\317\320\321#\322 \317\320\323#\322 \317\320\323#\322  \260\202\220\303\262 B\262 B BA\266\202\202\210\207" [ivy-searcher--current-dir ivy-searcher--candidates ivy-searcher-display-info nil "" plist-get :file s-replace :string :column ivy-searcher--propertize-line-string :start number-to-string :line-number #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (position 89 line/column 112)) propertize face ivy-grep-info ivy-searcher--separator-string ivy-grep-line-number] 20 (#$ . 6996)]) #@42 Search for INPUT in project. (fn INPUT) (defalias 'ivy-searcher--do-search-project #[257 "\301 \302!\303#\207" [ivy-searcher--search-string ivy-searcher--project-path searcher-search-in-project ivy-searcher--do-search-input-action] 7 (#$ . 7950)]) #@39 Search for INPUT in file. (fn INPUT) (defalias 'ivy-searcher--do-search-file #[257 "\302\303!!\304\"\305#\207" [ivy-searcher--target-buffer ivy-searcher--search-string f-slash f-dirname searcher-search-in-file ivy-searcher--do-search-input-action] 7 (#$ . 8211)]) #@29 Search through the project. (defalias 'ivy-searcher-search-project #[0 "\302 \210\303 \304\305 \306\"\307\310\311\312\313\312\314\315\316\317&\f)\207" [ivy-searcher--initial-input ivy-searcher--prompt-format ivy-searcher--init ivy-searcher--initial-input-or-region ivy-read format "Search" ivy-searcher--do-search-project :initial-input :dynamic-collection t :require-match :update-fn ivy-searcher--search-preselect :action ivy-searcher--do-search-complete-action] 13 (#$ . 8490) nil]) #@30 Search through current file. (defalias 'ivy-searcher-search-file #[0 "\303 \210\304 \305 \206\f\306 \307\310\n\311\"\312\313 \314\315\316\315\317\320\321\322&\f*\207" [ivy-searcher--target-buffer ivy-searcher--initial-input ivy-searcher--prompt-format ivy-searcher--init ivy-searcher--initial-input-or-region buffer-file-name buffer-name ivy-read format "Search" ivy-searcher--do-search-file :initial-input :dynamic-collection t :require-match :update-fn ivy-searcher--search-preselect :action ivy-searcher--do-search-complete-action] 13 (#$ . 8984) nil]) #@45 Replace all recorded candidates. (fn CAND) (defalias 'ivy-searcher--do-replace-complete-action #[257 "\303\211\2056\211@\211A\304\305\"\303\306\"\204-B\262\307 \n\310!\311$\262\312\303#\210\266A\266\202\202\207" [ivy-searcher--candidates ivy-searcher--search-string ivy-searcher--replace-string nil plist-get :file ivy-searcher--is-contain-list-string s-replace-regexp ivy-searcher--get-string-from-file t write-region] 12 (#$ . 9549)]) #@81 Update the candidates with INPUT in ivy so the user can look at it. (fn INPUT) (defalias 'ivy-searcher--do-replace #[257 "\211\303 \211\2033\211@\211@A\304\305\"\306GGZO\307\n \310$P\262B\262\266A\266\202\202\210\311!\207" [ivy-searcher--replace-string ivy-searcher--candidates ivy-searcher--search-string nil plist-get :string 0 s-replace-regexp t reverse] 13 (#$ . 10012)]) #@65 Get the new string input and replace all candidates. (fn CAND) (defalias 'ivy-searcher--do-replace-matched-action #[257 "\302\303\303\304 \"\"\305\306\307\310\307\311\312\313\314&\n\207" [ivy-searcher--prompt-format ivy-searcher--search-string ivy-read format "Replace %s with" ivy-searcher--do-replace :dynamic-collection t :require-match :update-fn ivy-searcher--search-preselect :action ivy-searcher--do-replace-complete-action] 12 (#$ . 10414)]) #@39 Search and replace string in project. (defalias 'ivy-searcher-replace-project #[0 "\302 \210\303 \304\305 \306\"\307\310\311\312\313\312\314\315\316\317&\f)\207" [ivy-searcher--initial-input ivy-searcher--prompt-format ivy-searcher--init ivy-searcher--initial-input-or-region ivy-read format "Replace" ivy-searcher--do-search-project :initial-input :dynamic-collection t :require-match :update-fn ivy-searcher--search-preselect :action ivy-searcher--do-replace-matched-action] 13 (#$ . 10872) nil]) #@36 Search and replace string in file. (defalias 'ivy-searcher-replace-file #[0 "\303 \210\304 \305 \206\f\306 \307\310\n\311\"\312\313 \314\315\316\315\317\320\321\322&\f*\207" [ivy-searcher--target-buffer ivy-searcher--initial-input ivy-searcher--prompt-format ivy-searcher--init ivy-searcher--initial-input-or-region buffer-file-name buffer-name ivy-read format "Replace" ivy-searcher--do-search-file :initial-input :dynamic-collection t :require-match :update-fn ivy-searcher--search-preselect :action ivy-searcher--do-replace-matched-action] 13 (#$ . 11379) nil]) (provide 'ivy-searcher)