From 19f5f1d7b1bb52fa59c035677e64b3973a272f74 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 29 Oct 2016 12:55:53 -0700 Subject: [PATCH] [Emacs] Only override shell-command-to-string for projectile-find-file --- dotfiles/emacs.d/README.org | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index e3977b59..aab917fa 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -218,9 +218,24 @@ This makes it so that we always try to call-process instead of shell-command-to- (imalison:get-call-process-args-from-shell-command command))) (if call-process-args (apply 'imalison:call-process-to-string call-process-args)))) +#+END_SRC +This had to be disabled because it was causing a bunch of issues with projectile. +#+BEGIN_SRC emacs-lisp :tangle no (advice-add 'shell-command-to-string :before-until 'imalison:try-call-process) #+END_SRC + +This solution only applies it to projectile-find-file +#+BEGIN_SRC emacs-lisp +(require 'noflet) + +(defun imalison:call-with-quick-shell-command (fn &rest args) + (noflet ((shell-command-to-string (&rest args) + (or (apply 'imalison:try-call-process args) (apply this-fn args)))) + (apply fn args))) + +(advice-add 'projectile-find-file :around 'imalison:call-with-quick-shell-command) +#+END_SRC ** Security #+BEGIN_SRC emacs-lisp (defvar imalison:secure t)