Use regex search instead of literal for ag.
--- a/.emacs-my Mon Feb 20 16:04:49 2017 +0200
+++ b/.emacs-my Mon Feb 20 20:26:21 2017 +0200
@@ -817,13 +817,13 @@
(cl-flet ( (grep-compute-defaults () nil) )
(call-interactively #'rgrep))))
-(defun my/ag (&optional str)
+(defun my/ag (regex)
"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)))
+ (interactive (list (ag/read-from-minibuffer "Search regex")))
+ (if current-prefix-arg
+ (let ((current-prefix-arg nil)) (ag-regexp regex default-directory))
+ (ag-project-regexp regex)))
(ignore-errors (require 'ag))