--- a/.emacs-my Thu Feb 09 15:41:59 2017 +0200
+++ b/.emacs-my Sun Feb 12 13:15:25 2017 +0200
@@ -812,9 +812,17 @@
(cl-flet ( (grep-compute-defaults () nil) )
(call-interactively #'rgrep))))
+(defun my/ag (&optional str)
+ "Search with ag from project roor without prefix and from
+`default-directory' with prefix."
+ (interactive (when current-prefix-arg (list (ag/read-from-minibuffer "Search string"))))
+ (if str
+ (let ((current-prefix-arg nil)) (ag str default-directory))
+ (call-interactively #'ag-project)))
+
(setq ag-highlight-search t)
(when (featurep 'ag)
- (global-set-key [f7] 'ag-project))
+ (global-set-key [f7] 'my/ag))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(message "highlighting")