]> git.earman.xyz Git - emacsinit.git/commitdiff
Re-define mode-specific bindings, move bg color
authorrearman <rearman@r717.net>
Thu, 29 Dec 2022 22:00:43 +0000 (17:00 -0500)
committerrearman <rearman@r717.net>
Thu, 29 Dec 2022 22:00:43 +0000 (17:00 -0500)
Put mode-specific bindings into mode-hook lambdas.  Move default bg color out of
condition (now does all the time, instead of just on Windows)

init.el

diff --git a/init.el b/init.el
index c0539062753e8ea94d4b1f750e3fdedbd8a52f9e..6968010d8487bd42c329bb2e7fd00120da4f00f5 100644 (file)
--- a/init.el
+++ b/init.el
@@ -2,7 +2,6 @@
 ;; SETUP FOR SHARED WINDOWS/WSL INIT
 (if (eq system-type 'windows-nt)
     (progn (defvar work-eqns (expand-file-name "work-eqs.el" user-emacs-directory))
-          (add-to-list 'default-frame-alist '(background-color . "#cae0a6"))
           (setq delete-by-moving-to-trash t))
   nil)
 
 (global-display-line-numbers-mode t)
 (set-face-background 'show-paren-match nil)
 (set-face-underline 'show-paren-match t)
+(add-to-list 'default-frame-alist '(background-color . "#cae0a6"))
 
 (unless (display-graphic-p)
   (xterm-mouse-mode 1))
@@ -359,11 +359,12 @@ Intended for use as an after-save-hook."
 (global-set-key (kbd "C-%") 'replace-regexp)
 (global-set-key (kbd "M-%") 'replace-string)
 (global-set-key (kbd "C-M-%") 'query-replace-regexp)
-(define-key eshell-mode-map (kbd ")") 'eshell-send-on-close-paren)
-(define-key org-mode-map (kbd "C-'") nil)
-(define-key org-mode-map (kbd "C-,") nil)
-(define-key org-agenda-mode-map (kbd "C-'") nil)
-(define-key org-agenda-mode-map (kbd "C-,") nil)
+;; MODE-SPECIFIC
+(add-hook 'eshell-mode-hook (lambda () (define-key eshell-mode-map (kbd ")") 'eshell-send-on-close-paren)))
+(add-hook 'org-mode-hook (lambda () (define-key org-mode-map (kbd "C-'") nil)
+                          (define-key org-mode-map (kbd "C-,") nil)))
+(add-hook 'org-agenda-mode-hook (lambda () (define-key org-agenda-mode-map (kbd "C-'") nil)
+                                 (define-key org-agenda-mode-map (kbd "C-,") nil)))
 
 (custom-set-variables
  ;; custom-set-variables was added by Custom.