From 2144e19b88b1eef1d625fc67c159c2a05dc30118 Mon Sep 17 00:00:00 2001 From: rearman Date: Sun, 8 Jan 2023 11:10:04 -0500 Subject: [PATCH] Split Win-specific defuns into their own file --- .gitignore | 1 - bindings.el | 1 - defuns.el | 15 ++------------- eshell/alias | 1 - init.el | 4 +++- win-defuns.el | 9 +++++++++ 6 files changed, 14 insertions(+), 17 deletions(-) create mode 100644 win-defuns.el diff --git a/.gitignore b/.gitignore index 09386f9..da38916 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ * -!/eshell/alias !/*.el diff --git a/bindings.el b/bindings.el index 5b8b11c..ea31af4 100644 --- a/bindings.el +++ b/bindings.el @@ -8,7 +8,6 @@ (global-set-key (kbd "C-c r") 'rotate-windows) (global-set-key (kbd "C-c s") 'eshell) (global-set-key (kbd "C-c t") 'toggle-window-split) -(global-set-key (kbd "C-c w") 'edit-work-eqs) (global-set-key (kbd "") 'recentf-open-files) ;; OVERRIDES (global-set-key [remap move-beginning-of-line] 'smart-beginning-of-line) diff --git a/defuns.el b/defuns.el index 32647b7..ca4c7dc 100644 --- a/defuns.el +++ b/defuns.el @@ -38,11 +38,6 @@ Can't go prev line first, edge case of beginning of buffer." (interactive) (find-file user-init-file)) -(defun edit-work-eqs () - "Bring up work-eqs.el for editing." - (interactive) - (find-file work-eqns)) - (defun toggle-window-split () "If two windows are open, toggle their split layout between vert. and horiz. Stolen from http://whattheemacsd.com" @@ -76,6 +71,8 @@ Stolen from http://whattheemacsd.com" (interactive) (cond ((not (> (count-windows)1)) (message "You can't rotate a single window!")) + ((> (count-windows) 2) + (message "You can't rotate more than two windows!")) (t (setq i 1) (setq numWindows (count-windows)) @@ -106,14 +103,6 @@ Stolen from BrettWitty's dotemacs github repo." (and (= oldpos (point)) (beginning-of-line)))) -(defun unfuck-aveva-license () - "Remove the offending xml files when aveva can't find the license." - (interactive) - (let ((xml1 "c:/ProgramData/AVEVA/Licensing/License API2/Data/LocalAcquireInfo.xml") - (xml2 "c:/ProgramData/AVEVA/Licensing/License API2/Data/LocalBackEndAcquireInfo.xml")) - (when (file-exists-p xml1) (delete-file xml1)) - (when (file-exists-p xml2) (delete-file xml2)))) - (defun eshell-send-on-close-paren () "Makes eshell act somewhat like genera. Makes a closing paren execute the sexp. Currently in test, look out for errors." diff --git a/eshell/alias b/eshell/alias index 2910772..78ab70e 100644 --- a/eshell/alias +++ b/eshell/alias @@ -1,2 +1 @@ alias weather clear -l && curl https://wttr.in -alias qmk c:/QMK_MSYS/conemu/ConEmu64.exe diff --git a/init.el b/init.el index b051f2a..9607c2c 100644 --- a/init.el +++ b/init.el @@ -1,7 +1,9 @@ ;; -*- lexical-binding: t; -*- ;; SETUP FOR SHARED WINDOWS/WSL INIT (if (eq system-type 'windows-nt) - (progn (setq delete-by-moving-to-trash t)) + (progn (setq delete-by-moving-to-trash t) + (load (expand-file-name "win-defuns.el" user-emacs-directory)) + (eshell-eval-command "alias qmk \"c:/QMK_MSYS/conemu/ConEmu64.exe\"")) nil) (load (expand-file-name "work-eqs.el" user-emacs-directory)) diff --git a/win-defuns.el b/win-defuns.el new file mode 100644 index 0000000..518155f --- /dev/null +++ b/win-defuns.el @@ -0,0 +1,9 @@ +;; -*- lexical-binding: t; -*- +;; DEFUNS FOR WINDOWS ONLY +(defun unfuck-aveva-license () + "Remove the offending xml files when aveva can't find the license." + (interactive) + (let ((xml1 "c:/ProgramData/AVEVA/Licensing/License API2/Data/LocalAcquireInfo.xml") + (xml2 "c:/ProgramData/AVEVA/Licensing/License API2/Data/LocalBackEndAcquireInfo.xml")) + (when (file-exists-p xml1) (delete-file xml1)) + (when (file-exists-p xml2) (delete-file xml2)))) -- 2.39.5