aboutsummaryrefslogtreecommitdiffstats
path: root/oni-ivy.el
diff options
context:
space:
mode:
authorGravatar Tom Willemse2019-02-28 22:06:47 -0800
committerGravatar Tom Willemse2019-02-28 22:06:47 -0800
commit7f0927f7cea7ed44b5d32083dd06d5c3feaba328 (patch)
tree6f9123984c2b0ffc99911241abb10a73af5cf59b /oni-ivy.el
parentb87f32a9a3340bd5045e2c24ef3972fd608347b7 (diff)
downloademacs-config-7f0927f7cea7ed44b5d32083dd06d5c3feaba328.tar.gz
emacs-config-7f0927f7cea7ed44b5d32083dd06d5c3feaba328.zip
Add Windows-specific settings for Ivy
Diffstat (limited to 'oni-ivy.el')
-rw-r--r--oni-ivy.el18
1 files changed, 17 insertions, 1 deletions
diff --git a/oni-ivy.el b/oni-ivy.el
index 98a3873..dd25275 100644
--- a/oni-ivy.el
+++ b/oni-ivy.el
@@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
-;; Version: 20190228215753
+;; Version: 20190228220438
;; Package-Requires: (ivy ivy-hydra diminish)
;; This program is free software; you can redistribute it and/or modify
@@ -29,6 +29,22 @@
(require 'ivy)
(require 'ivy-hydra)
+(defun oni-ivy--disable (orig-fun &rest args)
+ "Disable ivy while running ORIG-FUN with ARGS."
+ (let ((ivy-enabled ivy-mode))
+ (unwind-protect
+ (progn
+ (when ivy-enabled
+ (ivy-mode -1))
+ (apply orig-fun args))
+ (when ivy-enabled
+ (ivy-mode 1)))))
+
+(when (eq system-type 'windows-nt)
+ (with-eval-after-load 'grep
+ (add-function :around (symbol-function 'grep-read-files)
+ #'oni-ivy--disable)))
+
(diminish 'ivy-mode)
;;;###autoload(with-eval-after-load 'ivy (require 'oni-ivy))