.emacs-my
changeset 1488 8da1fc103e49
parent 1486 cf1175a9cd7b
child 1489 c0c3d88cd779
equal deleted inserted replaced
1487:d22fade5ae5c 1488:8da1fc103e49
   815   (interactive)
   815   (interactive)
   816   (let ( (grep-find-template "find . -type f <F> -exec zgrep <C> -nH -e <R> {} +") (grep-find-ignored-files nil) )
   816   (let ( (grep-find-template "find . -type f <F> -exec zgrep <C> -nH -e <R> {} +") (grep-find-ignored-files nil) )
   817     (cl-flet ( (grep-compute-defaults () nil) )
   817     (cl-flet ( (grep-compute-defaults () nil) )
   818       (call-interactively #'rgrep))))
   818       (call-interactively #'rgrep))))
   819 
   819 
   820 (defun my/ag (&optional str)
   820 (defun my/ag (regex)
   821   "Search with ag from project roor without prefix and from
   821   "Search with ag from project roor without prefix and from
   822 `default-directory' with prefix."
   822 `default-directory' with prefix."
   823   (interactive (when current-prefix-arg (list (ag/read-from-minibuffer "Search string"))))
   823   (interactive (list (ag/read-from-minibuffer "Search regex")))
   824   (if str
   824   (if current-prefix-arg
   825       (let ((current-prefix-arg nil)) (ag str default-directory))
   825       (let ((current-prefix-arg nil)) (ag-regexp regex default-directory))
   826     (call-interactively #'ag-project)))
   826     (ag-project-regexp regex)))
   827 
   827 
   828 (ignore-errors (require 'ag))
   828 (ignore-errors (require 'ag))
   829 
   829 
   830 (setq ag-highlight-search t)
   830 (setq ag-highlight-search t)
   831 (when (featurep 'ag)
   831 (when (featurep 'ag)