;ELC   
;;; Compiled
;;; in Emacs version 24.5.1
;;; 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.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(defvar anything-grep-version "$Id: anything-grep.el,v 1.27 2010-03-21 11:31:04 rubikitch Exp $")
(byte-code "\300\301!\210\300\302!\207" [require anything-config grep] 2)
#@59 Do `save-some-buffers' before performing `anything-grep'.
(defvar anything-grep-save-buffers-before-grep nil (#$ . 582))
#@63 List of functions to be called after `agrep-goto' opens file.
(defvar anything-grep-goto-hook nil (#$ . 709))
#@77 Function to visit a file with.
It takes one argument, a file name to visit.
(defvar anything-grep-find-file-function 'find-file (#$ . 825))
#@86 If non-nil, use multi-line display. It is prettier.
Use anything.el v1.147 or newer.
(defvar anything-grep-multiline t (#$ . 971))
#@59 If non-nil, fontify file name and line number of matches.
(defvar anything-grep-fontify-file-name t (#$ . 1108))
(defvar anything-grep-sh-program (byte-code "\300\301!\206	 \300\302!\207" [executable-find "zsh" "sh"] 2))
#@609 Mapping of location and command/pwd used by `anything-grep-by-name'.
The command is grep command line. Note that %s is replaced by query.
The command is typically "ack-grep -af | xargs egrep -Hin %s", which means
regexp/case-insensitive search for all files (including subdirectories)
except unneeded files.
The occurrence of $file in command is replaced with `buffer-file-name' of
all buffers.

The pwd is current directory to grep.

The format is:

  ((LOCATION1
     (COMMAND1-1 PWD1-1)
     (COMMAND1-2 PWD1-2)
     ...)
   (LOCATION2
     (COMMAND2-1 PWD2-1)
     (COMMAND2-2 PWD2-2)
     ...)
   ...)

(defvar anything-grep-alist '(("buffers" ("egrep -Hin %s $buffers" "/")) ("memo" ("ack-grep -af | xargs egrep -Hin %s" "~/memo")) ("PostgreSQL" ("egrep -Hin %s *.txt" "~/doc/postgresql-74/")) ("~/bin and ~/ruby" ("ack-grep -afG 'rb$' | xargs egrep -Hin %s" "~/ruby") ("ack-grep -af | xargs egrep -Hin %s" "~/bin"))) (#$ . 1336))
#@238 If non-nil, filter the result of grep command.

For example, normalizing many Japanese encodings to EUC-JP,
set this variable to "ruby -rkconv -pe '$_.replace $_.toeuc'".
The command is converting standard input to EUC-JP line by line. 
(defvar anything-grep-filter-command nil (#$ . 2280))
#@249 *If non-nil, a function that returns the current file's repository root directory.
The function is called with a single string argument (a file name) and should
return either nil, or a string, which is the root directory of that file's repository.
(defvar anything-grep-repository-root-function (byte-code "\300\301\302\303#\205	 \301\207" [require repository-root nil t] 4) (#$ . -2578))
#@54 `anything-sources' for last invoked `anything-grep'.
(defvar anything-grep-sources nil (#$ . 2973))
(defvar anything-grep-buffer-name nil)
#@40 Invoke `anything' for `anything-grep'.
(defalias 'anything-grep-base #[(sources &optional bufname) "\203\n \306	?\307\"\210\n\f\206 \310\311\312\fB\f\313\n\307\211\211\211\f&*\207" [anything-grep-save-buffers-before-grep compilation-ask-about-save sources anything-grep-sources bufname anything-grep-buffer-name save-some-buffers nil "*anything grep*" t anything-compile-source--agrep-init anything anything-compile-source-functions anything-quit-if-no-candidate] 7 (#$ . 3118)])
#@37 Anything Source of `anything-grep'.
(defalias 'agrep-source #[(command pwd) "\300B\301	B\303\304\305	#B\306\307\310\311\312\313\n\205 \314BBBBBBBBB\207" [command pwd anything-grep-multiline name format "%s [%s]" (action . agrep-goto) (anything-grep) (candidate-number-limit . 9999) (migemo) (candidates-in-buffer) (get-line . buffer-substring) ((multiline) (real-to-display . agrep-real-to-display))] 10 (#$ . 3613)])
(defalias 'anything-compile-source--agrep-init #[(source) "\301\236\203 \302\303\"\207\207" [source anything-grep append ((init . agrep-init) (candidates))] 3])
(defalias 'agrep-init #[nil "\300\301\302!\301\303!\"\207" [agrep-create-buffer anything-attr command pwd] 4])
(defalias 'agrep-real-to-display #[(file-line-content) "\301\302\"\203 \303\304\305\211\224O\306\307\"\305\225\310O$\207\207" [file-line-content string-match ":\\([0-9]+\\):" format "%s:%s\n %s" 0 match-string 1 nil] 7])
(defvar agrep-source-local nil)
#@57 `anything' sources to get together in `agrep-sentinel'.
(defvar agrep-waiting-source nil (#$ . 4575))
(defvar agrep-proc-tmpfile-alist nil)
#@121 Insert result of COMMAND. The current directory is PWD.
GNU grep is expected for COMMAND. The grep result is colorized.
(defalias 'agrep-do-grep #[(command pwd) "\306\307\310!\311=\203! \312\313\314\313!\315P\"\210\312\316\317\"\210\312\320\321\"\210\322\304!\210\323 \211\235\2033 \210\2027 \fB\324\325p\326\327\330	$%\211	BB\331\n\332\"+\207" [process-environment tmpfile proc grep-highlight-matches agrep-source-local agrep-waiting-source nil make-temp-file "agrep-" t setenv "GREP_OPTIONS" getenv " --color=always" "GREP_COLOR" "01;31" "GREP_COLORS" "mt=01;31:fn=:ln=:bn=:se=:ml=:cx=:ne" make-local-variable anything-get-current-source start-process "anything-grep" "-c" format "cd %s; %s > %s" set-process-sentinel agrep-sentinel anything-grep-sh-program pwd command agrep-proc-tmpfile-alist] 11 (#$ . 4722)])
(defvar agrep-do-after-minibuffer-exit nil)
(defalias 'agrep-minibuffer-exit-hook #[nil "\205 \301\302\303#\210\303\211\207" [agrep-do-after-minibuffer-exit run-at-time 1 nil] 4])
(add-hook 'minibuffer-exit-hook 'agrep-minibuffer-exit-hook)
(defalias 'agrep-highlight-line-after-persistent-action #[nil "\205\n \301\302 \303 \"\207" [anything-in-persistent-action anything-persistent-highlight-point point-at-bol point-at-eol] 3])
(add-hook 'anything-grep-goto-hook 'agrep-highlight-line-after-persistent-action)
(defalias 'agrep-show #[(func) "\302 \203	 \211\207 \207" [func agrep-do-after-minibuffer-exit active-minibuffer-window] 2])
(defalias 'agrep-sentinel #[(proc stat) "r\305!q\210\306	\n\"\307\"\310\f!\210\311b\210\312\f!\210)\313 \210)\n?\205* \314\315\316!\207" [proc agrep-source-local agrep-waiting-source agrep-proc-tmpfile-alist tmpfile process-buffer delete assoc-default insert-file-contents 1 delete-file agrep-fontify nil agrep-show #[nil "\303\304	\305\211\211\211\n&)\207" [anything-quit-if-no-candidate anything-grep-sources anything-grep-buffer-name #[nil "\300\301!\207" [message "No matches"] 2] anything nil] 7]] 3])
#@40 Fontify the result of `agrep-do-grep'.
(defalias 'agrep-fontify #[nil "\304b\210\305\306\307\310#\203' \311\312\224\312\225\313$\210\314\315\310\211\307\304%\210\314\315\310\211\307\316%\210\202 \304b\210\305\317\307\310#\203= \314\315\310\211\307\320%\210\202* 	\205d \304b\210\305\321\307\310#\205d \311\322 \320\224\313\n$\210\311\304\224\304\225\313$\210\304y\210\202D \207" [grep-match-face anything-grep-fontify-file-name compilation-info-face compilation-line-face 1 re-search-forward "\\(\\[01;31m\\)\\(.*?\\)\\(\\[[0-9]*m\\)" nil t put-text-property 2 face replace-match "" 3 "\\(\\[[0-9;]*[mK]\\)" 0 ":\\([0-9]+\\):" point-at-bol] 6 (#$ . 6725)])
#@85 Create candidate buffer for `anything-grep'.
Its contents is fontified grep result.
(defalias 'agrep-create-buffer #[(command pwd) "r\303\304!q\210\305\n\"\210p)\207" [pwd default-directory command anything-candidate-buffer global agrep-do-grep] 3 (#$ . 7394)])
#@48 Visit the source for the grep result at point.
(defalias 'agrep-goto #[(file-line-content) "\303\304\"\204 	\305\306\307!\"!\210\202/ \310 \311\216	\305\312\211\224O\306\307!\"!\210*\313\314\315\316\"!!\210\317\320!\207" [file-line-content anything-grep-find-file-function save-match-data-internal string-match ":\\([0-9]+\\):" expand-file-name anything-attr pwd match-data ((byte-code "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) 0 anything-goto-line string-to-number match-string 1 run-hooks anything-grep-goto-hook] 5 (#$ . 7665)])
#@119 Run grep in `anything' buffer to narrow results.
It asks COMMAND for grep command line and PWD for current directory.
(defalias 'anything-grep #[(command pwd) "\302\303\304!	\"C\305\306\307	!#\"\207" [command pwd anything-grep-base agrep-source agrep-preprocess-command format "*anything grep:%s [%s]*" abbreviate-file-name] 7 (#$ . 8242) (progn (grep-compute-defaults) (let ((default (grep-default-command))) (list (read-from-minibuffer "Run grep (like this): " (if current-prefix-arg default grep-command) nil nil 'grep-history (if current-prefix-arg nil default)) (read-directory-name "Directory: " default-directory default-directory t))))])
(defalias 'agrep-preprocess-command #[(command) "\303\304!rq\210\305\216	c\210\306b\210\307\310\311\312#\203, \313\224\313\225|\210\314\315\316\311\317\320\321 \"\"\322#c\210\n\2038 db\210\323\n\261\210\324 +\207" [#1=#:temp-buffer command anything-grep-filter-command generate-new-buffer " *temp*" ((byte-code "\301!\203\n \302!\210\301\207" [#1# buffer-name kill-buffer] 2)) 1 search-forward "$buffers" nil t 0 mapconcat shell-quote-argument delq mapcar buffer-file-name buffer-list " " "|" buffer-string] 7])
#@48 The last used name by `anything-grep-by-name'.
(defvar agbn-last-name nil (#$ . 9413))
(defalias 'agrep-by-name-read-info #[(&rest kinds) "\303\304!\206 \305\306\307	\"\211A\203 \n\202 \n@*\207" [default kinds result thing-at-point symbol "" mapcar #[(kind) "\304\305\"\203 \306\307\310	\"\311\211	$\207\304\312\"\205\" \313\314\n\311\315\311\211&\207" [kind default anything-grep-alist agbn-last-name memql 'query read-string format "Grep query (default:%s): " nil 'name completing-read "Grep by name: " t] 8]] 4])
#@88 Do `anything-grep' from predefined location.
It asks NAME for location name and QUERY.
(defalias 'anything-grep-by-name #[(&optional query name) "\206 \305\300!	\206 \305\301!\211\306	\"\211\203, \307 \210\310\311\312\f\"\313\314	#\"\2020 \315\316	\")\207" [query name agbn-last-name anything-grep-alist it agrep-by-name-read-info assoc-default grep-compute-defaults anything-grep-base mapcar #[(args) "\211G\305U\203 	\211A\242\202 \306\307\310	GD\"	@\311\312\313\n!\314\f!\"\"+\207" [args #1=#:--cl-rest-- cmd dir query 2 signal wrong-number-of-arguments nil agrep-source format agrep-preprocess-command shell-quote-argument] 6] format "*anything grep:%s [%s]" error "no such name %s"] 7 (#$ . 9945) (byte-code "\300\301\302\"\207" [agrep-by-name-read-info query name] 3)])
#@146 Do `anything-grep' from predefined location.
It asks QUERY and NAME for location name.

Difference with `anything-grep-by-name' is prompt order.
(defalias 'anything-grep-by-name-reversed #[(&optional name query) "\302	\"\207" [query name anything-grep-by-name] 3 (#$ . 10745) (byte-code "\300\301\302\"\207" [agrep-by-name-read-info name query] 3)])
#@226 Attempt to deduce the current file's repository root directory.
You should customize `anything-grep-repository-root-function' and provide a function that
does the actual work, based of the type of SCM tool that you're using.
(defalias 'agrep-repository-root #[(filename) "\205 \304!\n\205 \305\n!\205 \306\nC\"\211\206 	*\207" [filename directory anything-grep-repository-root-function repository-root file-name-directory functionp apply] 4 (#$ . 11103)])
#@36 Run `anything-grep' in repository.
(defalias 'anything-grep-repository-1 #[(command) "\303\304	\206 \n!\"\207" [command buffer-file-name default-directory anything-grep agrep-repository-root] 4 (#$ . 11574) (progn (grep-compute-defaults) (let ((default (grep-default-command))) (list (read-from-minibuffer (format "Run grep in %s (like this): " (agrep-repository-root (or buffer-file-name default-directory))) (if current-prefix-arg default grep-command) nil nil 'grep-history (if current-prefix-arg nil default)))))])
#@88 Do `anything-grep' from predefined location.
It asks NAME for location name and QUERY.
(defalias 'anything-grep-repository #[(&optional query) "\302 \210\303\304\305P\306	!\"!\207" [grep-command query grep-compute-defaults anything-grep-repository-1 format " %s" shell-quote-argument] 5 (#$ . 12101) (list (agrep-by-name-read-info 'query))])
(when (fboundp 'expectations) (expectations (desc "agrep-by-name-read-info") (expect "query1" (stub read-string => "query1") (agrep-by-name-read-info 'query)) (expect "elinit" (stub completing-read => "elinit") (agrep-by-name-read-info 'name)) (expect '("query1" "elinit") (stub read-string => "query1") (stub completing-read => "elinit") (agrep-by-name-read-info 'query 'name)) (expect '("elinit" "query1") (stub read-string => "query1") (stub completing-read => "elinit") (agrep-by-name-read-info 'name 'query))))
(provide 'anything-grep)
