;; rhjr/paths
(defvar rhjr/paths/config     "~/.config/emacs/")
(defvar rhjr/paths/packages   (concat rhjr/paths/config "packages/"))
(defvar rhjr/paths/thirdparty (concat rhjr/paths/config "thirdparty/"))

(defvar rhjr/paths/no-littering/etc (concat rhjr/paths/config "config/"))
(defvar rhjr/paths/no-littering/var (concat rhjr/paths/config "data/"))

(defvar rhjr/paths/eln-cache  (concat rhjr/paths/config "data/eln-cache"))

;; rhjr/packages
(require 'package)
(setq package-user-dir rhjr/paths/packages
  package-archives '(("melpa" . "https://melpa.org/packages/")
                     ("gnu"   . "http://elpa.gnu.org/packages/")))
(package-initialize)

(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))
  (eval-and-compile
    (setq use-package-always-ensure t
          use-package-expand-minimally t))

(require 'use-package)

;; rhjr/config-folder
(setq user-emacs-directory rhjr/paths/config)

(use-package compat) ; no-littering dependency
(add-to-list'load-path rhjr/paths/thirdparty)
(eval-and-compile 
  (setq no-littering-etc-directory rhjr/paths/no-littering/etc)
  (setq no-littering-var-directory rhjr/paths/no-littering/var)
  (require 'no-littering))

(when (fboundp 'startup-redirect-eln-cache)
  (startup-redirect-eln-cache
    (convert-standard-filename rhjr/paths/eln-cache)))

;; rhjr/defaults
(setq-default 
  initial-major-mode 'text-mode
  initial-scratch-message ""

  inhibit-startup-message ""
  inhibit-splash-screen             t 
  inhibit-startup-echo-area-message t

  create-lockfiles  nil
  make-backup-files nil
  auto-save-default nil)

(defun display-startup-echo-area-message ()
  (message ""))

;; rhjr/mode
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)

;; rhjr/packages
(use-package esup
  :defer t
  :config
  (setq esup-depth 0))

(use-package magit
  :defer t)

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(package-selected-packages '(compat)))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )