1
0
Fork 0

Add Windows-specific settings for Ivy

This commit is contained in:
Tom Willemse 2019-02-28 22:06:47 -08:00
parent b87f32a9a3
commit 7f0927f7ce

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 20190228215753 ;; Version: 20190228220438
;; Package-Requires: (ivy ivy-hydra diminish) ;; Package-Requires: (ivy ivy-hydra diminish)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -29,6 +29,22 @@
(require 'ivy) (require 'ivy)
(require 'ivy-hydra) (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) (diminish 'ivy-mode)
;;;###autoload(with-eval-after-load 'ivy (require 'oni-ivy)) ;;;###autoload(with-eval-after-load 'ivy (require 'oni-ivy))