From 50b5ea66e0d2f445defab5661df59010f3b1ed75 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Mon, 20 Jun 2016 01:03:43 -0700 Subject: [PATCH] Remove prompts on prefix call to imalison:do-ag The previous behavior of a call with a single C-u press (where the user was prompted for a directory in which to perform the search and filetypes on which to it) is now available with two C-u presses. imalison:do-ag is now defined with a call to imalison:prefix-alternatives. --- dotfiles/emacs.d/README.org | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index 7a59e4de..0a1c6c05 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -1584,9 +1584,12 @@ I use helm for almost all emacs completion ("C-c p f" . imalison:projectile-find-file)) :preface (progn - (defun imalison:do-ag (&optional arg) - (interactive "P") - (if arg (helm-do-ag) (helm-projectile-ag))) + (defun imalison:do-ag-default-directory () + (interactive) + (helm-do-ag default-directory (car (projectile-parse-dirconfig-file)))) + + (imalison:prefix-alternatives imalison:do-ag helm-projectile-ag + imalison:do-ag-default-directory helm-do-ag) (defun projectile-make-all-subdirs-projects (directory) (cl-loop for file-info in (directory-files-and-attributes directory)