aboutsummaryrefslogtreecommitdiffstats
path: root/emacs
diff options
context:
space:
mode:
authorGravatar Tom Willemse2018-06-19 10:43:05 -0700
committerGravatar Tom Willemse2018-06-19 10:43:05 -0700
commitf924fc9baa8432546e9084bdc0a06c2cadda94cb (patch)
tree73bc2308467289bfb5467ca1f295255e1da2214e /emacs
parenteada3961e6fe6cad0ec68ac26b0994211d53a493 (diff)
downloadnew-dotfiles-f924fc9baa8432546e9084bdc0a06c2cadda94cb.tar.gz
new-dotfiles-f924fc9baa8432546e9084bdc0a06c2cadda94cb.zip
Add windows-specific Emacs config
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.emacs.d/init.el5
-rwxr-xr-xemacs/.emacs.d/site-lisp/oni-windows-nt.el62
2 files changed, 66 insertions, 1 deletions
diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el
index 585266a..9175e4a 100644
--- a/emacs/.emacs.d/init.el
+++ b/emacs/.emacs.d/init.el
@@ -39,7 +39,10 @@
(let ((loaddefs (format "%ssite-lisp/site-autoloads.el" load-directory)))
(when (file-exists-p loaddefs)
- (load loaddefs)))))
+ (load loaddefs)))
+
+ (if (eq system-type 'windows-nt)
+ (require 'oni-windows-nt))))
(require 'oni-helpers)
diff --git a/emacs/.emacs.d/site-lisp/oni-windows-nt.el b/emacs/.emacs.d/site-lisp/oni-windows-nt.el
new file mode 100755
index 0000000..dac328d
--- /dev/null
+++ b/emacs/.emacs.d/site-lisp/oni-windows-nt.el
@@ -0,0 +1,62 @@
+;;; oni-windows-nt.el --- Windows-specific configuration -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2018 Tom Willemse
+
+;; Author: Tom Willemse <tom@ryuslash.org>
+;; Keywords: local
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Any settings that only apply when working on a Windows machine.
+
+;;; Code:
+
+(eval-when-compile
+ (require 'find-dired)
+ (require 'ivy)
+ (require 'grep))
+
+(defun oni-windows-nt--disable-ivy (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)))))
+
+(add-to-list 'load-path (locate-user-emacs-file "vendor/p4-vc"))
+(add-to-list 'exec-path "c:/Program Files/Git/bin")
+(add-to-list 'exec-path "C:/Program Files/Git/usr/bin")
+(add-to-list 'exec-path "c:/cygwin64/bin")
+
+(setq find-program (shell-quote-argument "c:/cygwin64/bin/find.exe"))
+
+(setq grep-program (shell-quote-argument "c:/cygwin64/bin/grep.exe"))
+
+(setq grep-use-null-device nil)
+
+(let ((exe (shell-quote-argument "c:/cygwin64/bin/ls.exe")))
+ (setq find-ls-option
+ (cons (concat "-exec " exe " -ld {} \";\"") "-ld")))
+
+(with-eval-after-load 'grep
+ (add-function :around (symbol-function 'grep-read-files) #'oni-windows-nt--disable-ivy))
+
+(provide 'oni-windows-nt)
+;;; oni-windows-nt.el ends here