From 841801059f021666315f072e1e02cfc8269663ba Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 19 Jul 2018 23:22:22 -0700 Subject: Don’t compile oni-windows-nt.el on non-windows systems --- emacs/.emacs.d/init.el | 1 + emacs/.emacs.d/os-lisp/oni-windows-nt.el | 93 ++++++++++++++++++++++++++++++ emacs/.emacs.d/site-lisp/oni-windows-nt.el | 93 ------------------------------ emacs/.emacs.d/windows.mk | 3 + 4 files changed, 97 insertions(+), 93 deletions(-) create mode 100755 emacs/.emacs.d/os-lisp/oni-windows-nt.el delete mode 100755 emacs/.emacs.d/site-lisp/oni-windows-nt.el diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index fc696d4..445e2f7 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -36,6 +36,7 @@ (format "%svendor-lisp/" load-directory) t "^[^.]")) (add-to-list 'load-path (format "%ssite-lisp/" load-directory)) + (add-to-list 'load-path (format "%sos-lisp/" load-directory)) (let ((loaddefs (format "%ssite-lisp/site-autoloads.el" load-directory))) (when (file-exists-p loaddefs) diff --git a/emacs/.emacs.d/os-lisp/oni-windows-nt.el b/emacs/.emacs.d/os-lisp/oni-windows-nt.el new file mode 100755 index 0000000..b0ed004 --- /dev/null +++ b/emacs/.emacs.d/os-lisp/oni-windows-nt.el @@ -0,0 +1,93 @@ +;;; oni-windows-nt.el --- Windows-specific configuration -*- lexical-binding: t; -*- + +;; Copyright (C) 2018 Tom Willemse + +;; Author: Tom Willemse +;; 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 . + +;;; Commentary: + +;; Any settings that only apply when working on a Windows machine. + +;;; Code: + +(eval-when-compile + (require 'package) + (package-initialize) + + (require 'find-dired) + (require 'ivy) + (require 'grep) + (require 'magit) + (require 'alert) + (require 'fill-column-indicator) + (require 'projectile) + (require 'sort)) + +(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) +(setq delete-by-moving-to-trash t) +(setq projectile-enable-caching nil) +(setq projectile-generic-command "\"C:\\Program Files\\Git\\usr\\bin\\find.exe\" . -type d \"(\" -path \"*/node_modules\" -o -path \"*/upload-test\" -o -path \"*/dlls\" -o -path \"*/apps/*/img\" -o -path \"*/apps/*/video\" -o -path \"*/apps/*/font\" -o -path \"*/apps/*/content\" -o -path \"*/apps/*/favicons\" -o -path \"*/apps/*/pages.*\" -o -path \"*/.intl\" \")\" -prune -o -type f -print0") +(setq projectile-git-command "\"C:/Program Files/Git/bin/git.exe\" ls-files -zco --exclude-standard") +(setq projectile-indexing-method 'alien) +(setq sort-fold-case t) + +(setq-default buffer-file-coding-system 'utf-8-unix) + +(let ((exe (shell-quote-argument "c:/cygwin64/bin/ls.exe"))) + (setq find-ls-option + (cons (concat "-exec " exe " -ld {} \";\"") "-ld"))) + +(with-eval-after-load 'alert + (setq alert-default-icon "c:/Users/WillemsenT/Emacs-25.1-2/share/emacs/25.1/etc/images/icons/hicolor/48x48/apps/emacs.png") + (setq alert-default-style 'toaster) + (setq alert-toaster-command "U:/projects/toaster/toast/bin/Release/toast.exe") + (setq alert-toaster-default-icon "c:/Users/WillemsenT/Emacs-25.1-2/share/emacs/25.1/etc/images/icons/hicolor/48x48/apps/emacs.png")) + +(with-eval-after-load 'grep + (add-function :around (symbol-function 'grep-read-files) #'oni-windows-nt--disable-ivy)) + +(with-eval-after-load 'magit + (setq magit-git-executable "c:/msys64/usr/bin/git.exe")) + +(with-eval-after-load 'vc + (require 'vc-p4)) + +(with-eval-after-load 'fill-column-indicator + (setq fci-always-use-textual-rule t)) + +(server-mode) + +(provide 'oni-windows-nt) +;;; oni-windows-nt.el ends here diff --git a/emacs/.emacs.d/site-lisp/oni-windows-nt.el b/emacs/.emacs.d/site-lisp/oni-windows-nt.el deleted file mode 100755 index b0ed004..0000000 --- a/emacs/.emacs.d/site-lisp/oni-windows-nt.el +++ /dev/null @@ -1,93 +0,0 @@ -;;; oni-windows-nt.el --- Windows-specific configuration -*- lexical-binding: t; -*- - -;; Copyright (C) 2018 Tom Willemse - -;; Author: Tom Willemse -;; 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 . - -;;; Commentary: - -;; Any settings that only apply when working on a Windows machine. - -;;; Code: - -(eval-when-compile - (require 'package) - (package-initialize) - - (require 'find-dired) - (require 'ivy) - (require 'grep) - (require 'magit) - (require 'alert) - (require 'fill-column-indicator) - (require 'projectile) - (require 'sort)) - -(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) -(setq delete-by-moving-to-trash t) -(setq projectile-enable-caching nil) -(setq projectile-generic-command "\"C:\\Program Files\\Git\\usr\\bin\\find.exe\" . -type d \"(\" -path \"*/node_modules\" -o -path \"*/upload-test\" -o -path \"*/dlls\" -o -path \"*/apps/*/img\" -o -path \"*/apps/*/video\" -o -path \"*/apps/*/font\" -o -path \"*/apps/*/content\" -o -path \"*/apps/*/favicons\" -o -path \"*/apps/*/pages.*\" -o -path \"*/.intl\" \")\" -prune -o -type f -print0") -(setq projectile-git-command "\"C:/Program Files/Git/bin/git.exe\" ls-files -zco --exclude-standard") -(setq projectile-indexing-method 'alien) -(setq sort-fold-case t) - -(setq-default buffer-file-coding-system 'utf-8-unix) - -(let ((exe (shell-quote-argument "c:/cygwin64/bin/ls.exe"))) - (setq find-ls-option - (cons (concat "-exec " exe " -ld {} \";\"") "-ld"))) - -(with-eval-after-load 'alert - (setq alert-default-icon "c:/Users/WillemsenT/Emacs-25.1-2/share/emacs/25.1/etc/images/icons/hicolor/48x48/apps/emacs.png") - (setq alert-default-style 'toaster) - (setq alert-toaster-command "U:/projects/toaster/toast/bin/Release/toast.exe") - (setq alert-toaster-default-icon "c:/Users/WillemsenT/Emacs-25.1-2/share/emacs/25.1/etc/images/icons/hicolor/48x48/apps/emacs.png")) - -(with-eval-after-load 'grep - (add-function :around (symbol-function 'grep-read-files) #'oni-windows-nt--disable-ivy)) - -(with-eval-after-load 'magit - (setq magit-git-executable "c:/msys64/usr/bin/git.exe")) - -(with-eval-after-load 'vc - (require 'vc-p4)) - -(with-eval-after-load 'fill-column-indicator - (setq fci-always-use-textual-rule t)) - -(server-mode) - -(provide 'oni-windows-nt) -;;; oni-windows-nt.el ends here diff --git a/emacs/.emacs.d/windows.mk b/emacs/.emacs.d/windows.mk index 0305935..45b2bd1 100755 --- a/emacs/.emacs.d/windows.mk +++ b/emacs/.emacs.d/windows.mk @@ -5,6 +5,9 @@ BASE_DIR := $(subst \,/,$(shell cygpath -w $(CURDIR))) .PHONY: install +SITE_LISPS := $(SITE_LISPS) os-lisp/oni-windows-nt.el +COMPILED_SITE_LISPS := $(COMPILED_SITE_LISPS) os-lisp/oni-windows-nt.elc + ALL_LISPS := init.el init.elc $(SITE_LISPS) $(COMPILED_SITE_LISPS) \ $(INIT_LISPS) $(COMPILED_INIT_LISPS) $(AUTOLOADS_FILE) -- cgit v1.2.3-54-g00ecf