-;;; Emacs Init Code
+;; * Emacs Init Code
 ;; Maintained by jgd
 ;; NOT byte-compiled
-;; Consider migrating content here to jgd.el{,c}
+;; Anything complicated should be migrated to a byte-compiled file
+;; under NGender if it's fairly generic
+;; under JGD otherwise
 
 ;; Attempted workaround for font prem in 24.3.1
  ;; (setq initial-frame-alist '(


;; Reduce the number of characters before company kicks in
; (setq company-minimum-prefix-length 1)

;; Racer

;; Set path to racer binary
(setq racer-cmd "/usr/local/bin/racer")

;; Set path to rust src directory
; (setq racer-rust-src-path "~/.rust/src/")
(setq racer-rust-src-path "/usr/local/lib/rustlib/")

;; Load rust-mode when you open `.rs` files
(add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-mode))

;; Setting up configurations when you load rust-mode
(add-hook 'rust-mode-hook
	  '(lambda ()
	     ;; Enable racer
	     (racer-activate)
	     (racer-mode)
	     
	     ;; Hook in racer with eldoc to provide documentation
	     (racer-turn-on-eldoc)
	     
	     ;; Use flycheck-rust in rust-mode
	     ; (add-hook 'flycheck-mode-hook #'flycheck-rust-setup)
	     
	     ;; Use company-racer in rust mode
	     ;; (set (make-local-variable 'company-backends) '(company-racer))
	     
	     ;; Key binding to jump to method definition
	     (local-set-key (kbd "M-.") #'racer-find-definition)
	     
	     ;; Key binding to auto complete and indent
	     (local-set-key (kbd "TAB") #'racer-complete-or-indent)
	     ) )


;;; Tramp



(add-hook 'cider-repl-mode-hook 'rainbow-delimiters-mode)

;; ** Font and Pitch Preferences

(defvar *ngender-pitch-mode* :variable)
(defvar *ngender-fixed-font* "Dejavu Sans Mono")
(defvar *ngender-variable-font* "Dejavu Sans Condensed")
(defvar *ngender-font* *ngender-variable-font*)
(defvar *ngender-frame-font* *ngender-font*)
;		 "-adobe-courier-medium-r-normal--%d-*-*-*-m-*-iso8859-1"

;; ** Load-Paths

(dolist (p '(
							"~/Lib/Emacs" "~/.emacs.d/vendor"
							"~/.emacs.d/JGD" "~/.emacs.d/NGender"
							"~/.emacs.d/vendor/ensime/elisp/"
							"~/.emacs.d/vendor/html5-el/" ) )
	(add-to-list 'load-path p) )

;; ** Load Packages

;; *** Load NGender Packages
;; Should instead arrange for most of them to autoload!!

;; Report an error if not found, say nothing if all goes well
(load "ngender" nil t)
(load "ngender-cut1" nil t)
(load "ngender-rx" nil t)
(load "ngender-org" nil t)
(load "ngender-shell" nil t)
(load "ngender-elisp" nil t)
(load "ngender-sql" nil t)
(load "ngender-sql-pw" nil t)
(load "ngender-sql-connect" nil t)

;; *** Load JGD Packages

;; Report an error if not found, say nothing if all goes well
(load "jgd" nil t)	; my fancy code in ~/.emacs.d/jgd

;;; Key Bindings - (Re)Define some keyboard shortcuts

