From c0c60d63bcb47990f0ac9c9e81adb665bf15ab14 Mon Sep 17 00:00:00 2001 From: Eric Danan Date: Wed, 19 Oct 2016 16:03:47 +0200 Subject: [PATCH] cp-find-file / cp-find-dir: run hook inside actions --- counsel-projectile.el | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/counsel-projectile.el b/counsel-projectile.el index 248e15b..08177ce 100644 --- a/counsel-projectile.el +++ b/counsel-projectile.el @@ -76,16 +76,17 @@ With a prefix ARG invalidates the cache first." (cons name (expand-file-name name root))) (projectile-current-project-files))) :action (lambda (x) - (find-file (cdr x))) + (find-file (cdr x)) + (run-hooks 'projectile-find-file-hook)) :require-match t :keymap counsel-projectile-map - :caller 'counsel-projectile-find-file) - (run-hooks 'projectile-find-file-hook)) + :caller 'counsel-projectile-find-file)) (ivy-set-actions 'counsel-projectile-find-file '(("j" (lambda (x) - (find-file-other-window (cdr x))) + (find-file-other-window (cdr x)) + (run-hooks 'projectile-find-file-hook)) "other window"))) ;;; counsel-projectile-find-dir @@ -105,16 +106,17 @@ With a prefix ARG invalidates the cache first." (append '("./") (projectile-current-project-dirs)) (projectile-current-project-dirs)))) :action (lambda (x) - (dired (cdr x))) + (dired (cdr x)) + (run-hooks 'projectile-find-dir-hook)) :require-match t :keymap counsel-projectile-map - :caller 'counsel-projectile-find-dir) - (run-hooks 'projectile-find-dir-hook)) + :caller 'counsel-projectile-find-dir)) (ivy-set-actions 'counsel-projectile-find-dir '(("j" (lambda (x) - (dired-other-window (cdr x))) + (dired-other-window (cdr x)) + (run-hooks 'projectile-find-dir-hook)) "other window"))) ;;; counsel-projectile-switch-to-buffer