From 64c0e3a9301129b71d2587d74db03f38281317c2 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 29 Jul 2017 01:00:43 -0700 Subject: [PATCH] [Emacs] Fix custom helm-projectile actions --- dotfiles/emacs.d/README.org | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index 1f793bd3..ca6e1f06 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -1816,21 +1816,18 @@ I use helm for almost all emacs completion ("M-t" . imalison:helm-term-projectile)) :preface (progn + (defmacro imalison:do-in-project (project-dir &rest forms) + `(noflet ((projectile-project-root (&rest args) ,project-dir)) + ,@forms)) (defun imalison:invalidate-cache-and-open-file (_dir) (projectile-invalidate-cache nil) (projectile-find-file)) (defun imalison:switch-to-project-and-search (dir) - (let ((default-directory dir) - (projectile-require-project-root nil) - (helm-action-buffer "this-buffer-should-not-exist")) - (helm-projectile-ag))) + (imalison:do-in-project dir (helm-projectile-ag))) (defun imalison:helm-term-projectile (dir) - (let ((default-directory dir) - (projectile-require-project-root nil) - (helm-action-buffer "this-buffer-should-not-exist")) - (term-projectile-forward)))) + (imalison:do-in-project dir (term-projectile-forward)))) :config (progn (helm-delete-action-from-source "Search in Project"