From 7f0927f7cea7ed44b5d32083dd06d5c3feaba328 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 28 Feb 2019 22:06:47 -0800 Subject: [PATCH] Add Windows-specific settings for Ivy --- oni-ivy.el | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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 ;; 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))